WebKit-https.git
19 months agoJSExports.h should be included as <JavaScriptCore/JSExportMacros.h>
don.olmstead@sony.com [Wed, 31 Jan 2018 00:53:48 +0000 (00:53 +0000)]
JSExports.h should be included as <JavaScriptCore/JSExportMacros.h>
https://bugs.webkit.org/show_bug.cgi?id=182312

Reviewed by Michael Catanzaro.

Source/WebCore:

No new tests. No change in behavior.

* config.h:

Source/WebKit:

* config.h:

Source/WebKitLegacy/cf:

* WebCoreSupport/WebInspectorClientCF.cpp:

Source/WebKitLegacy/mac:

* WebKitPrefix.h:

Tools:

* DumpRenderTree/config.h:
* TestWebKitAPI/config.h:
* WebKitTestRunner/config.h:

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

19 months agoMarked fast/workers/worker-cloneport.html as flaky on macOS Release.
jlewis3@apple.com [Wed, 31 Jan 2018 00:46:02 +0000 (00:46 +0000)]
Marked fast/workers/worker-cloneport.html as flaky on macOS Release.
https://bugs.webkit.org/show_bug.cgi?id=182007

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

19 months agoWeb Inspector: Replace Object.shallowMerge with ES2018 spread operator
webkit@devinrousso.com [Wed, 31 Jan 2018 00:39:18 +0000 (00:39 +0000)]
Web Inspector: Replace Object.shallowMerge with ES2018 spread operator
https://bugs.webkit.org/show_bug.cgi?id=182219

Reviewed by Brian Burg.

* UserInterface/Base/Utilities.js:
(Object.shallowMerge): Deleted.
* UserInterface/Base/DOMUtilities.js:
(WI.linkifyNodeReference):
* UserInterface/Base/Main.js:
(WI.handlePossibleLinkClick):
(WI.openURL):
(WI.showSourceCodeLocation):
(WI.showOriginalUnformattedSourceCodeLocation):
(WI.showOriginalOrFormattedSourceCodeLocation):
(WI.showOriginalOrFormattedSourceCodeTextRange):
(WI.linkifyLocation):
* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype._insertAdjacentHTML):
* UserInterface/Views/WebSocketContentView.js:
(WI.WebSocketContentView.prototype._addRow):

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

19 months agoStyleBench: Generate more mutation steps
rniwa@webkit.org [Wed, 31 Jan 2018 00:31:49 +0000 (00:31 +0000)]
StyleBench: Generate more mutation steps
https://bugs.webkit.org/show_bug.cgi?id=182291

Rubber-stamped by Antti Koivisto

Use zero-based index instead of one-based index.

* StyleBench/resources/tests.js:
(makeSteps):

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

19 months agoUse double-quotes when serializing font-feature-settings
commit-queue@webkit.org [Wed, 31 Jan 2018 00:08:44 +0000 (00:08 +0000)]
Use double-quotes when serializing font-feature-settings
https://bugs.webkit.org/show_bug.cgi?id=182201

Source/WebCore:

According to the CSSOM spec, all strings should be serialized with double-quotes. The feature
tag value was previously serialized with single-quotes; change this to double-quotes to match
the spec and non-WebKit browsers.

Patch by Chris Nardi <cnardi@chromium.org> on 2018-01-30
Reviewed by Myles C. Maxfield.

Updated css3/font-feature-settings-parsing.html, fast/css/inherited-properties-rare-text.html,
and fast/text/font-face-javascript.html.

* css/CSSFontFeatureValue.cpp:
(WebCore::CSSFontFeatureValue::customCSSText const):

LayoutTests:

Update tests with double-quotes instead of single-quotes.

Patch by Chris Nardi <cnardi@chromium.org> on 2018-01-30
Reviewed by Myles C. Maxfield.

* css3/font-feature-settings-parsing-expected.txt:
* css3/font-feature-settings-parsing.html:
* fast/css/inherited-properties-rare-text-expected.txt:
* fast/text/font-face-javascript-expected.txt:
* fast/text/font-face-javascript.html:

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

19 months agoUnreviewed build fix for JSCOnly after r227845.
don.olmstead@sony.com [Tue, 30 Jan 2018 23:13:27 +0000 (23:13 +0000)]
Unreviewed build fix for JSCOnly after r227845.
https://bugs.webkit.org/show_bug.cgi?id=182274

* wtf/PlatformJSCOnly.cmake:

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

19 months agoAdd telemetry to track storage access API adoption
bfulgham@apple.com [Tue, 30 Jan 2018 23:12:03 +0000 (23:12 +0000)]
Add telemetry to track storage access API adoption
https://bugs.webkit.org/show_bug.cgi?id=182197
<rdar://problem/35803309>

Reviewed by Chris Dumez.

Part 2: Add telemetry for the Storage Access API case

Source/WebCore:

Adds a new convenience method to identify origin/page/frame combinations that
have been granted access to the Storage Access API. This is used for debug
logging in the NetworkProcess. It is not used in production builds.

* platform/network/NetworkStorageSession.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::hasStorageAccessForFrame const): Added.

Source/WebKit:

This change increments a counter when an origin is loaded in a first part context because
it was granted Storage Access API permissions.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::logCookieInformation const): Add logging to indicate
loads that happened with the Storage Access API enabled.
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccess): Increment counter for
loads using the new API.

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

19 months ago[iOS] API test UIPasteboardTests.DataTransferGetDataWhenPastingPlatformRepresentation...
wenson_hsieh@apple.com [Tue, 30 Jan 2018 23:05:57 +0000 (23:05 +0000)]
[iOS] API test UIPasteboardTests.DataTransferGetDataWhenPastingPlatformRepresentations fails after r223440
https://bugs.webkit.org/show_bug.cgi?id=182307
<rdar://problem/36041485>

Reviewed by Ryosuke Niwa.

Adjusts a failing API test that we forgot to rebaseline after r223440, which ensures that the result of reading
"text/html" from the DataTransfer is sanitized markup. To do this, teach the test harness
(dump-datatransfer-types.html) to ignore inline styles in markup if a flag is set, and then set that flag in
UIPasteboardTests.DataTransferGetDataWhenPastingPlatformRepresentations.

* TestWebKitAPI/Tests/WebKitCocoa/dump-datatransfer-types.html:
* TestWebKitAPI/Tests/ios/UIPasteboardTests.mm:
(TestWebKitAPI::TEST):

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

19 months agoRelease assert in updateLayout() via AXObjectCache::childrenChanged
rniwa@webkit.org [Tue, 30 Jan 2018 22:47:05 +0000 (22:47 +0000)]
Release assert in updateLayout() via AXObjectCache::childrenChanged
https://bugs.webkit.org/show_bug.cgi?id=182279
<rdar://problem/36994456>

Reviewed by Antti Koivisto.

Source/WebCore:

Disable the assertion in Document::updateLayout and Document::updateStyle* in this particular circumstance as fixing it
would require a large architectural refactoring of the accessibility code.

Test: accessibility/accessibility-object-update-during-style-resolution-crash.html

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::childrenChanged): Disabled the release assertion here.
* dom/Document.cpp:
(WebCore::Document::isSafeToUpdateStyleOrLayout const): Check LayoutAssertionDisableScope::shouldDisable.
* dom/ScriptDisallowedScope.h:
(WebCore::ScriptDisallowedScope::LayoutAssertionDisableScope): Added.
(WebCore::ScriptDisallowedScope::LayoutAssertionDisableScope::LayoutAssertionDisableScope): Added.
(WebCore::ScriptDisallowedScope::LayoutAssertionDisableScope::~LayoutAssertionDisableScope): Added.
(WebCore::ScriptDisallowedScope::LayoutAssertionDisableScope::shouldDisable): Added.
* page/LayoutContext.cpp:
(WebCore::LayoutContext::layout): Check LayoutAssertionDisableScope::shouldDisable.

LayoutTests:

Added a regression test.

* accessibility/accessibility-object-update-during-style-resolution-crash-expected.txt: Added.
* accessibility/accessibility-object-update-during-style-resolution-crash.html: Added.

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

19 months agoSkipping imported/w3c/web-platform-tests/service-workers/service-worker/navigation...
jlewis3@apple.com [Tue, 30 Jan 2018 22:45:09 +0000 (22:45 +0000)]
Skipping imported/w3c/web-platform-tests/service-workers/service-worker/navigation-redirect.https.html.
https://bugs.webkit.org/show_bug.cgi?id=182311

Unreviewed test expectations.

* TestExpectations:

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

19 months ago[RenderTreeBuilder] Move RenderRubyRun::rubyBaseSafe to RenderTreeBuilder::Ruby
zalan@apple.com [Tue, 30 Jan 2018 22:40:57 +0000 (22:40 +0000)]
[RenderTreeBuilder] Move RenderRubyRun::rubyBaseSafe to RenderTreeBuilder::Ruby
https://bugs.webkit.org/show_bug.cgi?id=182306
<rdar://problem/37041440>

Reviewed by Antti Koivisto.

With all the ruby mutation code moving, only RenderTreeBuilder calls RenderRubyRun::rubyBaseSafe.

No change in functionality.

* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::rubyText const):
(WebCore::RenderRubyRun::rubyBase const):
(WebCore::RenderRubyRun::firstLineBlock const):
(WebCore::RenderRubyRun::takeChild):
(WebCore::RenderRubyRun::rubyBaseSafe): Deleted.
* rendering/RenderRubyRun.h:
* rendering/updating/RenderTreeBuilderRuby.cpp:
(WebCore::RenderTreeBuilder::Ruby::insertChild):
(WebCore::RenderTreeBuilder::Ruby::rubyBaseSafe):
* rendering/updating/RenderTreeBuilderRuby.h:

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

19 months agoMake preserve and restore focus more likely to be symmetrical
megan_gardner@apple.com [Tue, 30 Jan 2018 22:16:08 +0000 (22:16 +0000)]
Make preserve and restore focus more likely to be symmetrical
https://bugs.webkit.org/show_bug.cgi?id=182264
Source/WebKit:

<rdar://problem/36948473>

Reviewed by Tim Horton.

Keep a stack of if we actually increment the focusState, so that
changes to the web content do not result in asymmetric decrements to the focus state.
To work around problems associated with <rdar://problem/37000122>.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _restoreFocusWithToken:]):
(-[WKContentView _preserveFocusWithToken:destructively:]):

LayoutTests:

Reviewed by Tim Horton.

Added new test to verify that opening a selection form twice works.

* fast/forms/ios/ipad/select-form-run-twice-expected.txt: Added.
* fast/forms/ios/ipad/select-form-run-twice.html: Added.

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

19 months agoStyleBench: Generate more mutation steps
antti@apple.com [Tue, 30 Jan 2018 22:08:11 +0000 (22:08 +0000)]
StyleBench: Generate more mutation steps
https://bugs.webkit.org/show_bug.cgi?id=182291

Reviewed by Ryosuke Niwa.

The test should be doing multiple rounds of mutations in a single document to test what is supposed to test (like it did before r227756).
This also makes test results more stable and less dependent on possible first-time costs.

* StyleBench/resources/benchmark-runner.js:

Adjust correctionFactor to match the new steps count. With 1.5 Firefox is ~72rpm.

* StyleBench/resources/tests.js:
(makeSteps):

Generate 10 rounds of class/element mutation steps.
Give each generated step unique name so reporting works.
Make individual steps do fewer mutations.

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

19 months agoUnified sources for FEMorphology.cpp seems to break the windows build.
commit-queue@webkit.org [Tue, 30 Jan 2018 21:55:12 +0000 (21:55 +0000)]
Unified sources for FEMorphology.cpp seems to break the windows build.
https://bugs.webkit.org/show_bug.cgi?id=178847

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2018-01-30
Reviewed by Yusuke Suzuki.

Fix a compilation error.
platform/graphics/filters/SpotLightSource.cpp(45): error C2027: use of undefined type 'WebCore::FilterEffect'

No new tests (No behavior change)

* Sources.txt: Removed @no-unify for FEMorphology.cpp.
* platform/graphics/filters/SpotLightSource.cpp: Added #include "FilterEffect.h".

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

19 months agoTest fix after r227776
mmaxfield@apple.com [Tue, 30 Jan 2018 21:51:18 +0000 (21:51 +0000)]
Test fix after r227776
https://bugs.webkit.org/show_bug.cgi?id=180951

Unreviewed.

* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::mandatoryAttributesForUserInstalledFonts):

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

19 months agoCrashTracer: com.apple.WebKit.WebContent at WebCore: WebCore::Document::updateStyleIf...
dino@apple.com [Tue, 30 Jan 2018 20:29:02 +0000 (20:29 +0000)]
CrashTracer: com.apple.WebKit.WebContent at WebCore: WebCore::Document::updateStyleIfNeeded
https://bugs.webkit.org/show_bug.cgi?id=182299
<rdar://problem/36853088>

Removing a misleading comment based on Zalan Bujtas's feedback.

* rendering/RenderElement.cpp:
(WebCore::RenderElement::repaintForPausedImageAnimationsIfNeeded):

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

19 months ago[CMake] Make WTF headers copies
don.olmstead@sony.com [Tue, 30 Jan 2018 20:02:17 +0000 (20:02 +0000)]
[CMake] Make WTF headers copies
https://bugs.webkit.org/show_bug.cgi?id=182274

Reviewed by Alex Christensen.

Source/ThirdParty:

* gtest/CMakeLists.txt:

Source/WebDriver:

* CMakeLists.txt:

Source/WTF:

* wtf/CMakeLists.txt:
* wtf/PlatformGTK.cmake:
* wtf/PlatformJSCOnly.cmake:
* wtf/PlatformMac.cmake:
* wtf/PlatformWPE.cmake:
* wtf/PlatformWin.cmake:

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

19 months agoCrashTracer: com.apple.WebKit.WebContent at WebCore: WebCore::Document::updateStyleIf...
dino@apple.com [Tue, 30 Jan 2018 19:46:38 +0000 (19:46 +0000)]
CrashTracer: com.apple.WebKit.WebContent at WebCore: WebCore::Document::updateStyleIfNeeded
https://bugs.webkit.org/show_bug.cgi?id=182299
<rdar://problem/36853088>

Reviewed by Simon Fraser.

Source/WebCore:

Mostly speculative fix for the case where a scrollTo moves an
animated SVG image into view, causing its animation to restart during
a paint operation. This was causing a release ASSERT, so we now defer
the resumption of the animation into a timer.

Test: svg/animated-svgImage-scroll.html

* rendering/RenderElement.cpp:
(WebCore::RenderElement::repaintForPausedImageAnimationsIfNeeded): Enqueue the
animation if it is an SVGImage.
* svg/graphics/SVGImage.cpp: Add a timer to enqueue animation starts.
(WebCore::SVGImage::SVGImage):
(WebCore::SVGImage::startAnimationTimerFired):
(WebCore::SVGImage::enqueueStartAnimation):
(WebCore::SVGImage::stopAnimation):
* svg/graphics/SVGImage.h:

LayoutTests:

* svg/animated-svgImage-scroll-expected.txt: Added.
* svg/animated-svgImage-scroll.html: Added.

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

19 months agoService worker registration soft updates happen too frequently
cdumez@apple.com [Tue, 30 Jan 2018 18:47:51 +0000 (18:47 +0000)]
Service worker registration soft updates happen too frequently
https://bugs.webkit.org/show_bug.cgi?id=182296
<rdar://problem/37031862>

Reviewed by Youenn Fablet.

Move code that updates the registration's last update check time from after
the script bytecheck to before, as per:
- https://w3c.github.io/ServiceWorker/#update (step 7.19)

This way, the last update check time gets updated even if the newly fetched
script is identical to the previous one, which is the common case.

* workers/service/server/SWServer.cpp:
(WebCore::SWServer::updateWorker):
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::scriptFetchFinished):

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

19 months agoMove ENABLE_POISON to Platform.h.
mark.lam@apple.com [Tue, 30 Jan 2018 18:04:21 +0000 (18:04 +0000)]
Move ENABLE_POISON to Platform.h.
https://bugs.webkit.org/show_bug.cgi?id=182298
<rdar://problem/37032686>

Reviewed by Michael Saboff and JF Bastien.

ENABLE_POISON belongs in Platform.h to ensure that all places that depend on
ENABLE(POISON) will see it properly defined.

* wtf/Platform.h:
* wtf/Poisoned.h:

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

19 months ago[RenderTreeBuilder] Move childBecameNonInline to RenderTreeBuilder
zalan@apple.com [Tue, 30 Jan 2018 18:01:48 +0000 (18:01 +0000)]
[RenderTreeBuilder] Move childBecameNonInline to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182265
<rdar://problem/37004459>

Reviewed by Antti Koivisto.

Move the mutation code that wraps/unwraps a child element when its flow state changes
from(to) in-flow to(from) floating/out-of-flow.

No change in functionality.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::childBecameNonInline): Deleted.
* rendering/RenderBlock.h:
* rendering/RenderBoxModelObject.h:
(WebCore::RenderBoxModelObject::childBecameNonInline): Deleted.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::styleDidChange):
(WebCore::RenderElement::handleDynamicFloatPositionChange): Deleted.
* rendering/RenderInline.cpp:
(WebCore::RenderInline::childBecameNonInline): Deleted.
* rendering/RenderInline.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::childFlowStateChangesAndAffectsParentBlock):
(WebCore::RenderTreeBuilder::splitFlow): Deleted.
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderBlock.cpp:
(WebCore::RenderTreeBuilder::Block::childBecameNonInline):
* rendering/updating/RenderTreeBuilderBlock.h:
* rendering/updating/RenderTreeBuilderInline.cpp:
(WebCore::RenderTreeBuilder::Inline::childBecameNonInline):
* rendering/updating/RenderTreeBuilderInline.h:

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

19 months agoAdd telemetry to track storage access API adoption
bfulgham@apple.com [Tue, 30 Jan 2018 17:44:41 +0000 (17:44 +0000)]
Add telemetry to track storage access API adoption
https://bugs.webkit.org/show_bug.cgi?id=182197
<rdar://problem/35803309>

Reviewed by Chris Dumez.

Source/WebCore:

Partial roll-out of r227755.

The original patch assumed the WebContent process kept track of user interaction. This is
only tracked in the UIProcess, so we can get rid of some of the logging code adding in
r227755.

* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::logFrameNavigation):
(WebCore::ResourceLoadObserver::logSubresourceLoading):
(WebCore::ResourceLoadObserver::setTimeToLivePartitionFree): Deleted.
(WebCore::ResourceLoadObserver::wasAccessedWithinInteractionWindow const): Deleted.
* loader/ResourceLoadObserver.h:

Source/WebKit:

This patch also handled aggregating the counts in the UIProcess, which has access to
the right data.

The original patch assumed the WebContent process kept track of user interaction. This is
only tracked in the UIProcess, so we can get rid of some of the logging code adding in
r227755.

* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode const): Rollout of r227755 changes not
needed to track the statistics.
(WebKit::WebProcessCreationParameters::decode): Ditto.
* Shared/WebProcessCreationParameters.h:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess): Ditto.
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::wasAccessedAsFirstPartyDueToUserInteraction): Moved from
the WebContent process, which does not keep track of user interaction.
(WebKit::WebResourceLoadStatisticsStore::mergeStatistics): Aggregate counts while processing
the statistics.
* UIProcess/WebResourceLoadStatisticsStore.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):

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

19 months agoMake sure we never create a WebSWClientConnection with an invalid sessionID
cdumez@apple.com [Tue, 30 Jan 2018 17:21:49 +0000 (17:21 +0000)]
Make sure we never create a WebSWClientConnection with an invalid sessionID
https://bugs.webkit.org/show_bug.cgi?id=182276
<rdar://problem/36582633>

Reviewed by Alex Christensen.

Make sure we never create a WebSWClientConnection with an invalid sessionID as this
could corrupt our hash tables.

Source/WebCore:

* dom/Document.cpp:
(WebCore::Document::privateBrowsingStateDidChange):
* workers/service/ServiceWorker.cpp:
(WebCore::ServiceWorker::postMessage):
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::ready):
(WebCore::ServiceWorkerContainer::getRegistration):
(WebCore::ServiceWorkerContainer::didFinishGetRegistrationRequest):
(WebCore::ServiceWorkerContainer::getRegistrations):
(WebCore::ServiceWorkerContainer::didFinishGetRegistrationsRequest):
(WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
(WebCore::ServiceWorkerContainer::ensureSWClientConnection):

Source/WebKit:

* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::swServerForSession):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::WebSWClientConnection):
* WebProcess/Storage/WebServiceWorkerProvider.cpp:
(WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession):
(WebKit::WebServiceWorkerProvider::existingServiceWorkerConnectionForSession):
* WebProcess/Storage/WebToStorageProcessConnection.cpp:
(WebKit::WebToStorageProcessConnection::serviceWorkerConnectionForSession):

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

19 months ago[WebVR][GTK][WPE] Exclude OpenVR from tarballs
svillar@igalia.com [Tue, 30 Jan 2018 16:18:26 +0000 (16:18 +0000)]
[WebVR][GTK][WPE] Exclude OpenVR from tarballs
https://bugs.webkit.org/show_bug.cgi?id=182284

Reviewed by Michael Catanzaro.

.:

Added private build options for USE_OPENVR.

* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsWPE.cmake:

Tools:

* gtk/manifest.txt.in: Added ThirdParty/openvr to exclusions.
* wpe/manifest.txt.in: Ditto.

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

19 months agoAvoid traversing too much when doing class change invalidation
antti@apple.com [Tue, 30 Jan 2018 16:13:15 +0000 (16:13 +0000)]
Avoid traversing too much when doing class change invalidation
https://bugs.webkit.org/show_bug.cgi?id=181604

Reviewed by Zalan Bujtas.

We are now collecting information about which part of the tree a change in class can potentially affect.
Use the information to traverse only the required elements in Style::Invalidator.

The same mechanism can be later used for attribute and id change invalidation.

* css/DocumentRuleSets.cpp:
(WebCore::DocumentRuleSets::collectFeatures const):
(WebCore::DocumentRuleSets::classInvalidationRuleSets const):
(WebCore::DocumentRuleSets::subjectClassRules const): Deleted.
(WebCore::DocumentRuleSets::ancestorClassRules const): Deleted.

    Remove separate subject and ancestor invalidation RuleSets. Instead collect all invalidation rulesets
    to a vector along with their MatchElements.

* css/DocumentRuleSets.h:
* css/RuleFeature.cpp:
(WebCore::RuleFeatureSet::computeNextMatchElement):
(WebCore::RuleFeatureSet::computeSubSelectorMatchElement):
(WebCore::RuleFeatureSet::collectFeatures):

    Similarly collect all class invalidation RuleFeatures to a general HashMap along with the MatchElement.

(WebCore::RuleFeatureSet::add):
(WebCore::RuleFeatureSet::clear):
(WebCore::RuleFeatureSet::shrinkToFit):
* css/RuleFeature.h:
(WebCore::RuleFeature::RuleFeature):
* style/ClassChangeInvalidation.cpp:
(WebCore::Style::ClassChangeInvalidation::computeInvalidation):

    Find out InvalidationRuleSets to use.

(WebCore::Style::ClassChangeInvalidation::invalidateStyleWithRuleSets):

    Pass them to Style::Invalidator.

* style/ClassChangeInvalidation.h:
* style/StyleInvalidator.cpp:
(WebCore::Style::Invalidator::invalidateStyleForTree):
(WebCore::Style::Invalidator::invalidateStyleForDescendants):
(WebCore::Style::Invalidator::invalidateStyleWithMatchElement):

    Traverse only the part of the tree needed by the given MatchElement.

* style/StyleInvalidator.h:
* style/StyleSharingResolver.cpp:
(WebCore::Style::SharingResolver::classNamesAffectedByRules const):

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

19 months ago[css-align] The 'baseline' value must be invalid for the 'justify-content' property
jfernandez@igalia.com [Tue, 30 Jan 2018 16:03:14 +0000 (16:03 +0000)]
[css-align] The 'baseline' value must be invalid for the 'justify-content' property
https://bugs.webkit.org/show_bug.cgi?id=181794

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

Adapted the test cases using <baseline-position> keywords to the new CSS syntax.
Imported the CSS/support folder.

* resources/import-expectations.json:
* web-platform-tests/css/css-align/content-distribution/parse-align-content-001-expected.txt:
* web-platform-tests/css/css-align/content-distribution/parse-align-content-001.html:
* web-platform-tests/css/css-align/content-distribution/parse-align-content-003-expected.txt:
* web-platform-tests/css/css-align/content-distribution/parse-align-content-003.html:
* web-platform-tests/css/css-align/content-distribution/parse-justify-content-001-expected.txt:
* web-platform-tests/css/css-align/content-distribution/parse-justify-content-001.html:
* web-platform-tests/css/css-align/content-distribution/parse-justify-content-003-expected.txt:
* web-platform-tests/css/css-align/content-distribution/parse-justify-content-003.html:
* web-platform-tests/css/css-align/content-distribution/parse-justify-content-004-expected.txt:
* web-platform-tests/css/css-align/content-distribution/parse-justify-content-004.html:
* web-platform-tests/css/css-align/content-distribution/place-content-shorthand-001-expected.txt:
* web-platform-tests/css/css-align/content-distribution/place-content-shorthand-001.html:
* web-platform-tests/css/css-align/content-distribution/place-content-shorthand-002-expected.txt:
* web-platform-tests/css/css-align/content-distribution/place-content-shorthand-002.html:
* web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004-expected.txt:
* web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html:
* web-platform-tests/css/css-align/content-distribution/place-content-shorthand-006-expected.txt:
* web-platform-tests/css/css-align/content-distribution/place-content-shorthand-006.html:
* web-platform-tests/css/css-align/default-alignment/parse-align-items-001-expected.txt:
* web-platform-tests/css/css-align/default-alignment/parse-align-items-001.html:
* web-platform-tests/css/css-align/default-alignment/parse-align-items-003-expected.txt:
* web-platform-tests/css/css-align/default-alignment/parse-align-items-003.html:
* web-platform-tests/css/css-align/default-alignment/parse-justify-items-001-expected.txt:
* web-platform-tests/css/css-align/default-alignment/parse-justify-items-001.html:
* web-platform-tests/css/css-align/default-alignment/parse-justify-items-003-expected.txt:
* web-platform-tests/css/css-align/default-alignment/parse-justify-items-003.html:
* web-platform-tests/css/css-align/default-alignment/place-items-shorthand-001.html:
* web-platform-tests/css/css-align/default-alignment/place-items-shorthand-002.html:
* web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html:
* web-platform-tests/css/css-align/default-alignment/place-items-shorthand-006.html:
* web-platform-tests/css/css-align/resources/alignment-parsing-utils.js:
(checkPlaceShorhand):
(checkPlaceShorhandLonghands):
* web-platform-tests/css/css-align/self-alignment/parse-align-self-001-expected.txt:
* web-platform-tests/css/css-align/self-alignment/parse-align-self-001.html:
* web-platform-tests/css/css-align/self-alignment/parse-align-self-003-expected.txt:
* web-platform-tests/css/css-align/self-alignment/parse-align-self-003.html:
* web-platform-tests/css/css-align/self-alignment/parse-justify-self-001-expected.txt:
* web-platform-tests/css/css-align/self-alignment/parse-justify-self-001.html:
* web-platform-tests/css/css-align/self-alignment/parse-justify-self-003-expected.txt:
* web-platform-tests/css/css-align/self-alignment/parse-justify-self-003.html:
* web-platform-tests/css/css-align/self-alignment/place-self-shorthand-001.html:
* web-platform-tests/css/css-align/self-alignment/place-self-shorthand-002.html:
* web-platform-tests/css/css-align/self-alignment/place-self-shorthand-004.html:
* web-platform-tests/css/css-align/self-alignment/place-self-shorthand-006.html:
* web-platform-tests/css/support/1x1-green.png: Added.
* web-platform-tests/css/support/1x1-lime.png: Added.
* web-platform-tests/css/support/1x1-maroon.png: Added.
* web-platform-tests/css/support/1x1-navy.png: Added.
* web-platform-tests/css/support/1x1-red.png: Added.
* web-platform-tests/css/support/1x1-white.png: Added.
* web-platform-tests/css/support/60x60-gg-rr.png: Added.
* web-platform-tests/css/support/60x60-green.png: Added.
* web-platform-tests/css/support/60x60-red.png: Added.
* web-platform-tests/css/support/OWNERS: Added.
* web-platform-tests/css/support/README: Added.
* web-platform-tests/css/support/a-green.css: Added.
(.a):
* web-platform-tests/css/support/alignment.css: Added.
(.alignSelfAuto):
(.alignSelfNormal):
(.alignSelfStretch):
(.alignSelfStart):
(.alignSelfEnd):
(.alignSelfCenter):
(.alignSelfRight):
(.alignSelfLeft):
(.alignSelfFlexStart):
(.alignSelfFlexEnd):
(.alignSelfSelfStart):
(.alignSelfSelfEnd):
(.alignSelfSafeCenter):
(.alignSelfUnsafeCenter):
(.alignSelfSafeEnd):
(.alignSelfUnsafeEnd):
(.alignSelfSafeSelfEnd):
(.alignSelfUnsafeSelfEnd):
(.alignSelfSafeSelfStart):
(.alignSelfUnsafeSelfStart):
(.alignSelfSafeRight):
(.alignSelfUnsafeRight):
(.alignSelfSafeLeft):
(.alignSelfUnsafeLeft):
(.alignSelfSafeFlexEnd):
(.alignSelfUnsafeFlexEnd):
(.alignSelfSafeFlexStart):
(.alignSelfUnsafeFlexStart):
(.alignSelfBaseline):
(.alignSelfFirstBaseline):
(.alignSelfLastBaseline):
(.alignItemsAuto):
(.alignItemsNormal):
(.alignItemsStretch):
(.alignItemsStart):
(.alignItemsCenter):
(.alignItemsEnd):
(.alignItemsLeft):
(.alignItemsRight):
(.alignItemsFlexStart):
(.alignItemsFlexEnd):
(.alignItemsSelfStart):
(.alignItemsSelfEnd):
(.alignItemsSafeCenter):
(.alignItemsUnsafeCenter):
(.alignItemsSafeEnd):
(.alignItemsUnsafeEnd):
(.alignItemsSafeSelfEnd):
(.alignItemsUnsafeSelfEnd):
(.alignItemsSafeSelfStart):
(.alignItemsUnsafeSelfStart):
(.alignItemsSafeRight):
(.alignItemsUnsafeRight):
(.alignItemsSafeLeft):
(.alignItemsUnsafeLeft):
(.alignItemsSafeFlexEnd):
(.alignItemsUnsafeFlexEnd):
(.alignItemsSafeFlexStart):
(.alignItemsUnsafeFlexStart):
(.alignItemsBaseline):
(.alignItemsFirstBaseline):
(.alignItemsLastBaseline):
(.alignContentBaseline):
(.alignContentLastBaseline):
(.alignContentStart):
(.alignContentEnd):
(.alignContentCenter):
(.alignContentLeft):
(.alignContentRight):
(.alignContentFlexStart):
(.alignContentFlexEnd):
(.alignContentSpaceBetween):
(.alignContentSpaceAround):
(.alignContentSpaceEvenly):
(.alignContentStretch):
(.alignContentSafeCenter):
(.alignContentUnsafeCenter):
(.alignContentSafeEnd):
(.alignContentUnsafeEnd):
(.alignContentSafeRight):
(.alignContentUnsafeRight):
(.alignContentSafeLeft):
(.alignContentUnsafeLeft):
(.alignContentSafeFlexEnd):
(.alignContentUnsafeFlexEnd):
(.alignContentSafeFlexStart):
(.alignContentUnsafeFlexStart):
(.alignContentFirstBaseline):
(.justifySelfAuto):
(.justifySelfNormal):
(.justifySelfStretch):
(.justifySelfStart):
(.justifySelfCenter):
(.justifySelfEnd):
(.justifySelfRight):
(.justifySelfLeft):
(.justifySelfFlexStart):
(.justifySelfFlexEnd):
(.justifySelfSelfStart):
(.justifySelfSelfEnd):
(.justifySelfSafeCenter):
(.justifySelfUnsafeCenter):
(.justifySelfSafeEnd):
(.justifySelfUnsafeEnd):
(.justifySelfSafeSelfEnd):
(.justifySelfUnsafeSelfEnd):
(.justifySelfSafeSelfStart):
(.justifySelfUnsafeSelfStart):
(.justifySelfSafeRight):
(.justifySelfUnsafeRight):
(.justifySelfSafeLeft):
(.justifySelfUnsafeLeft):
(.justifySelfSafeFlexEnd):
(.justifySelfUnsafeFlexEnd):
(.justifySelfSafeFlexStart):
(.justifySelfUnsafeFlexStart):
(.justifySelfBaseline):
(.justifySelfFirstBaseline):
(.justifySelfLastBaseline):
(.justifyItemsAuto):
(.justifyItemsNormal):
(.justifyItemsStretch):
(.justifyItemsStart):
(.justifyItemsCenter):
(.justifyItemsEnd):
(.justifyItemsLeft):
(.justifyItemsRight):
(.justifyItemsFlexStart):
(.justifyItemsFlexEnd):
(.justifyItemsSelfStart):
(.justifyItemsSelfEnd):
(.justifyItemsLegacy):
(.justifyItemsLegacyLeft):
(.justifyItemsLegacyCenter):
(.justifyItemsLegacyRight):
(.justifyItemsLeftLegacy):
(.justifyItemsCenterLegacy):
(.justifyItemsRightLegacy):
(.justifyItemsSafeCenter):
(.justifyItemsUnsafeCenter):
(.justifyItemsSafeEnd):
(.justifyItemsUnsafeEnd):
(.justifyItemsSafeSelfEnd):
(.justifyItemsUnsafeSelfEnd):
(.justifyItemsSafeSelfStart):
(.justifyItemsUnsafeSelfStart):
(.justifyItemsSafeRight):
(.justifyItemsUnsafeRight):
(.justifyItemsSafeLeft):
(.justifyItemsUnsafeLeft):
(.justifyItemsSafeFlexEnd):
(.justifyItemsUnsafeFlexEnd):
(.justifyItemsSafeFlexStart):
(.justifyItemsUnsafeFlexStart):
(.justifyItemsTest):
(.justifyItemsBaseline):
(.justifyItemsFirstBaseline):
(.justifyItemsLastBaseline):
(.justifyContentBaseline):
(.justifyContentLastBaseline):
(.justifyContentStart):
(.justifyContentEnd):
(.justifyContentCenter):
(.justifyContentLeft):
(.justifyContentRight):
(.justifyContentFlexStart):
(.justifyContentFlexEnd):
(.justifyContentSpaceBetween):
(.justifyContentSpaceAround):
(.justifyContentSpaceEvenly):
(.justifyContentStretch):
(.justifyContentSafeCenter):
(.justifyContentUnsafeCenter):
(.justifyContentSafeEnd):
(.justifyContentUnsafeEnd):
(.justifyContentSafeRight):
(.justifyContentUnsafeRight):
(.justifyContentSafeLeft):
(.justifyContentUnsafeLeft):
(.justifyContentSafeFlexEnd):
(.justifyContentUnsafeFlexEnd):
(.justifyContentSafeFlexStart):
(.justifyContentUnsafeFlexStart):
(.justifyContentFirstBaseline):
(.itemsNormal):
(.itemsStretch):
(.itemsStart):
(.itemsCenter):
(.itemsEnd):
(.itemsLeft):
(.itemsRight):
(.itemsSelfStart):
(.itemsSelfEnd):
(.itemsBaseline):
(.selfStretch):
(.selfStart):
(.selfEnd):
(.selfCenter):
(.selfRight):
(.selfLeft):
(.selfSelfStart):
(.selfSelfEnd):
(.selfBaseline):
(.contentStart):
(.contentCenter):
(.contentEnd):
(.contentCenterSafe):
(.contentCenterUnsafe):
(.contentEndSafe):
(.contentEndUnsafe):
(.contentSpaceBetween):
(.contentSpaceAround):
(.contentSpaceEvenly):
(.contentStretch):
* web-platform-tests/css/support/b-green.css: Added.
(.b):
* web-platform-tests/css/support/c-red.css: Added.
(.c):
* web-platform-tests/css/support/cat.png: Added.
* web-platform-tests/css/support/green.ico: Added.
* web-platform-tests/css/support/import-green.css: Added.
(.import):
* web-platform-tests/css/support/import-red.css: Added.
(.import):
* web-platform-tests/css/support/pattern-grg-rgr-grg.png: Added.
* web-platform-tests/css/support/pattern-grg-rrg-rgg.png: Added.
* web-platform-tests/css/support/pattern-rgr-grg-rgr.png: Added.
* web-platform-tests/css/support/pattern-tr.png: Added.
* web-platform-tests/css/support/red.ico: Added.
* web-platform-tests/css/support/ruler-h-50%.png: Added.
* web-platform-tests/css/support/ruler-h-50px.png: Added.
* web-platform-tests/css/support/ruler-v-100px.png: Added.
* web-platform-tests/css/support/ruler-v-50px.png: Added.
* web-platform-tests/css/support/square-purple.png: Added.
* web-platform-tests/css/support/square-teal.png: Added.
* web-platform-tests/css/support/square-white.png: Added.
* web-platform-tests/css/support/support/README: Added.
* web-platform-tests/css/support/support/swatch-green.png: Added.
* web-platform-tests/css/support/support/swatch-red.png: Added.
* web-platform-tests/css/support/support/w3c-import.log: Added.
* web-platform-tests/css/support/swatch-blue.png: Added.
* web-platform-tests/css/support/swatch-green.png: Added.
* web-platform-tests/css/support/swatch-lime.png: Added.
* web-platform-tests/css/support/swatch-orange.png: Added.
* web-platform-tests/css/support/swatch-red.png: Added.
* web-platform-tests/css/support/swatch-teal.png: Added.
* web-platform-tests/css/support/swatch-white.png: Added.
* web-platform-tests/css/support/swatch-yellow.png: Added.
* web-platform-tests/css/support/test-bl.png: Added.
* web-platform-tests/css/support/test-br.png: Added.
* web-platform-tests/css/support/test-inner-half-size.png: Added.
* web-platform-tests/css/support/test-outer.png: Added.
* web-platform-tests/css/support/test-tl.png: Added.
* web-platform-tests/css/support/test-tr.png: Added.
* web-platform-tests/css/support/w3c-import.log: Added.

Source/WebCore:

The CSS WG has resolved that it doesn't make sense to define Baseline
Content-Alignment in the inline/main axis.

https://github.com/w3c/csswg-drafts/issues/1184

The spec has been updated so that <baseline-postion> is not valid for
the 'justify-content' property's syntax. This CL updates our parsing
logic to match the new spec, including the parsing logic of the
place-content shorthand.

Additionally, this CL updates the computed value of the
<baseline-position> values to match other browsers.

We don't implement support for <baseline-position> values in the
Content Distribution properties (align-content and justify-content),
so I don't expect this change to break content of sites using the CSS
Box Alignment feature.

No new tests, just adapt the Web Platform Tests we already have to the new CSS syntax.

* css/parser/CSSPropertyParser.cpp:
(WebCore::getBaselineKeyword):
(WebCore::consumeBaselineKeyword):
(WebCore::consumeContentDistributionOverflowPosition):
(WebCore::consumeSelfPositionOverflowPosition):
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::consumeSimplifiedContentPosition):
(WebCore::CSSPropertyParser::consumePlaceContentShorthand):
(WebCore::consumeSimplifiedItemPosition):

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

19 months agoUnreviewed test gardening.
fred.wang@free.fr [Tue, 30 Jan 2018 14:56:44 +0000 (14:56 +0000)]
Unreviewed test gardening.

Patch by Frederic Wang <fwang@igalia.com> on 2018-01-30

* TestExpectations: Add Bugzilla references for scrollingElement-quirks-dynamic tests.

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

19 months agoUnreviewed WPE test gardening
mcatanzaro@igalia.com [Tue, 30 Jan 2018 13:54:57 +0000 (13:54 +0000)]
Unreviewed WPE test gardening

This test now has a global flakiness expectation

* platform/wpe/TestExpectations:

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

19 months agoUnreviewed, try to fix JSCOnly build
utatane.tea@gmail.com [Tue, 30 Jan 2018 13:43:10 +0000 (13:43 +0000)]
Unreviewed, try to fix JSCOnly build
https://bugs.webkit.org/show_bug.cgi?id=177202

* CMakeLists.txt:

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

19 months agoUnreviewed. Try to avoid webdriver tests step timing out in the bots.
carlosgc@webkit.org [Tue, 30 Jan 2018 13:29:32 +0000 (13:29 +0000)]
Unreviewed. Try to avoid webdriver tests step timing out in the bots.

The process itself doesn't seem to be timing out, but the buildbot is always reporting the step as finished
after timeout. I think there's a race condition or something in buildbot, and it keeps watching the json log
file even when it has already been written. This is a speculative workaround, assuming that's the problem, that
creates the json file before running the tests. I'll revert this if it doesn't fix the issue in the end.

* Scripts/run-webdriver-tests:
* Scripts/webkitpy/webdriver_tests/webdriver_test_runner.py:
(WebDriverTestRunner.dump_results_to_json_file):

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

19 months agoUse document.scrollingElement to access viewport scroll properties in tests
fred.wang@free.fr [Tue, 30 Jan 2018 13:05:44 +0000 (13:05 +0000)]
Use document.scrollingElement to access viewport scroll properties in tests
https://bugs.webkit.org/show_bug.cgi?id=182241

Patch by Frederic Wang <fwang@igalia.com> on 2018-01-30
Reviewed by Antonio Gomes.

Many tests use document.body in standard mode in order to access scroll properties of the
viewport. This is incorrect per the CSSOM View specification but WebKit does not follow the
spec at the moment (see bug 5991). This replaces several of these instances with
document.scrollingElement, so that tests will still work when WebKit's behavior is changed.
LayoutTests/imported/w3c:

The change in that web-platform-tests test are imported from
https://github.com/w3c/web-platform-tests/commit/fc33ef7641427a3f1388093c54b24f292c21b34d

* web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/003.html:

LayoutTests:

* fast/multicol/scrolling-overflow.html:
* fast/scrolling/latching/iframe_in_iframe.html:
* fast/scrolling/latching/scroll-div-no-latching.html:
* fast/scrolling/latching/scroll-latched-nested-div.html:
* fast/scrolling/latching/scroll-nested-iframe.html:
* http/tests/navigation/anchor-frames-expected.txt:
* http/tests/navigation/anchor-frames-gbk-expected.txt:
* http/tests/navigation/anchor-frames-same-origin-expected.txt:
* http/tests/navigation/resources/frame-with-anchor-gbk.html:
* http/tests/navigation/resources/frame-with-anchor-same-origin.html:
* http/tests/navigation/resources/frame-with-anchor.html:
* tiled-drawing/resources/scroll-and-load-page.html:
* tiled-drawing/scrolling/fast-scroll-mainframe-zoom.html:
* tiled-drawing/scrolling/frames/resources/autoscrolling-frame-with-fixed.html:
* tiled-drawing/scrolling/iframe_in_iframe.html:
* tiled-drawing/tiled-drawing-scroll-position-page-cache-restoration-expected.txt:

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

19 months agoUnreviewed, update test262 expects
utatane.tea@gmail.com [Tue, 30 Jan 2018 12:55:17 +0000 (12:55 +0000)]
Unreviewed, update test262 expects
https://bugs.webkit.org/show_bug.cgi?id=182232

* test262.yaml:

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

19 months ago[JSC] Implement trimStart and trimEnd
utatane.tea@gmail.com [Tue, 30 Jan 2018 12:06:24 +0000 (12:06 +0000)]
[JSC] Implement trimStart and trimEnd
https://bugs.webkit.org/show_bug.cgi?id=182233

Reviewed by Mark Lam.

JSTests:

* stress/trim.js: Added.
(shouldBe):
(startTest):
(endTest):
(trimTest):

Source/JavaScriptCore:

String.prototype.{trimStart,trimEnd} are now stage 3[1].
String.prototype.{trimLeft,trimRight} are alias to these functions.

We rename these functions to trimStart and trimEnd, and put them as
trimLeft and trimRight too.

[1]: https://tc39.github.io/proposal-string-left-right-trim/

* runtime/StringPrototype.cpp:
(JSC::StringPrototype::finishCreation):
(JSC::trimString):
(JSC::stringProtoFuncTrim):
(JSC::stringProtoFuncTrimStart):
(JSC::stringProtoFuncTrimEnd):
(JSC::stringProtoFuncTrimLeft): Deleted.
(JSC::stringProtoFuncTrimRight): Deleted.

LayoutTests:

* js/Object-getOwnPropertyNames-expected.txt:
* js/script-tests/Object-getOwnPropertyNames.js:

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

19 months ago[WinCairo] Fix forwarding header conflict of WebKit on WinCairo
commit-queue@webkit.org [Tue, 30 Jan 2018 11:37:12 +0000 (11:37 +0000)]
[WinCairo] Fix forwarding header conflict of WebKit on WinCairo
https://bugs.webkit.org/show_bug.cgi?id=177202

Patch by Basuke Suzuki <Basuke.Suzuki@sony.com> on 2018-01-30
Reviewed by Alex Christensen.

.:

* Source/cmake/WebKitMacros.cmake:

Source/WebCore:

* PlatformWin.cmake:

Source/WebKit:

* PlatformWin.cmake:

Tools:

* CMakeLists.txt:

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

19 months agoShould fetch owner commits in build-requests-fetcher.
dewei_zhu@apple.com [Tue, 30 Jan 2018 10:07:04 +0000 (10:07 +0000)]
Should fetch owner commits in build-requests-fetcher.
https://bugs.webkit.org/show_bug.cgi?id=182266

Reviewed by Ryosuke Niwa.

In a build request, owner commit of a commit is not always one of a commit in the commit set.
Build request api should contain owner commits in the 'commits' field of the return value.

* public/include/build-requests-fetcher.php: Added logic to fetch owner commits and added them into 'commits'.
* server-tests/api-build-requests-tests.js: Added a unit test.
* server-tests/resources/mock-data.js:
(MockData.set addTestGroupWithOwnerCommitNotInCommitSet): Added a test group with a build request, the commit set of which does
not contain owner commit of one commit.

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

19 months agoA disallowed user-installed font may be used if its PostScript name is specified
mmaxfield@apple.com [Tue, 30 Jan 2018 09:01:28 +0000 (09:01 +0000)]
A disallowed user-installed font may be used if its PostScript name is specified
https://bugs.webkit.org/show_bug.cgi?id=180951

Reviewed by Brent Fulgham.

Source/WebCore:

This patch adds a new CoreText font attribute, kCTFontFallbackOptionAttribute, to the
fonts which WebKit creates. It also adds this attribute to web fonts, so that font
fallback will happen according to our rules about user-installed fonts. It also marks
these font attributes as "mandatory" so CoreText will be guaranteed to follow the
policy.

Test: fast/text/user-installed-fonts/disable.html

* platform/graphics/FontCache.h:
(WebCore::FontDescriptionKey::makeFlagsKey):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontDatabase::collectionForFamily):
(WebCore::FontDatabase::fontForPostScriptName):
(WebCore::addAttributesForUserInstalledFonts):
(WebCore::mandatoryAttributesForUserInstalledFonts):
* platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::fontPlatformData):

Source/WebCore/PAL:

* pal/spi/cocoa/CoreTextSPI.h:

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

19 months ago[JSC] Relax line terminators in String to make JSON subset of JS
utatane.tea@gmail.com [Tue, 30 Jan 2018 07:34:44 +0000 (07:34 +0000)]
[JSC] Relax line terminators in String to make JSON subset of JS
https://bugs.webkit.org/show_bug.cgi?id=182232

Reviewed by Keith Miller.

JSTests:

* ChakraCore/test/es5/Lex_u3.baseline-jsc:
* stress/relaxed-line-terminators-in-string.js: Added.
(shouldBe):

Source/JavaScriptCore:

"Subsume JSON" spec is now stage 3[1]. Before this spec change,
JSON can accept \u2028 / \u2029 in string while JS cannot do that.
It accidentally made JSON non subset of JS.

Now we extend our JS string to accept \u2028 / \u2029 to make JSON
subset of JS in this spec change.

[1]: https://github.com/tc39/proposal-json-superset

* parser/Lexer.cpp:
(JSC::Lexer<T>::parseStringSlowCase):

LayoutTests:

* sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A2.3-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A2.3.html:
* sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A2.4-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A2.4.html:

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

19 months agoWebDriver: evaluateJavaScriptFunction should return null when return value is undefined
carlosgc@webkit.org [Tue, 30 Jan 2018 06:32:38 +0000 (06:32 +0000)]
WebDriver: evaluateJavaScriptFunction should return null when return value is undefined
https://bugs.webkit.org/show_bug.cgi?id=180350

Reviewed by Carlos Alberto Lopez Perez.

Source/WebDriver:

Stop handling the empty string as a special case of evaluateJavaScriptFunction result.

* Session.cpp:
(WebDriver::Session::executeScript):

Source/WebKit:

undefined can't be converted to JSON string, in which case JSON.stringify() returns undefined and we handle that
case to return an empty string. We currently handle this case for execute script commands, but not in all other
cases where we use evaluateJavaScriptFunction. It would be simpler if evaluateJavaScriptFunction returned null,
because in that case we wouldn't need to handle it as a special case.

15.2 Executing Script
https://w3c.github.io/webdriver/webdriver-spec.html#dfn-json-clone

Fixes: imported/w3c/webdriver/tests/state/get_element_property.py::test_element_non_existent

* WebProcess/Automation/WebAutomationSessionProxy.js:
(let.AutomationSessionProxy.prototype._jsonStringify): Return "null" instead of "" when undefined is given.

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

19 months agoRelease assert in updateLayout while waiting for sync reply to WebPageProxy::HasInsec...
rniwa@webkit.org [Tue, 30 Jan 2018 05:56:36 +0000 (05:56 +0000)]
Release assert in updateLayout while waiting for sync reply to WebPageProxy::HasInsecureContent
https://bugs.webkit.org/show_bug.cgi?id=182273

Reviewed by Chris Dumez.

The assertion was caused by unrelated sync IPCs being processed while WebContent process is waiting for
the reply to WebPageProxy::HasInsecureContent. Since this IPC can be used while creating CachedFrame,
it's not safe to execute arbitrary code.

Fixed the bug by using DoNotProcessIncomingMessagesWhenWaitingForSyncReply added in r227566.

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

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

19 months agoAdd a build step to copy resources from WebKitAdditions as bundle resources in WebKit
wenson_hsieh@apple.com [Tue, 30 Jan 2018 05:36:38 +0000 (05:36 +0000)]
Add a build step to copy resources from WebKitAdditions as bundle resources in WebKit
https://bugs.webkit.org/show_bug.cgi?id=182268
<rdar://problem/37003784>

Reviewed by Tim Horton and Dan Bernstein.

Adds a "Copy Additional Resources" phase when building WebKit. This phase copies resources from
usr/local/include/WebKitAdditions/WebKit/AdditionalResources in the build directory into the
unlocalized resources directory. If the AdditionalResources directory does not exist in the build
directory, we fall back to searching the SDK.

* WebKit.xcodeproj/project.pbxproj:

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

19 months agoServiceWorkerClientFetch should not consider responses without Location headers as...
commit-queue@webkit.org [Tue, 30 Jan 2018 02:15:14 +0000 (02:15 +0000)]
ServiceWorkerClientFetch should not consider responses without Location headers as redirection responses
https://bugs.webkit.org/show_bug.cgi?id=182134

Patch by Youenn Fablet <youenn@apple.com> on 2018-01-29
Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* web-platform-tests/service-workers/service-worker/navigation-redirect.https-expected.txt:

Source/WebKit:

As per fetch spec, a response with a redirection status code but no Location header should not be considered as a redirection.
This is also consistent with SubresourceLoader::didReceiveResponse.

* WebProcess/Storage/ServiceWorkerClientFetch.cpp:
(WebKit::ServiceWorkerClientFetch::didReceiveResponse):

LayoutTests:

* TestExpectations:

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

19 months agoStyleBench: Remove : from a test name
antti@apple.com [Tue, 30 Jan 2018 02:04:09 +0000 (02:04 +0000)]
StyleBench: Remove : from a test name
https://bugs.webkit.org/show_bug.cgi?id=182258

Reviewed by Ryosuke Niwa.

It breaks reporting.

* StyleBench/resources/style-bench.js:
(nthPseudoClassConfiguration):

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

19 months agoCache API should make sure to resolve caches.open promises in the same order as called
commit-queue@webkit.org [Tue, 30 Jan 2018 01:41:22 +0000 (01:41 +0000)]
Cache API should make sure to resolve caches.open promises in the same order as called
https://bugs.webkit.org/show_bug.cgi?id=182193
<rdar://problem/36930363>

Patch by Youenn Fablet <youenn@apple.com> on 2018-01-29
Reviewed by Chris Dumez.

Source/WebCore:

Covered by LayoutTests/http/wpt/cache-storage/cache-open-delete-in-parallel.https.html.

* Modules/cache/DOMCacheStorage.cpp:
(WebCore::DOMCacheStorage::doRemove): Removed optimization consisting in removing the cache from DOMCacheStorage object synchronously.
This optimization prevents going to the network process to try deleting the cache.

Source/WebKit:

Covered by added test.
Whenever opening/removing a cache requires writing to disk, wait to finish the task
until any disk writing task is done.
Applying this strategy when clearing data so that we also clear data that is pending to be written.
For removing cache, we now return whether a cache was actually deleted by returning zero as removed cache identifier.
WebCore uses that information to return true/false as promise resolution value.

* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::retrieveCaches):
* NetworkProcess/cache/CacheStorageEngineCaches.cpp:
(WebKit::CacheStorage::Caches::clear):
(WebKit::CacheStorage::Caches::open):
(WebKit::CacheStorage::Caches::remove):
(WebKit::CacheStorage::Caches::writeCachesToDisk):
(WebKit::CacheStorage::Caches::cacheInfos):
(WebKit::CacheStorage::Caches::cacheInfos const): Deleted.
* NetworkProcess/cache/CacheStorageEngineCaches.h:
(WebKit::CacheStorage::Caches::createWeakPtr):

LayoutTests:

* http/wpt/cache-storage/cache-open.https-expected.txt: Added.
* http/wpt/cache-storage/cache-open.https.html: Added.

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

19 months agoTemporarily skip StyleBench until webkit.org/b/182088 is fixed.
rniwa@webkit.org [Tue, 30 Jan 2018 01:38:23 +0000 (01:38 +0000)]
Temporarily skip StyleBench until webkit.org/b/182088 is fixed.

* Skipped:

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

19 months agoMarked imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element...
jlewis3@apple.com [Tue, 30 Jan 2018 01:33:24 +0000 (01:33 +0000)]
Marked imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/errorhandling.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=182177

Unreviewed test expectations.

* TestExpectations:

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

19 months agoClean up API after bugs 178240 and 176474
achristensen@apple.com [Tue, 30 Jan 2018 01:27:18 +0000 (01:27 +0000)]
Clean up API after bugs 178240 and 176474
https://bugs.webkit.org/show_bug.cgi?id=182259

Reviewed by Dan Bernstein.

Source/WebKit:

NS_OPTIONS should be NSUInteger, not NSInteger.  This is how all other NS_OPTIONS in WebKit are,
and it's necessary if we get really big numbers as options.  Changing them won't cause binary
incompatibility unless someone does signed integer comparison with currently invalid values.

Added availability macros I forgot to add earlier.

* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/API/Cocoa/WKWebViewPrivate.h:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm:
(TEST):
(-[PinnedStateObserver observeValueForKeyPath:ofObject:change:context:]):

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

19 months ago[WebAuthN] Add a compile-time feature flag
jiewen_tan@apple.com [Tue, 30 Jan 2018 01:20:17 +0000 (01:20 +0000)]
[WebAuthN] Add a compile-time feature flag
https://bugs.webkit.org/show_bug.cgi?id=182211
<rdar://problem/36936365>

Reviewed by Brent Fulgham.

.:

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

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

Add a compile-time feature flag for WebAuthN as most of the functionality is platform
dependent.

No tests.

* Configurations/FeatureDefines.xcconfig:
* Modules/credentialmanagement/BasicCredential.cpp:
* Modules/credentialmanagement/BasicCredential.h:
* Modules/credentialmanagement/BasicCredential.idl:
* Modules/credentialmanagement/CredentialCreationOptions.h:
* Modules/credentialmanagement/CredentialCreationOptions.idl:
* Modules/credentialmanagement/CredentialRequestOptions.h:
* Modules/credentialmanagement/CredentialRequestOptions.idl:
* Modules/credentialmanagement/CredentialsContainer.cpp:
* Modules/credentialmanagement/CredentialsContainer.h:
* Modules/credentialmanagement/CredentialsContainer.idl:
* Modules/credentialmanagement/NavigatorCredentials.cpp:
* Modules/credentialmanagement/NavigatorCredentials.h:
* Modules/credentialmanagement/NavigatorCredentials.idl:
* Modules/webauthn/Authenticator.cpp:
* Modules/webauthn/Authenticator.h:
* Modules/webauthn/AuthenticatorAssertionResponse.cpp:
* Modules/webauthn/AuthenticatorAssertionResponse.h:
* Modules/webauthn/AuthenticatorAssertionResponse.idl:
* Modules/webauthn/AuthenticatorAttestationResponse.cpp:
* Modules/webauthn/AuthenticatorAttestationResponse.h:
* Modules/webauthn/AuthenticatorAttestationResponse.idl:
* Modules/webauthn/AuthenticatorResponse.cpp:
* Modules/webauthn/AuthenticatorResponse.h:
* Modules/webauthn/AuthenticatorResponse.idl:
* Modules/webauthn/PublicKeyCredential.cpp:
* Modules/webauthn/PublicKeyCredential.h:
* Modules/webauthn/PublicKeyCredential.idl:
* Modules/webauthn/PublicKeyCredentialCreationOptions.h:
* Modules/webauthn/PublicKeyCredentialCreationOptions.idl:
* Modules/webauthn/PublicKeyCredentialDescriptor.h:
* Modules/webauthn/PublicKeyCredentialDescriptor.idl:
* Modules/webauthn/PublicKeyCredentialRequestOptions.h:
* Modules/webauthn/PublicKeyCredentialRequestOptions.idl:
* Modules/webauthn/PublicKeyCredentialType.h:
* Modules/webauthn/PublicKeyCredentialType.idl:
* bindings/js/JSAuthenticatorResponseCustom.cpp:
* bindings/js/JSBasicCredentialCustom.cpp:

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:

Tools:

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

LayoutTests:

Skip WebAuthN related tests on certain platforms as they won't
support it immediately.

* platform/gtk/TestExpectations:
* platform/ios-wk1/TestExpectations:
* platform/mac-wk1/TestExpectations:
* platform/win/TestExpectations:
* platform/wpe/TestExpectations:

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

19 months agoMark webrtc/captureCanvas-webrtc.html as flaky on macOS.
ryanhaddad@apple.com [Tue, 30 Jan 2018 00:37:10 +0000 (00:37 +0000)]
Mark webrtc/captureCanvas-webrtc.html as flaky on macOS.
https://bugs.webkit.org/show_bug.cgi?id=181835

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

19 months agoResource Load Statistics: Introduce debug mode as experimental feature
wilander@apple.com [Tue, 30 Jan 2018 00:25:58 +0000 (00:25 +0000)]
Resource Load Statistics: Introduce debug mode as experimental feature
https://bugs.webkit.org/show_bug.cgi?id=182199
<rdar://problem/36930364>

Reviewed by Alex Christensen.

Source/WebCore:

No new tests. This adds an experimental feature.

The only changes to default behavior are:
- Increased resolution on timestamps which is needed to be able to set shorter
  timeouts in debug mode.
- Only update partitioning and blocking table when needed. This is an optimization
  which pays off in less XPC with shorter timeouts.

* loader/ResourceLoadObserver.cpp:
(WebCore::reduceTimeResolution):
(WebCore::ResourceLoadObserver::logFrameNavigation):
(WebCore::ResourceLoadObserver::logSubresourceLoading):
(WebCore::ResourceLoadObserver::logWebSocketLoading):
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
(WebCore::reduceToHourlyTimeResolution): Deleted.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setResourceLoadStatisticsDebugMode):
(WebCore::RuntimeEnabledFeatures::resourceLoadStatisticsDebugMode const):
* page/Settings.yaml:

Source/WebKit:

The only changes to default behavior are:
- Increased resolution on timestamps which is needed to be able to set shorter
  timeouts in debug mode.
- Only update partitioning and blocking table when needed. This is an optimization
  which pays off in less XPC with shorter timeouts.

* Shared/WebPreferences.yaml:
* UIProcess/API/APIWebsiteDataStore.cpp:
(API::WebsiteDataStore::resourceLoadStatisticsDebugMode const):
(API::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
* UIProcess/API/APIWebsiteDataStore.h:
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetResourceLoadStatisticsDebugMode):
* UIProcess/API/C/WKWebsiteDataStoreRef.h:
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _resourceLoadStatisticsDebugMode]):
(-[WKWebsiteDataStore _setResourceLoadStatisticsDebugMode:]):
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
(WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
* UIProcess/WebResourceLoadStatisticsStore.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::resourceLoadStatisticsDebugMode const):
(WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
* UIProcess/WebsiteData/WebsiteDataStore.h:

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

19 months agoSwitch grandfathering layout test to trigger on data record scanning instead of data...
wilander@apple.com [Tue, 30 Jan 2018 00:16:46 +0000 (00:16 +0000)]
Switch grandfathering layout test to trigger on data record scanning instead of data record modification
https://bugs.webkit.org/show_bug.cgi?id=181482
<rdar://problem/36549026>

Unreviewed test gardening.

* http/tests/resourceLoadStatistics/grandfathering.html:
    Switched from
    testRunner.installStatisticsDidModifyDataRecordsCallback()
    to
    testRunner.installStatisticsDidScanDataRecordsCallback().
* platform/mac-wk2/TestExpectations:
    Marked as [ Pass ] again.

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

19 months agoFetchResponse should support ConsumeData callback on chunk data is received: handling...
gskachkov@gmail.com [Mon, 29 Jan 2018 23:39:21 +0000 (23:39 +0000)]
FetchResponse should support ConsumeData callback on chunk data is received: handling ReadableStream bodies
https://bugs.webkit.org/show_bug.cgi?id=182008

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

* web-platform-tests/service-workers/service-worker/fetch-event-respond-with-readable-stream-chunk.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/fetch-event-respond-with-readable-stream-chunk.https.html: Added.
* web-platform-tests/service-workers/service-worker/resources/fetch-event-respond-with-readable-stream-chunk-iframe.html: Added.
* web-platform-tests/service-workers/service-worker/resources/fetch-event-respond-with-readable-stream-chunk-worker.js: Added.
(const.process):
(this.step):
(this.run):
(const.asyncSteps):

Source/WebCore:

Modify FetchResponse to support ConsumeData callback with
handling of ReadableStream by chunks

* Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::put):
* Modules/fetch/FetchBodyConsumer.cpp:
(WebCore::FetchBodyConsumer::resolve):
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::consumeBodyFromReadableStream):
* Modules/fetch/FetchResponse.h:
* Modules/streams/ReadableStreamChunk.h: Added.
* Modules/streams/ReadableStreamSink.cpp:
(WebCore::ReadableStreamToSharedBufferSink::enqueue):
(WebCore::ReadableStreamToSharedBufferSink::close):
* Modules/streams/ReadableStreamSink.h:
* WebCore.xcodeproj/project.pbxproj:
* workers/service/context/ServiceWorkerFetch.cpp:
(WebCore::ServiceWorkerFetch::processResponse):

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

19 months ago[iOS] Restrict synthetic clicks to the origin that handled the underlying touch event
aestes@apple.com [Mon, 29 Jan 2018 23:20:05 +0000 (23:20 +0000)]
[iOS] Restrict synthetic clicks to the origin that handled the underlying touch event
https://bugs.webkit.org/show_bug.cgi?id=182252
<rdar://problem/21555881>

Reviewed by Tim Horton.

Source/WebCore:

Test: http/tests/events/touch/ios/cross-frame-single-tap-same-origin.https.html

* dom/Document.h:
(WebCore::Document::handlingTouchEvent const):
* page/EventHandler.h:
(WebCore::EventHandler::touchEventTargetSubframe const):
(WebCore::EventHandler::touches const):

Exposed some information needed by WebPage::updatePotentialTapSecurityOrigin().

* page/Frame.h:
* page/ios/FrameIOS.mm:
(WebCore::Frame::betterApproximateNode):
(WebCore::Frame::qualifyingNodeAtViewportLocation):

Changed NodeQualifier from a function pointer to a WTF::Function.

(WebCore::Frame::nodeRespondingToClickEvents):

Turned ancestorRespondingToClickEvents() into a lambda that captures originRestriction. In
the lambda, if there is an origin restriction, return nullptr if the hit test result's inner
Node is not in the restricted origin.

(WebCore::Frame::nodeRespondingToScrollWheelEvents):

Turned ancestorRespondingToScrollWheelEvents() into a lambda.

(WebCore::ancestorRespondingToScrollWheelEvents):

Moved to lambda in nodeRespondingToScrollWheelEvents().

(WebCore::ancestorRespondingToClickEvents):

Moved to lambda in nodeRespondingToClickEvents().

Source/WebKit:

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::dispatchTouchEvent):
(WebKit::WebPage::updatePotentialTapSecurityOrigin):

Record the target frame origin of touch events that are potential taps, are
TouchStart events, are targeted in frames that have touch event listeners, and are not
handled by those listeners.

* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::potentialTapAtPosition):
(WebKit::WebPage::commitPotentialTap):
(WebKit::WebPage::cancelPotentialTapInFrame):

Passed the target frame origin to Frame::nodeRespondingToClickEvents() then cleared it.

LayoutTests:

* TestExpectations:
* http/tests/events/touch/ios/cross-frame-single-tap-same-origin.https-expected.txt: Added.
* http/tests/events/touch/ios/cross-frame-single-tap-same-origin.https.html: Added.
* http/tests/events/touch/ios/resources/click-target.html: Added.

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

19 months agoMake policy checks more robust against null pointer dereferencing
achristensen@apple.com [Mon, 29 Jan 2018 23:17:13 +0000 (23:17 +0000)]
Make policy checks more robust against null pointer dereferencing
https://bugs.webkit.org/show_bug.cgi?id=182263
<rdar://problem/34895714>

Reviewed by Tim Horton.

We're still dereferencing null.  Check everything.

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

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

19 months agoTrivially cleanup std::optional usage in RenderBlockFlow.
emilio@crisal.io [Mon, 29 Jan 2018 22:35:06 +0000 (22:35 +0000)]
Trivially cleanup std::optional usage in RenderBlockFlow.
https://bugs.webkit.org/show_bug.cgi?id=182142

Reviewed by Antti Koivisto.

No new tests, no behavior change.

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::firstLineBaseline const):
(WebCore::RenderBlockFlow::inlineBlockBaseline const):

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

19 months agoMake StyleBench compatible with run-benchmark and run-perf-tests
rniwa@webkit.org [Mon, 29 Jan 2018 22:09:07 +0000 (22:09 +0000)]
Make StyleBench compatible with run-benchmark and run-perf-tests
https://bugs.webkit.org/show_bug.cgi?id=182262

Reviewed by Antti Koivisto.

Copied resource files referenced from Speedometer directory since run-benchmark needs to be able
to checkout each benchmark separately.

Removed the code to create tests of the same name five times in makeSteps since this
won't be compatible with either run-benchmark or run-perf-tests.

* StyleBench/index.html: Removed the code to show warnings for local files since run-benchmark
doesn't use HTTP server in WebDriver mode.
* StyleBench/resources/benchmark-report.js: Copied from resources/benchmark-report.js.
* StyleBench/resources/benchmark-runner.js: Copied from resources/benchmark-runner.js.
(BenchmarkRunner.prototype._finalize): Use the correction factor of 8 instead of 5 in StyleBench.
* StyleBench/resources/gauge.png: Copied from resources/gauge.png.
* StyleBench/resources/gauge@2x.png: Copied from resources/gauge@2x.png.
* StyleBench/resources/main.css: Copied from resources/main.css.
* StyleBench/resources/main.js: Copied from resources/main.js.
* StyleBench/resources/tests.js:
(makeSteps): Only make each test once.

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

19 months agoAdd telemetry to track storage access API adoption
bfulgham@apple.com [Mon, 29 Jan 2018 22:00:58 +0000 (22:00 +0000)]
Add telemetry to track storage access API adoption
https://bugs.webkit.org/show_bug.cgi?id=182197
<rdar://problem/35803309>

Reviewed by Chris Dumez.
Source/WebCore:

Part 1: Add telemetry for the user interaction case

This patch adds telemetry to track how frequently third-party cookies are
used in a first party context due to user interaction. This will help
understand cases where the new Storage Access API can help, and to help
us understand if we have considered relevant use cases in its design.

* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::setTimeToLivePartitionFree): Let the observer
know the first party interaction duration.
(WebCore::ResourceLoadObserver::wasAccessedWithinInteractionWindow const): Added.
(WebCore::ResourceLoadObserver::logFrameNavigation): Note when a third party
resource is accessed as a first party due to user interaction.
(WebCore::ResourceLoadObserver::logSubresourceLoading): Ditto.
* loader/ResourceLoadObserver.h:
* loader/ResourceLoadStatistics.cpp:
(WebCore::ResourceLoadStatistics::encode const): Handle new fields.
(WebCore::ResourceLoadStatistics::decode): Ditto.
* loader/ResourceLoadStatistics.h:

Source/WebKit:

Part 1: Add telemetry for the user interaction case

This patch adds telemetry to track how frequently third-party cookies are
used in a first party context due to user interaction. This will help
understand cases where the new Storage Access API can help, and to help
us understand if we have considered relevant use cases in its design.

* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode const):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess):
* UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
(WebKit::sortedPrevalentResourceTelemetry): Update for new telemetry.
(WebKit::submitTopList): Update for new data types.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess): Handle the partitioning time
passed from the UIProcess.

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

19 months agoFix crash when during canAuthenticateAgainstProtectionSpace
achristensen@apple.com [Mon, 29 Jan 2018 21:58:31 +0000 (21:58 +0000)]
Fix crash when during canAuthenticateAgainstProtectionSpace
https://bugs.webkit.org/show_bug.cgi?id=182260
<rdar://problem/34911343>

Reviewed by Chris Dumez.

If we have a valid network load with no challenge completion handler and we are
telling it to continue with the challenge handling, something has gone wrong.
Maybe we've just recovered from a crashed network process.  If this happens, do nothing.

* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):

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

19 months agoCalcExpressionBlendLength::evaluate hits stack limit
antti@apple.com [Mon, 29 Jan 2018 21:46:02 +0000 (21:46 +0000)]
CalcExpressionBlendLength::evaluate hits stack limit
https://bugs.webkit.org/show_bug.cgi?id=182243

Reviewed by Zalan Bujtas.

Speculative fix to prevent nesting of CalcExpressionBlendLength.

No test, don't know how to make one.

* platform/CalculationValue.cpp:
(WebCore::CalcExpressionBlendLength::CalcExpressionBlendLength):

CalcExpressionBlendLength is only used in Length values of animated style. Normally such styles are not used
as input for further blending but there are some paths where this could in principle happen. Repeated
application (for each animation frame) could construct CalcExpressionBlendLength expression that blows
the stack when evaluated.

Speculatively fix by flattening any nesting.

* platform/CalculationValue.h:
(WebCore::CalcExpressionBlendLength::CalcExpressionBlendLength): Deleted.

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

19 months agoWarning in 32-bit WebKit build when trying to link to SafariSafeBrowsing
commit-queue@webkit.org [Mon, 29 Jan 2018 21:32:41 +0000 (21:32 +0000)]
Warning in 32-bit WebKit build when trying to link to SafariSafeBrowsing
https://bugs.webkit.org/show_bug.cgi?id=182251
rdar://problem/36964995

Patch by Zach Li <zacharyli323@gmail.com> on 2018-01-29
Reviewed by Alex Christensen.

* Configurations/WebKit.xcconfig:
Only link against SafariSafeBrowsing framework in 64-bit architecture.

* Platform/spi/Cocoa/SafeBrowsingSPI.h:
Guard the Safe Browsing code with WK_API_ENABLED.

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

19 months agoMake sure we do not re-enter Webcore during StorageToWebProcessConnection::EstablishS...
cdumez@apple.com [Mon, 29 Jan 2018 21:20:49 +0000 (21:20 +0000)]
Make sure we do not re-enter Webcore during StorageToWebProcessConnection::EstablishSWServerConnection Sync IPC
https://bugs.webkit.org/show_bug.cgi?id=182256
<rdar://problem/36689233>

Reviewed by Simon Fraser.

Make sure we do not re-enter Webcore during StorageToWebProcessConnection::EstablishSWServerConnection Sync IPC as
this can lead to crashes such as the one in <rdar://problem/36689233>.

* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::WebSWClientConnection):

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

19 months agoAdd the support for reporting Speedometer 2.0 results to perf dashboard
rniwa@webkit.org [Mon, 29 Jan 2018 20:38:37 +0000 (20:38 +0000)]
Add the support for reporting Speedometer 2.0 results to perf dashboard
https://bugs.webkit.org/show_bug.cgi?id=182089
<rdar://problem/36172346>

Rubber-stamped by Chris Dumez.

Apparently, this has always worked since the very first version of the perf dashboard added in r163688.
The relevant code is at the line 313 of report-processor.php now.

Added regression tests for this feature since we didn't have any tests four years ago.

* server-tests/api-report-tests.js:

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

19 months agoREGRESSION(r225898): The perf dashboard fails to open when there are no summary pages
rniwa@webkit.org [Mon, 29 Jan 2018 20:35:11 +0000 (20:35 +0000)]
REGRESSION(r225898): The perf dashboard fails to open when there are no summary pages
https://bugs.webkit.org/show_bug.cgi?id=182210

Rubber-stamped by Chris Dumez.

The bug was caused by TestFreshnessPage unconditionally assuming that summaryPageConfiguration is set.
Fixed it by not creating TestFreshnessPage when there are no summary pages specified.

Also modernized the code to use const & let instead of var.

* public/v3/main.js:
(main):

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

19 months agoMake the API test added in r227737 be Mac-only.
beidson@apple.com [Mon, 29 Jan 2018 20:34:38 +0000 (20:34 +0000)]
Make the API test added in r227737 be Mac-only.

Unreviewed gardening.

* TestWebKitAPI/Tests/WebKitCocoa/MessagePortProviders.mm:

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

19 months agoPerf dashboard's page title can be set to a previously visited page
rniwa@webkit.org [Mon, 29 Jan 2018 20:31:06 +0000 (20:31 +0000)]
Perf dashboard's page title can be set to a previously visited page
https://bugs.webkit.org/show_bug.cgi?id=182209

Rubber-stamped by Chris Dumez.

Before this patch, opening a page and navigating away from it could result in the page title
getting set to that of the previously visited page after the new page had been opened.

This bug was caused by Page.render keep setting document.title even though the page is no longer
the currently open page of the router. Fixed it by exiting early in Page.enqueueToRender when
this page is not the currently open page of the router.

Also added basic tests for Page.

* browser-tests/index.html:
* browser-tests/page-tests.js: Added.
* public/v3/pages/page.js:
(Page): Removed the unused second constructor argument.
(Page.prototype.enqueueToRender): Fixed the bug.
(Page.prototype.render): Use const instead of var.

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

19 months agoCommitLogViewer should not fetch commits in serial
rniwa@webkit.org [Mon, 29 Jan 2018 20:27:56 +0000 (20:27 +0000)]
CommitLogViewer should not fetch commits in serial
https://bugs.webkit.org/show_bug.cgi?id=182207

Rubber-stamped by Chris Dumez.

Fetch both the commits in the range as well as the preceding commit at once instead of
fetching the preceding commit only after the commits in the range had been fetched.

* browser-tests/commit-log-viewer-tests.js: Fixed the tcoest case after r224227.
* public/v3/components/commit-log-viewer.js:
(CommitLogViewer.prototype._fetchCommitLogs): Fetch commits in parallel.

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

19 months agoDrop unnecessary "ServiceWorker Task Thread" in SWServer
cdumez@apple.com [Mon, 29 Jan 2018 19:45:30 +0000 (19:45 +0000)]
Drop unnecessary "ServiceWorker Task Thread" in SWServer
https://bugs.webkit.org/show_bug.cgi?id=182253

Reviewed by Youenn Fablet.

Drop unnecessary "ServiceWorker Task Thread" in SWServer. We're spinning a thread for
each SWServer that is never used.

* workers/service/server/SWServer.cpp:
(WebCore::SWServer::~SWServer):
(WebCore::SWServer::SWServer):
(WebCore::SWServer::taskThreadEntryPoint): Deleted.
(WebCore::SWServer::postTask): Deleted.
(WebCore::SWServer::postTaskReply): Deleted.
(WebCore::SWServer::handleTaskRepliesOnMainThread): Deleted.
* workers/service/server/SWServer.h:

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

19 months ago[GTK] Zooming gesture incorrectly uses scale instead of zoom
commit-queue@webkit.org [Mon, 29 Jan 2018 19:29:08 +0000 (19:29 +0000)]
[GTK] Zooming gesture incorrectly uses scale instead of zoom
https://bugs.webkit.org/show_bug.cgi?id=182174

Patch by Jan-Michael Brummer <jan.brummer@tabos.org> on 2018-01-29
Reviewed by Michael Catanzaro.

Switch zooming gesture to use zoom instead of scale function.

* UIProcess/gtk/GestureController.cpp:
(WebKit::GestureController::ZoomGesture::begin):
(WebKit::GestureController::ZoomGesture::handleZoom):

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

19 months agoUnreviewed, rolling out r227731.
jlewis3@apple.com [Mon, 29 Jan 2018 19:27:06 +0000 (19:27 +0000)]
Unreviewed, rolling out r227731.

This caused and assertion failure in API tests.

Reverted changeset:

"Layout Test fast/events/beforeunload-dom-manipulation-
crash.html is crashing"
https://bugs.webkit.org/show_bug.cgi?id=181204
https://trac.webkit.org/changeset/227731

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

19 months agoREGRESSION (r227341): DFG_ASSERT failure at JSC::DFG::AtTailAbstractState::forNode()
msaboff@apple.com [Mon, 29 Jan 2018 19:13:45 +0000 (19:13 +0000)]
REGRESSION (r227341): DFG_ASSERT failure at JSC::DFG::AtTailAbstractState::forNode()
https://bugs.webkit.org/show_bug.cgi?id=182249

Reviewed by Keith Miller.

JSTests:

New regression test.

* stress/compare-clobber-untypeduse.js: Added.

Source/JavaScriptCore:

Changed clobberize() handling of CompareEq, et al to properly handle comparisons between
Untyped and Object values when compared against built in types.  Such comparisons can
invoke toNumber() or other methods.

* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):

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

19 months agoMove http/wpt/service-workers/clone-opaque-being-loaded-response.https.html to use...
commit-queue@webkit.org [Mon, 29 Jan 2018 18:37:48 +0000 (18:37 +0000)]
Move http/wpt/service-workers/clone-opaque-being-loaded-response.https.html to use HTTP
https://bugs.webkit.org/show_bug.cgi?id=182202

Patch by Youenn Fablet <youenn@apple.com> on 2018-01-29
Reviewed by Chris Dumez.

Some bots dislike cross origin HTTPS fetches.

* http/wpt/service-workers/clone-opaque-being-loaded-response-expected.txt: Renamed from LayoutTests/http/wpt/service-workers/clone-opaque-being-loaded-response.https-expected.txt.
* http/wpt/service-workers/clone-opaque-being-loaded-response.html: Renamed from LayoutTests/http/wpt/service-workers/clone-opaque-being-loaded-response.https.html.

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

19 months agoWPT test exporter should add WebKit export in its PR description
commit-queue@webkit.org [Mon, 29 Jan 2018 18:37:14 +0000 (18:37 +0000)]
WPT test exporter should add WebKit export in its PR description
https://bugs.webkit.org/show_bug.cgi?id=182246

Patch by Youenn Fablet <youenn@apple.com> on 2018-01-29
Reviewed by Chris Dumez.

Updating PR description body to contain the words 'WebKit export'.
That way, WPT PR bot will mark the PR as reviewed downstream.

* Scripts/webkitpy/w3c/test_exporter.py:
(TestExporter.__init__):
(TestExporter.make_pull_request):
* Scripts/webkitpy/w3c/test_exporter_unittest.py:
(TestExporterTest.test_export):

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

19 months agoAdd the support for running Speedometer 2.0 to run-benchmark
rniwa@webkit.org [Mon, 29 Jan 2018 18:18:37 +0000 (18:18 +0000)]
Add the support for running Speedometer 2.0 to run-benchmark
https://bugs.webkit.org/show_bug.cgi?id=182231

Reviewed by Antti Koivisto.

Made it possible to run Speedometer 2.0 using run-benchmark. To do this, this patch adds the ability to
aggregate results using the differently aggregated values of subtests. In particular, Speedometer 2.0
requires aggregating the geometric mean out of total time spent in each suite.

Also added --show-iteration-values to show individual measured values in each iteration.

* Scripts/webkitpy/benchmark_runner/benchmark_results.py:
(BenchmarkResults.format): Added show_iteration_values as an option.
(BenchmarkResults._format_tests): Ditto.
(BenchmarkResults._format_values): Ditto. Added the code to show the measured values for each iteration
when show_iteration_values is set to True. We don't emit the unit in each value so that the list of values
is easily parsable as a JSON array.
(BenchmarkResults._format_values.format_scaled): Added. A helper function.
(BenchmarkResults._subtest_values_by_config_iteration): Added the support for aggregating values using
the aggregated values of a subtest even when they were computed using a different aggregator if the subtest
had exactly one aggregator.
(BenchmarkResults._lint_results):
(BenchmarkResults._lint_subtest_results): Replaced parent_needing_aggregation, which is set to the parent
test's name only when the parent test had an aggregator, by self-explanatory parent_test and
parent_aggregator_list.
(BenchmarkResults._lint_aggregator_list): Ditto. Added raise an exception when a test has an aggregator but
its subtest doesn't specify the same aggregator or it has more than one aggregators, making it ambiguous.
(BenchmarkResults._lint_configuration):
* Scripts/webkitpy/benchmark_runner/benchmark_results_unittest.py:
(test_format_values_with_no_unit_scaling): Added.
(test_format_values_with_iteration_values): Added.
(test_format_values_with_no_unit_scaling_and_iteration_values): Added.
(test_aggregate_results_from_another_aggregator): Added.
(test_lint_results): Added a test case.
* Scripts/webkitpy/benchmark_runner/benchmark_runner.py:
(BenchmarkRunner.__init__): Added show_iteration_values as an argument.
(BenchmarkRunner._run_benchmark): Ditto.
(BenchmarkRunner.show_results): Ditto.
* Scripts/webkitpy/benchmark_runner/data/patches/webserver/Speedometer2.patch: Added.
* Scripts/webkitpy/benchmark_runner/data/plans/speedometer2.plan: Added.
* Scripts/webkitpy/benchmark_runner/run_benchmark.py:
(parse_args): Added --show-iteration-values as a boolean argument.
(run_benchmark_plan): Ditto.
(start): Ditto.
* Scripts/webkitpy/benchmark_runner/webserver_benchmark_runner.py:
(WebServerBenchmarkRunner.__init__): Ditto.

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

19 months agoUnreviewed, rolling out r227725.
jlewis3@apple.com [Mon, 29 Jan 2018 17:47:30 +0000 (17:47 +0000)]
Unreviewed, rolling out r227725.

This caused internal failures.

Reverted changeset:

"JSC Sampling Profiler: Detect tester and testee when sampling
in RegExp JIT"
https://bugs.webkit.org/show_bug.cgi?id=152729
https://trac.webkit.org/changeset/227725

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

19 months agoMake it possible for apps that use both WK1 and WK2 to use MessagePorts.
beidson@apple.com [Mon, 29 Jan 2018 17:45:17 +0000 (17:45 +0000)]
Make it possible for apps that use both WK1 and WK2 to use MessagePorts.
https://bugs.webkit.org/show_bug.cgi?id=182229

Reviewed by Chris Dumez.

Source/WebCore:

Covered by existing LayoutTests and a new API test.

* dom/messageports/MessagePortChannel.cpp:
(WebCore::MessagePortChannel::checkRemotePortForActivity): Don't use the global singleton
  provider. Instead use the provider that belongs to the owning registry.

* dom/messageports/MessagePortChannelProviderImpl.cpp:
(WebCore::MessagePortChannelProviderImpl::MessagePortChannelProviderImpl): Pass a reference
  to *this to the Registry.
* dom/messageports/MessagePortChannelProviderImpl.h:

* dom/messageports/MessagePortChannelRegistry.cpp:
(WebCore::MessagePortChannelRegistry::MessagePortChannelRegistry): Keep a Provider member so
  MessagePortChannels can get to it instead of relying on the global singleton provider.
* dom/messageports/MessagePortChannelRegistry.h:
(WebCore::MessagePortChannelRegistry::provider):

Source/WebKit:

* UIProcess/UIMessagePortChannelProvider.cpp:
(WebKit::UIMessagePortChannelProvider::UIMessagePortChannelProvider):

* UIProcess/WebPageProxy.cpp:
(WebKit::m_configurationPreferenceValues): The UI process does not need to override the
  global singleton provider. It can remain the default ProviderImpl to allow WK1 views
  to work fine, too.

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/MessagePortProviders.mm: Added.

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

19 months agoUnreviewed WPE test gardening
mcatanzaro@igalia.com [Mon, 29 Jan 2018 16:56:04 +0000 (16:56 +0000)]
Unreviewed WPE test gardening

* platform/wpe/TestExpectations:

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

19 months agoWebDriver: ASSERTION FAILED: !m_loadTimer.isActive()
carlosgc@webkit.org [Mon, 29 Jan 2018 16:47:08 +0000 (16:47 +0000)]
WebDriver: ASSERTION FAILED: !m_loadTimer.isActive()
https://bugs.webkit.org/show_bug.cgi?id=182237

Reviewed by Carlos Alberto Lopez Perez.

We should stop the load timer when we dispatch the pending navigation callbacks due to an alert open.

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::willShowJavaScriptDialog):

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

19 months agoWebDriver: properly recover w3c tests after a webdriver server crash
carlosgc@webkit.org [Mon, 29 Jan 2018 16:45:53 +0000 (16:45 +0000)]
WebDriver: properly recover w3c tests after a webdriver server crash
https://bugs.webkit.org/show_bug.cgi?id=182242

Reviewed by Carlos Alberto Lopez Perez.

When a test makes the webdriver server crash, all other subsequent tests fail because they still try to send
messages to the server, gettin connection refused errors all the time. Selenium tests handle this correctly by
relaunching the server after every test failure, because other failures, even when not crashing the server,
might leave it in an bad state. WPT runner does the same for test files, it uses a subprocess to run the tests
and when any subtest fails, a new subsprocess is used for the following test file. We could do the same.

* Scripts/webkitpy/webdriver_tests/webdriver_test_runner_w3c.py:
(WebDriverTestRunnerW3C.run): Restart the executor if any subtest failed.
* Scripts/webkitpy/webdriver_tests/webdriver_w3c_executor.py:
(WebDriverW3CExecutor.__init__): Save timeout and expectations and do not import pytest.
(WebDriverW3CExecutor.setup): Create a subprocess to run the tests.
(WebDriverW3CExecutor.teardown): Send a message to the subprocess to terminate.
(WebDriverW3CExecutor._runner): Run the tests using pytest runner.
(WebDriverW3CExecutor.run): Send a message to the subprocess to run the given test and return the results message.

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

19 months agoLayout Test fast/events/beforeunload-dom-manipulation-crash.html is crashing
pvollan@apple.com [Mon, 29 Jan 2018 16:02:17 +0000 (16:02 +0000)]
Layout Test fast/events/beforeunload-dom-manipulation-crash.html is crashing
https://bugs.webkit.org/show_bug.cgi?id=181204
<rdar://problem/36256274>

Reviewed by Ryosuke Niwa.

Source/WebCore:

When a frame element is moved in the DOM tree during the execution of a beforeunload handler,
the frame will be detached when removed from its previous position in the DOM tree. When being
detached, an attempt will also be made to stop the load by calling FrameLoader::stopAllLoaders().
However, this method will return early when executed in a beforeunload handler, since navigation
is not allowed then. The end result is a detached frame which will continue to load, and hitting
asserts in DocumentLoader::dataReceived(), and DocumentLoader::notifyFinished(). It should be
possible to stop a frame load, even when executing a beforeunload handler.

No new tests. Covered by the existing test fast/events/beforeunload-dom-manipulation-crash.html.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::isStopLoadingAllowed const):
(WebCore::FrameLoader::stopAllLoaders):
* loader/FrameLoader.h:

Tools:

Implement 'testRunner.forceImmediateCompletion()' for WK1.

* DumpRenderTree/TestRunner.cpp:
(forceImmediateCompletionCallback):
(TestRunner::staticFunctions):

LayoutTests:

* fast/events/beforeunload-dom-manipulation-crash.html: Make it clear that the
frame element is a child of the 'del' element.
* fast/events/beforeunload-dom-manipulation-crash-expected.html:
* platform/mac-wk1/TestExpectations: Unskip test.

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

19 months agoMark js/dom/array-with-double-assign.html as a failure on Windows.
pvollan@apple.com [Mon, 29 Jan 2018 15:35:05 +0000 (15:35 +0000)]
Mark js/dom/array-with-double-assign.html as a failure on Windows.
https://bugs.webkit.org/show_bug.cgi?id=182239

Unreviewed test gardening.

* platform/win/TestExpectations:

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

19 months ago[CoordnatedGraphics] A child layer of a semitransparent layer isn't clipped properly
magomez@igalia.com [Mon, 29 Jan 2018 15:26:17 +0000 (15:26 +0000)]
[CoordnatedGraphics] A child layer of a semitransparent layer isn't clipped properly
https://bugs.webkit.org/show_bug.cgi?id=181080

Reviewed by Žan Doberšek.

Check whether the applied clipping area is empty before drawing the children of a TextureMapperLayer. If
the area is empty no children will be drawn, so we can avoid drawing them.

No new tests -- no change in behavior.

* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::paintSelfAndChildren):

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

19 months ago[Cairo] Add GraphicsContextImplCairo::createFactory() helpers
zandobersek@gmail.com [Mon, 29 Jan 2018 14:32:25 +0000 (14:32 +0000)]
[Cairo] Add GraphicsContextImplCairo::createFactory() helpers
https://bugs.webkit.org/show_bug.cgi?id=182238

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Instead of duplicating lambdas that return a newly-created
GraphicsContextImplCairo object, provide static createFactory() helpers
on that class that produce GraphicsContextImplFactory wrappers which are
then invoked in the GraphicsContext constructor. The static functions
accept either the PlatformContextCairo reference or the cairo_t pointer,
invoking the proper GraphicsContextImplCairo constructor in the returned
lambda wrapper.

No new tests -- no change in functionality.

* platform/graphics/cairo/GraphicsContextImplCairo.cpp:
(WebCore::GraphicsContextImplCairo::createFactory):
* platform/graphics/cairo/GraphicsContextImplCairo.h:
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBuffer::ImageBuffer):
* platform/graphics/cairo/PathCairo.cpp:
(WebCore::Path::strokeBoundingRect const):
(WebCore::Path::strokeContains const):
* platform/graphics/nicosia/NicosiaPaintingContextCairo.cpp:
(Nicosia::PaintingContextCairo::PaintingContextCairo):
* platform/graphics/win/ImageCairoWin.cpp:
(WebCore::BitmapImage::getHBITMAPOfSize):

Source/WebKit:

Use GraphicsContextImplCairo::createFactory() helpers throughout the
Cairo-specific GraphicsContext constructors in the WebKit layer.

* Shared/cairo/ShareableBitmapCairo.cpp:
(WebKit::ShareableBitmap::createGraphicsContext):
* UIProcess/cairo/BackingStoreCairo.cpp:
(WebKit::BackingStore::incorporateUpdate):
* WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
(WebKit::WebPrintOperationGtk::renderPage):

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

19 months agoConstruct GraphicsContext with NonPaintingReasons::NoReason in FrameView::adjustPageH...
zandobersek@gmail.com [Mon, 29 Jan 2018 10:56:57 +0000 (10:56 +0000)]
Construct GraphicsContext with NonPaintingReasons::NoReason in FrameView::adjustPageHeightDeprecated()
https://bugs.webkit.org/show_bug.cgi?id=182235

Reviewed by Carlos Garcia Campos.

Pass the NonPaintingReasons::NoReason value to the GraphicsContext
constructor in FrameView::adjustPageHeightDeprecated(). This has the
same effect as when passing a null PlatformGraphicsContext to the
constructor, which effectively disables any painting through that
GraphicsContext, but doesn't have a platform-specific connotation.

No new tests -- no change in functionality.

* page/FrameView.cpp:
(WebCore::FrameView::adjustPageHeightDeprecated):

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

19 months ago[Cairo] Remove the GraphicsContext(cairo_t*) constructor
zandobersek@gmail.com [Mon, 29 Jan 2018 10:56:09 +0000 (10:56 +0000)]
[Cairo] Remove the GraphicsContext(cairo_t*) constructor
https://bugs.webkit.org/show_bug.cgi?id=182234

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Instead of using the GraphicsContext(cairo_t*) constructor, leverage the
GraphicsContextImplCairo class and work with an existing Cairo context
through that GraphicsContextImpl implementation.

A new GraphicsContextImplCairo constructor is added, expecting pointer
to the cairo_t object. With that, a PlatformContextCairo object is
created, with ownership of that object now being handled by the
GraphicsContextImplCairo class.

Call sites of the GraphicsContext(cairo_t*) constructor are adjusted to
instead provide a factory function that returns a fresh
GraphicsContextImplCairo object, passing that cairo_t object to its
constructor.

No new tests -- no change in behavior.

* platform/graphics/GraphicsContext.h:
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::GraphicsContext): Deleted.
* platform/graphics/cairo/GraphicsContextImplCairo.cpp:
(WebCore::GraphicsContextImplCairo::GraphicsContextImplCairo):
(WebCore::m_private):
* platform/graphics/cairo/GraphicsContextImplCairo.h:
* platform/graphics/cairo/PathCairo.cpp:
(WebCore::Path::strokeBoundingRect const):
(WebCore::Path::strokeContains const):
* platform/graphics/win/ImageCairoWin.cpp:
(WebCore::BitmapImage::getHBITMAPOfSize):

Source/WebKit:

Call sites of the GraphicsContext(cairo_t*) constructor are adjusted to
instead provide a factory function that returns a fresh
GraphicsContextImplCairo object, passing that cairo_t object to its
constructor.

* Shared/cairo/ShareableBitmapCairo.cpp:
(WebKit::ShareableBitmap::createGraphicsContext):
* UIProcess/cairo/BackingStoreCairo.cpp:
(WebKit::BackingStore::incorporateUpdate):
* WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
(WebKit::WebPrintOperationGtk::renderPage):

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

19 months agoJSC Sampling Profiler: Detect tester and testee when sampling in RegExp JIT
utatane.tea@gmail.com [Mon, 29 Jan 2018 10:43:13 +0000 (10:43 +0000)]
JSC Sampling Profiler: Detect tester and testee when sampling in RegExp JIT
https://bugs.webkit.org/show_bug.cgi?id=152729

Reviewed by Saam Barati.

JSTests:

* stress/sampling-profiler-regexp.js: Added.
(platformSupportsSamplingProfiler.test):
(platformSupportsSamplingProfiler.baz):
(platformSupportsSamplingProfiler):

Source/JavaScriptCore:

This patch extends SamplingProfiler to recognize JIT RegExp execution. We record
executing RegExp in VM so that SamplingProfiler can detect it. This is better
than the previous VM::isExecutingInRegExpJIT flag approach since

1. isExecutingInRegExpJIT is set after starting executing JIT RegExp code. Thus,
if we suspend the thread just before executing this flag, or just after clearing
this flag, SamplingProfiler gets invalid frame, and frame validation fails. We
should set such a flag before and after executing JIT RegExp code.

2. This removes VM dependency from YarrJIT which is not essential one.

We add ExecutionContext enum to RegExp::matchInline not to mark execution if it
is done in non JS thread.

* bytecode/BytecodeDumper.cpp:
(JSC::regexpName):
(JSC::BytecodeDumper<Block>::dumpRegExps):
(JSC::regexpToSourceString): Deleted.
* heap/Heap.cpp:
(JSC::Heap::addCoreConstraints):
* runtime/RegExp.cpp:
(JSC::RegExp::compile):
(JSC::RegExp::match):
(JSC::RegExp::matchConcurrently):
(JSC::RegExp::compileMatchOnly):
(JSC::RegExp::toSourceString const):
* runtime/RegExp.h:
* runtime/RegExpInlines.h:
(JSC::RegExp::matchInline):
* runtime/RegExpMatchesArray.h:
(JSC::createRegExpMatchesArray):
* runtime/SamplingProfiler.cpp:
(JSC::SamplingProfiler::SamplingProfiler):
(JSC::SamplingProfiler::timerLoop):
(JSC::SamplingProfiler::takeSample):
(JSC::SamplingProfiler::processUnverifiedStackTraces):
(JSC::SamplingProfiler::StackFrame::nameFromCallee):
(JSC::SamplingProfiler::StackFrame::displayName):
(JSC::SamplingProfiler::StackFrame::displayNameForJSONTests):
(JSC::SamplingProfiler::StackFrame::functionStartLine):
(JSC::SamplingProfiler::StackFrame::functionStartColumn):
(JSC::SamplingProfiler::StackFrame::sourceID):
(JSC::SamplingProfiler::StackFrame::url):
(WTF::printInternal):
(JSC::SamplingProfiler::~SamplingProfiler): Deleted.
* runtime/SamplingProfiler.h:
* runtime/VM.h:
* yarr/YarrJIT.cpp:
(JSC::Yarr::YarrGenerator::generateEnter):
(JSC::Yarr::YarrGenerator::generateReturn):
(JSC::Yarr::YarrGenerator::YarrGenerator):
(JSC::Yarr::jitCompile):
* yarr/YarrJIT.h:

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

19 months agoUnreviewed, add myself to some watch lists.
fred.wang@free.fr [Mon, 29 Jan 2018 10:20:32 +0000 (10:20 +0000)]
Unreviewed, add myself to some watch lists.

Patch by Frederic Wang <fwang@igalia.com> on 2018-01-29

* Scripts/webkitpy/common/config/watchlist:

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

19 months ago[DFG][FTL] WeakMap#set should have DFG node
utatane.tea@gmail.com [Mon, 29 Jan 2018 09:25:35 +0000 (09:25 +0000)]
[DFG][FTL] WeakMap#set should have DFG node
https://bugs.webkit.org/show_bug.cgi?id=180015

Reviewed by Saam Barati.

JSTests:

* stress/weakmap-set-change-get.js: Added.
(shouldBe):
(test):
* stress/weakmap-set-cse.js: Added.
(shouldBe):
(test):
* stress/weakset-add-change-get.js: Added.
(shouldBe):
* stress/weakset-add-cse.js: Added.
(shouldBe):

Source/JavaScriptCore:

This patch adds WeakMapSet and WeakSetAdd DFG nodes to handle them efficiently in DFG and FTL.
We also define CSE rules for them. Now, WeakMapSet and WeakSetAdd can offer the results of
the subsequent WeakMapGet if CSE allows.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::addVarArgChild):
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
WeakMap operations do not cause GC.

* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNodeType.h:
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileWeakSetAdd):
(JSC::DFG::SpeculativeJIT::compileWeakMapSet):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::callOperation):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileWeakSetAdd):
(JSC::FTL::DFG::LowerDFGToB3::compileWeakMapSet):
* jit/JITOperations.h:
* runtime/Intrinsic.cpp:
(JSC::intrinsicName):
* runtime/Intrinsic.h:
* runtime/WeakMapPrototype.cpp:
(JSC::WeakMapPrototype::finishCreation):
* runtime/WeakSetPrototype.cpp:
(JSC::WeakSetPrototype::finishCreation):

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

19 months agoOverflow of formulas is hidden for display mathematics
commit-queue@webkit.org [Mon, 29 Jan 2018 06:35:57 +0000 (06:35 +0000)]
Overflow of formulas is hidden for display mathematics
https://bugs.webkit.org/show_bug.cgi?id=160547

Patch by Minsheng Liu <lambda@liu.ms> on 2018-01-28
Reviewed by Frédéric Wang.

Source/WebCore:

Previously, <math> with display="block" uses its container's logical width as logical width.
However, that behavior will truncate overflowed contents. The patch fixes it by setting
the logical width as its content width rather than its container's logical width
if the former is wider than the latter.

Test: mathml/presentation/display-math-horizontal-overflow.html

* rendering/mathml/RenderMathMLRow.cpp:
(WebCore::RenderMathMLRow::layoutBlock):

LayoutTests:

Add a test to ensure <math> with display="block" will not truncate overflowed contents.

* mathml/presentation/display-math-horizontal-overflow-expected.txt: Added.
* mathml/presentation/display-math-horizontal-overflow.html: Added.

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

19 months agoLargeAllocation should do the same distancing as MarkedBlock
fpizlo@apple.com [Mon, 29 Jan 2018 05:08:13 +0000 (05:08 +0000)]
LargeAllocation should do the same distancing as MarkedBlock
https://bugs.webkit.org/show_bug.cgi?id=182226

Reviewed by Saam Barati.

This makes LargeAllocation do the same exact distancing that MarkedBlock promises to do.

To make that possible, this patch first makes MarkedBlock know exactly how much distancing it
is doing:

- I've rationalized the payloadSize calculation. In particular, I made MarkedSpace use the
  calculation done in MarkedBlock. MarkedSpace used to do the math a different way. This
  keeps the old way just for a static_assert.

- The promised amount of distancing is now codified in HeapCell.h as
  minimumDistanceBetweenCellsFromDifferentOrigins. We assert that the footer size is at least
  as big as this. I didn't want to just use footer size for this constant because then, if
  you increased the size of the footer, you'd also add padding to every large allocation.

Then this patch just adds minimumDistanceBetweenCellsFromDifferentOrigins to each large
allocation. It also zeroes that slice of memory to prevent any information leaks that way.

This is perf neutral. Large allocations start out at ~8000 bytes. The amount of padding is
~300 bytes. That's 3.75% space overhead for objects that are ~8000 bytes, zero overhead for
smaller objects, and diminishing overhead for larger objects. We allocate very few large
objects, so we shouldn't have any real space overhead from this.

* heap/HeapCell.h:
* heap/LargeAllocation.cpp:
(JSC::LargeAllocation::tryCreate):
* heap/MarkedBlock.h:
* heap/MarkedSpace.h:

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

19 months agoUnreviewed WPE gardening.
zandobersek@gmail.com [Sun, 28 Jan 2018 20:54:19 +0000 (20:54 +0000)]
Unreviewed WPE gardening.

* platform/wpe/TestExpectations: Add test failure expectations. Shuffle
around a few expectations and eliminate duplicate ones, removing overlap
warnings printed out when invoking run-webkit-tests.

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

19 months agoUnreviewed GTK+ gardening.
zandobersek@gmail.com [Sun, 28 Jan 2018 20:00:07 +0000 (20:00 +0000)]
Unreviewed GTK+ gardening.

* platform/gtk/TestExpectations: Add failure expectations for three tests.
* platform/gtk/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/errorhandling-expected.txt:
Added a test baseline due to console messages being output in a slightly different order.

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

19 months agoMake MarkedBlock::Footer bigger
fpizlo@apple.com [Sun, 28 Jan 2018 19:08:08 +0000 (19:08 +0000)]
Make MarkedBlock::Footer bigger
https://bugs.webkit.org/show_bug.cgi?id=182220

Reviewed by JF Bastien.

This makes the block footer larger by moving the newlyAllocated bits from the handle into
the footer.

It used to be profitable to put anything we could into the handle because that would free up
payload space inside the block. But now that we want to use the footer for padding, it's
profitable to put GC state information - especially data that is used by the GC itself and so
is not useful for a Spectre attack - into the footer to increase object distancing.

* heap/CellContainer.cpp:
(JSC::CellContainer::isNewlyAllocated const):
* heap/IsoCellSet.cpp:
(JSC::IsoCellSet::sweepToFreeList):
* heap/MarkedBlock.cpp:
(JSC::MarkedBlock::Handle::Handle):
(JSC::MarkedBlock::Footer::Footer):
(JSC::MarkedBlock::Handle::stopAllocating):
(JSC::MarkedBlock::Handle::lastChanceToFinalize):
(JSC::MarkedBlock::Handle::resumeAllocating):
(JSC::MarkedBlock::aboutToMarkSlow):
(JSC::MarkedBlock::resetAllocated):
(JSC::MarkedBlock::Handle::resetAllocated): Deleted.
* heap/MarkedBlock.h:
(JSC::MarkedBlock::newlyAllocatedVersion const):
(JSC::MarkedBlock::isNewlyAllocated):
(JSC::MarkedBlock::setNewlyAllocated):
(JSC::MarkedBlock::clearNewlyAllocated):
(JSC::MarkedBlock::newlyAllocated const):
(JSC::MarkedBlock::Handle::newlyAllocatedVersion const): Deleted.
(JSC::MarkedBlock::Handle::isNewlyAllocated): Deleted.
(JSC::MarkedBlock::Handle::setNewlyAllocated): Deleted.
(JSC::MarkedBlock::Handle::clearNewlyAllocated): Deleted.
(JSC::MarkedBlock::Handle::newlyAllocated const): Deleted.
* heap/MarkedBlockInlines.h:
(JSC::MarkedBlock::isNewlyAllocatedStale const):
(JSC::MarkedBlock::hasAnyNewlyAllocated):
(JSC::MarkedBlock::Handle::isLive):
(JSC::MarkedBlock::Handle::specializedSweep):
(JSC::MarkedBlock::Handle::newlyAllocatedMode):
(JSC::MarkedBlock::Handle::isNewlyAllocatedStale const): Deleted.
(JSC::MarkedBlock::Handle::hasAnyNewlyAllocated): Deleted.
* heap/MarkedSpace.cpp:
(JSC::MarkedSpace::endMarking):
* heap/SlotVisitor.cpp:
(JSC::SlotVisitor::appendJSCellOrAuxiliary):

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

19 months agoMarkedBlock should have a footer instead of a header
fpizlo@apple.com [Sun, 28 Jan 2018 02:23:25 +0000 (02:23 +0000)]
MarkedBlock should have a footer instead of a header
https://bugs.webkit.org/show_bug.cgi?id=182217

Reviewed by JF Bastien.

This moves the MarkedBlock's meta-data from the header to the footer. This doesn't really
change anything except for some compile-time constants, so it should not affect performance.

This change is to help protect against Spectre attacks on structure checks, which allow for
small-offset out-of-bounds access. By putting the meta-data at the end of the block, small
OOBs will only get to other objects in the same block or the block footer. The block footer
is not super interesting. So, if we combine this with the TLC change (r227617), this means we
can use blocks as the mechanism of achieving distance between objects from different origins.
We just need to avoid ever putting objects from different origins in the same block. That's
what bug 181636 is about.

* heap/BlockDirectory.cpp:
(JSC::blockHeaderSize): Deleted.
(JSC::BlockDirectory::blockSizeForBytes): Deleted.
* heap/BlockDirectory.h:
* heap/HeapUtil.h:
(JSC::HeapUtil::findGCObjectPointersForMarking):
* heap/MarkedBlock.cpp:
(JSC::MarkedBlock::MarkedBlock):
(JSC::MarkedBlock::~MarkedBlock):
(JSC::MarkedBlock::Footer::Footer):
(JSC::MarkedBlock::Footer::~Footer):
(JSC::MarkedBlock::Handle::stopAllocating):
(JSC::MarkedBlock::Handle::lastChanceToFinalize):
(JSC::MarkedBlock::Handle::resumeAllocating):
(JSC::MarkedBlock::aboutToMarkSlow):
(JSC::MarkedBlock::resetMarks):
(JSC::MarkedBlock::assertMarksNotStale):
(JSC::MarkedBlock::Handle::didConsumeFreeList):
(JSC::MarkedBlock::markCount):
(JSC::MarkedBlock::clearHasAnyMarked):
(JSC::MarkedBlock::Handle::didAddToDirectory):
(JSC::MarkedBlock::Handle::didRemoveFromDirectory):
(JSC::MarkedBlock::Handle::sweep):
* heap/MarkedBlock.h:
(JSC::MarkedBlock::markingVersion const):
(JSC::MarkedBlock::lock):
(JSC::MarkedBlock::subspace const):
(JSC::MarkedBlock::footer):
(JSC::MarkedBlock::footer const):
(JSC::MarkedBlock::handle):
(JSC::MarkedBlock::handle const):
(JSC::MarkedBlock::Handle::blockFooter):
(JSC::MarkedBlock::isAtomAligned):
(JSC::MarkedBlock::Handle::cellAlign):
(JSC::MarkedBlock::blockFor):
(JSC::MarkedBlock::vm const):
(JSC::MarkedBlock::weakSet):
(JSC::MarkedBlock::cellSize):
(JSC::MarkedBlock::attributes const):
(JSC::MarkedBlock::atomNumber):
(JSC::MarkedBlock::areMarksStale):
(JSC::MarkedBlock::aboutToMark):
(JSC::MarkedBlock::isMarkedRaw):
(JSC::MarkedBlock::isMarked):
(JSC::MarkedBlock::testAndSetMarked):
(JSC::MarkedBlock::marks const):
(JSC::MarkedBlock::isAtom):
(JSC::MarkedBlock::Handle::forEachCell):
(JSC::MarkedBlock::hasAnyMarked const):
(JSC::MarkedBlock::noteMarked):
(WTF::MarkedBlockHash::hash):
(JSC::MarkedBlock::firstAtom): Deleted.
* heap/MarkedBlockInlines.h:
(JSC::MarkedBlock::marksConveyLivenessDuringMarking):
(JSC::MarkedBlock::Handle::isLive):
(JSC::MarkedBlock::Handle::specializedSweep):
(JSC::MarkedBlock::Handle::forEachLiveCell):
(JSC::MarkedBlock::Handle::forEachDeadCell):
(JSC::MarkedBlock::Handle::forEachMarkedCell):
* heap/MarkedSpace.cpp:
* heap/MarkedSpace.h:
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:

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

19 months agoDFG strength reduction fails to convert NumberToStringWithValidRadixConstant for...
utatane.tea@gmail.com [Sat, 27 Jan 2018 18:14:06 +0000 (18:14 +0000)]
DFG strength reduction fails to convert NumberToStringWithValidRadixConstant for 0 to constant '0'
https://bugs.webkit.org/show_bug.cgi?id=182213

Reviewed by Mark Lam.

JSTests:

* stress/int32-min-to-string.js: Added.
(shouldBe):
(test2):
(test4):
(test8):
(test16):
(test32):
* stress/zero-to-string.js: Added.
(shouldBe):
(test2):
(test4):
(test8):
(test16):
(test32):

Source/JavaScriptCore:

toStringWithRadixInternal is originally used for the slow path if the given value is larger than radix or negative.
As a result, it does not accept 0 correctly, and produces an empty string. Since DFGStrengthReductionPhase uses
this function, it accidentally converts NumberToStringWithValidRadixConstant(0, radix) to an empty string.
This patch fixes toStringWithRadixInternal to accept 0. This change fixes twitch.tv's issue.

We also add a careful cast to avoid `-INT32_MIN`. It does not produce incorrect value in x86 in practice,
but it is UB, and a compiler may assume that the given value is never INT32_MIN and could do an incorrect optimization.

* runtime/NumberPrototype.cpp:
(JSC::toStringWithRadixInternal):

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

19 months agoHaveInternalSDK includes should be "#include?"
mitz@apple.com [Sat, 27 Jan 2018 17:50:55 +0000 (17:50 +0000)]
HaveInternalSDK includes should be "#include?"
https://bugs.webkit.org/show_bug.cgi?id=179670

Source/ThirdParty:

* gtest/xcode/Config/General.xcconfig:

Source/ThirdParty/ANGLE:

* Configurations/Base.xcconfig:

Source/ThirdParty/libwebrtc:

* Configurations/Base.xcconfig:

Source/WebCore/PAL:

* Configurations/Base.xcconfig:

Source/WebKitLegacy/mac:

* Configurations/Base.xcconfig:

Tools:

* DumpRenderTree/mac/Configurations/Base.xcconfig:

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

19 months ago[Web Animations] Distinguish between an omitted and a null timeline argument to the...
graouts@webkit.org [Sat, 27 Jan 2018 09:26:18 +0000 (09:26 +0000)]
[Web Animations] Distinguish between an omitted and a null timeline argument to the Animation constructor
https://bugs.webkit.org/show_bug.cgi?id=179065
LayoutTests/imported/w3c:

Reviewed by Dean Jackson.

Update WPT test output with progressions.

* web-platform-tests/web-animations/interfaces/Animation/constructor-expected.txt:
* web-platform-tests/web-animations/timing-model/animations/reversing-an-animation-expected.txt:
* web-platform-tests/web-animations/timing-model/animations/set-the-timeline-of-an-animation-expected.txt:

Source/WebCore:

<rdar://problem/36869046>

Reviewed by Dean Jackson.

The Web Animations specification requires that a missing or undefined "timeline" parameter means that the
document's timeline should be used, but a null value should be supported. To support this, we need to provide
a custom Animation constructor where we can check on the ExecState whether the second argument passed is
undefined, which is true if an explicit "undefined" value is passed or if the argument does not exist.

* Sources.txt: Add the new JSWebAnimationCustom.cpp file.
* WebCore.xcodeproj/project.pbxproj: Add the new JSWebAnimationCustom.cpp file.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::create): Add a create() variant that doesn't provide an AnimationTimeline parameter
to clearly indicate that the provided Document's timeline should be used.
* animation/WebAnimation.h:
* animation/WebAnimation.idl:
* bindings/js/JSWebAnimationCustom.cpp: Added.
(WebCore::constructJSWebAnimation): Provide a custom Animation constructor where we check whether the second
argument, the timeline, is undefined.
* dom/Element.cpp:
(WebCore::Element::animate): Use the new create() variant since passing "nullptr" now means a null timeline.

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

19 months agoMake accessibility/mac/selection-notification-focus-change.html more reliable and...
rniwa@webkit.org [Sat, 27 Jan 2018 06:26:09 +0000 (06:26 +0000)]
Make accessibility/mac/selection-notification-focus-change.html more reliable and re-enable it
https://bugs.webkit.org/show_bug.cgi?id=182198
<rdar://problem/36930258>

Reviewed by Tim Horton.

Refactored the test by splitting each test case into its own function split by setTimeout by zero seconds
instead of triggering the next test case when receiving a specific notification to make the test more robust.

Also moved functions which trigger the focus move into evalAndLog so that they appear in the expected result,
and added more logging to make the debugging of the test easier.

Finally, added WebKit2 specific expected result because it has one extra test failure compared to WebKit1.

* accessibility/mac/selection-notification-focus-change-expected.txt:
* accessibility/mac/selection-notification-focus-change.html:
* platform/mac-wk2/accessibility/mac: Added.
* platform/mac-wk2/accessibility/mac/selection-notification-focus-change-expected.txt: Added.
* platform/mac/TestExpectations: Removed the flaky test failure expectation since this test should now have
the same expected result everywhere on macOS.

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

19 months agoLayout Test http/wpt/beacon/beacon-async-error-logging.html is flaky
cdumez@apple.com [Sat, 27 Jan 2018 04:26:11 +0000 (04:26 +0000)]
Layout Test http/wpt/beacon/beacon-async-error-logging.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=182184
<rdar://problem/36929478>

Reviewed by Youenn Fablet.

Stop relying on a setTimeout(500) to end the test. Instead rely on the
internals.setConsoleMessageListener() API to wait for the console message
we are expecting.

* http/wpt/beacon/beacon-async-error-logging.html:

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

19 months agoUse the standard -webkit-autofill color on iOS
rmondello@apple.com [Sat, 27 Jan 2018 03:32:57 +0000 (03:32 +0000)]
Use the standard -webkit-autofill color on iOS
https://bugs.webkit.org/show_bug.cgi?id=182182

Reviewed by Tim Horton.

Source/WebCore:

* css/html.css:
(input:-webkit-autofill, input:-webkit-autofill-strong-password):

LayoutTests:

Update test expectations.

* platform/ios/fast/forms/auto-fill-button/input-strong-confirmation-password-auto-fill-button-expected.txt:
* platform/ios/fast/forms/auto-fill-button/input-strong-password-auto-fill-button-expected.txt:

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

19 months agoDon't retain focus for input peripheral views
megan_gardner@apple.com [Sat, 27 Jan 2018 02:13:48 +0000 (02:13 +0000)]
Don't retain focus for input peripheral views
https://bugs.webkit.org/show_bug.cgi?id=182204

Reviewed by Tim Horton.

Source/WebKit:

Retaining focus on input peripheral views makes it so they cannot dismiss themselves with
the current architecture. This should probably be fixed in UIKit, as there is no reason for
focus to be retained on these views anyways, as they don't have keyboard input, but this
guards against over-aggressive retain requests.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _restoreFocusWithToken:]):
(-[WKContentView _preserveFocusWithToken:destructively:]):

LayoutTests:

Fixed a spelling error while fixing a bug this test caught.

* fast/forms/ios/ipad/unfocus-inside-fixed-hittest.html:
* fast/forms/ios/ipad/unfocus-inside-fixed-hittest-expected.txt:

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

19 months agoMake sure service worker code does not launch a StorageProcess unnecessarily
cdumez@apple.com [Sat, 27 Jan 2018 01:49:11 +0000 (01:49 +0000)]
Make sure service worker code does not launch a StorageProcess unnecessarily
https://bugs.webkit.org/show_bug.cgi?id=182192
<rdar://problem/36927427>

Reviewed by Geoffrey Garen.

Source/WebKit:

When calling WebProcess::existingWebToStorageProcessConnection(), make sure we do not
force the creation of a WebProcess connection to the StorageProcess. If there is
no WebProcess, just return false right away.

* WebProcess/Storage/WebServiceWorkerProvider.cpp:
(WebKit::WebServiceWorkerProvider::existingServiceWorkerConnectionForSession):
* WebProcess/WebProcess.h:

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:

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