WebKit-https.git
4 years agoAdd simple line layout toggle to MiniBrowser
zalan@apple.com [Wed, 25 Jan 2017 05:02:56 +0000 (05:02 +0000)]
Add simple line layout toggle to MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=167405

Reviewed by Andreas Kling.

Source/WebKit/mac:

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences simpleLineLayoutEnabled]):
(-[WebPreferences setSimpleLineLayoutEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit2:

* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _simpleLineLayoutEnabled]):
(-[WKPreferences _setSimpleLineLayoutEnabled:]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:

Tools:

* MiniBrowser/mac/SettingsController.h:
* MiniBrowser/mac/SettingsController.m:
(-[SettingsController _populateMenu]):
(-[SettingsController validateMenuItem:]):
(-[SettingsController toggleSimpleLineLayoutEnabled:]):
(-[SettingsController simpleLineLayoutEnabled]):
* MiniBrowser/mac/WK1BrowserWindowController.m:
(-[WK1BrowserWindowController didChangeSettings]):
* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController didChangeSettings]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211135 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoWKR does not include my nick when commit-queue lands my patch
commit-queue@webkit.org [Wed, 25 Jan 2017 04:25:51 +0000 (04:25 +0000)]
WKR does not include my nick when commit-queue lands my patch
https://bugs.webkit.org/show_bug.cgi?id=167388

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-01-24
Reviewed by Ryosuke Niwa.

* Scripts/webkitpy/tool/commands/newcommitbot.py:
(NewCommitBot._summarize_commit_log):
* Scripts/webkitpy/tool/commands/newcommitbot_unittest.py:
Perform nickname insertion before grabbing "Patch by" details.
This way we can include the nickname with the full name.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211134 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoFold USER_TIMING into WEB_TIMING and make it a RuntimeEnabledFeature
commit-queue@webkit.org [Wed, 25 Jan 2017 04:23:27 +0000 (04:23 +0000)]
Fold USER_TIMING into WEB_TIMING and make it a RuntimeEnabledFeature
https://bugs.webkit.org/show_bug.cgi?id=167394

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-01-24
Reviewed by Ryosuke Niwa.

.:

* Source/cmake/OptionsEfl.cmake:
* Source/cmake/OptionsWin.cmake:
* Source/cmake/WebKitFeatures.cmake:
* Source/cmake/tools/vsprops/FeatureDefines.props:
* Source/cmake/tools/vsprops/FeatureDefinesCairo.props:

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:
* runtime/CommonIdentifiers.h:

Source/WebCore:

All of the Performance Timing specifications are highly coupled.
So let make WEB_TIMING encompass them all:

    - High Resolution Time (window.performance)
    - Performance Timeline (PerformanceEntry, PerformanceObserver)
    - Navigation Timing ("navigation" entries)
    - Resource Timing ("resource" entries)
    - User Timing ("mark" / "measure" entries)

We can then turn on and off individual pieces as runtime features,
such as Resource Timing, User Timing, and Performance Observer.

* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
Add User Timing files that are now included in WEB_TIMING builds.

* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setUserTimingEnabled):
(WebCore::RuntimeEnabledFeatures::userTimingEnabled):
Add a runtime feature for user timing. Disabled by default.

* Configurations/FeatureDefines.xcconfig:
* PAL/Configurations/FeatureDefines.xcconfig:
* bindings/js/JSPerformanceEntryCustom.cpp:
(WebCore::toJSNewlyCreated):
* page/Performance.cpp:
(WebCore::Performance::getEntries):
(WebCore::Performance::getEntriesByType):
(WebCore::Performance::getEntriesByName):
(WebCore::Performance::mark):
(WebCore::Performance::clearMarks):
(WebCore::Performance::measure):
(WebCore::Performance::clearMeasures):
(WebCore::Performance::webkitMark): Deleted.
(WebCore::Performance::webkitClearMarks): Deleted.
(WebCore::Performance::webkitMeasure): Deleted.
(WebCore::Performance::webkitClearMeasures): Deleted.
* page/Performance.h:
* page/Performance.idl:
* page/PerformanceMark.h:
* page/PerformanceMark.idl:
* page/PerformanceMeasure.h:
* page/PerformanceMeasure.idl:
* page/PerformanceUserTiming.cpp:
* page/PerformanceUserTiming.h:
Convert USER_TIMING to WEB_TIMING.
Drop webkit prefixed legacy names.

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:

Source/WTF:

* wtf/FeatureDefines.h:

Tools:

* Scripts/webkitperl/FeatureList.pm:
* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

LayoutTests:

* platform/gtk/fast/dom/Window/window-properties-performance-expected.txt:
Although this test is skipped on gtk, update the results.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211133 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoLayoutTest media/modern-media-controls/placard-support/placard-support-airplay.html...
commit-queue@webkit.org [Wed, 25 Jan 2017 02:59:59 +0000 (02:59 +0000)]
LayoutTest media/modern-media-controls/placard-support/placard-support-airplay.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=164298

Patch by Antoine Quint <graouts@apple.com> on 2017-01-24
Reviewed by Jon Lee.

Make media/modern-media-controls/placard-support/placard-support-airplay.html more robust by
following the same pattern used in media/airplay-target-availability.html which proved to be robust.

* media/modern-media-controls/placard-support/placard-support-airplay-expected.txt:
* media/modern-media-controls/placard-support/placard-support-airplay.html:
* platform/mac/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211132 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoLayoutTest media/modern-media-controls/tracks-panel/tracks-panel-hide.html is a flaky...
commit-queue@webkit.org [Wed, 25 Jan 2017 02:59:11 +0000 (02:59 +0000)]
LayoutTest media/modern-media-controls/tracks-panel/tracks-panel-hide.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=167311

Patch by Antoine Quint <graouts@apple.com> on 2017-01-24
Reviewed by Dean Jackson.

Source/WebCore:

Ensure we have a chance to start the transition (on the next frame) before registering for an event
tracking its completion.

* Modules/modern-media-controls/controls/tracks-panel.js:
(TracksPanel.prototype.hide):

LayoutTests:

This test should no longer be flaky, so let's no mark it as such anymore.

* platform/mac/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211131 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoWork around a crash when running media/modern-media-controls/pip-support/pip-support...
commit-queue@webkit.org [Wed, 25 Jan 2017 02:56:40 +0000 (02:56 +0000)]
Work around a crash when running media/modern-media-controls/pip-support/pip-support-enabled.html
https://bugs.webkit.org/show_bug.cgi?id=167381

Patch by Antoine Quint <graouts@apple.com> on 2017-01-24
Reviewed by Dean Jackson.

The test at media/modern-media-controls/pip-support/pip-support-enabled.html would crash because the test that
preceded it, media/modern-media-controls/pip-support/pip-support-click.html, would not exit the PiP presentation mode
before exiting the test. We now exit PiP before proceeding to the next test which avoid hitting the assertion
and the crash in Debug builds.

* media/modern-media-controls/pip-support/pip-support-click.html:
* platform/mac-wk1/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211130 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoAtomics.store should return the int-converted value according to toInteger
fpizlo@apple.com [Wed, 25 Jan 2017 02:52:51 +0000 (02:52 +0000)]
Atomics.store should return the int-converted value according to toInteger
https://bugs.webkit.org/show_bug.cgi?id=167399

Reviewed by Saam Barati.
JSTests:

* stress/atomics-add-uint32.js: Added.
* stress/atomics-store-return.js: Fix the test to match what the spec wants.

Source/JavaScriptCore:

I keep getting this wrong, but I think I've finally done it right. What we want is for
Atomics.store to return the value it was passed after toInteger, which doesn't clip the value to
any kind of range. It does get truncated to double.

This changes the code to pass those "integers" as doubles. It doesn't matter that this is slow,
since all of these code paths are slow due to their need to check everything. We'll take care of
that by making them intrinsic later.

* runtime/AtomicsObject.cpp:
(JSC::atomicsFuncAdd):
(JSC::atomicsFuncAnd):
(JSC::atomicsFuncCompareExchange):
(JSC::atomicsFuncExchange):
(JSC::atomicsFuncLoad):
(JSC::atomicsFuncOr):
(JSC::atomicsFuncStore):
(JSC::atomicsFuncSub):
(JSC::atomicsFuncXor):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211129 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years ago[JSC] Optimize Number#toString with Int52
utatane.tea@gmail.com [Wed, 25 Jan 2017 02:40:52 +0000 (02:40 +0000)]
[JSC] Optimize Number#toString with Int52
https://bugs.webkit.org/show_bug.cgi?id=167303

Reviewed by Sam Weinig.

JSTests:

* stress/to-string-with-int52.js: Added.
(shouldBe):

Source/JavaScriptCore:

In kraken crypto-sha256-iterative, we frequently call Number.prototype.toString with
Int52. In that case, toString handles it in the generic double path. But we should
have a fast path for this since it can be represented in int64_t.

The stanford-crypto-sha256-iterative shows 1.6% performance improvement (on Linux machine hanayamata).

    Collected 100 samples per benchmark/VM, with 100 VM invocations per benchmark. Emitted a call to gc() between
    sample measurements. Used 1 benchmark iteration per VM invocation for warm-up. Used the jsc-specific preciseTime()
    function to get microsecond-level timing. Reporting benchmark execution times with 95% confidence intervals in
    milliseconds.

                                               baseline                  patched

    stanford-crypto-sha256-iterative        32.853+-0.075      ^      32.325+-0.055         ^ definitely 1.0163x faster

* runtime/JSCJSValue.h:
* runtime/NumberPrototype.cpp:
(JSC::int52ToStringWithRadix):
(JSC::toStringWithRadix):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211128 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years ago[WebRTC] Use HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE for libwebrtc
commit-queue@webkit.org [Wed, 25 Jan 2017 02:18:01 +0000 (02:18 +0000)]
[WebRTC] Use HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE for libwebrtc
https://bugs.webkit.org/show_bug.cgi?id=167353

Patch by Youenn Fablet <youenn@apple.com> on 2017-01-24
Reviewed by Alex Christensen.

Source/ThirdParty/libwebrtc:

* CMakeLists.txt:

Tools:

* Scripts/webkitpy/libwebrtc/generate_cmake.py:
(CMakeGenerator.initialize_targets):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211127 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years ago[iOS WK2] Avoid IOSurface readback for snapshot creation
simon.fraser@apple.com [Wed, 25 Jan 2017 01:44:09 +0000 (01:44 +0000)]
[iOS WK2] Avoid IOSurface readback for snapshot creation
https://bugs.webkit.org/show_bug.cgi?id=167397
rdar://problem/30174873

Reviewed by Tim Horton.

Source/WebCore:

Export sinkIntoImage().

* platform/graphics/cocoa/IOSurface.h:

Source/WebKit2:

Use IOSurface::sinkIntoImage() for snapshots, to avoid GPU readback.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211126 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoBug 167392: REGRESSION(r210531): Relax same-volume display requirement for iOS
bfulgham@apple.com [Wed, 25 Jan 2017 01:43:21 +0000 (01:43 +0000)]
Bug 167392: REGRESSION(r210531): Relax same-volume display requirement for iOS
https://bugs.webkit.org/show_bug.cgi?id=167392
<rdar://problem/30074665>

Reviewed by Brady Eidson.

Source/WebCore:

* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::canDisplay): Exclude the new check when building on iOS.

LayoutTests:

Rebaseline two tests for ios-simulator, now that they exclude the cross-volume file check..

* platform/ios-simulator/fast/xmlhttprequest: Added.
* platform/ios-simulator/fast/xmlhttprequest/xmlhttprequest-nonexistent-file-expected.txt: Added.
* platform/ios-simulator/storage: Added.
* platform/ios-simulator/storage/domstorage: Added.
* platform/ios-simulator/storage/domstorage/sessionstorage: Added.
* platform/ios-simulator/storage/domstorage/sessionstorage/blocked-file-access-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211125 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoInferredTypeTable entry manipulation is not TOCTOU race safe
msaboff@apple.com [Wed, 25 Jan 2017 01:04:26 +0000 (01:04 +0000)]
InferredTypeTable entry manipulation is not TOCTOU race safe
https://bugs.webkit.org/show_bug.cgi?id=167344

Reviewed by Filip Pizlo.

Made the accesses to table values safe from Time of Check,
Time of Use races with local temporary values.

Fixed point that we set an entry in the table to access the
current table entry instead of using the local entry.  In that case,
we reload the now changed entry.

* runtime/InferredTypeTable.cpp:
(JSC::InferredTypeTable::visitChildren):
(JSC::InferredTypeTable::get):
(JSC::InferredTypeTable::willStoreValue):
(JSC::InferredTypeTable::makeTop):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211124 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoWKR should not confuse Miguel Gomez with Andres Gomez
mcatanzaro@igalia.com [Wed, 25 Jan 2017 00:55:10 +0000 (00:55 +0000)]
WKR should not confuse Miguel Gomez with Andres Gomez
https://bugs.webkit.org/show_bug.cgi?id=167389

Reviewed by Lucas Forschler.

Andres's email is a substring of Miguel's, causing WKR to credit Miguel's commits to
"mAndres Gomez". Fix this.

* Scripts/webkitpy/tool/commands/newcommitbot.py:
(NewCommitBot._summarize_commit_log): Be stricter about matching emails. SVN logs include a
space on each side of the email address, so expect both spaces to be there before
considering the email for replacement.
* Scripts/webkitpy/tool/commands/newcommitbot_unittest.py: Add a test.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211123 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoAtomics.store should return the int-converted value, not the value that it stored
fpizlo@apple.com [Wed, 25 Jan 2017 00:53:48 +0000 (00:53 +0000)]
Atomics.store should return the int-converted value, not the value that it stored
https://bugs.webkit.org/show_bug.cgi?id=167395

Reviewed by Saam Barati.
JSTests:

* stress/atomics-store-return.js: Added.

Source/JavaScriptCore:

Previously the code was based around passing a lambda that operated over the native type of the
operation (so for example int8_t if we were doing things to Int8Arrays). But to support this
behavior of store, we need it to be able to control how it converts its result to JSValue and it
needs to see its argument as an int32_t. It turns out that it's easy for all of the functions in
AtomicsObject.cpp to also adopt this protocol since the conversion to JSValue is just jsNumber()
from the native type in those cases, and the conversion from int32_t is done for free in
std::atomic.

* runtime/AtomicsObject.cpp:
(JSC::atomicsFuncAdd):
(JSC::atomicsFuncAnd):
(JSC::atomicsFuncCompareExchange):
(JSC::atomicsFuncExchange):
(JSC::atomicsFuncLoad):
(JSC::atomicsFuncOr):
(JSC::atomicsFuncStore):
(JSC::atomicsFuncSub):
(JSC::atomicsFuncXor):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211122 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoScript gets touch events even after navigation swipe begins
timothy_horton@apple.com [Wed, 25 Jan 2017 00:49:33 +0000 (00:49 +0000)]
Script gets touch events even after navigation swipe begins
https://bugs.webkit.org/show_bug.cgi?id=167383
<rdar://problem/22938927>

Reviewed by Simon Fraser.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _isNavigationSwipeGestureRecognizer:]):
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/Cocoa/ViewGestureController.h:
* UIProcess/ios/ViewGestureControllerIOS.mm:
(-[WKSwipeTransitionController isNavigationSwipeGestureRecognizer:]):
(WebKit::ViewGestureController::isNavigationSwipeGestureRecognizer):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView gestureRecognizer:shouldRequireFailureOfGestureRecognizer:]):
Require the navigation swipe gesture recognizer to fail before the
UIWebTouchEventsGestureRecognizer can recognize. This way, the page
doesn't get touch events during the swipe, which previously led to
e.g. carousels scrolling while swiping.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211121 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoAdd memory footprint reporting using diagnostic logging.
akling@apple.com [Wed, 25 Jan 2017 00:15:00 +0000 (00:15 +0000)]
Add memory footprint reporting using diagnostic logging.
<https://webkit.org/b/167285>
<rdar://problem/30151767>

Reviewed by Chris Dumez.

Add some basic logging of physical memory footprint post-load and post-backgrounding.
The logging works similarly to the CPU usage logging, though with slightly longer
delays to allow the measurement to stabilize.

* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::memoryUsageKey):
(WebCore::DiagnosticLoggingKeys::memoryUsageToDiagnosticLoggingKey):
* page/DiagnosticLoggingKeys.h:
* page/PerformanceLogging.cpp:
(WebCore::PerformanceLogging::physicalFootprint):
* page/PerformanceLogging.h:
* page/PerformanceMonitor.cpp:
(WebCore::PerformanceMonitor::PerformanceMonitor):
(WebCore::PerformanceMonitor::didFinishLoad):
(WebCore::PerformanceMonitor::activityStateChanged):
(WebCore::PerformanceMonitor::measurePostLoadMemoryUsage):
(WebCore::PerformanceMonitor::measurePostBackgroundingMemoryUsage):
* page/PerformanceMonitor.h:
* page/Settings.h:
(WebCore::Settings::isPostLoadMemoryUsageMeasurementEnabled):
(WebCore::Settings::isPostBackgroundingMemoryUsageMeasurementEnabled):
* page/cocoa/PerformanceLoggingCocoa.mm:
(WebCore::PerformanceLogging::physicalFootprint):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211120 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoMarking macos-inline-media-controls/macos-inline-media-controls-buttons-styles.html...
ryanhaddad@apple.com [Wed, 25 Jan 2017 00:09:09 +0000 (00:09 +0000)]
Marking macos-inline-media-controls/macos-inline-media-controls-buttons-styles.html as flaky on macOS WK1.
https://bugs.webkit.org/show_bug.cgi?id=163598

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211119 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoRemove always true unsafePluginPastingEnabled setting
commit-queue@webkit.org [Tue, 24 Jan 2017 23:49:34 +0000 (23:49 +0000)]
Remove always true unsafePluginPastingEnabled setting
https://bugs.webkit.org/show_bug.cgi?id=167360

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-01-24
Reviewed by Andreas Kling.

Source/WebCore:

Setting added by Chromium and never used by other ports.

* dom/ScriptableDocumentParser.cpp:
(WebCore::ScriptableDocumentParser::ScriptableDocumentParser):
* page/Settings.in:

LayoutTests:

* editing/pasteboard/paste-noplugin-expected.txt: Removed.
* editing/pasteboard/paste-noplugin-xhtml-expected.txt: Removed.
* editing/pasteboard/paste-noplugin-xhtml.xhtml: Removed.
* editing/pasteboard/paste-noplugin.html: Removed.
* platform/efl/TestExpectations:
* platform/wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211118 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoWhen Safari reloads pages with Flash objects after Flash is installed, placeholders...
andersca@apple.com [Tue, 24 Jan 2017 23:25:38 +0000 (23:25 +0000)]
When Safari reloads pages with Flash objects after Flash is installed, placeholders don't paint (but do work!)
https://bugs.webkit.org/show_bug.cgi?id=167391
rdar://problem/29857388

Reviewed by Sam Weinig.

* page/Page.cpp:
(WebCore::Page::refreshPlugins):
Remove an unused variable.

* plugins/PluginInfoProvider.cpp:
(WebCore::PluginInfoProvider::refresh):
Make sure to call refreshPlugins(). Instead of reloading subframes, just reload all the main frames with
subframes that contain plug-ins.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211114 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years ago-0 is a valid array index and AtomicsObject should know this
fpizlo@apple.com [Tue, 24 Jan 2017 23:24:35 +0000 (23:24 +0000)]
-0 is a valid array index and AtomicsObject should know this
https://bugs.webkit.org/show_bug.cgi?id=167386

Reviewed by Mark Lam.

JSTests:

* stress/atomics-neg-zero.js: Added.

Source/JavaScriptCore:

* runtime/AtomicsObject.cpp: The bug title really says it all.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211113 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoUnreviewed, rolling out r211091.
commit-queue@webkit.org [Tue, 24 Jan 2017 22:40:40 +0000 (22:40 +0000)]
Unreviewed, rolling out r211091.
https://bugs.webkit.org/show_bug.cgi?id=167384

introduces a subtle bug in InferredTypeTable, huge
Octane/deltablue regression (Requested by pizlo on #webkit).

Reverted changeset:

"InferredTypeTable entry manipulation is not TOCTOU race safe"
https://bugs.webkit.org/show_bug.cgi?id=167344
http://trac.webkit.org/changeset/211091

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211112 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoEnable the stochastic space-time scheduler on the larger multicores
fpizlo@apple.com [Tue, 24 Jan 2017 22:07:34 +0000 (22:07 +0000)]
Enable the stochastic space-time scheduler on the larger multicores
https://bugs.webkit.org/show_bug.cgi?id=167382
<rdar://problem/30173375>

Rubber stamped by Saam Barati

This looks like a 1.3% JetStream speed-up thanks to a 28% splay-latency improvement. This new
scheduler seems to prevent all of the same pathologies as the old one prevented. But instead of
periodically suspending the mutator, this new one will only suspend after an iteration of the
constraint fixpoint. The length of that suspension length is random with the distribution being
governed by mutatorUtilization. Once resumed, the mutator gets to run unimpeded until draining
stalls.

I'm enabling it on platforms as I benchmark those platforms. It's possible that we will want to
use a different scheduler on different platforms.

* runtime/Options.cpp:
(JSC::overrideDefaults):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211111 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoJSArray::tryCreateUninitialized should be called JSArray::tryCreateForInitializationP...
msaboff@apple.com [Tue, 24 Jan 2017 21:54:59 +0000 (21:54 +0000)]
JSArray::tryCreateUninitialized should be called JSArray::tryCreateForInitializationPrivate
https://bugs.webkit.org/show_bug.cgi?id=167334

Rubber-stamped by Filip Pizlo.

* dfg/DFGOperations.cpp:
* ftl/FTLOperations.cpp:
(JSC::FTL::operationMaterializeObjectInOSR):
* runtime/ArrayPrototype.cpp:
(JSC::arrayProtoFuncSplice):
(JSC::arrayProtoPrivateFuncConcatMemcpy):
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/JSArray.cpp:
(JSC::JSArray::tryCreateForInitializationPrivate):
(JSC::JSArray::fastSlice):
(JSC::JSArray::tryCreateUninitialized): Deleted.
* runtime/JSArray.h:
(JSC::JSArray::tryCreateForInitializationPrivate):
(JSC::constructArray):
(JSC::constructArrayNegativeIndexed):
(JSC::JSArray::tryCreateUninitialized): Deleted.
* runtime/RegExpMatchesArray.cpp:
(JSC::createEmptyRegExpMatchesArray):
* runtime/RegExpMatchesArray.h:
(JSC::createRegExpMatchesArray):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211110 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoClean up Performance IDL interfaces so they are easier to read
commit-queue@webkit.org [Tue, 24 Jan 2017 21:45:13 +0000 (21:45 +0000)]
Clean up Performance IDL interfaces so they are easier to read
https://bugs.webkit.org/show_bug.cgi?id=167378

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-01-24
Reviewed by Sam Weinig.

* page/Performance.idl:
* page/PerformanceEntry.idl:
* page/PerformanceMark.idl:
* page/PerformanceMeasure.idl:
Update spec links and use a typedef to match specs.

* page/PerformanceResourceTiming.cpp:
(WebCore::PerformanceResourceTiming::workerStart):
* page/PerformanceResourceTiming.h:
* page/PerformanceResourceTiming.idl:
Add the workerStart property which always returns 0 for non-workers.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211109 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoSimple line layout: Add support for hyphen: auto.
zalan@apple.com [Tue, 24 Jan 2017 21:38:20 +0000 (21:38 +0000)]
Simple line layout: Add support for hyphen: auto.
https://bugs.webkit.org/show_bug.cgi?id=167297
<rdar://problem/30119463>

Reviewed by Antti Koivisto.

Source/WebCore:

Implement hyphen: auto for simple line layout.

Tests: fast/text/simple-line-hyphens-with-text-align.html
       fast/text/simple-line-hyphens-with-word-letter-spacing.html

* platform/text/Hyphenation.h:
(WebCore::enoughWidthForHyphenation):
* rendering/RenderTreeAsText.cpp:
(WebCore::writeSimpleLine):
(WebCore::write):
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForStyle):
(WebCore::SimpleLineLayout::LineState::appendFragmentAndCreateRunIfNeeded): Inherit the hyphen attribute from the
run-to-be-appended. Ensure that we don't append additional runs when the last run has hyphen.
(WebCore::SimpleLineLayout::splitFragmentToFitLine): Before calling into the lastHyphenPosition() we need to
ensure that the hyphen would surely fit (even on the splitting position).
(WebCore::SimpleLineLayout::createLineRuns): Probe hypenation for overhanging non-whitespace runs.
(WebCore::SimpleLineLayout::printReason):
* rendering/SimpleLineLayout.h:
(WebCore::SimpleLineLayout::Run::Run):
* rendering/SimpleLineLayoutFlowContents.h:
(WebCore::SimpleLineLayout::FlowContents::Segment::toSegmentPosition):
(WebCore::SimpleLineLayout::FlowContents::Segment::toRenderPosition):
* rendering/SimpleLineLayoutResolver.cpp:
(WebCore::SimpleLineLayout::RunResolver::Run::Run):
(WebCore::SimpleLineLayout::RunResolver::Run::constructStringForHyphenIfNeeded):
(WebCore::SimpleLineLayout::RunResolver::Run::text):
* rendering/SimpleLineLayoutResolver.h:
(WebCore::SimpleLineLayout::RunResolver::Run::hasHyphen):
* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
(WebCore::SimpleLineLayout::TextFragmentIterator::nextBreakablePosition):
(WebCore::SimpleLineLayout::TextFragmentIterator::nextNonWhitespacePosition):
(WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
(WebCore::SimpleLineLayout::TextFragmentIterator::lastHyphenPosition): We only check the actual run for hyphenation ignoring
the neighboring runs. This might need to be changed in the future.
(WebCore::SimpleLineLayout::TextFragmentIterator::runWidth):
* rendering/SimpleLineLayoutTextFragmentIterator.h:
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::TextFragment):
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::hasHyphen):
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::operator==):
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::split):
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::splitWithHyphen):
* rendering/line/BreakingContext.h:
(WebCore::tryHyphenating):

LayoutTests:

* fast/text/simple-line-hyphens-with-text-align-expected.html: Added.
* fast/text/simple-line-hyphens-with-text-align.html: Added.
* fast/text/simple-line-hyphens-with-word-letter-spacing-expected.html: Added.
* fast/text/simple-line-hyphens-with-word-letter-spacing.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211108 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoPass down website autoplay policies to media elements
commit-queue@webkit.org [Tue, 24 Jan 2017 21:03:42 +0000 (21:03 +0000)]
Pass down website autoplay policies to media elements
https://bugs.webkit.org/show_bug.cgi?id=167355

Patch by Matt Rajca <mrajca@apple.com> on 2017-01-24
Reviewed by Alex Christensen.

Source/WebCore:

Autoplay policies can be specified at the global web view preferences level or on a per-page
basis during navigation. This patch ensures that policies specified on a per-page basis hold
precedence over global policies. If no policies are specified during navigation, global
policies are used. A WebsiteAutoplayPolicy::Default option has been added to let clients
explicitly specify web view defaults should be used.

* dom/Document.cpp:
(WebCore::Document::audioPlaybackRequiresUserGesture):
(WebCore::Document::videoPlaybackRequiresUserGesture):
* dom/Document.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
(WebCore::HTMLMediaElement::playInternal):
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::audioPlaybackRequiresUserGesture):
(WebCore::DocumentLoader::setAudioPlaybackRequiresUserGesture):
(WebCore::DocumentLoader::videoPlaybackRequiresUserGesture):
(WebCore::DocumentLoader::setVideoPlaybackRequiresUserGesture):

Source/WebKit2:

Autoplay policies can be specified at the global web view preferences level or on a per-page
basis during navigation. This patch ensures that policies specified on a per-page basis hold
precedence over global policies. If no policies are specified during navigation, global
policies are used. A WebsiteAutoplayPolicy::Default option has been added to let clients
explicitly specify web view defaults should be used.

* Shared/WebsitePolicies.h:
* UIProcess/API/C/WKWebsitePolicies.cpp:
(WKWebsitePoliciesGetAutoplayPolicy):
(WKWebsitePoliciesSetAutoplayPolicy):
* UIProcess/API/C/WKWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
(-[_WKWebsitePolicies setAutoplayPolicy:]):
(-[_WKWebsitePolicies autoplayPolicy]):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/autoplay-check.html: Renamed from Tools/TestWebKitAPI/Tests/WebKit2/autoplayCheck.html to match our naming conventions.
* TestWebKitAPI/Tests/WebKit2/autoplay-no-audio-check.html: Added.
* TestWebKitAPI/Tests/WebKit2/test-without-audio-track.mp4: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/WebsitePolicies.mm:
(-[AutoplayPoliciesDelegate _webView:decidePolicyForNavigationAction:decisionHandler:]):
(TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211097 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoMore modern-media-controls LayoutTest gardening.
ryanhaddad@apple.com [Tue, 24 Jan 2017 20:49:12 +0000 (20:49 +0000)]
More modern-media-controls LayoutTest gardening.

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:
* platform/mac/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211096 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoAX: Speak Selection does not work in an iframe
n_wang@apple.com [Tue, 24 Jan 2017 20:44:38 +0000 (20:44 +0000)]
AX: Speak Selection does not work in an iframe
https://bugs.webkit.org/show_bug.cgi?id=166794
<rdar://problem/29913013>

Reviewed by Chris Fleizach.

Source/WebKit2:

Making sure WebPage::getSelectionOrContentsAsString() is getting the
selection content in the right frame.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _accessibilityRetrieveSpeakSelectionContent]):
(-[WKWebView _accessibilityDidGetSpeakSelectionContent:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView accessibilityRetrieveSpeakSelectionContent]):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::getSelectionOrContentsAsString):

Tools:

* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::retrieveSpeakSelectionContent):
(WTR::UIScriptController::accessibilitySpeakSelectionContent):
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::retrieveSpeakSelectionContent):
(WTR::UIScriptController::accessibilitySpeakSelectionContent):
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/cocoa/TestRunnerWKWebView.h:
* WebKitTestRunner/cocoa/TestRunnerWKWebView.mm:
(-[TestRunnerWKWebView dealloc]):
(-[TestRunnerWKWebView _accessibilityDidGetSpeakSelectionContent:]):
(-[TestRunnerWKWebView accessibilityRetrieveSpeakSelectionContentWithCompletionHandler:]):
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::retrieveSpeakSelectionContent):
(WTR::UIScriptController::accessibilitySpeakSelectionContent):

LayoutTests:

* accessibility/ios-simulator/speak-selection-content-expected.txt: Added.
* accessibility/ios-simulator/speak-selection-content.html: Added.
* platform/ios-simulator-wk1/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211095 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoMake _WKFullscreenDelegate available to users of the WebKit2 C-API.
jer.noble@apple.com [Tue, 24 Jan 2017 19:55:56 +0000 (19:55 +0000)]
Make _WKFullscreenDelegate available to users of the WebKit2 C-API.
https://bugs.webkit.org/show_bug.cgi?id=165255

Reviewed by Anders Carlsson.

Add a getter and setter to WKPagePrivate allowing clients to set/get the
_WKFullscreenDelegate associated with the page.

* UIProcess/API/C/mac/WKPagePrivateMac.h:
* UIProcess/API/C/mac/WKPagePrivateMac.mm:
(WKPageSetFullscreenDelegate):
(WKPageGetFullscreenDelegate):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211094 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agomodern-media-controls LayoutTest gardening.
ryanhaddad@apple.com [Tue, 24 Jan 2017 19:09:38 +0000 (19:09 +0000)]
modern-media-controls LayoutTest gardening.
https://bugs.webkit.org/show_bug.cgi?id=167266

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:
* platform/mac/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211093 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoRemove always true selectionIncludesAltImageText setting
joepeck@webkit.org [Tue, 24 Jan 2017 19:08:42 +0000 (19:08 +0000)]
Remove always true selectionIncludesAltImageText setting
https://bugs.webkit.org/show_bug.cgi?id=167358

Reviewed by Alex Christensen.

Source/WebCore:

* editing/Editor.cpp:
(WebCore::Editor::selectedTextForDataTransfer):
* page/Settings.in:

LayoutTests:

* editing/pasteboard/copy-image-with-alt-text-expected.txt:
* editing/pasteboard/copy-image-with-alt-text.html:
* platform/efl/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211092 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoInferredTypeTable entry manipulation is not TOCTOU race safe
msaboff@apple.com [Tue, 24 Jan 2017 18:57:36 +0000 (18:57 +0000)]
InferredTypeTable entry manipulation is not TOCTOU race safe
https://bugs.webkit.org/show_bug.cgi?id=167344

Reviewed by Filip Pizlo.

Made the accesses to table values safe from Time of Check,
Time of Use races with local temporary values.

* runtime/InferredTypeTable.cpp:
(JSC::InferredTypeTable::visitChildren):
(JSC::InferredTypeTable::get):
(JSC::InferredTypeTable::willStoreValue):
(JSC::InferredTypeTable::makeTop):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211091 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoMarking media/modern-media-controls/media-controller/media-controller-resize.html...
ryanhaddad@apple.com [Tue, 24 Jan 2017 18:27:31 +0000 (18:27 +0000)]
Marking media/modern-media-controls/media-controller/media-controller-resize.html as flaky on macOS WK1.
https://bugs.webkit.org/show_bug.cgi?id=164571

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211090 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoWPT LayoutTest gardening for ios-simulator.
ryanhaddad@apple.com [Tue, 24 Jan 2017 18:17:36 +0000 (18:17 +0000)]
WPT LayoutTest gardening for ios-simulator.

Unreviewed test gardening.

* platform/ios-simulator/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211089 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoVS2015 supports ref qualifiers
annulen@yandex.ru [Tue, 24 Jan 2017 18:15:12 +0000 (18:15 +0000)]
VS2015 supports ref qualifiers
https://bugs.webkit.org/show_bug.cgi?id=167368

Reviewed by Sam Weinig.

* wtf/Compiler.h: Enable
WTF_COMPILER_SUPPORTS_CXX_REFERENCE_QUALIFIED_FUNCTIONS for VS2015

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211088 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoStringView.split() should use an iterator design pattern instead of allocating a...
dbates@webkit.org [Tue, 24 Jan 2017 17:44:50 +0000 (17:44 +0000)]
StringView.split() should use an iterator design pattern instead of allocating a Vector
https://bugs.webkit.org/show_bug.cgi?id=163225

Reviewed by Darin Adler.

Source/WebCore:

Update code to use the new iterator-style StringView.split().

* platform/URLParser.cpp:

Source/WTF:

Implement StringView.split() using an iterator design.

Using an iterator design avoids the need to allocate a Vector of StringView objects,
which is space-inefficient and error prone as the returned Vector may outlive the
lifetime of the underlying string associated with the split (as StringView is a non-
owning reference to a string).

StringView.split() now returns a StringView::SplitResult object that implements begin()/end()
to support iterating over StringView substrings delimited by the specified separator
character. For example, to iterate over the 'c'-separated substrings of a StringView v,
you can write:

for (StringView substring : v.split('c'))
    // Do something with substring.

* wtf/text/StringView.cpp:
(WTF::StringView::SplitResult::Iterator::findNextSubstring): Advances the iterator to point to the
next substring.
(WTF::StringView::split): Modified to return a SplitResult::Iterator object instead of a Vector<StringView>.
* wtf/text/StringView.h:
(WTF::StringView::SplitResult::SplitResult):
(WTF::StringView::SplitResult::Iterator::Iterator):
(WTF::StringView::SplitResult::Iterator::operator*):
(WTF::StringView::SplitResult::Iterator::operator==):
(WTF::StringView::SplitResult::Iterator::operator!=):
Implements the iterator interface.

Tools:

Add unit tests for StringView.split().

* TestWebKitAPI/Tests/WTF/StringView.cpp:
(TestWebKitAPI::stringViewFromLiteral): Moved to the top of the file so that it can be
used in the StringView.split() unit tests.
(TestWebKitAPI::stringViewFromUTF8): Ditto.
(TestWebKitAPI::vectorFromSplitResult): Convenience function to convert a StringView::SplitResult
object to a Vector of String objects.
(TestWebKitAPI::TEST): Added the following tests:
    - WTF.StringViewSplitEmptyAndNullStrings
    - WTF.StringViewSplitBasic
    - WTF.StringViewSplitWithConsecutiveSeparators

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211087 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoThe Score Esports crashes on launch
andersca@apple.com [Tue, 24 Jan 2017 17:29:13 +0000 (17:29 +0000)]
The Score Esports crashes on launch
https://bugs.webkit.org/show_bug.cgi?id=167338
rdar://problem/29948645

Reviewed by Dan Bernstein.

Source/WebKit2:

* Shared/Cocoa/WKObject.mm:
(+[WKObject conformsToProtocol:]):
Add a class method implementation in case an app ends up calling +[WKObject conformsToProtocol:] for some reason.

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/WKObject.mm:
(TestWebKitAPI::TEST):
Add a test.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211086 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoRemove always true openGLMultisamplingEnabled setting
commit-queue@webkit.org [Tue, 24 Jan 2017 17:01:44 +0000 (17:01 +0000)]
Remove always true openGLMultisamplingEnabled setting
https://bugs.webkit.org/show_bug.cgi?id=167364

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-01-24
Reviewed by Sam Weinig.

* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create):
* page/Settings.in:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211085 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years ago[GTK] Do not paint non composited content into the window when using the threaded...
magomez@igalia.com [Tue, 24 Jan 2017 16:25:31 +0000 (16:25 +0000)]
[GTK] Do not paint non composited content into the window when using the threaded compositor
https://bugs.webkit.org/show_bug.cgi?id=167367

Reviewed by Carlos Garcia Campos.

When using the threaded compositor we need to send the non composited content for compositing as well,
not painting it directly into the window.

No new tests.

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::paintsIntoWindow):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211084 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years ago[Coordinated Graphics] Ensure that we're in AC mode before trying to create GraphicsL...
magomez@igalia.com [Tue, 24 Jan 2017 14:10:43 +0000 (14:10 +0000)]
[Coordinated Graphics] Ensure that we're in AC mode before trying to create GraphicsLayers
https://bugs.webkit.org/show_bug.cgi?id=167365

Reviewed by Carlos Garcia Campos.

When entering AC on demand, the RenderLayerCompositor wants to create the root GraphicsLayer before the
AcceleratedDrawingArea is in AC mode. This means there's no LayerTreeHost to request the GraphicsLayerFactory,
so no layers are created. Ensure that we are in AC mode before requesting the GraphicsLayerFactory.

No behaviour change, no new tests.

* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::graphicsLayerFactory):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211083 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoRemove always true allowCustomScrollbarInMainFrame setting
commit-queue@webkit.org [Tue, 24 Jan 2017 11:48:25 +0000 (11:48 +0000)]
Remove always true allowCustomScrollbarInMainFrame setting
https://bugs.webkit.org/show_bug.cgi?id=167362

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-01-24
Reviewed by Andreas Kling.

Setting added by Chromium and never used by other ports.

* page/FrameView.cpp:
(WebCore::FrameView::createScrollbar):
* page/Settings.in:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211082 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoRemove always true syncXHRInDocumentsEnabled setting
commit-queue@webkit.org [Tue, 24 Jan 2017 10:29:21 +0000 (10:29 +0000)]
Remove always true syncXHRInDocumentsEnabled setting
https://bugs.webkit.org/show_bug.cgi?id=167359

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-01-24
Reviewed by Alex Christensen.

Source/WebCore:

Setting added by Chromium and never used by other ports.

* page/Settings.in:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::open):

LayoutTests:

* fast/xmlhttprequest/xmlhttprequest-sync-disabled-expected.txt: Removed.
* fast/xmlhttprequest/xmlhttprequest-sync-disabled.html: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211081 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoRemove always true antialiased2dCanvasEnabled setting
commit-queue@webkit.org [Tue, 24 Jan 2017 10:04:27 +0000 (10:04 +0000)]
Remove always true antialiased2dCanvasEnabled setting
https://bugs.webkit.org/show_bug.cgi?id=167361

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-01-24
Reviewed by Andreas Kling.

* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::createImageBuffer):
* page/Settings.in:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211080 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years ago[GTK] Add API to WebKitWebsiteDataManager to handle website data
carlosgc@webkit.org [Tue, 24 Jan 2017 07:48:40 +0000 (07:48 +0000)]
[GTK] Add API to WebKitWebsiteDataManager to handle website data
https://bugs.webkit.org/show_bug.cgi?id=146589

Reviewed by Michael Catanzaro.

Source/WebKit2:

Add WebKitWebsiteData boxed type to wrap a WebsiteDataRecord and new methods to WebKitWebsiteDataManager to
fetch, remove and clear website data.

* PlatformGTK.cmake: Add new files to compilation.
* UIProcess/API/gtk/WebKitWebsiteData.cpp: Added.
(_WebKitWebsiteData::_WebKitWebsiteData):
(recordContainsSupportedDataTypes): Helper function to check if the WebsiteDataRecord contains any type exposed
by our API.
(toWebKitWebsiteDataTypes): Convert from WebKit::WebsiteDataType to the GTK+ public API types.
(webkitWebsiteDataCreate): Create a new WebKitWebsiteData for the given WebsiteDataRecord if it contains any
supported type.
(webkitWebsiteDataGetRecord): Returns the wrapped WebsiteDataRecord.
(webkit_website_data_ref):
(webkit_website_data_unref):
(webkit_website_data_get_name): Return the display name.
(webkit_website_data_get_types): Returns the mask of types.
(webkit_website_data_get_size): Returns the size for the given types.
* UIProcess/API/gtk/WebKitWebsiteData.h: Added.
* UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:
(toWebsiteDataTypes): Convert from GTK+ public API types to WebKit::WebsiteDataType.
(webkit_website_data_manager_fetch): Fetch website data of the given types.
(webkit_website_data_manager_fetch_finish):
(webkit_website_data_manager_remove): Remove the website data of the given types for the given WebKitWebsiteData list.
(webkit_website_data_manager_remove_finish):
(webkit_website_data_manager_clear): Clear all website data of the given types modified since the given time span.
(webkit_website_data_manager_clear_finish):
* UIProcess/API/gtk/WebKitWebsiteDataManager.h:
* UIProcess/API/gtk/WebKitWebsiteDataPrivate.h: Added.
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols.
* UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new section.
* UIProcess/API/gtk/webkit2.h: Inlcude WebKitWebsiteData.h

Tools:

Add about:data handler to MiniBrowser to manually test the website data API. Also add unit tests to test all the
new API, moving the WebKitWebsiteDataManager configuration API to the new file too.

* MiniBrowser/gtk/BrowserWindow.c:
(webViewDecidePolicy):
(newTabCallback):
* MiniBrowser/gtk/main.c:
(createBrowserTab):
(aboutDataRequestFree):
(aboutDataRequestNew):
(aboutDataRequestForView):
(websiteDataRemovedCallback):
(websiteDataClearedCallback):
(aboutDataScriptMessageReceivedCallback):
(domainListFree):
(aboutDataFillTable):
(gotWebsiteDataCallback):
(aboutDataHandleRequest):
(aboutURISchemeRequestCallback):
(main):
* TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt:
* TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebContext.cpp:
(serverCallback):
(beforeAll):
* TestWebKitAPI/Tests/WebKit2Gtk/TestWebsiteData.cpp: Added.
(serverCallback):
(WebsiteDataTest::WebsiteDataTest):
(WebsiteDataTest::~WebsiteDataTest):
(WebsiteDataTest::fetch):
(WebsiteDataTest::remove):
(WebsiteDataTest::clear):
(testWebsiteDataConfiguration):
(testWebsiteDataCache):
(testWebsiteDataStorage):
(testWebsiteDataDatabases):
(testWebsiteDataAppcache):
(beforeAll):
(afterAll):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211079 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoAdd the support for nomodule attribute on script element
utatane.tea@gmail.com [Tue, 24 Jan 2017 06:52:49 +0000 (06:52 +0000)]
Add the support for nomodule attribute on script element
https://bugs.webkit.org/show_bug.cgi?id=166987

Reviewed by Sam Weinig.

Source/WebCore:

As discussed on https://github.com/whatwg/html/pull/2261, we should have
the way to suppress classic script execution when our user agent have
modules support. With such a feature, developers can write the code like,

    <script type="module" src="./app.js"></script>
    <script nomodule src="./bundled-app.js"></script>

In the above code, if the user agent does not support modules, the bundled-app.js
will be executed. On the other hand, if the user agent supports modules, we should
ignore the script tag which has the `nomodule` attribute.
This way allows us to support the legacy browsers while using modules.

In WebKit, we already support modules. Thus, we should ignore the classic script
attributed `nomodule`.

We also rename asyncAttributeValue and deferAttributeValue to hasAsyncAttribute and
hasDeferAttribute.

Tests: js/dom/modules/nomodule-has-no-effect-on-module-inline.html
       js/dom/modules/nomodule-has-no-effect-on-module-src.html
       js/dom/modules/nomodule-prevents-execution-classic-script-inline.html
       js/dom/modules/nomodule-prevents-execution-classic-script-src.html

* dom/ScriptElement.cpp:
(WebCore::ScriptElement::prepareScript):
* dom/ScriptElement.h:
* html/HTMLAttributeNames.in:
* html/HTMLScriptElement.cpp:
(WebCore::HTMLScriptElement::hasAsyncAttribute):
(WebCore::HTMLScriptElement::hasDeferAttribute):
(WebCore::HTMLScriptElement::hasNoModuleAttribute):
(WebCore::HTMLScriptElement::asyncAttributeValue): Deleted.
(WebCore::HTMLScriptElement::deferAttributeValue): Deleted.
* html/HTMLScriptElement.h:
* html/HTMLScriptElement.idl:
* svg/SVGScriptElement.cpp:
(WebCore::SVGScriptElement::hasAsyncAttribute):
(WebCore::SVGScriptElement::hasDeferAttribute):
(WebCore::SVGScriptElement::hasNoModuleAttribute):
(WebCore::SVGScriptElement::asyncAttributeValue): Deleted.
(WebCore::SVGScriptElement::deferAttributeValue): Deleted.
* svg/SVGScriptElement.h:

LayoutTests:

* js/dom/modules/nomodule-dynamic-classic-inline-expected.txt: Added.
* js/dom/modules/nomodule-dynamic-classic-inline.html: Added.
* js/dom/modules/nomodule-dynamic-classic-src-expected.txt: Added.
* js/dom/modules/nomodule-dynamic-classic-src.html: Added.
* js/dom/modules/nomodule-has-no-effect-on-module-inline-expected.txt: Added.
* js/dom/modules/nomodule-has-no-effect-on-module-inline.html: Added.
* js/dom/modules/nomodule-has-no-effect-on-module-src-expected.txt: Added.
* js/dom/modules/nomodule-has-no-effect-on-module-src.html: Added.
* js/dom/modules/nomodule-prevents-execution-classic-script-inline-expected.txt: Added.
* js/dom/modules/nomodule-prevents-execution-classic-script-inline.html: Added.
* js/dom/modules/nomodule-prevents-execution-classic-script-src-expected.txt: Added.
* js/dom/modules/nomodule-prevents-execution-classic-script-src.html: Added.
* js/dom/modules/nomodule-reflect-expected.txt: Added.
* js/dom/modules/nomodule-reflect.html: Added.
* js/dom/modules/script-tests/error-classic-script.js: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211078 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years ago[EFL] Update timeout tests in media/modern-media-controls
gyuyoung.kim@webkit.org [Tue, 24 Jan 2017 06:07:28 +0000 (06:07 +0000)]
[EFL] Update timeout tests in media/modern-media-controls

Unreviewed EFL gardening.

* platform/efl/TestExpectations: Dozens of modern-media-controls tests are timeout.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211077 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoMaintain ordering when doing speculative loads
antti@apple.com [Tue, 24 Jan 2017 06:01:27 +0000 (06:01 +0000)]
Maintain ordering when doing speculative loads
https://bugs.webkit.org/show_bug.cgi?id=167324

Forgot to implement a review comment.

* NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
(WebKit::NetworkCache::makeSubresourceInfoVector):

Allocated initial capacity and use uncheckedAppend.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211076 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoWeb Inspector: Provide a way to trigger a Garbage Collection
commit-queue@webkit.org [Tue, 24 Jan 2017 03:19:03 +0000 (03:19 +0000)]
Web Inspector: Provide a way to trigger a Garbage Collection
https://bugs.webkit.org/show_bug.cgi?id=167345
<rdar://problem/30102853>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-01-23
Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

* inspector/protocol/Console.json:
* inspector/protocol/Debugger.json:
* inspector/protocol/Heap.json:
* inspector/protocol/Runtime.json:
These domains are supported by Worker backends. Label them.

* inspector/scripts/codegen/generate_js_backend_commands.py:
(JSBackendCommandsGenerator.generate_domain):
* inspector/scripts/codegen/models.py:
(Protocol.parse_domain):
(Domain.__init__):
(Domains):
Parse "workerSupported" and include a line in BackendCommands.js
that calls to InspectorBackend.workerSupportedDomain().

* inspector/scripts/tests/generic/domain-availability.json: Added.
* inspector/scripts/tests/generic/expected/domain-availability.json-result: Added.
* inspector/scripts/tests/generic/expected/worker-supported-domains.json-result: Added.
* inspector/scripts/tests/generic/worker-supported-domains.json: Added.
Tests for domain "workerSupported" and "availability" properties.

Source/WebCore:

* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::WorkerInspectorController):
Include a HeapAgent so we can do Heap.gc on Workers.

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js:
New "Garbage collect" tooltip.

* Versions/Inspector-iOS-10.3.json:
* UserInterface/Protocol/Legacy/10.3/InspectorBackendCommands.js:
Update 10.3 so it generates its list of supported domains for workers.
Note that the Heap domain is not be available in this backend but it is now.

* UserInterface/Protocol/Connection.js:
(InspectorBackend.WorkerConnection):
* UserInterface/Protocol/HeapObserver.js:
(WebInspector.HeapObserver.prototype.garbageCollected):
* UserInterface/Protocol/InspectorBackend.js:
(InspectorBackendClass):
(InspectorBackendClass.prototype.get workerSupportedDomains):
(InspectorBackendClass.prototype.workerSupportedDomain):

* UserInterface/Images/NavigationItemClear.svg: Added.
* UserInterface/Images/NavigationItemGarbageCollect.svg: Added.
New image for Garbage Collection. Better image for clearing.

* UserInterface/Images/gtk/NavigationItemClear.svg: Added.
Copy the Trash icon for Clear for gtk.

* UserInterface/Protocol/Target.js:
(WebInspector.Target.prototype.get HeapAgent):
* UserInterface/Protocol/WorkerTarget.js:
(WebInspector.WorkerTarget):
Include Heap agent for Workers.

* UserInterface/Views/LogContentView.js:
(WebInspector.LogContentView):
(WebInspector.LogContentView.prototype.get navigationItems):
(WebInspector.LogContentView.prototype._garbageCollect):
Add garbage collect button which triggers gc on all capable targets.

* UserInterface/Views/NetworkGridContentView.js:
(WebInspector.NetworkGridContentView):
* UserInterface/Views/TimelineRecordingContentView.js:
(WebInspector.TimelineRecordingContentView):
Update the Clear icon to an improved icon.

* UserInterface/Controllers/HeapManager.js:
(WebInspector.HeapManager.prototype.garbageCollected):
Timelines only shows Main Target events, do not show GC events for Workers.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211075 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoCleanup WEB_TIMING code
commit-queue@webkit.org [Tue, 24 Jan 2017 03:12:53 +0000 (03:12 +0000)]
Cleanup WEB_TIMING code
https://bugs.webkit.org/show_bug.cgi?id=167339

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-01-23
Reviewed by Alex Christensen.

Stylistic cleanup to WEB_TIMING related code.

* bindings/js/JSPerformanceEntryCustom.cpp:
* loader/ResourceTimingInformation.cpp:
* loader/ResourceTimingInformation.h:
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didFinishLoading):
* page/Performance.cpp:
(WebCore::Performance::getEntries):
(WebCore::Performance::getEntriesByType):
(WebCore::Performance::setResourceTimingBufferSize):
(WebCore::Performance::isResourceTimingBufferFull):
* page/Performance.h:
* page/PerformanceMark.h:
* page/PerformanceMeasure.h:
* page/PerformanceNavigation.h:
* page/PerformanceResourceTiming.cpp:
(WebCore::PerformanceResourceTiming::PerformanceResourceTiming):
(WebCore::PerformanceResourceTiming::resourceTimeToDocumentMilliseconds):
* page/PerformanceResourceTiming.h:
* page/PerformanceTiming.cpp:
(WebCore::PerformanceTiming::documentLoader):
(WebCore::PerformanceTiming::documentTiming):
(WebCore::PerformanceTiming::loadTiming):
* page/PerformanceTiming.h:
* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::createCFURLConnection):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211074 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoLayoutTest gardening for modern-media-tests.
ryanhaddad@apple.com [Tue, 24 Jan 2017 02:30:47 +0000 (02:30 +0000)]
LayoutTest gardening for modern-media-tests.

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:
* platform/mac/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211073 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoUnreviewed, rolling out r211062.
commit-queue@webkit.org [Tue, 24 Jan 2017 02:19:21 +0000 (02:19 +0000)]
Unreviewed, rolling out r211062.
https://bugs.webkit.org/show_bug.cgi?id=167354

broke API tests (Requested by alexchristensen on #webkit).

Reverted changeset:

"Pass down website autoplay policies to media elements"
https://bugs.webkit.org/show_bug.cgi?id=167132
http://trac.webkit.org/changeset/211062

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211072 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoRemove conflicting TestExpectations for font variations tests.
ryanhaddad@apple.com [Tue, 24 Jan 2017 00:17:14 +0000 (00:17 +0000)]
Remove conflicting TestExpectations for font variations tests.

Unreviewed test gardening.

* platform/mac/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211071 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agohttps://bugs.webkit.org/show_bug.cgi?id=167247
sbarati@apple.com [Tue, 24 Jan 2017 00:15:21 +0000 (00:15 +0000)]
https://bugs.webkit.org/show_bug.cgi?id=167247
JSC: operationSpreadGeneric uses the wrong global object for the builtin function and slow_path_spread consults the wrong global object to prove if the iterator protocol is unobservable
<rdar://problem/30121809>

Reviewed by Filip Pizlo.

JSTests:

* stress/spread-consults-correct-global-object.js: Added.
(assert):
(spread):
* stress/spread-correct-global-object-on-exception.js: Added.
(assert):
(spread):
(const.objectText.let.o.Symbol.iterator):
(catch):

Source/JavaScriptCore:

There were two bugs in the different tiers with respect to how
spread handled global objects.

The first was in the LLInt/baseline inside slow_path_spread:

We consulted the lexical global object instead of the thing we're
spreading's global object to determine if the array iterator protocol
is unobservable. This is wrong if the incoming array is from a different
global object. We must consult the incoming array's global object
to determine if it can be spread using the fast path.

The second was in operationSpreadGeneric in the DFG/FTL:

We were always using the incoming array's global object, even
when going down the slow path. This is wrong because we were
fetching the builtin iteration function helper from the incoming
array's global object, which meant that if the iterator function
were to throw an exception, it could leak objects from a different
global object. We should be executing the iterator function with
the lexical global object.

* dfg/DFGOperations.cpp:
* jsc.cpp:
(GlobalObject::finishCreation):
(functionGlobalObjectForObject):
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/JSArray.h:
* runtime/JSArrayInlines.h:
(JSC::JSArray::isIteratorProtocolFastAndNonObservable):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211070 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoLand the stochastic space-time scheduler disabled
fpizlo@apple.com [Tue, 24 Jan 2017 00:01:13 +0000 (00:01 +0000)]
Land the stochastic space-time scheduler disabled
https://bugs.webkit.org/show_bug.cgi?id=167249

Reviewed by Saam Barati.

The space-time scheduler is pretty weird. It uses a periodic scheduler where the next period is
simply determined by an integer multiple of time since when the scheduler last snapped phase. It
snaps phase after constraint solving. Both the snapping of the phase after constraint solving and
the periodicity appear to be necessary for good performance. For example, if the space-time
scheduler decided that it was in the resume part of the phase just by virtue of having just
resumed, then it would be empirically worse than our scheduler which asks "what time is it?" to
decide whether it should be suspended or resumed even if it just suspended or resumed. I've spent
a lot of time wondering why these two features are essential, and I think I found a reason.

What's happening is that sometimes the GC has an overrun and its increment takes longer than it
should have. The current scheduler forgives overruns when constraint solving, which seems to
make sense because it cannot control whether constraint solving runs with the mutator resumed or
suspended. It has to be suspended currently. Snapping phase after constraint solving accomplishes
this. What's more surprising is how important it is to manage deadline misses during draining.
The relevant kind of deadline miss is when doing mutator-suspended draining to catch up to the
retreating wavefront. Deadline misses while doing this can happen systematically in some
workloads, like JetStream/hash-map and some test in Speedometer. It's because they have some
ginormous object and it takes like ~3ms+-1.5ms just to scan it. The space-time scheduler's use
of time to decide what to do saves the day here: after the deadline miss, the scheduler will
initially realize that it missed its deadline to resume the mutator. But as soon as it does this
it asks: "based on current time since phase snap, what should I do?". In the case of a deadline
miss, this question is essentially a weighted coin flip because of the high noise in the amount
of time that it takes to do things in the GC. If you overrun, you will probably overrun by
multiple milliseconds, which is enough that where you land in the space-time scheduler's timeline
is random. The likelihood that you land in the "resume mutator" part of the timeline has a
probability that is roughly the same as what the space-time scheduler calls mutator utilization.
This is a super weird property. I did not intend for it to have this property, but it appears to
be the most important property of this scheduler.

Based on this, it seems that the fact that the space-time scheduler could suspend the mutator
before draining runs out of work doesn't accomplish anything. As soon as you resume the
mutator, you have a retreating wavefront to worry about. But if the collector is happily scanning
things then it's almost certain that the collector will outpace the mutator. Also, anything that
the mutator asks us to revisit is deferred anyway.

In the past I've tried to replace the scheduler in one patch and this turned out to be annoying
because even a poorly conceived scheduler should be iterated on. This patch lands a new scheduler
called the StochasticSpaceTime scheduler. It replaces two of the known-good features of the old
scheduler: (1) it forgives constraint pauses and (2) after deadline overrun its choice is random,
weighted by the mutator utilization target. Unlike the old scheduler, this one will only suspend
the mutator when the draining terminates, but it may pause for any amount of time after an
iteration of constraint solving. It computes the targetPause by measuring constraint solving time
and multiplying by the pauseScale (0.3 by default). If smaller then minimumPause (0.3ms by
default), then it uses minimumPause instead. The stochastic scheduler will then definitely do at
least targetPause worth of suspended draining after the constraint solving iteration, and then
it will decide whether or not to do another one at random. The probability that it will choose to
resume is exactly mutatorUtilization, which is computed exactly as before. Therefore, the
probability of resumption starts at 0.7 and goes down as memory usage rises. Conversely, the
probability that we will stay suspended starts at 0.3 and goes up from there.

This new scheduler looks like it might be a 25% improvement on splay-latency. It also looks like
a small progression on hash-map. Hash-map is a great test of one of the worst cases of retreating
wavefront, since it is repeatedly storing to a ginormous array. This array is sure to take a
while to scan, and to complete, the GC must be smart enough to visit any new objects it finds
while scanning the array immediately after scanning that array. This new scheduler means that
after scanning the array, the probability that you will scan whatever you found in it starts at
0.3 and rises as the program allocates. It's sure to be 0.3, and not 0.3^k, because after the
wavefront stops advancing, the only object on the mark stack after a constraint iteration will be
that array. Since there is sure to be a 0.3ms or longer pause, the GC will be sure to start
visiting this object. The GC can then complete if it just allows enough time after this to scan
whatever new objects it finds. If scanning the array overruns the deadline (and it almost
certainly will) then the probability that the GC keeps the mutator suspended is simply
1 - mutatorUtilization.

This scheduler is disabled by default. You can enable it with
--useStochasticMutatorScheduler=true.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* heap/Heap.cpp:
(JSC::Heap::Heap):
(JSC::Heap::markToFixpoint):
* heap/Heap.h:
* heap/MarkingConstraintSet.cpp:
(JSC::MarkingConstraintSet::didStartMarking):
(JSC::MarkingConstraintSet::executeConvergenceImpl):
(JSC::MarkingConstraintSet::resetStats): Deleted.
(JSC::MarkingConstraintSet::executeBootstrap): Deleted.
* heap/MarkingConstraintSet.h:
* heap/MutatorScheduler.cpp:
(JSC::MutatorScheduler::didReachTermination):
(JSC::MutatorScheduler::synchronousDrainingDidStall):
* heap/MutatorScheduler.h:
* heap/SlotVisitor.cpp:
(JSC::SlotVisitor::didReachTermination):
(JSC::SlotVisitor::drainFromShared):
* heap/StochasticSpaceTimeMutatorScheduler.cpp: Added.
(JSC::StochasticSpaceTimeMutatorScheduler::Snapshot::Snapshot):
(JSC::StochasticSpaceTimeMutatorScheduler::Snapshot::now):
(JSC::StochasticSpaceTimeMutatorScheduler::Snapshot::bytesAllocatedThisCycle):
(JSC::StochasticSpaceTimeMutatorScheduler::StochasticSpaceTimeMutatorScheduler):
(JSC::StochasticSpaceTimeMutatorScheduler::~StochasticSpaceTimeMutatorScheduler):
(JSC::StochasticSpaceTimeMutatorScheduler::state):
(JSC::StochasticSpaceTimeMutatorScheduler::beginCollection):
(JSC::StochasticSpaceTimeMutatorScheduler::didStop):
(JSC::StochasticSpaceTimeMutatorScheduler::willResume):
(JSC::StochasticSpaceTimeMutatorScheduler::didReachTermination):
(JSC::StochasticSpaceTimeMutatorScheduler::didExecuteConstraints):
(JSC::StochasticSpaceTimeMutatorScheduler::synchronousDrainingDidStall):
(JSC::StochasticSpaceTimeMutatorScheduler::timeToStop):
(JSC::StochasticSpaceTimeMutatorScheduler::timeToResume):
(JSC::StochasticSpaceTimeMutatorScheduler::log):
(JSC::StochasticSpaceTimeMutatorScheduler::endCollection):
(JSC::StochasticSpaceTimeMutatorScheduler::setResumeTime):
(JSC::StochasticSpaceTimeMutatorScheduler::bytesAllocatedThisCycleImpl):
(JSC::StochasticSpaceTimeMutatorScheduler::bytesSinceBeginningOfCycle):
(JSC::StochasticSpaceTimeMutatorScheduler::maxHeadroom):
(JSC::StochasticSpaceTimeMutatorScheduler::headroomFullness):
(JSC::StochasticSpaceTimeMutatorScheduler::mutatorUtilization):
* heap/StochasticSpaceTimeMutatorScheduler.h: Added.
* runtime/Options.cpp:
(JSC::overrideDefaults):
* runtime/Options.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211069 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoMaintain ordering when doing speculative loads
antti@apple.com [Mon, 23 Jan 2017 23:37:42 +0000 (23:37 +0000)]
Maintain ordering when doing speculative loads
https://bugs.webkit.org/show_bug.cgi?id=167324

Reviewed by Chris Dumez.

We currently randomize the ordering of speculative loads because they are serialized as a hash map.
It would be better to load in the same order as the requests were originally issued as that is
likely to match the order the document needs them.

* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
(WebKit::NetworkCache::SpeculativeLoadManager::startSpeculativeRevalidation):
* NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
(WebKit::NetworkCache::SubresourceInfo::encode):
(WebKit::NetworkCache::SubresourceInfo::decode):

    Include key into SubresourceInfo.

(WebKit::NetworkCache::makeSubresourcesVector):

    Deduplicate the entries.

(WebKit::NetworkCache::SubresourcesEntry::SubresourcesEntry):
(WebKit::NetworkCache::SubresourcesEntry::updateSubresourceLoads):
* NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
(WebKit::NetworkCache::SubresourceInfo::SubresourceInfo):
(WebKit::NetworkCache::SubresourceInfo::key):
(WebKit::NetworkCache::SubresourceInfo::setTransient):
(WebKit::NetworkCache::SubresourcesEntry::subresources):

    Keep the resources in a Vector instead of a HashMap to maintain order.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211068 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoURLParser should fail to parse percent-encoded invalid UTF-8 sequences
achristensen@apple.com [Mon, 23 Jan 2017 23:26:55 +0000 (23:26 +0000)]
URLParser should fail to parse percent-encoded invalid UTF-8 sequences
https://bugs.webkit.org/show_bug.cgi?id=167330
Source/WebCore:

<rdar://problem/29319962>

Reviewed by Tim Horton.

Covered by new API tests.

* platform/URLParser.cpp:
(WebCore::containsOnlyASCII):
(WebCore::URLParser::parseHostAndPort):
If UTF-8 decoding fails after percent-decoding the host, fail to parse.
This matches Chrome and Firefox, and it was proposed to the spec in https://github.com/whatwg/url/issues/215

Tools:

Reviewed by Tim Horton.

* TestWebKitAPI/Tests/WebCore/URLParser.cpp:
(TestWebKitAPI::TEST_F):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211067 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoAdded a comment to clarify an assertion.
mark.lam@apple.com [Mon, 23 Jan 2017 23:22:27 +0000 (23:22 +0000)]
Added a comment to clarify an assertion.

Rubber-stamped by Filip Pizlo.

* runtime/JSCellInlines.h:
(JSC::JSCell::classInfo):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211066 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoSharedArrayBuffer plus WebGL should not equal CRASH
fpizlo@apple.com [Mon, 23 Jan 2017 23:13:41 +0000 (23:13 +0000)]
SharedArrayBuffer plus WebGL should not equal CRASH
https://bugs.webkit.org/show_bug.cgi?id=167329

Reviewed by Saam Barati.

Source/JavaScriptCore:

DOM unwrapping methods should return null rather than crashing. The code expects an
unshared buffer, so we should return null when it's shared. The caller can then decide
if they like null or not.

* runtime/JSArrayBufferViewInlines.h:
(JSC::JSArrayBufferView::toWrapped):

LayoutTests:

This test used to crash and now it doesn't. It throws some exception.

* js/shared-array-buffer-webgl-expected.txt: Added.
* js/shared-array-buffer-webgl.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211065 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoWeb Inspector: long press on New Tab Tab Item should show context menu with recently...
commit-queue@webkit.org [Mon, 23 Jan 2017 23:06:26 +0000 (23:06 +0000)]
Web Inspector: long press on New Tab Tab Item should show context menu with recently closed tabs that are still closed
https://bugs.webkit.org/show_bug.cgi?id=166901

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2017-01-23
Reviewed by Joseph Pecoraro.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Views/TabBar.js:
(WebInspector.TabBar.Event):
(WebInspector.TabBar.prototype._handleNewTabContextMenu):
Add listener dispatch for contextmenu event on New Tab tab item.

(WebInspector.TabBar.prototype.get newTabTabBarItem): Deleted.
Unused.

* UserInterface/Views/TabBrowser.js:
(WebInspector.TabBrowser):
(WebInspector.TabBrowser.prototype._tabBarItemAdded):
(WebInspector.TabBrowser.prototype._tabBarItemRemoved):
(WebInspector.TabBrowser.prototype._handleNewTabContextMenu): Added.
Create an array that keeps track of tabs as they are closed, and populate the contextmenu
of the New Tab tab item with entries for each of these tabs.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211064 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoObjCCallbackFunction::destroy() should not use jsCast().
mark.lam@apple.com [Mon, 23 Jan 2017 22:49:26 +0000 (22:49 +0000)]
ObjCCallbackFunction::destroy() should not use jsCast().
https://bugs.webkit.org/show_bug.cgi?id=167322

Reviewed by Filip Pizlo.

Since r210829, it is no longer correct for object destructors to use jsCast().
Fixed ObjCCallbackFunction::destroy() to use a static_cast instead.

* API/ObjCCallbackFunction.mm:
(JSC::ObjCCallbackFunction::destroy):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211063 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoPass down website autoplay policies to media elements
commit-queue@webkit.org [Mon, 23 Jan 2017 22:25:59 +0000 (22:25 +0000)]
Pass down website autoplay policies to media elements
https://bugs.webkit.org/show_bug.cgi?id=167132

Patch by Matt Rajca <mrajca@apple.com> on 2017-01-23
Reviewed by Alex Christensen.

The playbackRequiresUserGesture APIs are already covered by tests. This patch adds API tests
for autoplay website policies.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211062 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoWeb Inspector: tree elements with depth > 1 should have context menu "expand all...
commit-queue@webkit.org [Mon, 23 Jan 2017 22:24:01 +0000 (22:24 +0000)]
Web Inspector: tree elements with depth > 1 should have context menu "expand all"/"collapse all" commands
https://bugs.webkit.org/show_bug.cgi?id=135590

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2017-01-23
Reviewed by Timothy Hatcher.

Rework the context menu event handlers for all TreeOutline and TreeElement instances such
that the TreeOutline handles the event listener and creates the context menu object and the
TreeElement populates the list with items.  This is necessary due to the way in which
children are laid out, as there is padding on either side of the element that would not
trigger a context menu event.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Views/BreakpointTreeElement.js:
(WebInspector.BreakpointTreeElement.prototype.ondetach):
(WebInspector.BreakpointTreeElement.prototype.populateContextMenu):
(WebInspector.BreakpointTreeElement.prototype.oncontextmenu): Deleted.
* UserInterface/Views/ContextMenuUtilities.js:
(WebInspector.appendContextMenuItemsForSourceCode):
* UserInterface/Views/DOMTreeElement.js:
(WebInspector.DOMTreeElement.prototype._populateNodeContextMenu):
* UserInterface/Views/DOMTreeOutline.js:
(WebInspector.DOMTreeOutline):
(WebInspector.DOMTreeOutline.prototype.populateContextMenu):
(WebInspector.DOMTreeOutline.prototype._onmousedown):
(WebInspector.DOMTreeOutline.prototype._onmousemove):
(WebInspector.DOMTreeOutline.prototype._ondragstart):
(WebInspector.DOMTreeOutline.prototype._ondragover):
(WebInspector.DOMTreeOutline.prototype._ondrop):
(WebInspector.DOMTreeOutline.prototype._treeElementFromEvent): Deleted.
(WebInspector.DOMTreeOutline.prototype._contextMenuEventFired): Deleted.
* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel):
(WebInspector.DebuggerSidebarPanel.prototype._breakpointTreeOutlineContextMenuTreeElement):
* UserInterface/Views/FrameTreeElement.js:
(WebInspector.FrameTreeElement.prototype.onattach):
* UserInterface/Views/GeneralTreeElement.js:
(WebInspector.GeneralTreeElement.prototype.onattach):
(WebInspector.GeneralTreeElement.prototype.ondetach): Deleted.
* UserInterface/Views/ObjectTreeBaseTreeElement.js:
(WebInspector.ObjectTreeBaseTreeElement.prototype.populateContextMenu):
(WebInspector.ObjectTreeBaseTreeElement.prototype._logSymbolProperty):
(WebInspector.ObjectTreeBaseTreeElement.prototype._logValue):
(WebInspector.ObjectTreeBaseTreeElement.prototype.oncontextmenu): Deleted.
(WebInspector.ObjectTreeBaseTreeElement.prototype._contextMenuHandler): Deleted.
* UserInterface/Views/ResourceTreeElement.js:
(WebInspector.ResourceTreeElement.prototype.populateContextMenu):
(WebInspector.ResourceTreeElement.prototype.onattach): Deleted.
(WebInspector.ResourceTreeElement.prototype._handleContextMenuEvent): Deleted.
* UserInterface/Views/ThreadTreeElement.js:
(WebInspector.ThreadTreeElement.prototype.populateContextMenu):
(WebInspector.ThreadTreeElement.prototype.oncontextmenu): Deleted.
* UserInterface/Views/TreeElement.js:
(WebInspector.TreeElement.prototype.populateContextMenu):
(WebInspector.TreeElement):
* UserInterface/Views/TreeOutline.js:
(WebInspector.TreeOutline):
(WebInspector.TreeOutline.prototype.treeElementFromEvent):
(WebInspector.TreeOutline.prototype.populateContextMenu):
(WebInspector.TreeOutline._generateStyleRulesIfNeeded):
* UserInterface/Views/VisualStyleSelectorTreeItem.js:
(WebInspector.VisualStyleSelectorTreeItem.prototype.onattach):
(WebInspector.VisualStyleSelectorTreeItem.prototype.populateContextMenu):
(WebInspector.VisualStyleSelectorTreeItem.prototype._highlightNodesWithSelector):
(WebInspector.VisualStyleSelectorTreeItem.prototype._hideDOMNodeHighlight):
(WebInspector.VisualStyleSelectorTreeItem.prototype._handleContextMenuEvent): Deleted.
* UserInterface/Views/WorkerTreeElement.js:
(WebInspector.WorkerTreeElement.prototype.populateContextMenu):
(WebInspector.WorkerTreeElement.prototype.onattach):
(WebInspector.WorkerTreeElement.prototype._handleContextMenuEvent): Deleted.

* UserInterface/Views/DataGrid.js:
(WebInspector.DataGrid.prototype._contextMenuInDataTable):
Add "Expand All"/"Collapse All" context menu items.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211061 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoMigrate font variations tests to using David Jonathan Ross's Boxis font
mmaxfield@apple.com [Mon, 23 Jan 2017 21:41:23 +0000 (21:41 +0000)]
Migrate font variations tests to using David Jonathan Ross's Boxis font
https://bugs.webkit.org/show_bug.cgi?id=167222

Reviewed by Dean Jackson.

He extremely generously made this font for doing testing of variation fonts,
and worked with us to licence it appropriately so it can be used in WebKit
directly.

Thanks so much to DJR!!!!

I also took this opportunity to make the tests in animations/font-variations
more robust.

* animations/font-variations/font-variation-settings-expected.html: Removed.
* animations/font-variations/font-variation-settings-expected.txt: Added.
* animations/font-variations/font-variation-settings-order-expected.html: Removed.
* animations/font-variations/font-variation-settings-order-expected.txt: Added.
* animations/font-variations/font-variation-settings-order.html:
* animations/font-variations/font-variation-settings-unlike-expected.html: Removed.
* animations/font-variations/font-variation-settings-unlike-expected.txt: Added.
* animations/font-variations/font-variation-settings-unlike.html:
* animations/font-variations/font-variation-settings.html:
* animations/font-variations/resources/Boxis-VF.ttf: Added.
* fast/backgrounds/background-repeat-x-y.html: Removed.
* fast/text/variations/advances.html:
* fast/text/variations/case-axis-names-expected.html:
* fast/text/variations/case-axis-names.html:
* fast/text/variations/default-value-expected.html:
* fast/text/variations/default-value.html:
* fast/text/variations/duplicate-axis-expected.html: Removed.
* fast/text/variations/duplicate-axis.html: Removed.
* fast/text/variations/duplicate-expected.html:
* fast/text/variations/duplicate.html:
* fast/text/variations/exist-expected-mismatch.html:
* fast/text/variations/exist.html:
* fast/text/variations/getComputedStyle-expected.txt:
* fast/text/variations/getComputedStyle.html:
* fast/text/variations/inheritance-expected.html:
* fast/text/variations/inheritance.html:
* fast/text/variations/order-expected.html:
* fast/text/variations/order.html:
* fast/text/variations/outofbounds-expected-mismatch.html:
* fast/text/variations/outofbounds.html:
* fast/text/variations/resources/Boxis-VF.ttf: Added.
* platform/mac/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211060 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoMarking media/modern-media-controls/tracks-panel/tracks-panel-hide.html as flaky...
ryanhaddad@apple.com [Mon, 23 Jan 2017 21:31:29 +0000 (21:31 +0000)]
Marking media/modern-media-controls/tracks-panel/tracks-panel-hide.html as flaky on macOS debug.
https://bugs.webkit.org/show_bug.cgi?id=167311

Unreviewed test gardening.

* platform/mac/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211059 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoMake URLs with non-special schemes and a query or fragment but no slash after the...
achristensen@apple.com [Mon, 23 Jan 2017 21:30:32 +0000 (21:30 +0000)]
Make URLs with non-special schemes and a query or fragment but no slash after the host more compatible
https://bugs.webkit.org/show_bug.cgi?id=167317
Source/WebCore:

<rdar://problem/29526875>

Reviewed by Sam Weinig.

This is currently being added to the URL spec in https://github.com/whatwg/url/issues/212
Covered by new API tests.

* platform/URLParser.cpp:
(WebCore::URLParser::parse):
Only add a slash if there wasn't one if the URL has a special scheme.
This new behavior matches the old behavior of URL::parse.

Tools:

Reviewed by Sam Weinig.

* TestWebKitAPI/Tests/WebCore/URLParser.cpp:
(TestWebKitAPI::TEST_F):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211058 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoWeb Inspector: color picker should feature an editable CSS value
commit-queue@webkit.org [Mon, 23 Jan 2017 21:27:26 +0000 (21:27 +0000)]
Web Inspector: color picker should feature an editable CSS value
https://bugs.webkit.org/show_bug.cgi?id=124356

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2017-01-23
Reviewed by Timothy Hatcher.

* UserInterface/Views/ColorPicker.css:
(.color-picker):
(.color-picker.hide-inputs):
(.color-picker > .color-inputs):
(.color-picker > .color-inputs > div):
(.color-picker > .color-inputs > div[hidden]):
(.color-picker > .color-inputs input):

* UserInterface/Views/ColorPicker.js:
(WebInspector.ColorPicker.createColorInput):
(WebInspector.ColorPicker):
(WebInspector.ColorPicker.prototype.set color):
(WebInspector.ColorPicker.prototype.set enableColorComponentInputs):
(WebInspector.ColorPicker.prototype._updateColor):
(WebInspector.ColorPicker.prototype._handleFormatChange):
(WebInspector.ColorPicker.prototype._showColorComponentInputs.updateColorInput):
(WebInspector.ColorPicker.prototype._showColorComponentInputs):
(WebInspector.ColorPicker.prototype._handleColorInputInput):
Add an input element (with a label for the component name and its units) for each component
as part of the current color format (e.g. R, G, B, A).  If any of these inputs are changed
then the color is also changed and the "ColorChanged" event is fired.

* UserInterface/Controllers/CodeMirrorColorEditingController.js:
(WebInspector.CodeMirrorColorEditingController.prototype.popoverWillPresent):
* UserInterface/Views/InlineSwatch.js:
(WebInspector.InlineSwatch.prototype._swatchElementClicked):
Add FormatChanged event that fires whenever a new color is set with a different format or
the color value is set for the first time (there is no old format to compare to).  This is
needed because if the format becomes RGB, RGBA, HSL, or HSLA from something not in that list
then the size of the containing popover needs to change since the newly added color inputs
will be displayed.

* UserInterface/Views/GradientEditor.js:
(WebInspector.GradientEditor):
Prevent the color inputs from displaying at all, since there aren't individual swatches for
each color in a gradient.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211057 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoMarking media/modern-media-controls/placard-support/placard-support-pip.html as a...
ryanhaddad@apple.com [Mon, 23 Jan 2017 21:22:13 +0000 (21:22 +0000)]
Marking media/modern-media-controls/placard-support/placard-support-pip.html as a flaky crash on Sierra WK1.
https://bugs.webkit.org/show_bug.cgi?id=167320

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211056 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoConvert langAttributeAwareFormControlUIEnabled to a Setting
commit-queue@webkit.org [Mon, 23 Jan 2017 21:16:19 +0000 (21:16 +0000)]
Convert langAttributeAwareFormControlUIEnabled to a Setting
https://bugs.webkit.org/show_bug.cgi?id=167279

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-01-23
Reviewed by Sam Weinig.

* dom/Document.cpp:
(WebCore::Document::getCachedLocale):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setupDateTimeChooserParameters):
Convert to use Settings instead of RuntimeEnabledFeatures.

* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::langAttributeAwareFormControlUIEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::setLangAttributeAwareFormControlUIEnabled): Deleted.
* page/Settings.in:
Move to Settings.

* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setLangAttributeAwareFormControlUIEnabled): Deleted.
* testing/InternalSettings.h:
* testing/InternalSettings.idl:
Remove the manual interface for the RuntimeEnabledFeature.
An identical interface is generated from Settings.in!

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211055 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoWeb Inspector: Asserts seen opening and closing Remote Web Inspector windows
commit-queue@webkit.org [Mon, 23 Jan 2017 21:08:02 +0000 (21:08 +0000)]
Web Inspector: Asserts seen opening and closing Remote Web Inspector windows
https://bugs.webkit.org/show_bug.cgi?id=167316
<rdar://problem/28891161>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-01-23
Reviewed by Alexey Proskuryakov.

* UIProcess/RemoteWebInspectorProxy.cpp:
(WebKit::RemoteWebInspectorProxy::createFrontendPageAndWindow):
Assume read access, like the local web inspector, to Web Inspector resources.

* WebProcess/WebPage/RemoteWebInspectorUI.cpp:
(WebKit::RemoteWebInspectorUI::closeWindow):
Clear ourselves as the inspector frontend client when closing.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211054 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoAdd Sierra flag to TestExpectation for media/modern-media-controls/placard-support...
ryanhaddad@apple.com [Mon, 23 Jan 2017 21:00:21 +0000 (21:00 +0000)]
Add Sierra flag to TestExpectation for media/modern-media-controls/placard-support/placard-support-pip.html.

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211053 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoWhen Safari reloads pages with Flash objects after Flash is installed, placeholders...
andersca@apple.com [Mon, 23 Jan 2017 20:58:35 +0000 (20:58 +0000)]
When Safari reloads pages with Flash objects after Flash is installed, placeholders don't paint (but do work!)
https://bugs.webkit.org/show_bug.cgi?id=167268
rdar://problem/29857388

Reviewed by Sam Weinig.

Source/WebCore:

* page/Page.cpp:
(WebCore::Page::refreshPlugins):
Call PluginInfoProvider::refresh instead.

(WebCore::Page::clearPluginData):
Add new setter.

* page/Page.h:
Declare new members.

* plugins/PluginInfoProvider.cpp:
(WebCore::PluginInfoProvider::refresh):
Put the logic to clear plug-in data and reload frames here.

* plugins/PluginInfoProvider.h:
Add new members.

Source/WebKit2:

* WebProcess/Plugins/WebPluginInfoProvider.h:
Make refreshPlugins() private.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::refreshPlugins):
Call the newly added PluginInfoProvider::refresh().

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211052 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoMarking media/modern-media-controls/tracks-support/tracks-support-show-panel-after...
ryanhaddad@apple.com [Mon, 23 Jan 2017 20:55:09 +0000 (20:55 +0000)]
Marking media/modern-media-controls/tracks-support/tracks-support-show-panel-after-dragging-controls.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=167275

Unreviewed test gardening.

* platform/mac/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211051 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agogtest fails to link on Linux due to missing -lpthread
timothy@hatcher.name [Mon, 23 Jan 2017 20:29:41 +0000 (20:29 +0000)]
gtest fails to link on Linux due to missing -lpthread
https://bugs.webkit.org/show_bug.cgi?id=167313

* gtest/CMakeLists.txt: Remove find_package(Threads) that was added in my last commit.
This is assumed to already happen in the platform cmake options file.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211050 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoUse priorities in speculative revalidation
antti@apple.com [Mon, 23 Jan 2017 20:21:40 +0000 (20:21 +0000)]
Use priorities in speculative revalidation
https://bugs.webkit.org/show_bug.cgi?id=167314

Reviewed by Chris Dumez.

We currently do all speculative cache operations with 'Medium' priority
and network operations with 'Low'. We should use the actual request priorities instead.

* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
(WebKit::NetworkCache::constructRevalidationRequest):

    Use priority when constructing validation request.

(WebKit::NetworkCache::SpeculativeLoadManager::retrieveEntryFromStorage):

    Use priority when retrieving from cache.

(WebKit::NetworkCache::SpeculativeLoadManager::preloadEntry):
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
* NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
(WebKit::NetworkCache::SubresourceInfo::encode):
(WebKit::NetworkCache::SubresourceInfo::decode):

    Save and restore the priority.

* NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
(WebKit::NetworkCache::SubresourceInfo::SubresourceInfo):
(WebKit::NetworkCache::SubresourceInfo::priority):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211049 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agosvn-create-patch should emit properties when files are moved or copied
jbedard@apple.com [Mon, 23 Jan 2017 20:15:15 +0000 (20:15 +0000)]
svn-create-patch should emit properties when files are moved or copied
https://bugs.webkit.org/show_bug.cgi?id=167264

Reviewed by Daniel Bates.

* Scripts/svn-create-patch:
(manufacturePatchForAdditionWithHistory): Diff the source file against nothing to get properties.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211048 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years ago[WebRTC] Filter libwebrtc link flags
commit-queue@webkit.org [Mon, 23 Jan 2017 19:32:54 +0000 (19:32 +0000)]
[WebRTC] Filter libwebrtc link flags
https://bugs.webkit.org/show_bug.cgi?id=167287

Patch by Youenn Fablet <youenn@apple.com> on 2017-01-23
Reviewed by Alex Christensen.

Source/ThirdParty/libwebrtc:

* CMakeLists.txt:

Tools:

* Scripts/webkitpy/libwebrtc/generate_cmake.py:
(CMakeGenerator._compute_link_flags):
(CMakeGenerator._compute_link_flags.keep_flag):
(CMakeGenerator._generate_compile_target_options):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211047 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years ago[WebRTC] Make VP8 optional in libwebrtc
commit-queue@webkit.org [Mon, 23 Jan 2017 19:32:37 +0000 (19:32 +0000)]
[WebRTC] Make VP8 optional in libwebrtc
https://bugs.webkit.org/show_bug.cgi?id=167257

Patch by Youenn Fablet <youennf@gmail.com> on 2017-01-23
Reviewed by Darin Adler.

Source/ThirdParty/libwebrtc:

Reusing strategy used to have VP9 optional for VP8 codec.

* CMakeLists.txt: Updated tocompile and link vp8_noop.cc
* Source/webrtc/media/engine/webrtcvideoengine2.cc:
* Source/webrtc/modules/video_coding/codecs/vp8/include/vp8.h:
* Source/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc:
* Source/webrtc/modules/video_coding/codecs/vp8/vp8_noop.cc: Added.
* Source/webrtc/video/video_encoder.cc:

Tools:

* Scripts/webkitpy/libwebrtc/generate_cmake.py:
(CMakeGenerator.remove_libvpx): Adding vp8_noop.cc to the build system.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211046 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoSource/WebCore:
jer.noble@apple.com [Mon, 23 Jan 2017 19:23:34 +0000 (19:23 +0000)]
Source/WebCore:
REGRESSION (r208149): Video details does not apear and missing scrubber in Control Center
https://bugs.webkit.org/show_bug.cgi?id=167233

Reviewed by Alex Christensen.

Test: In TestWebKitAPI, NowPlayingControlsTests.NowPlayingControlsIOS

In r208149, we introduced a new media type, Video, and renamed the old type to
VideoAudio (to be able to distinguish between video-with-audio and silent-video).
But we missed one place where that type needs to be renamed.

For testing purposes, overload methods from PlatformMediaSessionManager which WebKit2 uses
to report the current now playing session and it's information.

* platform/audio/ios/MediaSessionManagerIOS.h:
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::nowPlayingEligibleSession):
(WebCore::MediaSessionManageriOS::updateNowPlayingInfo):

Source/WebKit2:
Video details does not apear and missing scrubber in Control Center
https://bugs.webkit.org/show_bug.cgi?id=167233

Reviewed by Alex Christensen.

Make requestActiveNowPlayingSessionInfo() and handleActiveNowPlayingSessionInfoResponse()
work in PLATFORM(IOS).

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _requestActiveNowPlayingSessionInfo]):
(-[WKWebView _handleActiveNowPlayingSessionInfoResponse:title:duration:elapsedTime:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::requestActiveNowPlayingSessionInfo):
(WebKit::WebPageProxy::handleActiveNowPlayingSessionInfoResponse):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::handleActiveNowPlayingSessionInfoResponse):
* WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::WebPage::requestActiveNowPlayingSessionInfo):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::requestActiveNowPlayingSessionInfo): Deleted.

Tools:
Video details does not apear and missing scrubber in Control Center
https://bugs.webkit.org/show_bug.cgi?id=167233

Reviewed by Alex Christensen.

Refactor TestWKWebViewMac to work on PLATFORM(IOS). Add a new test to
NowPlayingControlTests for iOS.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/NowPlayingControlsTests.mm:
(-[NowPlayingTestWebView setWindowVisible:]):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit2Cocoa/SnapshotStore.mm:
* TestWebKitAPI/Tests/WebKit2Cocoa/VideoControlsManager.mm:
* TestWebKitAPI/Tests/WebKit2Cocoa/WKWebViewCandidateTests.mm:
* TestWebKitAPI/cocoa/TestWKWebView.h: Renamed from Tools/TestWebKitAPI/mac/TestWKWebViewMac.h.
* TestWebKitAPI/cocoa/TestWKWebView.mm: Renamed from Tools/TestWebKitAPI/mac/TestWKWebViewMac.mm.
(SOFT_LINK_CLASS):
(-[TestMessageHandler addMessage:withHandler:]):
(-[TestMessageHandler userContentController:didReceiveScriptMessage:]):
(__simulated_forceClickAssociatedEventsMask):
(-[TestWKWebViewHostWindow _mouseDownAtPoint:simulatePressure:]):
(-[TestWKWebViewHostWindow isKeyWindow]):
(-[TestWKWebViewHostWindow makeKeyWindow]):
(-[TestWKWebViewHostWindow resignKeyWindow]):
(-[TestWKWebView initWithFrame:]):
(-[TestWKWebView initWithFrame:configuration:]):
(-[TestWKWebView _setUpTestWindow:]):
(-[TestWKWebView performAfterReceivingMessage:action:]):
(-[TestWKWebView loadTestPageNamed:]):
(-[TestWKWebView synchronouslyLoadTestPageNamed:]):
(-[TestWKWebView stringByEvaluatingJavaScript:]):
(-[TestWKWebView waitForMessage:]):
(-[TestWKWebView performAfterLoading:]):
(-[TestWKWebView mouseDownAtPoint:simulatePressure:]):
(-[TestWKWebView typeCharacter:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211045 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agogtest fails to link on Linux due to missing -lpthread
timothy@hatcher.name [Mon, 23 Jan 2017 18:45:51 +0000 (18:45 +0000)]
gtest fails to link on Linux due to missing -lpthread
https://bugs.webkit.org/show_bug.cgi?id=167313

Reviewed by Alex Christensen.

* gtest/CMakeLists.txt: Add call to find_package(Threads) before testing CMAKE_USE_PTHREADS_INIT.
Without the find_package call, CMAKE_USE_PTHREADS_INIT was always false for me. Also explicitly
define GTEST_HAS_PTHREAD to 0 when CMAKE_USE_PTHREADS_INIT is false to prevent gtest-port.h from
setting GTEST_HAS_PTHREAD based on the platform.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211044 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoIntlObject uses JSArray::tryCreateUninitialized in an unsafe way
msaboff@apple.com [Mon, 23 Jan 2017 18:45:17 +0000 (18:45 +0000)]
IntlObject uses JSArray::tryCreateUninitialized in an unsafe way
https://bugs.webkit.org/show_bug.cgi?id=167288

Reviewed by Filip Pizlo.

Refactored the following "create" methods into a "tryCreate" method and a
"create" wrapper: JSArray::create(), Butterfly::create() and
createArrayButterfly().

Changed IntlObject.cpp to use JSArray::tryCreate() as it is simpler to use
by not requiring the caller to be GC savey.  The performance benefits of
tryCreateUninitialized() are not needed by the IntlObject c++ code.

Did not add a new test as the bug caused LayoutTests/js/intl.html to fail
reliably with the JSC option values scribbleFreeCells=true,
collectContinuously=true and JSC_useGenerationalGC=false.

* runtime/Butterfly.h:
* runtime/ButterflyInlines.h:
(JSC::Butterfly::tryCreate): Added.
(JSC::Butterfly::create):
* runtime/IntlObject.cpp:
(JSC::canonicalizeLocaleList):
(JSC::lookupSupportedLocales):
(JSC::intlObjectFuncGetCanonicalLocales):
* runtime/JSArray.h:
(JSC::createContiguousArrayButterfly): Deleted.
(JSC::tryCreateArrayButterfly): Added.
(JSC::createArrayButterfly):
(JSC::JSArray::tryCreate): Added.
(JSC::JSArray::create):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211043 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoREGRESSION (r211033): ASSERTION FAILED: m_ptr in com.apple.WebCore: WTF::RefPtr<WebCo...
cdumez@apple.com [Mon, 23 Jan 2017 18:39:48 +0000 (18:39 +0000)]
REGRESSION (r211033): ASSERTION FAILED: m_ptr in com.apple.WebCore: WTF::RefPtr<WebCore::Element>::operator* const + 70
https://bugs.webkit.org/show_bug.cgi?id=167308
<rdar://problem/30144964>

Unreviewed, do a partial revert of r211033 to fix assertion.

Source/WebCore:

No new tests, already covered by:
fullscreen/exit-full-screen-iframe.html

* dom/Document.cpp:
(WebCore::Document::webkitExitFullscreen):
* page/ChromeClient.h:

Source/WebKit/mac:

* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::exitFullScreenForElement):

Source/WebKit/win:

* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::exitFullScreenForElement):

Source/WebKit2:

* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::exitFullScreenForElement):
* WebProcess/WebCoreSupport/WebChromeClient.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211042 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoREGRESSION (r210941): LayoutTest scrollingcoordinator/ios/sync-layer-positions-after...
megan_gardner@apple.com [Mon, 23 Jan 2017 18:30:25 +0000 (18:30 +0000)]
REGRESSION (r210941): LayoutTest scrollingcoordinator/ios/sync-layer-positions-after-scroll.html failing
https://bugs.webkit.org/show_bug.cgi?id=167262

Unreviewed test gardening.

Fix to interpolation code caused a different result.

* scrollingcoordinator/ios/sync-layer-positions-after-scroll-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211041 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years ago[GTK] asserting on unknown locale for hyphenation is wrong
gns@gnome.org [Mon, 23 Jan 2017 18:20:10 +0000 (18:20 +0000)]
[GTK] asserting on unknown locale for hyphenation is wrong
https://bugs.webkit.org/show_bug.cgi?id=167312

Reviewed by Carlos Garcia Campos.

The fact that we hit the assert on a test called 'hyphenation-unknown-locale' is already
a strong indication we should not have it. In addition to that, Carlos Lopez pointed out
a similar assert was removed from the Mac codepaths when the test was introduced.

* platform/text/hyphen/HyphenationLibHyphen.cpp:
(WebCore::lastHyphenLocation): early return when a locale that is not available is provided
for hyphenation, instead of asserting.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211040 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoUnreviewed attempt to fix the iOS build after r211033.
cdumez@apple.com [Mon, 23 Jan 2017 17:40:30 +0000 (17:40 +0000)]
Unreviewed attempt to fix the iOS build after r211033.

* dom/Node.cpp:
(WebCore::Node::defaultEventHandler):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211039 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agourlParserEnabled parameter is only encoded for COCOA ports
gns@gnome.org [Mon, 23 Jan 2017 11:28:08 +0000 (11:28 +0000)]
urlParserEnabled parameter is only encoded for COCOA ports
https://bugs.webkit.org/show_bug.cgi?id=167238

Reviewed by Alex Christensen.

This leads to URLParser being enabled on the UI process, since it is
the default, but disabled on the WebProcess, which is the default for
WebProcessCreationParameters, casuing asserts like on tests such as these
due to differences in parsing:

- fast/loader/redirect-to-invalid-url-using-javascript-calls-policy-delegate.html
- fast/loader/window-open-to-invalid-url-calls-policy-delegate.html
- http/tests/inspector/network/copy-as-curl.html

* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode): encode urlParserEnabled
(WebKit::WebProcessCreationParameters::decode): decode urlParserEnabled

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211038 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoJavaScriptCore has a weak external symbol in it
commit-queue@webkit.org [Mon, 23 Jan 2017 10:41:42 +0000 (10:41 +0000)]
JavaScriptCore has a weak external symbol in it
https://bugs.webkit.org/show_bug.cgi?id=167282

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-01-23
Reviewed by Yusuke Suzuki.

* debugger/Debugger.cpp:
(JSC::Debugger::ProfilingClient::~ProfilingClient):
* debugger/Debugger.h:
Avoid possible weak external symbol.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211037 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoRemove allowWindowOpenWithoutUserGesture setting
commit-queue@webkit.org [Mon, 23 Jan 2017 09:54:59 +0000 (09:54 +0000)]
Remove allowWindowOpenWithoutUserGesture setting
https://bugs.webkit.org/show_bug.cgi?id=167301

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-01-23
Reviewed by Darin Adler.

Source/WebCore:

* page/DOMWindow.cpp:
(WebCore::DOMWindow::allowPopUp):
* page/Settings.in:

Source/WebKit/mac:

* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):
Use the equivalent existing setting.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211036 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoDatabase file not removed for origins after deleting all databases
carlosgc@webkit.org [Mon, 23 Jan 2017 07:28:48 +0000 (07:28 +0000)]
Database file not removed for origins after deleting all databases
https://bugs.webkit.org/show_bug.cgi?id=167281

Reviewed by Darin Adler.

When DatabaseTracker::deleteDatabasesModifiedSince() is called with a min time, all databases for every origin
are deleted. For each origin if all databases are removed DatabaseTracker::deleteOrigin() is called to remove
also the origin database file. However, DatabaseTracker::deleteOrigin() returns early if the origin doesn't have
databases and in this particular case it never has databases, because we have just removed them.

This will be covered by GTK+ unit tests.

* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::deleteDatabasesModifiedSince): Instead of removing the databases while iterating
them, add the ones to be removed to a vector. If after the iteration all databases should be removed call
DatabaseTracker::deleteOrigin() to ensure both the databases and the database file are removed for the origin,
otherwhise call DatabaseTracker::deleteDatabase() for every database to delete.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211035 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years ago[GTK] Update Safari version in user agent
mcatanzaro@igalia.com [Mon, 23 Jan 2017 07:25:41 +0000 (07:25 +0000)]
[GTK] Update Safari version in user agent
https://bugs.webkit.org/show_bug.cgi?id=167290

Reviewed by Carlos Garcia Campos.

Update Safari version from 10 to 11.

* platform/gtk/UserAgentGtk.cpp:
(WebCore::buildUserAgentString):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211034 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoRemove PassRefPtr from "page" directory of WebCore, also deploy references
darin@apple.com [Mon, 23 Jan 2017 06:24:18 +0000 (06:24 +0000)]
Remove PassRefPtr from "page" directory of WebCore, also deploy references
https://bugs.webkit.org/show_bug.cgi?id=167224

Reviewed by Chris Dumez.

Source/WebCore:

* Modules/fetch/DOMWindowFetch.cpp:
(WebCore::DOMWindowFetch::fetch): Use DOMWindow::document instead of
scriptExecutionContext.

* Modules/webdatabase/DatabaseContext.cpp:
(WebCore::DatabaseContext::databaseExceededQuota): Pass a reference.

* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityShowContextMenu]):
Pass a reference.

* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::getOwnPropertySlot): Pass a reference.

* dom/Document.cpp:
(WebCore::Document::childrenChanged): Pass a reference. Also made the
didReceiveDocType code unconditional instead of iOS-only.
(WebCore::Document::platformSuspendOrStopActiveDOMObjects): Ditto.
(WebCore::Document::updateViewportArguments): Ditto.
(WebCore::Document::setFocusedElement): Ditto.
(WebCore::Document::createDOMWindow): Ditto.
(WebCore::Document::takeDOMWindowFrom): Ditto.
(WebCore::Document::requestFullScreenForElement): Ditto.
(WebCore::Document::webkitExitFullscreen): Ditto.
* dom/Element.cpp:
(WebCore::Element::focus): Ditto.
(WebCore::Element::blur): Ditto.
(WebCore::Element::dispatchFocusEvent): Ditto.
(WebCore::Element::dispatchBlurEvent): Ditto.
* dom/Node.cpp:
(WebCore::Node::defaultEventHandler): Ditto.
* editing/EditorCommand.cpp:
(WebCore::executePrint): Ditto.
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::setFocusedElementIfNeeded): Ditto.
* history/CachedFrame.cpp:
(WebCore::CachedFrameBase::restore): Ditto.
(WebCore::CachedFrame::CachedFrame): Ditto.
* html/ColorInputType.cpp:
(WebCore::ColorInputType::handleDOMActivateEvent): Ditto.
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::isKeyboardFocusable): Ditto.

* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::isKeyboardFocusable): Pass a reference,
and also rewrote to use && for clarity.

* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::supportsFullscreen): Pass a reference.
* html/shadow/SpinButtonElement.cpp:
(WebCore::SpinButtonElement::defaultEventHandler): Ditto.
(WebCore::SpinButtonElement::releaseCapture): Ditto.
* html/shadow/mac/ImageControlsButtonElementMac.cpp:
(WebCore::ImageControlsButtonElementMac::defaultEventHandler): Ditto.
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::showContextMenu): Ditto.
(WebCore::InspectorFrontendHost::dispatchEventAsContextMenuEvent): Ditto.

* loader/EmptyClients.cpp:
(WebCore::EmptyChromeClient::createPopupMenu): Updated to take reference.
(WebCore::EmptyChromeClient::createSearchPopupMenu): Ditto.
(WebCore::EmptyChromeClient::createColorChooser): Ditto.
* loader/EmptyClients.h: Ditto.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::submitForm): Pass a reference.
(WebCore::FrameLoader::commitProvisionalLoad): Ditto.
(WebCore::FrameLoader::closeAndRemoveChild): Take a reference.
(WebCore::FrameLoader::detachFromParent): Pass a reference.
(WebCore::FrameLoader::dispatchBeforeUnloadEvent): Ditto.
(WebCore::createWindow): Ditto.
* loader/FrameLoader.h: Updated for the above.

* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNewWindowPolicy): Pass a reference.
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::recalculateAvailableSpaceInQuota): Ditto.

* loader/appcache/ApplicationCacheGroup.h: Return a reference from origin.

* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::calculateQuotaForOrigin): Take a reference.
(WebCore::ApplicationCacheStorage::calculateRemainingSizeForOriginExcludingCache):
Ditto.
(WebCore::ApplicationCacheStorage::store): Pass a reference.
(WebCore::ApplicationCacheStorage::checkOriginQuota): Updated since origin
now returns areference.
* loader/appcache/ApplicationCacheStorage.h: Updated for the above.

* loader/archive/mhtml/MHTMLArchive.cpp:
(WebCore::MHTMLArchive::generateMHTMLData): Pass a reference.
* mathml/MathMLElement.cpp:
(WebCore::MathMLElement::isKeyboardFocusable): Ditto.

* page/Chrome.cpp:
(WebCore::Chrome::Chrome): Moved initialization of data members to the
class definition.
(WebCore::Chrome::contentsSizeChanged): Take a reference.
(WebCore::Chrome::createWindow): Ditto.
(WebCore::Chrome::runBeforeUnloadConfirmPanel): Ditto.
(WebCore::Chrome::runJavaScriptAlert): Ditto.
(WebCore::Chrome::runJavaScriptConfirm): Ditto.
(WebCore::Chrome::runJavaScriptPrompt): Ditto.
(WebCore::Chrome::setStatusbarText): Ditto.
(WebCore::Chrome::print): Ditto.
(WebCore::Chrome::createColorChooser): Ditto.
(WebCore::Chrome::createPopupMenu): Ditto.
(WebCore::Chrome::createSearchPopupMenu): Ditto.
(WebCore::Chrome::didReceiveDocType): Ditto. Also made unconditional, but
empty for non-iOS platforms.
(WebCore::Chrome::registerPopupOpeningObserver): Take a reference.
(WebCore::Chrome::unregisterPopupOpeningObserver): Ditto.
* page/Chrome.h: Updated for the above.

* page/ChromeClient.h: Take references. Also updated some arguments from
Node to Element.

* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::handleContextMenuEvent): Take a reference.
(WebCore::ContextMenuController::showContextMenu): Ditto.
(WebCore::ContextMenuController::maybeCreateContextMenu): Ditto. Also use
make_unique instead of unique_ptr plus new.
(WebCore::openNewWindow): Ditto.
(WebCore::insertUnicodeCharacter): Ditto.
(WebCore::ContextMenuController::contextMenuItemSelected): Ditto.
(WebCore::ContextMenuController::showContextMenuAt): Ditto.
(WebCore::ContextMenuController::showImageControlsMenu): Ditto.
* page/ContextMenuController.h: Updated for the above.

* page/DOMTimer.cpp:
(WebCore::DOMTimer::fired): Pass a reference.

* page/DOMWindow.cpp:
(WebCore::PostMessageTimer::PostMessageTimer): Take Ref&& instead of
PassRefPtr.
(WebCore::DOMWindow::adjustWindowRect): Use a reference.
(WebCore::DOMWindow::allowPopUp): Ditto. Also rewrite to use || instead
of successive if statements.
(WebCore::DOMWindow::canShowModalDialog): Ditto.
(WebCore::DOMWindow::DOMWindow): Ditto.
(WebCore::DOMWindow::didSecureTransitionTo): Ditto.
(WebCore::DOMWindow::registerProperty): Ditto.
(WebCore::DOMWindow::unregisterProperty): Ditto.
(WebCore::DOMWindow::postMessageTimerFired): Merge with the function
immediately followed, called only from here.
(WebCore::DOMWindow::dispatchMessageEventWithOriginCheck): Deleted.
(WebCore::DOMWindow::print): Pass a reference.
(WebCore::DOMWindow::alert): Ditto.
(WebCore::DOMWindow::confirm): Ditto.
(WebCore::DOMWindow::prompt): Ditto.
(WebCore::DOMWindow::setStatus): Ditto.
(WebCore::DOMWindow::setDefaultStatus): Ditto.
(WebCore::DOMWindow::moveBy): Ditto.
(WebCore::DOMWindow::moveTo): Ditto.
(WebCore::DOMWindow::resizeBy): Ditto.
(WebCore::DOMWindow::resizeTo): Ditto.
(WebCore::DOMWindow::clearTimeout): Ditto.
(WebCore::DOMWindow::incrementScrollEventListenersCount): Ditto.
(WebCore::DOMWindow::decrementScrollEventListenersCount): Ditto.
(WebCore::DOMWindow::showModalDialog): Ditto.
* page/DOMWindow.h: Updated for the above. ALso made functions private
and final.

* page/DOMWindowProperty.cpp:
(WebCore::DOMWindowProperty::DOMWindowProperty): Pass a reference.
(WebCore::DOMWindowProperty::~DOMWindowProperty): Ditto.
(WebCore::DOMWindowProperty::willDestroyGlobalObjectInCachedFrame): Ditto.
(WebCore::DOMWindowProperty::willDestroyGlobalObjectInFrame): Ditto.

* page/DebugPageOverlays.cpp:
(WebCore::RegionOverlay::create): Return RefPtr instead of PassRefPtr.
(WebCore::RegionOverlay::~RegionOverlay): Pass a reference.
(WebCore::DebugPageOverlays::showRegionOverlay): Ditto.
(WebCore::DebugPageOverlays::hideRegionOverlay): Ditto.

* page/DragController.cpp:
(WebCore::DragController::dragExited): Pass a reference.
(WebCore::DragController::performDragOperation): Ditto.
(WebCore::DragController::concludeEditDrag): Ditto.
(WebCore::DragController::tryDHTMLDrag): Ditto.

* page/EventHandler.cpp: Replaced OptionalCursor with std::optional<Cursor>.
(WebCore::EventHandler::updateCursor): Refactor into two functions so we
can share more code with selectCursor.
(WebCore::EventHandler::selectCursor): Updated to use std::optional.
(WebCore::EventHandler::handleMouseMoveEvent): Use the new updateCursor.
(WebCore::EventHandler::startPanScrolling): Use a reference.
(WebCore::EventHandler::updateDragAndDrop): Ditto.
(WebCore::EventHandler::cancelDragAndDrop): Ditto.
(WebCore::EventHandler::performDragAndDrop): Ditto.
(WebCore::EventHandler::setCapturingMouseEventsElement): Take a raw pointer
instead of a PassRefPtr.
(WebCore::EventHandler::dispatchMouseEvent): Use a reference.
(WebCore::EventHandler::updateDragStateAfterEditDragIfNeeded): Ditto.
(WebCore::EventHandler::isKeyboardOptionTab): Ditto.
(WebCore::EventHandler::eventInvertsTabsToLinksClientCallResult): Ditto.
(WebCore::EventHandler::tabsToLinks): Ditto.
* page/EventHandler.h: Updated for the above.

* page/FocusController.cpp:
(WebCore::FocusController::setFocusedFrame): Take pointer instead
of PassRefPtr.
(WebCore::FocusController::setFocusedElement): Take reference instead of
PassRefPtr.
* page/FocusController.h: Updated for the above changes.

* page/FrameTree.cpp:
(WebCore::FrameTree::transferChild): Deleted. Unused function.
(WebCore::FrameTree::appendChild): Merged with the following function
since it's now only used here. Take reference instead of PassRefPtr.
(WebCore::FrameTree::actuallyAppendChild): Deleted.
(WebCore::FrameTree::removeChild): Take reference instead of pointer.
Use move instead of trickier swap.
* page/FrameTree.h: Updated for the above.

* page/FrameView.cpp:
(WebCore::FrameView::setContentsSize): Use a reference.
* page/MainFrame.cpp:
(WebCore::MainFrame::dropChildren): Ditto.
* page/Page.cpp:
(WebCore::Page::scrollingCoordinator): Ditto.
* page/PageOverlay.cpp:
(WebCore::PageOverlay::fadeAnimationTimerFired): Ditto.

* page/PageOverlayController.cpp:
(WebCore::PageOverlayController::installPageOverlay): Take reference
instead of PassRefPtr.
(WebCore::PageOverlayController::uninstallPageOverlay): Take reference
intead of pointer.
* page/PageOverlayController.h: Updated for the above.

* page/PageSerializer.cpp:
(WebCore::PageSerializer::PageSerializer): Moved most initialization to the
class definition.
(WebCore::PageSerializer::serialize): Use reference.
(WebCore::PageSerializer::serializeFrame): Use initializer list instead of
constructor for resource.
(WebCore::PageSerializer::serializeCSSStyleSheet): Ditto.
(WebCore::PageSerializer::addImageToResources): Ditto.
* page/PageSerializer.h: Removed constructors from PageSerializer::Resource
struct since structures don't really need them. Updated for the above.
Changed SerializerMarkupAccumulator into a nested class.

* page/PerformanceEntry.h:
(WebCore::PerformanceEntry::startTimeCompareLessThan): Use const RefPtr&
instead of PassRefPtr to compare RefPtr in place.

* page/PerformanceUserTiming.cpp:
(WebCore::insertPerformanceEntry): Take Ref&& instead of PassRefPtr.

* page/ResourceUsageOverlay.cpp:
(WebCore::ResourceUsageOverlay::~ResourceUsageOverlay): Use refrence.
(WebCore::ResourceUsageOverlay::initialize): Ditto.

* page/animation/AnimationBase.h: Removed unneeded include.

* page/animation/AnimationController.cpp:
(WebCore::AnimationControllerPrivate::clear): Use reference.
(WebCore::AnimationControllerPrivate::fireEventsAndUpdateStyle): Ditto.
(WebCore::AnimationControllerPrivate::addEventToDispatch): Use the
append function instead of a hand-written alternative.
(WebCore::AnimationControllerPrivate::addElementChangeToDispatch):
Take a reference rather than a Ref&& since no caller is passing ownership.
* page/animation/AnimationControllerPrivate.h: Updated for the above.

* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc): Return RefPtr instead of PassRefPtr.
(WebCore::blendFilter): Ditto.
(WebCore::crossfadeBlend): Ditto.

* page/animation/CompositeAnimation.cpp:
(WebCore::CompositeAnimation::updateTransitions): Updated to use
animationForProperty, which returns a raw pointer.
(WebCore::CompositeAnimation::animationForProperty): Renamed from
getAnimationForProperty and changed to return raw pointer instead
of PassRefPtr.
* page/animation/CompositeAnimation.h: Updated for the above.

* page/animation/ImplicitAnimation.cpp:
(WebCore::ImplicitAnimation::onAnimationEnd): Use animationForProperty.
(WebCore::ImplicitAnimation::sendTransitionEvent): Pass reference.
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::sendAnimationEvent): Ditto.

* page/efl/EventHandlerEfl.cpp:
(WebCore::EventHandler::tabsToAllFormControls): Take reference.
(WebCore::EventHandler::createDraggingDataTransfer): Return Ref.
* page/gtk/EventHandlerGtk.cpp:
(WebCore::EventHandler::tabsToAllFormControls): Ditto.
(WebCore::EventHandler::createDraggingDataTransfer): Ditto.
* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::tabsToAllFormControls): Ditto.
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::createDraggingDataTransfer): Ditto.
(WebCore::EventHandler::tabsToAllFormControls): Ditto.
(WebCore::EventHandler::platformPrepareForWheelEvents): Ditto.

* page/mac/ServicesOverlayController.h: Take Ref&& for ranges instead
of PassRefPtr. Use references.
* page/mac/ServicesOverlayController.mm:
(WebCore::ServicesOverlayController::Highlight::createForSelection): Ditto.
(WebCore::ServicesOverlayController::Highlight::createForTelephoneNumber): Ditto.
(WebCore::ServicesOverlayController::Highlight::Highlight): Ditto.
(WebCore::ServicesOverlayController::buildPotentialHighlightsIfNeeded): Ditto.
(WebCore::ServicesOverlayController::buildPhoneNumberHighlights): Ditto.
(WebCore::ServicesOverlayController::buildSelectionHighlight): Ditto.
(WebCore::ServicesOverlayController::highlightsAreEquivalent): Ditto.
(WebCore::ServicesOverlayController::findTelephoneNumberHighlightContainingSelectionHighlight): Ditto.
(WebCore::ServicesOverlayController::handleClick): Ditto.

* page/mac/TextIndicatorWindow.mm:
(-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]):
Take a reference instead of PassRefPtr.
(WebCore::TextIndicatorWindow::setTextIndicator): Updated for the above.

* page/scrolling/AsyncScrollingCoordinator.h: Use Ref&& and RefPtr intead
of PsasRefPtr.

* page/scrolling/ScrollLatchingState.cpp:
(WebCore::ScrollLatchingState::ScrollLatchingState): Initialize data members
in class definition.
(WebCore::ScrollLatchingState::setWheelEventElement): Use raw pointer instead
of PassRefPtr.
(WebCore::ScrollLatchingState::setPreviousWheelScrolledElement): Use raw
pointer instead of RefPtr&&.
(WebCore::ScrollLatchingState::setScrollableContainer): Use raw pointer instead
of PassRefPtr.
* page/scrolling/ScrollLatchingState.h: Updated for the above.

* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::cloneAndReset): Use Ref instead of PassRefPtr.
(WebCore::ScrollingStateNode::appendChild): Use Ref&& instead of PassRefPtr.
* page/scrolling/ScrollingStateNode.h: Updated for the above.

* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::createNode): Use Ref instead of PassRefPtr.
(WebCore::ScrollingStateTree::attachNode): Updated for the abve.
(WebCore::ScrollingStateTree::commit): Ditto.
* page/scrolling/ScrollingStateTree.h: Ditto.

* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::updateTreeFromStateNode): Use reference.
* page/scrolling/ScrollingTree.h: Return Ref instead of PassRefPtr.

* page/scrolling/ScrollingTreeNode.cpp:
(WebCore::ScrollingTreeNode::appendChild): Take Ref&& instead of PassRefPtr.
(WebCore::ScrollingTreeNode::removeChild): Take reference instead of pointer.
* page/scrolling/ScrollingTreeNode.h: Updated for the above.

* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::ThreadedScrollingTree): Take reference
instead of pointer.
* page/scrolling/ThreadedScrollingTree.h: Updated for the above.

* page/scrolling/ios/ScrollingCoordinatorIOS.mm:
(WebCore::ScrollingCoordinatorIOS::ScrollingCoordinatorIOS): Pass reference.

* page/scrolling/ios/ScrollingTreeIOS.cpp:
(WebCore::ScrollingTreeIOS::create): Take a reference.
(WebCore::ScrollingTreeIOS::ScrollingTreeIOS): Ditto.
(WebCore::ScrollingTreeIOS::createScrollingTreeNode): Return Ref instead of
PassRefPtr.
* page/scrolling/ios/ScrollingTreeIOS.h: Updated for the above.

* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::ScrollingCoordinatorMac): Use reference.

* page/scrolling/mac/ScrollingTreeMac.cpp:
(ScrollingTreeMac::create): Take a reference.
(ScrollingTreeMac::ScrollingTreeMac): Ditto.
(ScrollingTreeMac::createScrollingTreeNode): Return a Ref instead of a
PassRefPtr.
* page/scrolling/mac/ScrollingTreeMac.h: Updated for the above.

* page/win/EventHandlerWin.cpp:
(WebCore::EventHandler::tabsToAllFormControls): Take reference.
(WebCore::EventHandler::createDraggingDataTransfer): Return Ref.

* platform/Cursor.h: Rearranged the header a bit. Got rid of the explicit
copy constructor, assignment operator, and destructor. Using the ones
that the compiler automatically generates will work for all platforms and
we then also get move constructor and move assignment operator.

* platform/efl/CursorEfl.cpp:
(WebCore::Cursor::Cursor): Deleted.
(WebCore::Cursor::~Cursor): Deleted.
(WebCore::Cursor::operator=): Deleted.
* platform/gtk/CursorGtk.cpp:
(WebCore::Cursor::Cursor): Deleted.
(WebCore::Cursor::operator=): Deleted.
(WebCore::Cursor::~Cursor): Deleted.
* platform/mac/CursorMac.mm:
(WebCore::Cursor::Cursor): Deleted.
(WebCore::Cursor::operator=): Deleted.
(WebCore::Cursor::~Cursor): Deleted.
* platform/win/CursorWin.cpp:
(WebCore::SharedCursor::SharedCursor): Moved this here from the header
since it is only used within this file.
(WebCore::SharedCursor::create): Ditto.
(WebCore::Cursor::Cursor): Deleted.
(WebCore::Cursor::operator=): Deleted.
(WebCore::Cursor::~Cursor): Deleted.

* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::handleUnavailablePluginIndicatorEvent):
Pass reference.

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::RenderLayerBacking): Get to FrameView
through the render tree itself, rather than through the frame.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateLayerForHeader): Use reference.
(WebCore::RenderLayerCompositor::updateLayerForFooter): Ditto.
(WebCore::RenderLayerCompositor::attachRootLayer): Ditto.
(WebCore::RenderLayerCompositor::detachRootLayer): Ditto.
* rendering/RenderMenuList.cpp:
(RenderMenuList::showPopup): Ditto.
* rendering/RenderSearchField.cpp:
(WebCore::RenderSearchField::addSearchResult): Ditto.
(WebCore::RenderSearchField::showPopup): Ditto.
(WebCore::RenderSearchField::valueChanged): Ditto.
* svg/SVGAElement.cpp:
(WebCore::SVGAElement::isKeyboardFocusable): Ditto.
* testing/MockPageOverlayClient.cpp:
(WebCore::MockPageOverlayClient::installOverlay): Ditto.
(WebCore::MockPageOverlayClient::uninstallAllOverlays): Ditto.

Source/WebKit/ios:

* WebCoreSupport/WebChromeClientIOS.h: Update for changes to ChromeClient.
* WebCoreSupport/WebChromeClientIOS.mm:
(WebChromeClientIOS::runJavaScriptAlert): Ditto.
(WebChromeClientIOS::runJavaScriptConfirm): Ditto.
(WebChromeClientIOS::runJavaScriptPrompt): Ditto.
(WebChromeClientIOS::setNeedsScrollNotifications): Ditto.
(WebChromeClientIOS::observedContentChange): Ditto.
(WebChromeClientIOS::clearContentChangeObservers): Ditto.
(WebChromeClientIOS::notifyRevealedSelectionByScrollingFrame): Ditto.
(WebChromeClientIOS::elementDidFocus): Ditto.
(WebChromeClientIOS::elementDidBlur): Ditto.
(WebChromeClientIOS::createPopupMenu): Ditto.
(WebChromeClientIOS::createSearchPopupMenu): Ditto.
(WebChromeClientIOS::attachRootGraphicsLayer): Ditto.

Source/WebKit/mac:

* WebCoreSupport/WebApplicationCacheQuotaManager.mm:
(-[WebApplicationCacheQuotaManager quota]): Pass reference.

* WebCoreSupport/WebChromeClient.h: Updated for changes to ChromeClient.
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::focusedElementChanged): Ditto.
(WebChromeClient::createWindow): Ditto.
(WebChromeClient::runBeforeUnloadConfirmPanel): Ditto.
(WebChromeClient::runJavaScriptAlert): Ditto.
(WebChromeClient::runJavaScriptConfirm): Ditto.
(WebChromeClient::runJavaScriptPrompt): Ditto.
(WebChromeClient::contentsSizeChanged): Ditto.
(WebChromeClient::unavailablePluginButtonClicked): Ditto.
(WebChromeClient::print): Ditto.
(WebChromeClient::exceededDatabaseQuota): Ditto.
(WebChromeClient::reachedApplicationCacheOriginQuota): Ditto.
(WebChromeClient::createColorChooser): Ditto.
(WebChromeClient::elementDidFocus): Ditto.
(WebChromeClient::elementDidBlur): Ditto.
(WebChromeClient::createPopupMenu): Ditto.
(WebChromeClient::createSearchPopupMenu): Ditto.
(WebChromeClient::attachRootGraphicsLayer): Ditto.
(WebChromeClient::attachViewOverlayGraphicsLayer): Ditto.
(WebChromeClient::supportsFullScreenForElement): Ditto.
(WebChromeClient::enterFullScreenForElement): Ditto.
(WebChromeClient::exitFullScreenForElement): Ditto.

* WebView/WebFrame.mm:
(+[WebFrame _createFrameWithPage:frameName:frameView:ownerElement:]):
Updated for change to the appendChild function.

Source/WebKit/win:

* Plugins/PluginView.cpp:
(WebCore::PluginView::status): Pass reference.
(WebCore::PluginView::focusPluginElement): Ditto.

* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::createWindow): Updated for change to ChromeClient.
(WebChromeClient::runBeforeUnloadConfirmPanel): Ditto.
(WebChromeClient::runJavaScriptAlert): Ditto.
(WebChromeClient::runJavaScriptConfirm): Ditto.
(WebChromeClient::runJavaScriptPrompt): Ditto.
(WebChromeClient::contentsSizeChanged): Ditto.
(WebChromeClient::unavailablePluginButtonClicked): Ditto.
(WebChromeClient::print): Ditto.
(WebChromeClient::exceededDatabaseQuota): Ditto.
(WebChromeClient::reachedApplicationCacheOriginQuota): Ditto.
(WebChromeClient::attachRootGraphicsLayer): Ditto.
(WebChromeClient::attachViewOverlayGraphicsLayer): Ditto.
(WebChromeClient::enterVideoFullscreenForVideoElement): Ditto.
(WebChromeClient::createPopupMenu): Ditto.
(WebChromeClient::createSearchPopupMenu): Ditto.
(WebChromeClient::supportsFullScreenForElement): Ditto.
(WebChromeClient::enterFullScreenForElement): Ditto.
(WebChromeClient::exitFullScreenForElement): Ditto.
(WebChromeClient::shouldUseTiledBackingForFrameView): Ditto.
* WebCoreSupport/WebChromeClient.h: Ditto.

Source/WebKit2:

* UIProcess/Scrolling/RemoteScrollingTree.cpp:
(WebKit::RemoteScrollingTree::createScrollingTreeNode): Return a Ref
instead of PassRefPtr.
* UIProcess/Scrolling/RemoteScrollingTree.h: Updated for the above.

* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageInstallPageOverlay): Pass a reference.
(WKBundlePageUninstallPageOverlay): Ditto.
(WKBundlePageInstallPageOverlayWithAnimation): Ditto.
(WKBundlePageUninstallPageOverlayWithAnimation): Ditto.
* WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
(WebKit::PDFPlugin::jsPDFDocPrint): Ditto.
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::focusPluginElement): Ditto.
(WebKit::PluginView::setStatusbarText): Ditto.

* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::elementDidFocus): Updated for changes to ChromeClient.
(WebKit::WebChromeClient::elementDidBlur): Ditto.
(WebKit::WebChromeClient::makeFirstResponder): Ditto.
(WebKit::WebChromeClient::createWindow): Ditto.
(WebKit::WebChromeClient::runBeforeUnloadConfirmPanel): Ditto.
(WebKit::WebChromeClient::runJavaScriptAlert): Ditto.
(WebKit::WebChromeClient::runJavaScriptConfirm): Ditto.
(WebKit::WebChromeClient::runJavaScriptPrompt): Ditto.
(WebKit::WebChromeClient::contentsSizeChanged): Ditto.
(WebKit::WebChromeClient::unavailablePluginButtonClicked): Ditto.
(WebKit::WebChromeClient::print): Ditto.
(WebKit::WebChromeClient::exceededDatabaseQuota): Ditto.
(WebKit::WebChromeClient::reachedApplicationCacheOriginQuota): Ditto.
(WebKit::WebChromeClient::createColorChooser): Ditto.
(WebKit::WebChromeClient::createPopupMenu): Ditto.
(WebKit::WebChromeClient::createSearchPopupMenu): Ditto.
(WebKit::WebChromeClient::attachRootGraphicsLayer): Ditto.
(WebKit::WebChromeClient::attachViewOverlayGraphicsLayer): Ditto.
(WebKit::WebChromeClient::createScrollingCoordinator): Ditto.
(WebKit::WebChromeClient::supportsFullScreenForElement): Ditto.
(WebKit::WebChromeClient::enterFullScreenForElement): Ditto.
(WebKit::WebChromeClient::exitFullScreenForElement): Ditto.
(WebKit::WebChromeClient::didAddHeaderLayer): Ditto.
(WebKit::WebChromeClient::didAddFooterLayer): Ditto.
(WebKit::WebChromeClient::shouldUseTiledBackingForFrameView): Ditto.
* WebProcess/WebCoreSupport/WebChromeClient.h: Ditto.
* WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
(WebKit::WebChromeClient::elementDidRefocus): Ditto.
(WebKit::WebChromeClient::didReceiveMobileDocType): Ditto.
(WebKit::WebChromeClient::observedContentChange): Ditto.
(WebKit::WebChromeClient::clearContentChangeObservers): Ditto.
(WebKit::WebChromeClient::notifyRevealedSelectionByScrollingFrame): Ditto.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchCreatePage): Pass reference.
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
(WebKit::WebInspectorClient::~WebInspectorClient): Ditto.
(WebKit::WebInspectorClient::hideHighlight): Ditto.
(WebKit::WebInspectorClient::showPaintRect): Ditto.
* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::updateFindUIAfterPageScroll): Ditto.
(WebKit::FindController::hideFindUI): Ditto.

* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::createWithCoreMainFrame): Return Ref instead of
PassRefPtr.
(WebKit::WebFrame::createSubframe): Ditto.
(WebKit::WebFrame::create): Ditto.
* WebProcess/WebPage/WebFrame.h: Updated for the above.

* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::openInNewTab): Pass reference.

* WebProcess/WebPage/ios/FindControllerIOS.mm:
(WebKit::FindController::updateFindIndicator): Use reference.
(WebKit::FindController::hideFindIndicator): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211033 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoRebaseline WebKit1 results after r211006.
joepeck@webkit.org [Mon, 23 Jan 2017 06:21:07 +0000 (06:21 +0000)]
Rebaseline WebKit1 results after r211006.

Unreviewed test gardening.

* platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211032 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years ago[Cocoa] Unify FontPlatformData's hashing and equality operators
mmaxfield@apple.com [Mon, 23 Jan 2017 03:52:39 +0000 (03:52 +0000)]
[Cocoa] Unify FontPlatformData's hashing and equality operators
https://bugs.webkit.org/show_bug.cgi?id=167061

Reviewed by Darin Adler.

On iOS, we were using CFEqual() and CFHash(), while on macOS
we were using pointer hashing and pointer equality. Instead,
we should be consistent about these operators.

Right now, FontPlatformData holds two internal CTFontRefs, and
switching to these higher-level CFEqual() and CFHash()
functions is required for eliminating one of these two
internal font objects.

No new tests because there is no behavior change.

* platform/graphics/FontPlatformData.h:
(WebCore::FontPlatformData::hash): Deleted.
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::FontPlatformData::hash):
(WebCore::FontPlatformData::platformIsEqual):
(WebCore::cascadeToLastResortAttributesDictionary):
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::FontPlatformData::hash):
* platform/graphics/win/FontPlatformDataCGWin.cpp:
(WebCore::FontPlatformData::hash):
* platform/graphics/win/FontPlatformDataCairoWin.cpp:
(WebCore::FontPlatformData::hash):
* platform/graphics/win/FontPlatformDataDirect2D.cpp:
(WebCore::FontPlatformData::hash):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211029 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years ago[WebGL] Do not allow GPU muxing on some old Mac hardware
dino@apple.com [Sun, 22 Jan 2017 18:51:09 +0000 (18:51 +0000)]
[WebGL] Do not allow GPU muxing on some old Mac hardware
https://bugs.webkit.org/show_bug.cgi?id=167259
<rdar://problem/30060378>

Reviewed by Simon Fraser and Darin Adler.

Some old Macbook Pro models should never use the
integrated GPU for WebGL, because they are unstable
when swapping between that and the discrete GPU.

Unfortunately this hardware configuration isn't in our
testing infrastructure, so it was confirmed manually.
Meanwhile, our existing tests make sure this patch
doesn't break anything elsewhere.

* platform/graphics/mac/GraphicsContext3DMac.mm:
(WebCore::attachToAppleGraphicsControl): Helper function
to get a mach port that talks to Apple's Graphics Control
system.
(WebCore::hasMuxCapability): Decides whether a system
can do live GPU switching, based on whether or not it
has a muxable GPU, and if that GPU is not the old hardware
we know is problematic.
(WebCore::hasMuxableGPU): Helper to return the static hasMuxCapability value.
(WebCore::setPixelFormat): Only request the integrated card when the
GPU is muxable.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211028 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoIntroducing the Platform Abstraction Layer (PAL)
mmaxfield@apple.com [Sun, 22 Jan 2017 17:24:51 +0000 (17:24 +0000)]
Introducing the Platform Abstraction Layer (PAL)
https://bugs.webkit.org/show_bug.cgi?id=143358

Reviewed by Alex Christensen.

.:

* CMakeLists.txt:
* Source/CMakeLists.txt:
* Source/cmake/WebKitFS.cmake:

Source/WebCore:

In order to enforce layering and promote testability, WebCore/platform files
should be compiled in their own project. This new project can enforce layering
and can be tested with unit tests in addition to layout tests.

The name of this new project is the Platform Abstraction Layer, or "PAL."
This comprises of a new directory in WebCore which will be the destination
for files migrated from WebCore/platform. This new folder, and its associated
project, will maintain layering invariants. These invariants are enforced at
build-time by setting the #include path for PAL to not include the rest of
WebCore (which is the same layering enforcement mechanism for WTF). Files will
be migrated into this new target/directory piece-by-piece, and the migration
of a file will be performed as soon as it can be migrated without violating
layering.

Within WebCore, files should include PAL files using the convention
#include <pal/foo.h>. Symbols within PAL are placed within a new top-level
namespace, "PAL," and therefore when used should be referred to as PAL::Foo.

The first set of files to move into the new platform is the crypto/ subdirectory
because it is both simple but also includes platform-dependent files.

No new tests because there is no behavior change.

* CMakeLists.txt:
* Configurations/WebCore.xcconfig: Add PAL to the include path
* PAL/Configurations/Base.xcconfig: Added.
* PAL/Configurations/DebugRelease.xcconfig: Added.
* PAL/Configurations/PAL.xcconfig: Added. Sets up some PAL-specific
variables.
* PAL/Configurations/FeatureDefines.xcconfig: Added.
* PAL/Configurations/Version.xcconfig: Added.
* PAL/PAL.xcodeproj/project.pbxproj: Added. New project file.
* PAL/config.h: Added. Simplified from WebCore/config.h.
* PAL/pal/CMakeLists.txt: Added.
* PAL/pal/PlatformEfl.cmake: Added.
* PAL/pal/PlatformGTK.cmake: Added.
* PAL/pal/PlatformMac.cmake: Added.
* PAL/pal/PlatformWin.cmake: Added.
* PAL/pal/crypto/CryptoDigest.h: Renamed from Source/WebCore/platform/crypto/CryptoDigest.h.
* PAL/pal/crypto/commoncrypto/CryptoDigestCommonCrypto.cpp: Renamed from Source/WebCore/platform/crypto/commoncrypto/CryptoDigestCommonCrypto.cpp.
* PAL/pal/crypto/gcrypt/CryptoDigestGCrypt.cpp: Renamed from Source/WebCore/platform/crypto/gcrypt/CryptoDigestGCrypt.cpp.
* PAL/pal/crypto/gnutls/CryptoDigestGnuTLS.cpp: Renamed from Source/WebCore/platform/crypto/gnutls/CryptoDigestGnuTLS.cpp.
* PAL/pal/crypto/win/CryptoDigestWin.cpp: Renamed from Source/WebCore/platform/crypto/win/CryptoDigestWin.cpp.
* PlatformEfl.cmake:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* PlatformWin.cmake:
* WebCore.xcodeproj/project.pbxproj: Create a project link so WebCore
knows that it needs to build PAL as a dependency.
* crypto/algorithms/CryptoAlgorithmSHA1.cpp:
(WebCore::CryptoAlgorithmSHA1::digest): Update #include and namespace.
* crypto/algorithms/CryptoAlgorithmSHA224.cpp:
(WebCore::CryptoAlgorithmSHA224::digest): Ditto.
* crypto/algorithms/CryptoAlgorithmSHA256.cpp:
(WebCore::CryptoAlgorithmSHA256::digest): Ditto.
* crypto/algorithms/CryptoAlgorithmSHA384.cpp:
(WebCore::CryptoAlgorithmSHA384::digest): Ditto.
* crypto/algorithms/CryptoAlgorithmSHA512.cpp:
(WebCore::CryptoAlgorithmSHA512::digest): Ditto.
* crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
(WebCore::cryptoDigestAlgorithm): Ditto.
(WebCore::signRSASSA_PKCS1_v1_5): Ditto.
(WebCore::verifyRSASSA_PKCS1_v1_5): Ditto.
* inspector/InspectorDOMAgent.cpp:
(WebCore::computeContentSecurityPolicySHA256Hash): Ditto.
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::toCryptoDigestAlgorithm): Ditto.
(WebCore::ContentSecurityPolicy::findHashOfContentInPolicies): Ditto.
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::HostTLSCertificateSet::computeCertificateHash): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211027 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years ago[GStreamer] Clear out m_appsinkCaps in AppendPipeline::appsinkCapsChanged() before...
zandobersek@gmail.com [Sun, 22 Jan 2017 08:29:30 +0000 (08:29 +0000)]
[GStreamer] Clear out m_appsinkCaps in AppendPipeline::appsinkCapsChanged() before using outPtr()
https://bugs.webkit.org/show_bug.cgi?id=167165

Reviewed by Carlos Garcia Campos.

* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::appsinkCapsChanged): Replace the gst_caps_replace() call
with a simple comparison and, in case the current appsink caps differ from the caps
on the sink's pad, move the reference to the latter into the m_appsinkCaps member
variable. This removes the use of GRefPtr<>::outPtr() which asserted in debug
configurations in the case of m_appsinkCaps not being null.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211026 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoREGRESSION (r210959): LayoutTest fast/mediastream/MediaStream-video-element-video...
commit-queue@webkit.org [Sun, 22 Jan 2017 06:44:49 +0000 (06:44 +0000)]
REGRESSION (r210959): LayoutTest fast/mediastream/MediaStream-video-element-video-tracks-disabled.html is failing
https://bugs.webkit.org/show_bug.cgi?id=167260

Unreviewed test gardening.

Since this test checks against a black frame as its expected output, we need to use the legacy
media controls so that there is no start button.

Patch by Antoine Quint <graouts@apple.com> on 2017-01-21

* fast/mediastream/MediaStream-video-element-video-tracks-disabled.html:
* platform/mac-wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211025 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoJavaScript for-of does not work on a lot of collection types (e.g. HTMLCollection)
cdumez@apple.com [Sun, 22 Jan 2017 05:48:28 +0000 (05:48 +0000)]
JavaScript for-of does not work on a lot of collection types (e.g. HTMLCollection)
https://bugs.webkit.org/show_bug.cgi?id=167091

Reviewed by Darin Adler.

Source/JavaScriptCore:

Update Array methods to throw a TypeError when (this === null || this === undefined)
instead of when (this == null). This is because (this == null) returns true for types
that masquerades as undefined (such as document.all) and this prevented use of the
Array API on such types. The specification only stays to use ToObject(), which throws
when the input is undefined or null.

The corresponding specification is at:
- https://www.ecma-international.org/ecma-262/7.0/index.html#sec-array.prototype.values
- https://www.ecma-international.org/ecma-262/7.0/index.html#sec-toobject

* builtins/ArrayPrototype.js:
(values):
(keys):
(entries):
(reduce):
(reduceRight):
(every):
(forEach):
(filter):
(map):
(some):
(fill):
(find):
(findIndex):
(includes):
(sort):
(concatSlowPath):
(copyWithin):

Source/WebCore:

As per the Web IDL specification [1], https://heycam.github.io/webidl/#es-iterator
an interface should get an iterator if it has:
- an indexed property getter and an integer-typed attribute named "length".

We now comply with this part of the Web IDL specification. This adds an iterator
to the following interfaces:
- AudioTrackList, ClientRectList, CSSRuleList, CSSStyleDeclaration, CSSValueList,
  MimeTypeArray, WebKitNamedFlowCollection, Plugin, PluginArray, DOMStringList,
  FileList, HTMLAllCollection, HTMLCollection, HTMLFormElement, HTMLOptionsCollection,
  HTMLSelectElement, MediaList, NamedNodeMap, SourceBufferList, StyleSheetList,
  TextTrackCueList, TextTrackList, TouchList, VideoTrackList, VTTRegionList.

As a result, it is now possible to use `for ... of` for those types.

Tests: fast/dom/FileList-iterator.html
       fast/dom/collection-iterators.html
       fast/dom/document-all-undefined.html
       fast/events/touch/ios/touchlist-iterator.html

* bindings/scripts/CodeGeneratorJS.pm:
(GetAttributeWithName):
(InterfaceNeedsIterator):
(GenerateImplementation):
(addIterableProperties):

LayoutTests:

* fast/dom/FileList-iterator-expected.txt: Added.
* fast/dom/FileList-iterator.html: Added.
* fast/dom/collection-iterators-expected.txt: Added.
* fast/dom/collection-iterators.html: Added.
* fast/events/touch/ios/touchlist-iterator-expected.txt: Added.
* fast/events/touch/ios/touchlist-iterator.html: Added.
Add layout test coverage for all types that gained an iterator.

* fast/dom/document-all-undefined-expected.txt: Added.
* fast/dom/document-all-undefined.html: Added.
Add layout test to cover the fact that HTMLAllCollection masquerades as
undefined, as per:
- https://html.spec.whatwg.org/multipage/obsolete.html#dom-document-all

* inspector/model/remote-object-get-properties-expected.txt:
Rebaseline now that there is an extra Symbol.iterator property.

* platform/wk2/TestExpectations:
Skip that requires beginDragWithFiles() as this is unimplemented in
WebKitTestRunner.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211024 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoinnerText should replace existing text node
cdumez@apple.com [Sun, 22 Jan 2017 05:19:17 +0000 (05:19 +0000)]
innerText should replace existing text node
https://bugs.webkit.org/show_bug.cgi?id=167116

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline existing test now that one more check is passing.

* web-platform-tests/innerText/setter-expected.txt:

Source/WebCore:

Update setInnerText() to use ContainerNode::replaceAllChildren()
instead of replaceChildrenWithText(). replaceAllChildren() is
implemented as per specification:
- https://html.spec.whatwg.org/multipage/dom.html#the-innertext-idl-attribute
- https://dom.spec.whatwg.org/#concept-node-replace-all

As a result, we now correctly remove existing children before
inserting the new one.

No new tests, updated existing one.

* editing/markup.cpp:
(WebCore::replaceChildrenWithText): Deleted.
* editing/markup.h:
* html/HTMLElement.cpp:
(WebCore::HTMLElement::setInnerText):

LayoutTests:

* accessibility/mac/aria-liveregions-changedtext.html:
The text is using innerText and changed behavior now that we stopped
reusing the existing Text child. Code in RenderObject::willBeDestroyed()
is supposed to call AXObjectCache::childrenChanged(parent()) to fire
the AXLiveRegionChanged notification. However, it did not because the
parent renderer did not have an associated AccessibilityObject.

* fast/dom/HTMLElement/set-inner-outer-optimization.html:
Update existing test which expected the non spec-compliant Text child
optimization.

* fast/repaint/vertical-text-repaint-expected.txt:
* fast/repaint/vertical-text-repaint.html:
Update / rebaseline test. We now repaint each 80x80 rectangle instead of
only repainting the text rects because we remove the Text node then add
a new one instead of only updating the existing Text node's test. The
output looks exactly the same otherwise.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211023 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoAccessibilityRenderObject::textChanged() bypasses AXLiveRegionChanged notification...
cdumez@apple.com [Sun, 22 Jan 2017 02:29:15 +0000 (02:29 +0000)]
AccessibilityRenderObject::textChanged() bypasses AXLiveRegionChanged notification coalescing
https://bugs.webkit.org/show_bug.cgi?id=167286
<rdar://problem/30133211>

Reviewed by Ryosuke Niwa.

Source/WebCore:

AccessibilityRenderObject::textChanged() bypasses AXLiveRegionChanged notification
coalescing. This patch fixes the issue.

No new tests, updated existing test.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::textChanged):

LayoutTests:

Update test to use a longer timer delay. When using this longer delay, we were getting 4
AXLiveRegionChanged notifications instead of the expected 2 because
AccessibilityRenderObject::textChanged() was bypassing AXLiveRegionChanged notification
coalescing.

* accessibility/mac/aria-multiple-liveregions-notification-expected.txt:
* accessibility/mac/aria-multiple-liveregions-notification.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211022 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years agoRemove -[WebFrame sendOrientationChangeEvent:] which is unused
simon.fraser@apple.com [Sun, 22 Jan 2017 02:16:33 +0000 (02:16 +0000)]
Remove -[WebFrame sendOrientationChangeEvent:] which is unused
https://bugs.webkit.org/show_bug.cgi?id=167276

Reviewed by Alex Christensen.

It was usurped by -deviceOrientationChanged in 2014.

* WebView/WebFrame.mm:
(-[WebFrame sendOrientationChangeEvent:]): Deleted.
* WebView/WebFramePrivate.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211021 268f45cc-cd09-0410-ab3c-d52691b4dbfc