WebKit-https.git
4 months ago[Async overflow scrolling] Fix missing or misplaced content inside overflow:scroll
simon.fraser@apple.com [Thu, 27 Jun 2019 04:13:15 +0000 (04:13 +0000)]
[Async overflow scrolling] Fix missing or misplaced content inside overflow:scroll
https://bugs.webkit.org/show_bug.cgi?id=199253
Source/WebCore:

rdar://problem/51855156, rdar://problem/51934514

Reviewed by Zalan Bujtas.

This patch fixes a couple of related issues triggered by failing to composite layers inside non-stacking-context
overflow scroll.

First, we relied on overlap testing to composite position:relative layers inside overflow:scroll, but this only
worked when they came later in z-order, so didn't work for layers with negative z-index.
RenderLayerCompositor::requiresCompositingForIndirectReason() was intended to trigger compositing in such cases,
but it only did so for position:absolute inside stacking-context scroller, because
isNonScrolledLayerInsideScrolledCompositedAncestor() tested ancestorMovedByScroller && !layerMovedByScroller.

I fixed this by sharing code between the three places that ask whether compositing crosses a containing-block
boundary to call a single function, RenderLayerCompositor::layerScrollBehahaviorRelativeToCompositedAncestor(),
that returns a ScrollPositioningBehavior. We now do compositing for both "moves" and "stationary" behaviors (but
not "none"), ensuring that position:relative inside non-stacking scroller is always composited.

However, this would trigger compositing on layers that should be using backing sharing; if they were outside the
visible part of the scroller, the overlap code would not trigger, but the
"IndirectCompositingReason::OverflowScrollPositioning" code would. This is undesirable; any layer that can use
backing sharing should, because that's fewer composited layers, so smaller layer trees and less backing store.
To fix this, I moved the backing-sharing check before the overlap check in
RenderLayerCompositor::computeCompositingRequirements().

The "layer.setHasCompositingDescendant(currentState.subtreeIsCompositing)" line was in the wrong place,
triggering assertions on some content; "subtreeIsCompositing" only refers to child layers, so this bit needs to
be set right after we've traversed the z-order lists.

Tests: compositing/scrolling/async-overflow-scrolling/hidden-relative-layer-content-in-scroller.html
       compositing/scrolling/async-overflow-scrolling/layer-for-negative-z-in-scroller.html
       compositing/scrolling/async-overflow-scrolling/negative-z-in-scroller.html

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
(WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
(WebCore::isScrolledByOverflowScrollLayer):
(WebCore::enclosingCompositedScrollingLayer):
(WebCore::RenderLayerCompositor::layerScrollBehahaviorRelativeToCompositedAncestor):
(WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
(WebCore::isNonScrolledLayerInsideScrolledCompositedAncestor): Deleted.
(WebCore::RenderLayerCompositor::layerContainingBlockCrossesCoordinatedScrollingBoundary): Deleted.
* rendering/RenderLayerCompositor.h:

LayoutTests:

Reviewed by Zalan Bujtas.

* compositing/geometry/limit-layer-bounds-clipping-ancestor-expected.txt:
* compositing/layer-creation/clipping-scope/overlap-constrained-inside-scroller-expected.txt:
* compositing/layer-creation/clipping-scope/scroller-with-negative-z-children-expected.txt:
* compositing/rtl/rtl-scrolling-with-transformed-descendants-expected.txt:
* compositing/scrolling/async-overflow-scrolling/hidden-relative-layer-content-in-scroller-expected.html: Added.
* compositing/scrolling/async-overflow-scrolling/hidden-relative-layer-content-in-scroller.html: Added.
* compositing/scrolling/async-overflow-scrolling/layer-for-negative-z-in-scroller-expected.txt: Added.
* compositing/scrolling/async-overflow-scrolling/layer-for-negative-z-in-scroller.html: Added.
* compositing/scrolling/async-overflow-scrolling/negative-z-in-scroller-expected.html: Added.
* compositing/scrolling/async-overflow-scrolling/negative-z-in-scroller.html: Added.
* compositing/shared-backing/overflow-scroll/nested-absolute-with-clipping-in-stacking-overflow-expected.txt:
* platform/ios-wk2/compositing/layer-creation/clipping-scope/overlap-constrained-inside-scroller-expected.txt:
* platform/ios-wk2/compositing/layer-creation/clipping-scope/scroller-with-negative-z-children-expected.txt:
* platform/ios-wk2/compositing/scrolling/async-overflow-scrolling/layer-for-negative-z-in-scroller-expected.txt: Added.
* platform/ios-wk2/compositing/shared-backing/overflow-scroll/nested-absolute-with-clipping-in-stacking-overflow-expected.txt:
* platform/ios/compositing/geometry/limit-layer-bounds-clipping-ancestor-expected.txt:

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

4 months agoReplacementFragment should not have script observable side effects
rniwa@webkit.org [Thu, 27 Jun 2019 02:55:58 +0000 (02:55 +0000)]
ReplacementFragment should not have script observable side effects
https://bugs.webkit.org/show_bug.cgi?id=199147

Reviewed by Wenson Hsieh.

Source/WebCore:

Fixed the bug that ReplacementFragment has script observable side effects.

Use a brand new document for sanitization where the script is disabled for test rendering,
and remove style and script elements as well as event handlers before the test rendering
and the actual pasting.

Test: editing/pasteboard/paste-contents-with-side-effects.html

* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplacementFragment::document): Deleted.
(WebCore::ReplacementFragment::ReplacementFragment): Use createPageForSanitizingWebContent
to create our own document for test rendering. We need to copy over the computed style
from the root editable element (editing host) to respect whitespace treatment, etc...
(WebCore::ReplacementFragment::removeContentsWithSideEffects): Moved from removeHeadContents.
Now removes event handlers and JavaScript URLs.
(WebCore::ReplacementFragment::insertFragmentForTestRendering): Renamed variable names.
(WebCore::ReplaceSelectionCommand::willApplyCommand): Create the plain text and HTML markup
for beforeinput and input events before ReplacementFragment removes contents with side effects.
(WebCore::ReplaceSelectionCommand::ensureReplacementFragment): The removal of head elements
is now done in ReplacementFragment's constructor.

LayoutTests:

Added regression tests.

* editing/pasteboard/paste-contents-with-side-effects-expected.txt: Added.
* editing/pasteboard/paste-contents-with-side-effects.html: Added.

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

4 months agoAdd type to UIImage symbol mapping for _WKElementAction
dino@apple.com [Thu, 27 Jun 2019 01:28:57 +0000 (01:28 +0000)]
Add type to UIImage symbol mapping for _WKElementAction
https://bugs.webkit.org/show_bug.cgi?id=199255

Reviewed by Sam Weinig.

Moving some code in from WebKitAdditions now
that the API is public.

* UIProcess/API/Cocoa/_WKElementAction.mm:
(+[_WKElementAction imageForElementActionType:]):
(elementActionTypeToUIActionIdentifier):
(uiActionIdentifierToElementActionType):

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

4 months agoWeb Inspector: Update legacy backend commands after enum name change
pecoraro@apple.com [Thu, 27 Jun 2019 01:08:23 +0000 (01:08 +0000)]
Web Inspector: Update legacy backend commands after enum name change
https://bugs.webkit.org/show_bug.cgi?id=199250

Reviewed by Devin Rousso.

* UserInterface/Protocol/Legacy/11.3/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/12.0/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/12.2/InspectorBackendCommands.js:

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

4 months agoExpose UIAction identifiers for _WKElementActions
dino@apple.com [Thu, 27 Jun 2019 01:04:48 +0000 (01:04 +0000)]
Expose UIAction identifiers for _WKElementActions
https://bugs.webkit.org/show_bug.cgi?id=199246
<rdar://problem/52218950>

Reviewed by Tim Horton.

In order for clients to create a contextual menu, they are given
a set of suggested UIActions, created from _WKElementActions.
By associating identifiers (strings) with the UIActions, clients
can inspect the suggestions and make a decision on whether or
not to include them in the final menu.

* UIProcess/API/Cocoa/_WKElementAction.h: Typedef UIActionIdentifier,
add a method to create a UIAction from an _WKElementAction, and a
helper to map between identifiers and types.

* UIProcess/API/Cocoa/_WKElementAction.mm:
(elementActionTypeToUIActionIdentifier): Helper to convert between the two types.
(uiActionIdentifierToElementActionType): The inverse of above.
(+[_WKElementAction elementActionTypeForUIActionIdentifier:]): A client given
a UIAction object can use this helper method to see what _WKElementActionType it
corresponds to.
(-[_WKElementAction uiActionForElementInfo:]): Used by WKContentViewInteraction to
create a UIAction from this _WKElementAction.

* UIProcess/ios/WKContentViewInteraction.mm:
(uiActionForLegacyPreviewAction): Renamed to make it clear this is a legacy approach.
(menuFromLegacyPreviewOrDefaultActions): Split these functions to separate the legacy
and non-legacy approach.
(-[WKContentView assignLegacyDataForContextMenuInteraction]):
(-[WKContentView continueContextMenuInteraction:]):
(uiActionForPreviewAction): Deleted.
(menuFromPreviewOrDefaults): Deleted.

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

4 months ago[ews-build] Add configuration and architecture for WPE and GTK builders
aakash_jain@apple.com [Thu, 27 Jun 2019 00:54:07 +0000 (00:54 +0000)]
[ews-build] Add configuration and architecture for WPE and GTK builders
https://bugs.webkit.org/show_bug.cgi?id=199249

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/config.json:

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

4 months ago[Payment Request] Set state to Closed when show() is called during an active session
aestes@apple.com [Thu, 27 Jun 2019 00:39:29 +0000 (00:39 +0000)]
[Payment Request] Set state to Closed when show() is called during an active session
https://bugs.webkit.org/show_bug.cgi?id=199239

Reviewed by Alex Christensen.

Source/WebCore:

According to step 7 of https://w3c.github.io/payment-request/#show-method (as of 26 June
2019), when another payment request is showing, calling show() should set the [[state]]
internal slot to Closed in addition to rejecting the show promise with an AbortError. WebKit
was only doing the latter. Let's do both.

Test: http/tests/paymentrequest/payment-is-showing.https.html

* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::show):

LayoutTests:

Copied from web-platform-tests/payment-request/payment-is-showing.https.html and modified to
use UIHelper instead of test_driver.bless.

* http/tests/paymentrequest/payment-is-showing.https-expected.txt: Added.
* http/tests/paymentrequest/payment-is-showing.https.html: Added.
* http/tests/paymentrequest/resources/blank.html: Added.

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

4 months ago[ews-build] Add check for duplicate workers in config.json
aakash_jain@apple.com [Thu, 27 Jun 2019 00:36:51 +0000 (00:36 +0000)]
[ews-build] Add check for duplicate workers in config.json
https://bugs.webkit.org/show_bug.cgi?id=199240

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/loadConfig.py:
(checkWorkersAndBuildersForConsistency._find_worker_with_name): Check for duplicate worker entry.
* BuildSlaveSupport/ews-build/loadConfig_unittest.py:
(TestcheckWorkersAndBuildersForConsistency.test_duplicate_worker): Added unit-test.

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

4 months ago[Win] MiniBrowser should make better font choices
ross.kirsling@sony.com [Thu, 27 Jun 2019 00:34:50 +0000 (00:34 +0000)]
[Win] MiniBrowser should make better font choices
https://bugs.webkit.org/show_bug.cgi?id=199244

Reviewed by Brent Fulgham.

* MiniBrowser/win/MainWindow.cpp:
(MainWindow::updateDeviceScaleFactor):
* MiniBrowser/win/MiniBrowserLib.rc:

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

4 months ago[RemoteInspector] Add address argument to listen for RemoteInspectorServer Socket...
Basuke.Suzuki@sony.com [Thu, 27 Jun 2019 00:20:26 +0000 (00:20 +0000)]
[RemoteInspector] Add address argument to listen for RemoteInspectorServer Socket implementation.
https://bugs.webkit.org/show_bug.cgi?id=199035

Reviewed by Ross Kirsling.

Added new argument `address` to start listening.

* inspector/remote/socket/RemoteInspectorServer.cpp:
(Inspector::RemoteInspectorServer::start):
* inspector/remote/socket/RemoteInspectorServer.h:
* inspector/remote/socket/posix/RemoteInspectorSocketPOSIX.cpp:
(Inspector::Socket::listen):
* inspector/remote/socket/win/RemoteInspectorSocketWin.cpp:
(Inspector::Socket::listen):

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

4 months ago[iPadOS] Fix another crash in -[UIPreviewTarget initWithContainer:center:transform...
wenson_hsieh@apple.com [Thu, 27 Jun 2019 00:18:19 +0000 (00:18 +0000)]
[iPadOS] Fix another crash in -[UIPreviewTarget initWithContainer:center:transform:] when generating a fallback targeted preview
https://bugs.webkit.org/show_bug.cgi?id=199243
<rdar://problem/51554509>

Reviewed by Tim Horton.

Additionally make createFallbackTargetedPreview robust in the case where the content view is unparented, and
rename _ensureTargetedPreview to _createTargetedPreviewIfPossible, to reflect the fact that it may now return
nil.

* UIProcess/ios/WKContentViewInteraction.mm:
(createTargetedPreview):
(createFallbackTargetedPreview):
(-[WKContentView _createTargetedPreviewIfPossible]):
(-[WKContentView contextMenuInteraction:previewForHighlightingMenuWithConfiguration:]):
(-[WKContentView contextMenuInteraction:previewForDismissingMenuWithConfiguration:]):
(-[WKContentView _ensureTargetedPreview]): Deleted.

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

4 months agoRemove unneeded #include <wtf/glib/GRefPtr.h>
annulen@yandex.ru [Thu, 27 Jun 2019 00:08:02 +0000 (00:08 +0000)]
Remove unneeded #include <wtf/glib/GRefPtr.h>
https://bugs.webkit.org/show_bug.cgi?id=199228

Reviewed by Michael Catanzaro.

* wtf/MemoryPressureHandler.h:

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

4 months agotestRunner.setAlwaysAcceptCookies should wait for cookie accept policy to be set
commit-queue@webkit.org [Wed, 26 Jun 2019 23:30:19 +0000 (23:30 +0000)]
testRunner.setAlwaysAcceptCookies should wait for cookie accept policy to be set
https://bugs.webkit.org/show_bug.cgi?id=199230
<rdar://51757107>

Patch by Alex Christensen <achristensen@webkit.org> on 2019-06-26
Reviewed by Andy Estes.

Source/WebKit:

This patch adds an optional callback to WKCookieManagerSetHTTPCookieAcceptPolicy which is luckily only used for testing.
It also adds listener-based asynchronous versions of didReceiveSynchronousMessageFromInjectedBundle.
WebKitTestRunner uses these new abilities to wait for the cookie accept policy to be set in the network process while the web process is hung.
This removes the race condition that was causing some flakiness in tests that use testRunner.setAlwaysAcceptCookies

* Shared/API/APIObject.h:
* Shared/API/c/WKBase.h:
* Sources.txt:
* UIProcess/API/APIInjectedBundleClient.h:
(API::InjectedBundleClient::didReceiveSynchronousMessageFromInjectedBundle):
* UIProcess/API/APIMessageListener.h: Copied from Source/WebKit/UIProcess/API/APIInjectedBundleClient.h.
(API::MessageListener::create):
(API::MessageListener::sendReply):
(API::MessageListener::MessageListener):
* UIProcess/API/C/WKAPICast.h:
* UIProcess/API/C/WKContextInjectedBundleClient.h:
* UIProcess/API/C/WKCookieManager.cpp:
(WKCookieManagerSetHTTPCookieAcceptPolicy):
* UIProcess/API/C/WKCookieManager.h:
* UIProcess/API/C/WKMessageListener.cpp: Copied from Source/WebKit/UIProcess/API/APIInjectedBundleClient.h.
(WKMessageListenerGetTypeID):
(WKMessageListenerSendReply):
* UIProcess/API/C/WKMessageListener.h: Copied from Source/WebKit/UIProcess/API/APIInjectedBundleClient.h.
* UIProcess/API/C/WKPageInjectedBundleClient.h:
* UIProcess/WebContextInjectedBundleClient.cpp:
(WebKit::WebContextInjectedBundleClient::didReceiveSynchronousMessageFromInjectedBundle):
* UIProcess/WebContextInjectedBundleClient.h:
* UIProcess/WebPageInjectedBundleClient.cpp:
(WebKit::WebPageInjectedBundleClient::didReceiveSynchronousMessageFromInjectedBundle):
* UIProcess/WebPageInjectedBundleClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::handleSynchronousMessage):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::injectedBundleClient): Deleted.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::handleSynchronousMessage):
* WebKit.xcodeproj/project.pbxproj:

Tools:

* TestWebKitAPI/Tests/WebKit/CookieManager.cpp:
(TestWebKitAPI::didGetTestHTTPCookieAcceptPolicy):
(TestWebKitAPI::didGetUserHTTPCookieAcceptPolicy):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::generatePageConfiguration):
(WTR::TestController::createWebViewWithOptions):
(WTR::TestController::didReceiveSynchronousMessageFromInjectedBundleWithListener):
(WTR::TestController::didReceiveSynchronousPageMessageFromInjectedBundleWithListener):
(WTR::TestController::didReceiveSynchronousMessageFromInjectedBundle):
(WTR::TestController::didReceiveSynchronousPageMessageFromInjectedBundle): Deleted.
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::invoke):
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):

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

4 months agoWeb Inspector: REGRESSION: Elements: the forced pseudo-class indicator isn't visible...
drousso@apple.com [Wed, 26 Jun 2019 23:25:18 +0000 (23:25 +0000)]
Web Inspector: REGRESSION: Elements: the forced pseudo-class indicator isn't visible when hovering
https://bugs.webkit.org/show_bug.cgi?id=199166

Reviewed by Matt Baker.

Make the pseudo-class indicator into its own element instead of being a `::before`.

* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement):
(WI.DOMTreeElement.prototype.updateSelectionArea):
(WI.DOMTreeElement.prototype.updateTitle):
(WI.DOMTreeElement.prototype._updatePseudoClassIndicator): Added.
(WI.DOMTreeElement.prototype.get pseudoClassesEnabled): Deleted.
(WI.DOMTreeElement.prototype._nodePseudoClassesDidChange): Deleted.

* UserInterface/Views/DOMTreeOutline.css:
(.tree-outline.dom):
(.tree-outline.dom li .pseudo-class-indicator): Added.
(body[dir=ltr] .tree-outline.dom li .pseudo-class-indicator): Added.
(body[dir=rtl] .tree-outline.dom li .pseudo-class-indicator): Added.
(.tree-outline.dom:focus li.selected .pseudo-class-indicator): Added.
(.tree-outline.dom li.pseudo-class-enabled > .selection-area::before): Deleted.
(body[dir=ltr] .tree-outline.dom li.pseudo-class-enabled > .selection-area::before): Deleted.
(body[dir=rtl] .tree-outline.dom li.pseudo-class-enabled > .selection-area::before): Deleted.
(.tree-outline.dom:focus li.selected.pseudo-class-enabled > .selection-area::before): Deleted.

* UserInterface/Views/FormattedValue.css:
(.formatted-node > .tree-outline.dom):
Adjust the indent of any `DOMTreeOutline` so there's more room for the pseudo-class
indicator, such as in the Console.

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

4 months agoLayout Test http/tests/performance/performance-resource-timing-resourcetimingbufferfu...
tsavell@apple.com [Wed, 26 Jun 2019 23:20:47 +0000 (23:20 +0000)]
Layout Test http/tests/performance/performance-resource-timing-resourcetimingbufferfull-shrinking-buffer-crash.html is failing.
https://bugs.webkit.org/show_bug.cgi?id=199242

Unreviewed Test Gardening.

Patch by Russell Epstein <russell_e@apple.com> on 2019-06-26

* platform/mac-wk1/TestExpectations:

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

4 months ago[iPadOS] eddm.usps.com scrolls horizontally due to explicit width set in viewport...
wenson_hsieh@apple.com [Wed, 26 Jun 2019 23:10:21 +0000 (23:10 +0000)]
[iPadOS] eddm.usps.com scrolls horizontally due to explicit width set in viewport meta tag
https://bugs.webkit.org/show_bug.cgi?id=199219
<rdar://problem/50425765>

Reviewed by Tim Horton.

Source/WebKit:

Currently, the heuristic to determine whether the page should be shrunk to fit the content width after loading
works by checking whether the page's content is wider than the layout width we've provided for the page.
However, in the case where an explicit width larger than the true view width is specified by the page's meta
viewport, we'll end up believing that the page's content is not wider than the layout width, which is dictated
by the fixed meta viewport width. Instead, we can shrink the page down in this scenario by comparing the content
width against the scaled size of the view when computing the amount of horizontal overflow.

Test: fast/viewport/ios/shrink-to-fit-content-large-constant-width.html

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::immediatelyShrinkToFitContent):

LayoutTests:

Add a new test to verify that if the meta viewport tag specifies a wide fixed width value, we will still try to
shrink the page down to fit within the viewport.

* fast/viewport/ios/shrink-to-fit-content-large-constant-width-expected.txt: Added.
* fast/viewport/ios/shrink-to-fit-content-large-constant-width.html: Added.

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

4 months agospeciesConstruct needs to throw if the result is a DataView
keith_miller@apple.com [Wed, 26 Jun 2019 23:07:28 +0000 (23:07 +0000)]
speciesConstruct needs to throw if the result is a DataView
https://bugs.webkit.org/show_bug.cgi?id=199231

Reviewed by Mark Lam.

JSTests:

* stress/typedarray-filter.js:
(subclasses.forEach):
* stress/typedarray-map.js:
(subclasses.forEach):
* stress/typedarray-slice.js:
(typedArrays.forEach):
* stress/typedarray-subarray.js:
(subclasses.forEach):

Source/JavaScriptCore:

Previously, we only checked that the result was a
JSArrayBufferView, which can include DataViews. This is incorrect
as the result should be only be a TypedArray.

* runtime/JSGenericTypedArrayViewPrototypeFunctions.h:
(JSC::speciesConstruct):

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

4 months agoWeb Inspector: Implement console.countReset
pecoraro@apple.com [Wed, 26 Jun 2019 22:25:48 +0000 (22:25 +0000)]
Web Inspector: Implement console.countReset
https://bugs.webkit.org/show_bug.cgi?id=199200

Reviewed by Devin Rousso.

Source/JavaScriptCore:

* inspector/JSGlobalObjectConsoleClient.cpp:
(Inspector::JSGlobalObjectConsoleClient::countReset):
* inspector/JSGlobalObjectConsoleClient.h:
* inspector/agents/InspectorConsoleAgent.cpp:
(Inspector::InspectorConsoleAgent::getCounterLabel):
(Inspector::InspectorConsoleAgent::count):
(Inspector::InspectorConsoleAgent::countReset):
* inspector/agents/InspectorConsoleAgent.h:
* runtime/ConsoleClient.h:
* runtime/ConsoleObject.cpp:
(JSC::ConsoleObject::finishCreation):
(JSC::consoleProtoFuncCountReset):

Source/WebCore:

Updated existing tests.

* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::consoleCountImpl):
(WebCore::InspectorInstrumentation::consoleCountResetImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::consoleCountReset):
* page/PageConsoleClient.cpp:
(WebCore::PageConsoleClient::countReset):
* page/PageConsoleClient.h:
* workers/WorkerConsoleClient.cpp:
(WebCore::WorkerConsoleClient::countReset):
* workers/WorkerConsoleClient.h:
* worklets/WorkletConsoleClient.cpp:
(WebCore::WorkletConsoleClient::countReset):
* worklets/WorkletConsoleClient.h:

LayoutTests:

* inspector/console/console-count-expected.txt:
* inspector/console/console-count.html:
* js/console-expected.txt:

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

4 months ago[Pointer Events] Respect pointer capture when dispatching mouse boundary events and...
graouts@webkit.org [Wed, 26 Jun 2019 22:11:30 +0000 (22:11 +0000)]
[Pointer Events] Respect pointer capture when dispatching mouse boundary events and updating :hover
https://bugs.webkit.org/show_bug.cgi?id=198999
<rdar://problem/51979477>

Reviewed by Dean Jackson.

Make sure we don't return early prior to setting the flag that prevents re-entrancy, or else we would never
enter this function again. No new tests, this was caught because Pointer Events WPT tests on iOS tests regressed.

* page/PointerCaptureController.cpp:
(WebCore::PointerCaptureController::processPendingPointerCapture):

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

4 months ago[Win][MiniBrowser] Remove obsolete code after r246814.
ross.kirsling@sony.com [Wed, 26 Jun 2019 22:11:07 +0000 (22:11 +0000)]
[Win][MiniBrowser] Remove obsolete code after r246814.
https://bugs.webkit.org/show_bug.cgi?id=199233

Reviewed by Fujii Hironori.

* MiniBrowser/win/MiniBrowserWebHost.cpp:
(MiniBrowserWebHost::didFinishLoadForFrame):
(SimpleEventListener::SimpleEventListener): Deleted.
(SimpleEventListener::handleEvent): Deleted.

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

4 months agocommit api should not return 'AmbiguousRevisionPrefix' if there is an exact revision...
dewei_zhu@apple.com [Wed, 26 Jun 2019 21:59:41 +0000 (21:59 +0000)]
commit api should not return 'AmbiguousRevisionPrefix' if there is an exact revision match
https://bugs.webkit.org/show_bug.cgi?id=199227

Reviewed by Ryosuke Niwa.

When prefix match is specified, api should check whether there is an exact match when multiple commits
match the prefix.

* public/include/commit-log-fetcher.php: Added the logic to check if there is an exact match when multiple matches are found.
* server-tests/api-commits-tests.js: Added an unit test.

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

4 months agoREGRESSION: ( r246394 ) webgpu/whlsl-buffer-fragment.html and webgpu/whlsl-buffer...
mmaxfield@apple.com [Wed, 26 Jun 2019 19:35:26 +0000 (19:35 +0000)]
REGRESSION: ( r246394 ) webgpu/whlsl-buffer-fragment.html and webgpu/whlsl-buffer-vertex.html are failing
https://bugs.webkit.org/show_bug.cgi?id=199012

Reviewed by Saam Barati.

Source/WebCore:

* platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
(WebCore::isAcceptableDevice):
(WebCore::GPUDevice::tryCreate):

Source/WTF:

* wtf/Platform.h:

LayoutTests:

Make the tests still pass if the machine doesn't support WebGPU.

* webgpu/adapter-options-expected.txt: Removed.
* webgpu/adapter-options.html: Removed.
* webgpu/bind-groups.html:
* webgpu/blend-color-triangle-strip-expected.html:
* webgpu/blend-color-triangle-strip.html:
* webgpu/blend-triangle-strip-expected.html:
* webgpu/blend-triangle-strip.html:
* webgpu/blit-commands-expected.html:
* webgpu/blit-commands.html:
* webgpu/buffer-command-buffer-races-expected.html:
* webgpu/buffer-command-buffer-races.html:
* webgpu/color-write-mask-triangle-strip-expected.html:
* webgpu/color-write-mask-triangle-strip.html:
* webgpu/command-buffers.html:
* webgpu/depth-enabled-triangle-strip-expected.html:
* webgpu/depth-enabled-triangle-strip.html:
* webgpu/draw-indexed-triangles-expected.html:
* webgpu/draw-indexed-triangles.html:
* webgpu/js/create-worker-device.js: Removed.
* webgpu/js/webgpu-functions.js:
(drawWhiteSquareOnBlueBackgroundInSoftware):
(drawGreenSquareInSoftware):
(drawGreenAndBlueCheckerboardInSoftware):
(async.mapWriteDataToBuffer):
* webgpu/map-read-buffers.html:
* webgpu/map-write-buffers.html:
* webgpu/pipeline-layouts.html:
* webgpu/propertyresolver/ander-abstract-lvalue-expected.html:
* webgpu/propertyresolver/ander-abstract-lvalue.html:
* webgpu/propertyresolver/ander-expected.html:
* webgpu/propertyresolver/ander-lvalue-3-levels-expected.html:
* webgpu/propertyresolver/ander-lvalue-3-levels.html:
* webgpu/propertyresolver/ander-lvalue-expected.html:
* webgpu/propertyresolver/ander-lvalue.html:
* webgpu/propertyresolver/ander.html:
* webgpu/propertyresolver/getter-expected.html:
* webgpu/propertyresolver/getter.html:
* webgpu/propertyresolver/indexer-ander-abstract-lvalue-expected.html:
* webgpu/propertyresolver/indexer-ander-abstract-lvalue.html:
* webgpu/propertyresolver/indexer-ander-expected.html:
* webgpu/propertyresolver/indexer-ander-lvalue-3-levels-expected.html:
* webgpu/propertyresolver/indexer-ander-lvalue-3-levels.html:
* webgpu/propertyresolver/indexer-ander-lvalue-expected.html:
* webgpu/propertyresolver/indexer-ander-lvalue.html:
* webgpu/propertyresolver/indexer-ander.html:
* webgpu/propertyresolver/indexer-getter-expected.html:
* webgpu/propertyresolver/indexer-getter.html:
* webgpu/propertyresolver/indexer-setter-abstract-lvalue-3-levels-expected.html:
* webgpu/propertyresolver/indexer-setter-abstract-lvalue-3-levels.html:
* webgpu/propertyresolver/indexer-setter-abstract-lvalue-expected.html:
* webgpu/propertyresolver/indexer-setter-abstract-lvalue.html:
* webgpu/propertyresolver/indexer-setter-expected.html:
* webgpu/propertyresolver/indexer-setter-lvalue-expected.html:
* webgpu/propertyresolver/indexer-setter-lvalue.html:
* webgpu/propertyresolver/indexer-setter.html:
* webgpu/propertyresolver/setter-abstract-lvalue-3-levels-expected.html:
* webgpu/propertyresolver/setter-abstract-lvalue-3-levels.html:
* webgpu/propertyresolver/setter-abstract-lvalue-expected.html:
* webgpu/propertyresolver/setter-abstract-lvalue.html:
* webgpu/propertyresolver/setter-lvalue-expected.html:
* webgpu/propertyresolver/setter-lvalue.html:
* webgpu/queue-creation.html:
* webgpu/render-command-encoding.html:
* webgpu/render-pipelines.html:
* webgpu/shader-modules.html:
* webgpu/simple-triangle-strip-expected.html:
* webgpu/simple-triangle-strip.html:
* webgpu/texture-triangle-strip-expected.html:
* webgpu/texture-triangle-strip.html:
* webgpu/textures-textureviews.html:
* webgpu/vertex-buffer-triangle-strip-expected.html:
* webgpu/vertex-buffer-triangle-strip.html:
* webgpu/viewport-scissor-rect-triangle-strip-expected.html:
* webgpu/viewport-scissor-rect-triangle-strip.html:
* webgpu/webgpu-enabled-expected.txt: Removed.
* webgpu/webgpu-enabled-in-worker-expected.txt: Removed.
* webgpu/webgpu-enabled-in-worker.html: Removed.
* webgpu/webgpu-enabled.html: Removed.
* webgpu/whlsl-arbitrary-vertex-attribute-locations-expected.html:
* webgpu/whlsl-arbitrary-vertex-attribute-locations.html:
* webgpu/whlsl-buffer-fragment-expected.html:
* webgpu/whlsl-buffer-fragment.html:
* webgpu/whlsl-buffer-length-expected.txt:
* webgpu/whlsl-buffer-length.html:
* webgpu/whlsl-buffer-vertex-expected.html:
* webgpu/whlsl-buffer-vertex.html:
* webgpu/whlsl-checker-should-set-type-of-read-modify-write-variables-expected.txt:
* webgpu/whlsl-checker-should-set-type-of-read-modify-write-variables.html:
* webgpu/whlsl-compute-expected.txt:
* webgpu/whlsl-compute.html:
* webgpu/whlsl-dereference-pointer-should-type-check-expected.html:
* webgpu/whlsl-dereference-pointer-should-type-check.html:
* webgpu/whlsl-do-while-loop-break-expected.html:
* webgpu/whlsl-do-while-loop-break.html:
* webgpu/whlsl-do-while-loop-continue-expected.html:
* webgpu/whlsl-do-while-loop-continue.html:
* webgpu/whlsl-do-while-loop-expected.html:
* webgpu/whlsl-do-while-loop.html:
* webgpu/whlsl-dont-crash-parsing-enum-expected.html:
* webgpu/whlsl-dont-crash-parsing-enum.html:
* webgpu/whlsl-dot-expressions-expected.html:
* webgpu/whlsl-dot-expressions.html:
* webgpu/whlsl-duplicate-types-should-not-produce-duplicate-ctors-expected.txt:
* webgpu/whlsl-duplicate-types-should-not-produce-duplicate-ctors.html:
* webgpu/whlsl-ensure-proper-variable-lifetime-2-expected.html:
* webgpu/whlsl-ensure-proper-variable-lifetime-2.html:
* webgpu/whlsl-ensure-proper-variable-lifetime-3-expected.html:
* webgpu/whlsl-ensure-proper-variable-lifetime-3.html:
* webgpu/whlsl-ensure-proper-variable-lifetime-expected.html:
* webgpu/whlsl-ensure-proper-variable-lifetime.html:
* webgpu/whlsl-expected.html:
* webgpu/whlsl-loops-break-expected.html:
* webgpu/whlsl-loops-break.html:
* webgpu/whlsl-loops-continue-expected.html:
* webgpu/whlsl-loops-continue.html:
* webgpu/whlsl-loops-expected.html:
* webgpu/whlsl-loops.html:
* webgpu/whlsl-matrix-2-expected.txt:
* webgpu/whlsl-matrix-2.html:
* webgpu/whlsl-matrix-expected.txt:
* webgpu/whlsl-matrix.html:
* webgpu/whlsl-nested-dot-expression-rvalue-expected.html:
* webgpu/whlsl-nested-dot-expression-rvalue.html:
* webgpu/whlsl-nested-loop-expected.html:
* webgpu/whlsl-nested-loop.html:
* webgpu/whlsl-null-dereference-expected.txt:
* webgpu/whlsl-null-dereference.html:
* webgpu/whlsl-oob-access-expected.txt:
* webgpu/whlsl-oob-access.html:
* webgpu/whlsl-read-modify-write-high-zombies-expected.txt:
* webgpu/whlsl-read-modify-write-high-zombies.html:
* webgpu/whlsl-return-local-variable-expected.html:
* webgpu/whlsl-return-local-variable.html:
* webgpu/whlsl-store-to-property-updates-properly-expected.html:
* webgpu/whlsl-store-to-property-updates-properly.html:
* webgpu/whlsl-textures-getdimensions-expected.txt:
* webgpu/whlsl-textures-getdimensions.html:
* webgpu/whlsl-textures-load-expected.html:
* webgpu/whlsl-textures-load.html:
* webgpu/whlsl-textures-sample-expected.html:
* webgpu/whlsl-textures-sample.html:
* webgpu/whlsl-while-loop-break-expected.html:
* webgpu/whlsl-while-loop-break.html:
* webgpu/whlsl-while-loop-continue-expected.html:
* webgpu/whlsl-while-loop-continue.html:
* webgpu/whlsl-zero-initialize-values-2-expected.html:
* webgpu/whlsl-zero-initialize-values-2.html:
* webgpu/whlsl-zero-initialize-values-expected.html:
* webgpu/whlsl-zero-initialize-values.html:
* webgpu/whlsl.html:

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

4 months agoIncorrect clippping with overflow:scroll inside oveflow:hidden with border-radius
simon.fraser@apple.com [Wed, 26 Jun 2019 19:12:40 +0000 (19:12 +0000)]
Incorrect clippping with overflow:scroll inside oveflow:hidden with border-radius
https://bugs.webkit.org/show_bug.cgi?id=199135
rdar://problem/51882383

Reviewed by Zalan Bujtas.
Source/WebCore:

In some cases the geometry of the shape mask layer added to m_childContainmentLayer, for
border-radius, was incorrect. GraphicsLayerCA::updateClippingStrategy() treated
the rounded rect as if it were in renderer coordinates, but to match the other geometry
on GraphicsLayer, it should in GraphicsLayer coordinates, so we need to offset by
clipLayer->offsetFromRenderer().

In addition, RenderLayerBacking::updateChildClippingStrategy() is called from
the updateConfiguration(), which is before we've set offsetFromRenderer() on the clipLayer.
This first call is really to find out whether the platform supports this rounded rect
as a shape mask.

So we need to call setMasksToBoundsRect() a second time in RenderLayerBacking::updateGeometry()
after clipLayers's offsetFromRenderer() has been computed.

Test: compositing/scrolling/async-overflow-scrolling/border-radius-on-scroll-container.html

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::updateClippingStrategy):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
(WebCore::RenderLayerBacking::updateDescendantClippingLayer):
(WebCore::RenderLayerBacking::updateChildClippingStrategy):

LayoutTests:

* compositing/scrolling/async-overflow-scrolling/border-radius-on-scroll-container-expected.html: Added.
* compositing/scrolling/async-overflow-scrolling/border-radius-on-scroll-container.html: Added.

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

4 months ago[Pointer Events] Respect pointer capture when dispatching mouse boundary events and...
graouts@webkit.org [Wed, 26 Jun 2019 18:36:41 +0000 (18:36 +0000)]
[Pointer Events] Respect pointer capture when dispatching mouse boundary events and updating :hover
https://bugs.webkit.org/show_bug.cgi?id=198999
<rdar://problem/51979477>

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Mark the progressions in 3 WPT tests.

* web-platform-tests/pointerevents/pointerevent_boundary_events_at_implicit_release_hoverable_pointers-expected.txt:
* web-platform-tests/pointerevents/pointerevent_mouse_capture_change_hover-expected.txt:
* web-platform-tests/pointerevents/pointerevent_setpointercapture_relatedtarget-expected.txt:

Source/WebCore:

Up until now, we would not account for pointer capture (see ​https://w3c.github.io/pointerevents/#pointer-capture) when dispatching
mouse boundary events (mouseover, mouseout, mouseenter, mouseleave) and their counterpart pointer events. We would also not account
for it when updating :hover styles.

Now, when pointer capture changes for an element, we call setCapturingMouseEventsElement() on the EventHandler such that the element
that would naturally hit-test is overridden by the pointer capture element when identifying which target to use for the dispatch of
boundary mouse events. Additionally, when calling Document::prepareMouseEvent(), we also use the pointer capture element to
pass down to Document::updateHoverActiveState() such that :hover styles are applied to the correct element.

* dom/Document.cpp:
(WebCore::Document::prepareMouseEvent): When a new event is going to be dispatched, we must run the Process Pending Capture Element
steps as mandated by the Pointer Events spec. Calling this will dispatch the appropriate pointer capture change events and also
required boundary events since EventHandler::setCapturingMouseEventsElement() calls into EventHandler::updateMouseEventTargetNode().
Since this may update the capturing mouse events element, we ensure that we call updateHoverActiveState() with a flag that indicates that.
Finally, we use the capturing mouse events element instead of the hit-testing element to pass to updateHoverActiveState() to ensure
that is has :hover styles applied.
(WebCore::Document::updateHoverActiveState): Account for the new CaptureChange flag to force the invalidation of the :hover and :active
elements chain at all times when the capturing mouse events element changed.
* dom/Document.h:
* dom/PointerEvent.h: Update PointerEvent::createForPointerCapture() to take specific parameters rather than a single PointerEvent to
set the pointerId, isPrimary and pointerType properties of the generated event. This is required to call processPendingPointerCapture()
outside of PointerEvent dispatch logic since we now call it from Document::prepareMouseEvent() where we haven't yet generated such an
event.
* page/EventHandler.cpp:
(WebCore::EventHandler::pointerCaptureElementDidChange): When a new pointer capture element is set, call updateMouseEventTargetNode()
to ensure that boundary events are fired to indicate the pointer capture state change.
(WebCore::EventHandler::prepareMouseEvent): Keep track of the last PlatformMouseEvent used to prepare a mouse event so that we can use
it when setCapturingMouseEventsElement() is called.
* page/EventHandler.h:
* page/PointerCaptureController.cpp:
(WebCore::PointerCaptureController::pointerCaptureElement): Since Document::prepareMouseEvent() needs to know the current pointer capture
element, add a new public method that indicates the pointer capture element if that element is contained in the provided document. We need
to provide the document since PointerCaptureController is owned by the Page and may manage several documents.
(WebCore::PointerCaptureController::dispatchEvent): Only run the Process Pending Capture Element steps when dealing with a touch or pen
event since those steps are already ran for mouse events in Document::prepareMouseEvent(). Additionally, since the element target is already
set to be the pointer capture element with the changes made to processPendingPointerCapture(), and because on iOS pointer capture is always
active, we can remove the code that would retarget the event to the pointer capture element.
(WebCore::PointerCaptureController::pointerEventWasDispatched):
(WebCore::PointerCaptureController::cancelPointer):
(WebCore::PointerCaptureController::processPendingPointerCapture): We now call into EventHandler::setCapturingMouseEventsElement() when the
capture target element changes. We must be careful to call this method prior to dispatching the "gotpointercapture" event and after dispatching
the "lostpointercapture" event so that boundary events are fired at the right time.
* page/PointerCaptureController.h:

LayoutTests:

Update some WK1-specific expectations.

* platform/mac-wk1/imported/w3c/web-platform-tests/pointerevents/pointerevent_boundary_events_at_implicit_release_hoverable_pointers-expected.txt:
* platform/mac-wk1/imported/w3c/web-platform-tests/pointerevents/pointerevent_setpointercapture_relatedtarget-expected.txt:

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

4 months agoRemove a file I accidentally added.
dino@apple.com [Wed, 26 Jun 2019 18:36:36 +0000 (18:36 +0000)]
Remove a file I accidentally added.

* UIProcess/ios/WKContentViewInteraction.mm.orig: Removed.

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

4 months agoScript which adjusts include paths in ANGLE's copied headers breaks incremental builds
dino@apple.com [Wed, 26 Jun 2019 18:34:56 +0000 (18:34 +0000)]
Script which adjusts include paths in ANGLE's copied headers breaks incremental builds
https://bugs.webkit.org/show_bug.cgi?id=199212

Patch by Kenneth Russell <kbr@chromium.org> on 2019-06-25
Reviewed by Darin Adler.

Maintain and test a timestamp in adjust-angle-include-paths.sh
in order to avoid touching the headers during each build.

* adjust-angle-include-paths.sh:

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

4 months agoLayout Test imported/mozilla/svg/text/selectSubString-2.svg is failing.
tsavell@apple.com [Wed, 26 Jun 2019 17:45:28 +0000 (17:45 +0000)]
Layout Test imported/mozilla/svg/text/selectSubString-2.svg is failing.
https://bugs.webkit.org/show_bug.cgi?id=199196

Unreviewed Test Gardening.

Patch by Russell Epstein <russell_e@apple.com> on 2019-06-26

* platform/ios-wk2/TestExpectations:

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

4 months agoremove unneeded didBecomePrototype() calls
keith_miller@apple.com [Wed, 26 Jun 2019 16:49:13 +0000 (16:49 +0000)]
remove unneeded didBecomePrototype() calls
https://bugs.webkit.org/show_bug.cgi?id=199221

Reviewed by Saam Barati.

Since we now set didBecomePrototype in Structure::create we don't
need to set it expliticly in most of our finishCreation
methods. The only exception to this is object prototype, which we
set as the prototype of function prototype late (via
setPrototypeWithoutTransition).

* inspector/JSInjectedScriptHostPrototype.cpp:
(Inspector::JSInjectedScriptHostPrototype::finishCreation):
* inspector/JSJavaScriptCallFramePrototype.cpp:
(Inspector::JSJavaScriptCallFramePrototype::finishCreation):
* runtime/ArrayIteratorPrototype.cpp:
(JSC::ArrayIteratorPrototype::finishCreation):
* runtime/ArrayPrototype.cpp:
(JSC::ArrayPrototype::finishCreation):
* runtime/AsyncFromSyncIteratorPrototype.cpp:
(JSC::AsyncFromSyncIteratorPrototype::finishCreation):
* runtime/AsyncFunctionPrototype.cpp:
(JSC::AsyncFunctionPrototype::finishCreation):
* runtime/AsyncGeneratorFunctionPrototype.cpp:
(JSC::AsyncGeneratorFunctionPrototype::finishCreation):
* runtime/AsyncGeneratorPrototype.cpp:
(JSC::AsyncGeneratorPrototype::finishCreation):
* runtime/AsyncIteratorPrototype.cpp:
(JSC::AsyncIteratorPrototype::finishCreation):
* runtime/GeneratorFunctionPrototype.cpp:
(JSC::GeneratorFunctionPrototype::finishCreation):
* runtime/GeneratorPrototype.cpp:
(JSC::GeneratorPrototype::finishCreation):
* runtime/IteratorPrototype.cpp:
(JSC::IteratorPrototype::finishCreation):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* runtime/MapIteratorPrototype.cpp:
(JSC::MapIteratorPrototype::finishCreation):
* runtime/MapPrototype.cpp:
(JSC::MapPrototype::finishCreation):
* runtime/ObjectPrototype.cpp:
(JSC::ObjectPrototype::finishCreation):
* runtime/RegExpStringIteratorPrototype.cpp:
(JSC::RegExpStringIteratorPrototype::finishCreation):
* runtime/SetIteratorPrototype.cpp:
(JSC::SetIteratorPrototype::finishCreation):
* runtime/SetPrototype.cpp:
(JSC::SetPrototype::finishCreation):
* runtime/StringIteratorPrototype.cpp:
(JSC::StringIteratorPrototype::finishCreation):
* runtime/WeakMapPrototype.cpp:
(JSC::WeakMapPrototype::finishCreation):
* runtime/WeakObjectRefPrototype.cpp:
(JSC::WeakObjectRefPrototype::finishCreation):
* runtime/WeakSetPrototype.cpp:
(JSC::WeakSetPrototype::finishCreation):

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

4 months ago[ContentChangeObserver] Dispatch synthetic mouse event asynchronously in completePend...
zalan@apple.com [Wed, 26 Jun 2019 14:44:25 +0000 (14:44 +0000)]
[ContentChangeObserver] Dispatch synthetic mouse event asynchronously in completePendingSyntheticClickForContentChangeObserver
https://bugs.webkit.org/show_bug.cgi?id=199220
<rdar://problem/51787961>

Reviewed by Simon Fraser.

Source/WebKit:

WebPage::completePendingSyntheticClickForContentChangeObserver should not dispatch mouse events synchronously.
Mouse events, through style updates could destroy the element that initiated this change.
WebPage::handleSyntheticClick() already implements this pattern.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):

LayoutTests:

* fast/events/touch/ios/content-observation/animation-end-with-visiblity-change-crash-expected.txt: Added.
* fast/events/touch/ios/content-observation/animation-end-with-visiblity-change-crash.html: Added.

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

4 months agoUnreviewed, rolling out r246825.
ryanhaddad@apple.com [Wed, 26 Jun 2019 03:56:58 +0000 (03:56 +0000)]
Unreviewed, rolling out r246825.

Breaks internal builds.

Reverted changeset:

"Script which adjusts include paths in ANGLE's copied headers
breaks incremental builds"
https://bugs.webkit.org/show_bug.cgi?id=199212
https://trac.webkit.org/changeset/246825

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

4 months ago[WinCairo] incorrect font height for 'Google Sans Display' font
Hironori.Fujii@sony.com [Wed, 26 Jun 2019 03:51:59 +0000 (03:51 +0000)]
[WinCairo] incorrect font height for 'Google Sans Display' font
https://bugs.webkit.org/show_bug.cgi?id=198909

Reviewed by Frédéric Wang.

r191893 changed to use OS/2 typo metrics, but its calculation
wasn't correct. And, there is no reliable way to get OS/2 table by
using Windows API. Revert the part of r191893 change at the
moment.

* platform/graphics/win/SimpleFontDataCairoWin.cpp:
(WebCore::Font::platformInit):
* platform/graphics/win/SimpleFontDataWin.cpp:
(WebCore::Font::initGDIFont):
Reverted the part of r191893 change, and added FIXME comments.

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

4 months agoLayout Test imported/blink/editing/selection/deleteFromDocument-crash.html is failing.
ryanhaddad@apple.com [Wed, 26 Jun 2019 03:49:16 +0000 (03:49 +0000)]
Layout Test imported/blink/editing/selection/deleteFromDocument-crash.html is failing.
https://bugs.webkit.org/show_bug.cgi?id=199213

Unreviewed Test Gardening.

Patch by Russell Epstein <russell_e@apple.com> on 2019-06-25

* platform/ios-wk2/TestExpectations:

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

4 months agoImplement a new SPI to inform clients about AppSSO
jiewen_tan@apple.com [Wed, 26 Jun 2019 03:11:36 +0000 (03:11 +0000)]
Implement a new SPI to inform clients about AppSSO
https://bugs.webkit.org/show_bug.cgi?id=199085
<rdar://problem/50028246>

Reviewed by Geoffrey Garen.

Source/WebKit:

This patch implements a new SPI to inform clients about incoming AppSSO interceptions during
navigations. Therefore, clients can make an informed decision about whether this is the right
moment to do the interception as interceptions often show native UI. Also, the SPI is designed
to pass along a human readable name for the extension such that clients can do whatever they
want to inform users about what's going on.

Here is the new SPI:
- (void)_webView:(WKWebView *)webView decidePolicyForSOAuthorizationLoadWithCurrentPolicy:(_WKSOAuthorizationLoadPolicy)policy forExtension:(NSString *)extension completionHandler:(void (^)(_WKSOAuthorizationLoadPolicy policy))completionHandler;

* UIProcess/API/APINavigationClient.h:
(API::NavigationClient::decidePolicyForSOAuthorizationLoad):
* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::setNavigationDelegate):
(WebKit::soAuthorizationLoadPolicy):
(WebKit::wkSOAuthorizationLoadPolicy):
(WebKit::NavigationState::NavigationClient::decidePolicyForSOAuthorizationLoad):
* UIProcess/Cocoa/SOAuthorization/SOAuthorizationLoadPolicy.h: Added.
* UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm:
(WebKit::SOAuthorizationSession::start):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForSOAuthorizationLoad):
* UIProcess/WebPageProxy.h:
* WebKit.xcodeproj/project.pbxproj:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm:
(-[TestSOAuthorizationBasicDelegate webView:didFinishNavigation:]):
(-[TestSOAuthorizationNavigationDelegate init]):
(-[TestSOAuthorizationNavigationDelegate _webView:decidePolicyForSOAuthorizationLoadWithCurrentPolicy:forExtension:completionHandler:]):
(TestWebKitAPI::TEST):

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

4 months ago[iOS WK2 Debug] scrollingcoordinator/scrolling-tree/scroller-with-negative-z-child...
simon.fraser@apple.com [Wed, 26 Jun 2019 02:59:02 +0000 (02:59 +0000)]
[iOS WK2 Debug] scrollingcoordinator/scrolling-tree/scroller-with-negative-z-child.html asserts
https://bugs.webkit.org/show_bug.cgi?id=199218

Reviewed by Zalan Bujtas.

Followup to r246766; don't assert in the UI process if a ScrollingTreeOverflowScrollProxyNode
doesn't have a related overflow node; this is currently expected behavior with negative z-order
children of a scroller.

* UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations):

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

4 months agoCagedPtr doesn't merge PAC bits back into the resulting caged pointer.
keith_miller@apple.com [Wed, 26 Jun 2019 02:25:19 +0000 (02:25 +0000)]
CagedPtr doesn't merge PAC bits back into the resulting caged pointer.
https://bugs.webkit.org/show_bug.cgi?id=199214

Reviewed by Yusuke Suzuki.

The current code means that caging will just strip the any failed
authentication bits. Adding this code doesn't appear to be a
regression on iPhone Xs.

* wtf/CagedPtr.h:
(WTF::CagedPtr::get const):
(WTF::CagedPtr::getMayBeNull const):
(WTF::CagedPtr::getUnsafe const):
(WTF::CagedPtr::mergePointers):

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

4 months agoExperiment with simple structured bindings use
weinig@apple.com [Wed, 26 Jun 2019 02:00:47 +0000 (02:00 +0000)]
Experiment with simple structured bindings use
https://bugs.webkit.org/show_bug.cgi?id=198905

Reviewed by Darin Adler.

* wtf/URLHelpers.cpp:
(WTF::URLHelpers::mapHostNames):
Simplify code using c++ structured bindings (https://en.cppreference.com/w/cpp/language/structured_binding)
to see if all the platforms will work with it.

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

4 months agoScript which adjusts include paths in ANGLE's copied headers breaks incremental builds
dino@apple.com [Wed, 26 Jun 2019 01:44:53 +0000 (01:44 +0000)]
Script which adjusts include paths in ANGLE's copied headers breaks incremental builds
https://bugs.webkit.org/show_bug.cgi?id=199212

Patch by Kenneth Russell <kbr@chromium.org> on 2019-06-25
Reviewed by Darin Adler.

Maintain and test a timestamp in adjust-angle-include-paths.sh
in order to avoid touching the headers during each build.

* adjust-angle-include-paths.sh:

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

4 months ago[WHLSL] Make whlsl-test-harness actually generate WHLSL shaders by default
justin_fan@apple.com [Wed, 26 Jun 2019 01:40:52 +0000 (01:40 +0000)]
[WHLSL] Make whlsl-test-harness actually generate WHLSL shaders by default
https://bugs.webkit.org/show_bug.cgi?id=199028

Reviewed by Saam Barati.

whlsl-test-harness.js now generates WHLSL shaders and invokes WebKit's WHLSL compiler.
MSL mode remains to facilitate further harness tesing.
In addition, if WebGPU is not supported, synchronous Harness methods do nothing.
Asynchronous methods will throw a WebGPUUnsupportedError that "rejects" the returned Promise.

* TestExpectations:
* platform/mac/TestExpectations:
* webgpu/js/whlsl-test-harness.js:
(WebGPUUnsupportedError): Layout tests should catch these to fail gracefully if WebGPU is not supported.
(Data):
(Data.prototype.async.getArrayBuffer):
(Data.prototype.get isBuffer): Renamed from isPointer.
(Harness):
(Harness.prototype.async.requestDevice): Can be used to re-acquire a GPUDevice.
(Harness.prototype.set isWHLSL): Determines whether harness will generate WHLSL or MSL shaders.
(Harness.prototype.async.callTypedFunction):
(Harness.prototype.callVoidFunction):
(Harness.prototype.get device):
(Harness.prototype._clearResults):
(Harness.prototype._setUpArguments):
(Harness.prototype._callFunction):
(Data.prototype.get isPointer): Deleted.
(Harness.prototype._initialize): Deleted.
(Harness.prototype.async.callVoidFunction): Deleted.
(harness._initialize.async): Deleted.
* webgpu/msl-harness-test-expected.txt: Renamed from LayoutTests/webgpu/whlsl-harness-test-expected.txt.
* webgpu/msl-harness-test.html: Copied from LayoutTests/webgpu/whlsl-harness-test.html.
* webgpu/whlsl-test-harness-test-expected.html: Added.
* webgpu/whlsl-test-harness-test.html: Renamed from LayoutTests/webgpu/whlsl-harness-test.html.

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

4 months ago[ews-build] Retry Layout test in case of failures
aakash_jain@apple.com [Wed, 26 Jun 2019 01:01:01 +0000 (01:01 +0000)]
[ews-build] Retry Layout test in case of failures
https://bugs.webkit.org/show_bug.cgi?id=199194

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/steps.py:
(RunWebKitTests.evaluateCommand): Check if tests failed and retry them if required.
(ReRunWebKitTests): Build step to re-run layout tests.
(ReRunWebKitTests.evaluateCommand): Check if tests failed and retry on clean build if required.
(RunWebKitTestsWithoutPatch): Build step to run tests without patch.
(RunWebKitTestsWithoutPatch.evaluateCommand):

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

4 months ago[ews-build] Combine various patchFailed*Tests properties
aakash_jain@apple.com [Wed, 26 Jun 2019 00:56:44 +0000 (00:56 +0000)]
[ews-build] Combine various patchFailed*Tests properties
https://bugs.webkit.org/show_bug.cgi?id=199193

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/steps.py: Renamed patchFailedJSCTests and patchFailedAPITests to patchFailedTests. This property
can also be used for layout-tests later on.
* BuildSlaveSupport/ews-build/steps_unittest.py: Updated unit-tests.

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

4 months agoWeb Inspector: Elements: show shadow DOM by default
mattbaker@apple.com [Tue, 25 Jun 2019 23:45:37 +0000 (23:45 +0000)]
Web Inspector: Elements: show shadow DOM by default
https://bugs.webkit.org/show_bug.cgi?id=199128

Reviewed by Devin Rousso.

* UserInterface/Base/Setting.js:

* UserInterface/Test/Test.js:
(WI.loaded):
Overriding the default value isn't necessary since the default is now true.

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

4 months agoClicking the up/down spin buttons for a number input increments/decrements by 2.
timothy@apple.com [Tue, 25 Jun 2019 23:42:03 +0000 (23:42 +0000)]
Clicking the up/down spin buttons for a number input increments/decrements by 2.
https://bugs.webkit.org/show_bug.cgi?id=198809

Reviewed by Tim Horton.

AppKit no longer registers NSScrollerButtonDelay and NSScrollerButtonPeriod in the base
NSUserDefaults for an app. This caused our use to always get 0s when setting the click
and hold timer, causing the value to increment quickly for a single press.

* platform/mac/ScrollbarThemeMac.h:
(WebCore::ScrollbarThemeMac::initialAutoscrollTimerDelay): Added. Hardcode 500ms.
(WebCore::ScrollbarThemeMac::autoscrollTimerDelay): Added. Hardcode 50ms.
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::ScrollbarThemeMac::preferencesChanged): Removed use of old user defaults.
(WebCore::ScrollbarThemeMac::initialAutoscrollTimerDelay): Deleted.
(WebCore::ScrollbarThemeMac::autoscrollTimerDelay): Deleted.

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

4 months agoNon-editable text selections should be modifiable with hardware keyboard
dbates@webkit.org [Tue, 25 Jun 2019 23:41:31 +0000 (23:41 +0000)]
Non-editable text selections should be modifiable with hardware keyboard
https://bugs.webkit.org/show_bug.cgi?id=199204
<rdar://problem/51651496>

Reviewed by Wenson Hsieh.

Source/WebKit:

UIKit changes are need for this to work, including <rdar://problem/48322899>.
Note that without these changes, -canPerformAction is never called for _move*
selectors.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView canPerformAction:withSender:]):

LayoutTests:

Add a test, skipped for now, until we have the fix for <rdar://problem/48322899>.

* editing/selection/ios/select-non-editable-text-using-keyboard-expected.txt: Added.
* editing/selection/ios/select-non-editable-text-using-keyboard.html: Added.
* platform/ios/TestExpectations:
* resources/ui-helper.js:
(window.UIHelper.callFunctionAndWaitForEvent): Added.

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

4 months agoREGRESSION(r246621): Web Inspector: Styles: property may get removed when editing...
nvasilyev@apple.com [Tue, 25 Jun 2019 23:40:14 +0000 (23:40 +0000)]
REGRESSION(r246621): Web Inspector: Styles: property may get removed when editing after deleting value
https://bugs.webkit.org/show_bug.cgi?id=199143
<rdar://problem/52042815>

Reviewed by Matt Baker.

r246621 affected when WI.CSSStyleDeclaration.Event.PropertiesChanged event is fired, which caused
SpreadsheetCSSStyleDeclarationEditor to possibly enter a state when `focused` property is
incorrectly set to false.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyRemoved): Removed.
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyWillRemove): Added.
Renamed from "removed" to "willRemove" since we need to call it before the property DOM element
is detached from the document.

* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype.remove):
Don't set focused to false when the removed property wasn't focused.
This code need to exist because removing focused element from the DOM doesn't trigger blur event.

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

4 months ago[Win] MiniBrowser should default to webkit.org
ross.kirsling@sony.com [Tue, 25 Jun 2019 23:24:30 +0000 (23:24 +0000)]
[Win] MiniBrowser should default to webkit.org
https://bugs.webkit.org/show_bug.cgi?id=199201

Reviewed by Don Olmstead.

* MiniBrowser/win/BrowserWindow.h:
* MiniBrowser/win/MiniBrowserReplace.h:
* MiniBrowser/win/WebKitBrowserWindow.cpp:
(WebKitBrowserWindow::loadHTMLString): Deleted.
* MiniBrowser/win/WebKitBrowserWindow.h:
* MiniBrowser/win/WebKitLegacyBrowserWindow.cpp:
(WebKitLegacyBrowserWindow::loadHTMLString): Deleted.
* MiniBrowser/win/WebKitLegacyBrowserWindow.h:
* MiniBrowser/win/WinMain.cpp:
(wWinMain):

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

4 months agoUnreviewed, windows build fix.
keith_miller@apple.com [Tue, 25 Jun 2019 22:13:41 +0000 (22:13 +0000)]
Unreviewed, windows build fix.

* bindings/js/JSDOMGlobalObject.h:

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

4 months ago[iOS] Should not process key events in non-editable elements using IME
dbates@webkit.org [Tue, 25 Jun 2019 21:47:10 +0000 (21:47 +0000)]
[iOS] Should not process key events in non-editable elements using IME
https://bugs.webkit.org/show_bug.cgi?id=199122
<rdar://problem/52006654>

Reviewed by Brent Fulgham.

Source/WebKit:

Use the non-Input Method code path (the one we use for US keyboard input) for all key events
targeting a non-editable element. Such key events will never require Input Method support
(i.e. show candidate suggestions). Moreover, this behavior matches the behavior on Mac.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView handleKeyWebEvent:withCompletionHandler:]):

LayoutTests:

Add a test to ensure that we do not process key events as being handled by the Input Manager
when using a Chinese keyboard layout and targeting a non-editable element.

* fast/events/ios/keydown-keyup-keypress-keys-in-non-editable-using-chinese-keyboard-expected.txt: Added.
* fast/events/ios/keydown-keyup-keypress-keys-in-non-editable-using-chinese-keyboard.html: Added.

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

4 months ago[fuchsia] Update to newer zx_clock_get syscall
abarth@webkit.org [Tue, 25 Jun 2019 21:35:03 +0000 (21:35 +0000)]
[fuchsia] Update to newer zx_clock_get syscall
https://bugs.webkit.org/show_bug.cgi?id=199191

Reviewed by Sam Weinig.

Fuchsia has changed the zx_clock_get syscall to return the clock value
via an out parameter rather than via its return value. This change
makes zx_clock_get consistent with all the other syscalls.

This patch updates our use of zx_clock_get to use the new syscall. The
old syscall is no longer supported by Fuchsia.

* wtf/fuchsia/CPUTimeFuchsia.cpp:
(WTF::CPUTime::get): Switch to using the out parameter.
(WTF::CPUTime::forCurrentThread): Switch to using the out parameter.

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

4 months agoAdd didBecomePrototype() calls to global context prototypes
keith_miller@apple.com [Tue, 25 Jun 2019 21:19:21 +0000 (21:19 +0000)]
Add didBecomePrototype() calls to global context prototypes
https://bugs.webkit.org/show_bug.cgi?id=199202

Reviewed by Mark Lam.

This fixes some crashes related to asserting that all prototypes
have been marked as such in JSC from
https://trac.webkit.org/changeset/246801. It's ok to call
didBecomePrototype here as we setting up the world state right now
so we won't be having a bad time.

We don't automatically call didBecomePrototype() for
setPrototypeWithoutTransition because existing objects may already
have this structure so it seems more reasonable to be explicit
there.

* bindings/js/JSWindowProxy.cpp:
(WebCore::JSWindowProxy::setWindow):
* bindings/js/WorkerScriptController.cpp:
(WebCore::WorkerScriptController::initScript):
* worklets/WorkletScriptController.cpp:
(WebCore::WorkletScriptController::initScriptWithSubclass):

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

4 months agoMake HTTPCookieAcceptPolicy an enum class
commit-queue@webkit.org [Tue, 25 Jun 2019 21:08:23 +0000 (21:08 +0000)]
Make HTTPCookieAcceptPolicy an enum class
https://bugs.webkit.org/show_bug.cgi?id=199081

Patch by Alex Christensen <achristensen@webkit.org> on 2019-06-25
Source/WebCore/PAL:

Reviewed by Michael Catanzaro

* pal/spi/cf/CFNetworkSPI.h:

Source/WebKit:

Reviewed by Michael Catanzaro.

Doing so reveals some interesting bugs in the C API that are also fixed:
WKPreferencesGetIncrementalRenderingSuppressionTimeout was using its toAPI function to convert a double to a double because HTTPCookieAcceptPolicy used to be an unsigned integer.
toAPI(WebCore::MouseButton) was also using the toAPI(HTTPCookieAcceptPolicy) because HTTPCookieAcceptPolicy used to be an unsigned integer.
Yikes!  Type safety is our friend.

* NetworkProcess/Cookies/WebCookieManager.messages.in:
* NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
(WebKit::toCFHTTPCookieStorageAcceptPolicy):
(WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
(WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy):
* Shared/API/c/WKSharedAPICast.h:
(WebKit::toAPI):
* Shared/HTTPCookieAcceptPolicy.h:
(): Deleted.
* UIProcess/API/C/WKAPICast.h:
(WebKit::toHTTPCookieAcceptPolicy):
(WebKit::toAPI):
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesGetIncrementalRenderingSuppressionTimeout):
* UIProcess/API/Cocoa/WKProcessPool.mm:
(toHTTPCookieAcceptPolicy):
* UIProcess/WebCookieManagerProxy.cpp:
(WebKit::WebCookieManagerProxy::didGetHTTPCookieAcceptPolicy):
* UIProcess/WebCookieManagerProxy.h:
* UIProcess/WebCookieManagerProxy.messages.in:

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

4 months ago[macOS WK2] REGRESSION (r242313): Layout Test scrollingcoordinator/mac/multiple-fixed...
tsavell@apple.com [Tue, 25 Jun 2019 20:51:19 +0000 (20:51 +0000)]
[macOS WK2] REGRESSION (r242313): Layout Test scrollingcoordinator/mac/multiple-fixed.html is a flaky time out and image diff
https://bugs.webkit.org/show_bug.cgi?id=195635

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

4 months agoWrong title for Data Detectors tap action menu
timothy_horton@apple.com [Tue, 25 Jun 2019 20:51:12 +0000 (20:51 +0000)]
Wrong title for Data Detectors tap action menu
https://bugs.webkit.org/show_bug.cgi?id=199198
<rdar://problem/51957842>

Reviewed by Wenson Hsieh.

* UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant showDataDetectorsSheet]):
Always pass the results array through to DataDetectors; they need it
to figure out the title too!

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

4 months agoMigrate LayoutTests/http/tests/resourceLoadStatistics/clear-in-memory-and-persistent...
wilander@apple.com [Tue, 25 Jun 2019 20:48:36 +0000 (20:48 +0000)]
Migrate LayoutTests/http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store* test cases to setEnableFeature() and jsTestIsAsync
https://bugs.webkit.org/show_bug.cgi?id=199180
<rdar://problem/52085369>

Reviewed by Brent Fulgham.

* http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-expected.txt:
* http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour-expected.txt:
* http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour.html:
* http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store.html:

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

4 months agoStructure::create should call didBecomePrototype()
keith_miller@apple.com [Tue, 25 Jun 2019 19:49:22 +0000 (19:49 +0000)]
Structure::create should call didBecomePrototype()
https://bugs.webkit.org/show_bug.cgi?id=196315

Reviewed by Filip Pizlo.

Structure::create should also assert that the indexing type makes sense
for the prototype being used.

* runtime/JSObject.h:
* runtime/Structure.cpp:
(JSC::Structure::isValidPrototype):
(JSC::Structure::changePrototypeTransition):
* runtime/Structure.h:
(JSC::Structure::create): Deleted.
* runtime/StructureInlines.h:
(JSC::Structure::create):
(JSC::Structure::setPrototypeWithoutTransition):

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

4 months ago[iOS] Occasional crash under -[UIPreviewTarget initWithContainer:center:transform...
wenson_hsieh@apple.com [Tue, 25 Jun 2019 18:48:25 +0000 (18:48 +0000)]
[iOS] Occasional crash under -[UIPreviewTarget initWithContainer:center:transform:] when generating a drag preview
https://bugs.webkit.org/show_bug.cgi?id=199192
<rdar://problem/51554509>

Reviewed by Tim Horton.

Source/WebKit:

Tweak our preview generation code (for both the context menu and dragging) to be robust in the case where the
content view's unscaled view is nil; this may happen in the case after the web content process is terminated
and -cleanupInteraction is called, but before -setupInteraction is subsequently called.

Additionally, make our logic for creating targeted previews robust in the case where the view is removed from
the view hierarchy right before the platform asks for a targeted preview.

Test:   DragAndDropTests.WebProcessTerminationDuringDrag
        DragAndDropTests.WebViewRemovedFromViewHierarchyDuringDrag

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView containerViewForTargetedPreviews]):
(-[WKContentView _deliverDelayedDropPreviewIfPossible:]):
(-[WKContentView dragInteraction:previewForLiftingItem:session:]):
(-[WKContentView _ensureTargetedPreview]):

Tools:

Tweak the drag and drop simulator to ask for drag cancellation previews, and use this to write a couple tests to
verify that we gracefully handle web process termination and web view unparenting mid-drag.

* TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/cocoa/DragAndDropSimulator.h:
* TestWebKitAPI/ios/DragAndDropSimulatorIOS.mm:
(-[DragAndDropSimulator _resetSimulatedState]):
(-[DragAndDropSimulator _concludeDropAndPerformOperationIfNecessary]):
(-[DragAndDropSimulator _advanceProgress]):
(-[DragAndDropSimulator liftPreviews]):
(-[DragAndDropSimulator cancellationPreviews]):
(-[DragAndDropSimulator setSessionWillBeginBlock:]):
(-[DragAndDropSimulator sessionWillBeginBlock]):
(-[DragAndDropSimulator _webView:dataInteraction:sessionWillBegin:]):

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

4 months agoLayout Test imported/mozilla/svg/text/textpath-selection.svg is flaky.
tsavell@apple.com [Tue, 25 Jun 2019 18:47:01 +0000 (18:47 +0000)]
Layout Test imported/mozilla/svg/text/textpath-selection.svg is flaky.
https://bugs.webkit.org/show_bug.cgi?id=199196

Unreviewed Test Gardening.

Patch by Russell Epstein <russell_e@apple.com> on 2019-06-25

* platform/ios-wk2/TestExpectations:

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

4 months agoWeb Inspector: Implement console.timeLog
pecoraro@apple.com [Tue, 25 Jun 2019 18:36:29 +0000 (18:36 +0000)]
Web Inspector: Implement console.timeLog
https://bugs.webkit.org/show_bug.cgi?id=199184

Reviewed by Devin Rousso.

Source/JavaScriptCore:

* inspector/JSGlobalObjectConsoleClient.cpp:
(Inspector::JSGlobalObjectConsoleClient::timeLog):
* inspector/JSGlobalObjectConsoleClient.h:
* inspector/agents/InspectorConsoleAgent.cpp:
(Inspector::InspectorConsoleAgent::logTiming):
(Inspector::InspectorConsoleAgent::stopTiming):
* inspector/agents/InspectorConsoleAgent.h:
* runtime/ConsoleClient.h:
* runtime/ConsoleObject.cpp:
(JSC::ConsoleObject::finishCreation):
(JSC::consoleProtoFuncTimeLog):

Source/WebCore:

Updated existing tests.

* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::logConsoleTimingImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::logConsoleTiming):
* page/PageConsoleClient.cpp:
(WebCore::PageConsoleClient::timeLog):
* page/PageConsoleClient.h:
* workers/WorkerConsoleClient.cpp:
(WebCore::WorkerConsoleClient::timeLog):
* workers/WorkerConsoleClient.h:
* worklets/WorkletConsoleClient.cpp:
(WebCore::WorkletConsoleClient::timeLog):
* worklets/WorkletConsoleClient.h:

Source/WebInspectorUI:

* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype._appendMessageTextAndArguments):
Time messages (like timeLog) do not include their messageText
in their parameters list. So to behave more like normal logs
build a parameter list that includes it at the front.

LayoutTests:

* inspector/console/console-time-expected.txt:
* inspector/console/console-time.html:
Add new timeLog tests.

* js/console-expected.txt:
New timeLog method.

* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:
Unskip test.

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

4 months agoClose sockets with too high file descriptor
youenn@apple.com [Tue, 25 Jun 2019 18:09:32 +0000 (18:09 +0000)]
Close sockets with too high file descriptor
https://bugs.webkit.org/show_bug.cgi?id=199116

Reviewed by Eric Carlson.

Source/ThirdParty/libwebrtc:

* Source/webrtc/rtc_base/physicalsocketserver.cc:
* WebKit/0001-Close-sockets-with-file-descriptors-above-FD_SETSIZE.patch: Added.

Source/WebKit:

Log the case of failing to open a socket.

* NetworkProcess/webrtc/NetworkRTCProvider.cpp:
(WebKit::NetworkRTCProvider::createSocket):

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

4 months agoWhen Caps Lock is enabled on the Smart Keyboard, can't scroll with space or arrow...
timothy_horton@apple.com [Tue, 25 Jun 2019 17:29:53 +0000 (17:29 +0000)]
When Caps Lock is enabled on the Smart Keyboard, can't scroll with space or arrow keys
https://bugs.webkit.org/show_bug.cgi?id=199187
<rdar://problem/51521709>

Reviewed by Anders Carlsson.

* UIProcess/ios/WKKeyboardScrollingAnimator.mm:
(-[WKKeyboardScrollingAnimator keyboardScrollForEvent:]):
When deciding whether a key event should start a scroll, ignore all
modifiers other than the ones we actually care about (including Caps Lock).

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

4 months ago[ews-build] UploadTestResults and ExtractTestResults clobber results in case of multi...
aakash_jain@apple.com [Tue, 25 Jun 2019 16:17:43 +0000 (16:17 +0000)]
[ews-build] UploadTestResults and ExtractTestResults clobber results in case of multiple layout test runs in a build
https://bugs.webkit.org/show_bug.cgi?id=199178

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/steps.py:
(UploadTestResults.__init__): Add an optional identifier and append the identifier to the file name.
(ExtractTestResults.__init__): Ditto.
* BuildSlaveSupport/ews-build/steps_unittest.py: Added unit tests.

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

4 months agoREGRESSION(r245586): static assertion failed: Match result and EncodedMatchResult...
mcatanzaro@igalia.com [Tue, 25 Jun 2019 16:08:27 +0000 (16:08 +0000)]
REGRESSION(r245586): static assertion failed: Match result and EncodedMatchResult should be the same size
https://bugs.webkit.org/show_bug.cgi?id=198518

Reviewed by Keith Miller.

r245586 made some bad assumptions about the size of size_t, which we can solve using the
CPU(ADDRESS32) guard that I didn't know about.

This solution was developed by Mark Lam and Keith Miller. I'm just preparing the patch.

* runtime/MatchResult.h:

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

4 months agoAdd user agent quirk for bankofamerica.com
mcatanzaro@igalia.com [Tue, 25 Jun 2019 14:59:18 +0000 (14:59 +0000)]
Add user agent quirk for bankofamerica.com
https://bugs.webkit.org/show_bug.cgi?id=199154

Reviewed by Carlos Garcia Campos.

Source/WebCore:

This suppresses an unsupported browser warning.

* platform/UserAgentQuirks.cpp:
(WebCore::urlRequiresMacintoshPlatform):

Tools:

* TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp:
(TestWebKitAPI::TEST):

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

4 months agoFully rename WebKitGTK+ -> WebKitGTK everywhere
mcatanzaro@igalia.com [Tue, 25 Jun 2019 14:56:39 +0000 (14:56 +0000)]
Fully rename WebKitGTK+ -> WebKitGTK everywhere
https://bugs.webkit.org/show_bug.cgi?id=199159

Reviewed by Carlos Garcia Campos.

.:

* Source/cmake/FindGLIB.cmake:

Source/WebCore:

* accessibility/atk/WebKitAccessibleInterfaceText.cpp:
(webkitAccessibleTextGetStringAtOffset):
* platform/UserAgentQuirks.cpp:
(WebCore::urlRequiresMacintoshPlatform):
* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::saveCredentialToPersistentStorage):
* rendering/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::adjustTextFieldStyle const):

Source/WebKit:

* UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:

Source/WTF:

* wtf/URLParser.cpp:
(WTF::URLParser::internationalDomainNameTranscoder):

Tools:

* BuildSlaveSupport/gtk/README:
* MiniBrowser/gtk/BrowserWindow.c:
* MiniBrowser/gtk/main.c:
(aboutURISchemeRequestCallback):
* Scripts/webkitpy/common/config/contributionareas.py:
* Scripts/webkitpy/common/config/contributors.json:
* Scripts/webkitpy/tool/commands/analyzechangelog_unittest.py:
* TestWebKitAPI/Tests/WebKitGLib/TestCookieManager.cpp:
* TestWebKitAPI/Tests/WebKitGLib/TestResources.cpp:
(testWebViewResources):
* TestWebKitAPI/Tests/WebKitGLib/TestUIClient.cpp:
(testWebViewMouseTarget):
* TestWebKitAPI/Tests/WebKitGLib/TestWebExtensions.cpp:
(testWebExtensionGetTitle):
(testDocumentLoadedSignal):
(testWebExtensionFormControlsAssociated):
* TestWebKitAPI/Tests/WebKitGLib/TestWebKitSettings.cpp:
(testWebKitSettingsUserAgent):
* TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebView.cpp:
(testWebViewRunJavaScript):
* TestWebKitAPI/Tests/WebKitGtk/InspectorTestServer.cpp:
(main):
* TestWebKitAPI/Tests/WebKitGtk/TestContextMenu.cpp:
(prepareContextMenuTestView):
(testContextMenuPopulateMenu):
(testContextMenuCustomMenu):
(testContextMenuDisableMenu):
(testContextMenuSubMenu):
(testContextMenuDismissed):
(testContextMenuWebExtensionMenu):
(testContextMenuWebExtensionNode):
* TestWebKitAPI/Tests/WebKitGtk/TestInspector.cpp:
(testInspectorDefault):
(testInspectorManualAttachDetach):
(testInspectorCustomContainerDestroyed):
* TestWebKitAPI/Tests/WebKitGtk/TestPrinting.cpp:
(testWebViewPrint):
(testPrintOperationPrint):
(testPrintOperationErrors):
* gtk/install-dependencies:
* gtk/jhbuild.modules:
* gtkdoc/generate-gtkdoc:
* wpe/install-dependencies:

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

4 months agoRequire GCC 7
mcatanzaro@igalia.com [Tue, 25 Jun 2019 14:47:44 +0000 (14:47 +0000)]
Require GCC 7
https://bugs.webkit.org/show_bug.cgi?id=198914

Reviewed by Darin Adler.

.:

* CMakeLists.txt:

Source/WTF:

Remove now-stale GCC version check.

* wtf/Compiler.h:

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

4 months agoUnreviewed test gardening
Hironori.Fujii@sony.com [Tue, 25 Jun 2019 09:13:53 +0000 (09:13 +0000)]
Unreviewed test gardening

* TestExpectations: Added webkit.org/b/184066 to imported/w3c/web-platform-tests/IndexedDB/nested-cloning-large-multiple.html and others.
Added webkit.org/b/184065 to imported/w3c/web-platform-tests/IndexedDB/keypath-exceptions.htm.

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

4 months ago[WinCairo] Unreviewed test gardening
Hironori.Fujii@sony.com [Tue, 25 Jun 2019 09:00:53 +0000 (09:00 +0000)]
[WinCairo] Unreviewed test gardening

* platform/wincairo/TestExpectations: Added webkit.org/b/199186 to fonts/use-typo-metrics-1.html.
Removed duplicated storage/indexeddb/key-type-array-private.html and storage/indexeddb/key-type-array.html.

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

4 months agoIntroduce LinkLoadParameters
commit-queue@webkit.org [Tue, 25 Jun 2019 08:42:30 +0000 (08:42 +0000)]
Introduce LinkLoadParameters
https://bugs.webkit.org/show_bug.cgi?id=198960

Patch by Rob Buis <rbuis@igalia.com> on 2019-06-25
Reviewed by Frédéric Wang.

Avoid the long parameters lists in LinkLoader by moving them
to LinkLoadParameters.

No new tests because there is no behavior change.

* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::process):
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::loadLinksFromHeader):
(WebCore::LinkLoader::preconnectIfNeeded):
(WebCore::LinkLoader::preloadIfNeeded):
(WebCore::LinkLoader::prefetchIfNeeded):
(WebCore::LinkLoader::loadLink):
* loader/LinkLoader.h:

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

4 months ago[Text autosizing] [iPadOS] Revise our heuristics to determine idempotent text autosiz...
wenson_hsieh@apple.com [Tue, 25 Jun 2019 04:06:51 +0000 (04:06 +0000)]
[Text autosizing] [iPadOS] Revise our heuristics to determine idempotent text autosizing candidates
https://bugs.webkit.org/show_bug.cgi?id=198763
<rdar://problem/51826266>

Reviewed by Simon Fraser.

Source/WebCore:

This patch adjusts existing text autosizing heuristics, based on a survey of text on websites in the Alexa top
500 that shrink down to fit the viewport when requesting the desktop version of the site. The new heuristic is
derived from training decision trees against the dataset obtained from this survey, and balances false positives
(cases where layout is broken due to autosizing) against overall accuracy (measured using cross-validation).

See below for more details. Additionally, please refer to the link in the radar for more details, as well as
resources used to generate, validate, and analyze these decision trees.

Test: fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates.html

* css/StyleResolver.cpp:
(WebCore::StyleResolver::adjustRenderStyleForTextAutosizing):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::isIdempotentTextAutosizingCandidate const):

Rename AutosizeStatus::shouldSkipSubtree to RenderStyle::isIdempotentTextAutosizingCandidate. We relocate this
logic to RenderStyle, such that we're able to ask the element's RenderStyle questions when determining whether
the element should be autosized.

Of course, this patch additionally revamps the heuristic used to determine whether it is safe to autosize an
element. Our current heuristic in trunk simply checks for the presence of inline block display, out of flow
positioning and a fixed height ancestor; if any of these conditions are satisfied, we opt the element out of
text autosizing. This is an excellent strategy for boosting some runs of text while avoiding autosizing in the
vast majority of cases where increasing font size may lead to layout breakage (e.g. overlapping or clipped text,
content unexpectedly flowing to the next line, etc.). However, it also avoids boosting font sizes in many
scenarios where boosting font sizes is desired; for concrete examples, see the (currently 24) radars about small
font sizes that are duped to <rdar://problem/51826266>.

To help analyze and identify trends in autosizable and non-autosizable text, we assembled a dataset of elements
with text from the Alexa top 500 that either: (1) were too small and could be boosted safely, or (2) would break
layout if boosted. With this labeled dataset, we then trained binary decision trees to classify the data. Each
decision tree was trained with a number of hyperparameters: namely, maximum depth, minimum leaf size, and the
amount of bias towards negative samples (i.e. the ratio of the weight of a non-autosizable sample relative to
the weight of an autosizable sample).

For each 3-tuple of these hyperparameters (800 in total: max depth between 3 and 10, min leaf size between 1 and
10 and bias between 1 and 10), for 5000 iterations each, we split the full dataset into a training dataset and
a cross-validation dataset, trained a decision tree using the training set, and tested against the cross-
validation set to compute average precision, recall, and overall accuracy for each tuple of hyperparameters.

The decision tree introduced in this patch was generated using a hand-picked set of hyperparameters (max depth
10, min leaf size 4, and negative bias 2) to provide a balance between precision scores (limiting layout
breakage) and recall score (ensuring that small text is mostly autosized), while optimizing for overall
accuracy. Cross-validation scores predict that the overall accuracy of this classifier is approximately 70%, up
from the current accuracy in trunk (~53%).

* rendering/style/RenderStyle.h:

Grow the width of `autosizeStatus` from 4 to 8 (notably, this does not increase the size of RenderStyle).

* rendering/style/TextSizeAdjustment.cpp:
(WebCore::AutosizeStatus::updateStatus):
(WebCore::AutosizeStatus::shouldSkipSubtree const): Deleted.
* rendering/style/TextSizeAdjustment.h:

Introduce new text autosizing state flags, and remove some existing ones.

LayoutTests:

Rebaseline an existing text autosizing test, and introduce some new test cases that correspond to several common
patterns of autosizable (or non-autosizable) text on websites that were surveyed.

* fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-after-changing-initial-scale.html:
* fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates-expected.txt: Added.
* fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates.html: Renamed from LayoutTests/fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-skip.html.

Rename this existing layout test too, to avoid using the term "skip" in the name of a layout test.

* fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-skip-expected.txt: Removed.

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

4 months agoUnreviewed, rolling out r246714.
commit-queue@webkit.org [Tue, 25 Jun 2019 01:21:32 +0000 (01:21 +0000)]
Unreviewed, rolling out r246714.
https://bugs.webkit.org/show_bug.cgi?id=199179

revert to do patch in a different way. (Requested by keith_mi_
on #webkit).

Reverted changeset:

"All prototypes should call didBecomePrototype()"
https://bugs.webkit.org/show_bug.cgi?id=196315
https://trac.webkit.org/changeset/246714

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

4 months agoRevert "-[WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]...
beidson@apple.com [Tue, 25 Jun 2019 00:26:41 +0000 (00:26 +0000)]
Revert "-[WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:] doesn't delete _WKWebsiteDataTypeCredentials"

See <rdar://problem/52077293>

This reverts commit d86464be5509e2e6dbc7356cfd802e6b4e14b350.

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

4 months agoREGRESSION (r244436): IndexedDB Uint8Array returned as ArrayBuffer
sihui_liu@apple.com [Mon, 24 Jun 2019 23:45:41 +0000 (23:45 +0000)]
REGRESSION (r244436): IndexedDB Uint8Array returned as ArrayBuffer
https://bugs.webkit.org/show_bug.cgi?id=198738
<rdar://problem/51614053>

Reviewed by Brady Eidson.

In InexedDB, two binary keys are the same as long as their data is the same.

Modified tests: storage/indexeddb/key-type-binary.html
                storage/indexeddb/key-type-binary-private.html

* bindings/js/IDBBindingUtilities.cpp:
(WebCore::injectIDBKeyIntoScriptValue):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneDeserializer::readArrayBufferView):

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

4 months agoRemove WebSQL quirk for nytimes.com
sihui_liu@apple.com [Mon, 24 Jun 2019 23:26:36 +0000 (23:26 +0000)]
Remove WebSQL quirk for nytimes.com
https://bugs.webkit.org/show_bug.cgi?id=199175

Reviewed by Geoffrey Garen.

Removed unused code.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateRuntimeEnableConditionalString):
* bindings/scripts/IDLAttributes.json:
* page/Quirks.cpp:
(WebCore::Quirks::hasBrokenEncryptedMediaAPISupportQuirk const):
(WebCore::Quirks::hasWebSQLSupportQuirk const): Deleted.
* page/Quirks.h:

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

4 months agoNull deref in WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad.
beidson@apple.com [Mon, 24 Jun 2019 23:00:22 +0000 (23:00 +0000)]
Null deref in WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad.
<rdar://problem/51535942> and https://bugs.webkit.org/show_bug.cgi?id=199123

Reviewed by Andy Estes.

Source/WebCore:

* loader/FrameLoaderStateMachine.h:
(WebCore::FrameLoaderStateMachine::stateForDebugging const):

Source/WebKit:

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad): Properly detect this null DocumentLoader
  and try to learn more about the state of things.

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

4 months agoREGRESSION (r246725 ): Crashes on twitch.tv
simon.fraser@apple.com [Mon, 24 Jun 2019 22:44:09 +0000 (22:44 +0000)]
REGRESSION (r246725 ): Crashes on twitch.tv
https://bugs.webkit.org/show_bug.cgi?id=199176
Source/WebCore:

rdar://problem/52071249

Reviewed by Zalan Bujtas.

With a composited negative z-index child inside a scroller, we can register the overflow scroll
proxy node before we've traversed the overflow layer, so it that layer hasn't got its OverflowScrollingNode
yet. Thus, AsyncScrollingCoordinator::setRelatedOverflowScrollingNodes() can be called with an empty vector.
Avoid crashing when this happens.

Test: scrollingcoordinator/scrolling-tree/scroller-with-negative-z-child.html

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::setRelatedOverflowScrollingNodes):
* page/scrolling/cocoa/ScrollingTreeOverflowScrollProxyNode.mm:
(WebCore::ScrollingTreeOverflowScrollProxyNode::commitStateBeforeChildren):

LayoutTests:

Reviewed by Zalan Bujtas.

* scrollingcoordinator/scrolling-tree/scroller-with-negative-z-child-expected.txt: Added.
* scrollingcoordinator/scrolling-tree/scroller-with-negative-z-child.html: Added.

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

4 months agoAdd Array.prototype.{flat,flatMap} to unscopables
commit-queue@webkit.org [Mon, 24 Jun 2019 22:29:00 +0000 (22:29 +0000)]
Add Array.prototype.{flat,flatMap} to unscopables
https://bugs.webkit.org/show_bug.cgi?id=194322

Patch by Alexey Shvayka <shvaikalesh@gmail.com> on 2019-06-24
Reviewed by Keith Miller.

JSTests:

* stress/unscopables.js: Fix test.
* test262/expectations.yaml: Mark 2 test cases as passing.

Source/JavaScriptCore:

* runtime/ArrayPrototype.cpp:
(JSC::ArrayPrototype::finishCreation):

LayoutTests:

* js/array-unscopables-properties-expected.txt:
* js/script-tests/array-unscopables-properties.js:

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

4 months agoPages using Google's anti-flicker optimization may take ~5 seconds to do initial...
cdumez@apple.com [Mon, 24 Jun 2019 22:22:42 +0000 (22:22 +0000)]
Pages using Google's anti-flicker optimization may take ~5 seconds to do initial paint
https://bugs.webkit.org/show_bug.cgi?id=199173
<rdar://problem/45968770>

Reviewed by Geoffrey Garen.

Source/WebCore:

Pages using Google's anti-flicker optimization [1] take ~5 seconds to do initial paint when
analytics.js load is blocked by a content blocker.

To address the issue, this patch introduces a quirk behind an experimental feature flag that
calls window.dataLayer.hide.end() on the page when the load of https://www.google-analytics.com/analytics.js
is blocked by a content blocker. Note that this is more robust than dropping the 'async-hide'
class from document.documentElement since the class name is customizable by the caller.
A message is logged in the console when the quirk causes window.dataLayer.hide.end() to get called
early.

[1] https://developers.google.com/optimize/

* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::processContentRuleListsForLoad):
* page/Settings.yaml:

Source/WebKit:

Add experimental feature for the quirk.

* Shared/WebPreferences.yaml:

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

4 months agoRemove IsITPFirstPartyWebsiteDataRemovalEnabled as runtime check
wilander@apple.com [Mon, 24 Jun 2019 21:37:26 +0000 (21:37 +0000)]
Remove IsITPFirstPartyWebsiteDataRemovalEnabled as runtime check
https://bugs.webkit.org/show_bug.cgi?id=199164
<rdar://problem/52061147>

Reviewed by Brent Fulgham.

Source/WebCore:

No new tests. Just a removal of a runtime feature check. The functionality
already has a layout test.

We've had this toggle as a safety thing since mid-March. No need for it any longer.

* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::isITPDatabaseEnabled const):
(WebCore::RuntimeEnabledFeatures::setIsITPFirstPartyWebsiteDataRemovalEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::isITPFirstPartyWebsiteDataRemovalEnabled const): Deleted.

Source/WebKit:

We've had this toggle as a safety thing since mid-March. No need for it any longer.

* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveAllButCookiesFor const):
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* Shared/WebPreferences.yaml:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):

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

4 months agoiOS 12.2 Drawing portrait video to canvas is sideways
jer.noble@apple.com [Mon, 24 Jun 2019 19:57:46 +0000 (19:57 +0000)]
iOS 12.2 Drawing portrait video to canvas is sideways
https://bugs.webkit.org/show_bug.cgi?id=196772
<rdar://problem/49781802>

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/video-orientation-canvas.html

Move rotation code into its own ImageRotationSessionVT class for re-use across
all existing classes with rotation operations. Should slightly increase performance
for painting rotated media files, as the rotation only occurs once per frame, rather
than once per drawing operation.

* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h:
(WebCore::ImageDecoderAVFObjC::RotationProperties::isIdentity const): Deleted.
* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
(WebCore::ImageDecoderAVFObjC::readTrackMetadata):
(WebCore::ImageDecoderAVFObjC::storeSampleBuffer):
(WebCore::ImageDecoderAVFObjC::setTrack):
(WebCore::transformToRotationProperties): Deleted.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastPixelBuffer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
* platform/graphics/cv/ImageRotationSessionVT.h: Added.
(WebCore::ImageRotationSessionVT::RotationProperties::isIdentity const):
(WebCore::ImageRotationSessionVT::rotationProperties const):
(WebCore::ImageRotationSessionVT::rotatedSize):
* platform/graphics/cv/ImageRotationSessionVT.mm: Added.
(WebCore::transformToRotationProperties):
(WebCore::ImageRotationSessionVT::ImageRotationSessionVT):
(WebCore::ImageRotationSessionVT::rotate):
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h:
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.mm:
(WebCore::rotationToAngle):
(WebCore::RealtimeOutgoingVideoSourceCocoa::rotatePixelBuffer):
(WebCore::computeRotatedWidthAndHeight): Deleted.

LayoutTests:

* media/content/no-rotation.mp4:
* media/media-source/only-bcp47-language-tags-accepted-as-valid-expected.txt:
* media/video-orientation-canvas-expected.txt: Added.
* media/video-orientation-canvas.html: Added.
* media/video-test.js:
(waitFor):

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

4 months agom_focusedElement != &element in WebPage::elementDidBlur() sometimes
dbates@webkit.org [Mon, 24 Jun 2019 19:47:31 +0000 (19:47 +0000)]
m_focusedElement != &element in WebPage::elementDidBlur() sometimes
https://bugs.webkit.org/show_bug.cgi?id=198928
<rdar://problem/51814327>

Reviewed by Brent Fulgham.

Source/WebKit:

This can happen when the focused editable element is inside a nested frame and a person
taps outside that frame. For reasons that seem lost to time, WebKit2 on iOS would mutate
the focused frame whenever computing selection positioning information (say, for a tap).
This "quirk" was added in r163476, but that code has go through multiple iterations and
is no longer comparable to the current code. Yet, the original mutation of the focused
frame remained. As a result the UI process and Web process go out of sync with respect
to what each thinks is the focused element and this visually manifest itself in at least
two ways:

    1. A non-sensical DOM focus event would be dispatched at the frame tapped, but
    we would keep the focused element focused.

    2. Because we would keep the focused element focused in (1), even though its frame
    is not focused, the keyboard would be active (software keyboard on screen or candidate bar
    on screen if a hardware keyboard is attached), but appear unresponsive: any keys pressed
    would not cause text to be typed into the editable field.

Because of (1) it was possible for m_focusedElement != &element in WebPage::elementDidBlur().
When this happens the UI process would never receive an ElementDidBlur message and hence would
not clear out the focused element state and hide the keyboard.

We neither do this frame focus mutation in Legacy WebKit on iOS nor Mac. Let's remove this quirk.
If it turns out that it causes a compatibility issue then we will be in a better position to
understand its purpose and consider bringing this quirk back, if needed.

* Shared/ios/InteractionInformationRequest.cpp:
(WebKit::InteractionInformationRequest::encode const):
(WebKit::InteractionInformationRequest::decode):
(WebKit::InteractionInformationRequest::isValidForRequest):
(WebKit::InteractionInformationRequest::isApproximatelyValidForRequest):
* Shared/ios/InteractionInformationRequest.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _requestActivatedElementAtPosition:completionBlock:]):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _webTouchEventsRecognized:]):
Remove the readOnly field.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::selectionPositionInformation): Remove code to mutate the focused frame.

LayoutTests:

Update test result now that we do not mutate the focused frame on tap.

* TestExpectations: Skip problematic test editing/deleting/smart-delete-paragraph-003.html;
See <https://bugs.webkit.org/show_bug.cgi?id=198928#c16>, <https://bugs.webkit.org/show_bug.cgi?id=198928#c17>,
and <https://bugs.webkit.org/show_bug.cgi?id=199039> for more details.
* fast/events/ios/should-be-able-to-dismiss-form-accessory-after-tapping-outside-iframe-with-focused-field-expected.txt:

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

4 months ago[StyleResolver] Pass RenderStyle& instead of RenderStyle* to updateFont() related...
zalan@apple.com [Mon, 24 Jun 2019 19:37:59 +0000 (19:37 +0000)]
[StyleResolver] Pass RenderStyle& instead of RenderStyle* to updateFont() related functions.
https://bugs.webkit.org/show_bug.cgi?id=199167
<rdar://problem/52062669>

Reviewed by Antti Koivisto.

It is expected to have a valid RenderStyle object here (and existing code relies on it).

* css/StyleResolver.cpp:
(WebCore::checkForOrientationChange):
(WebCore::StyleResolver::updateFont):
(WebCore::StyleResolver::checkForTextSizeAdjust):
(WebCore::StyleResolver::checkForZoomChange):
(WebCore::StyleResolver::checkForGenericFamilyChange):
* css/StyleResolver.h:

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

4 months ago[Cocoa] Avoid creating a PlatformMediaSessionManager when the WebProcess is suspended...
pvollan@apple.com [Mon, 24 Jun 2019 19:32:03 +0000 (19:32 +0000)]
[Cocoa] Avoid creating a PlatformMediaSessionManager when the WebProcess is suspended or resumed
https://bugs.webkit.org/show_bug.cgi?id=199160

Reviewed by Brent Fulgham.

When the WebProcess suspends or resumes, the PlatformMediaSessionManager is notified about this.
Avoid creating a new PlatformMediaSessionManager if it does not already exist.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::actualPrepareToSuspend):
(WebKit::WebProcess::cancelPrepareToSuspend):
(WebKit::WebProcess::processDidResume):

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

4 months ago[Pointer Events WPT] Unskip imported/w3c/web-platform-tests/pointerevents/pointerlock...
graouts@webkit.org [Mon, 24 Jun 2019 19:02:40 +0000 (19:02 +0000)]
[Pointer Events WPT] Unskip imported/w3c/web-platform-tests/pointerevents/pointerlock/pointerevent_coordinates_when_locked.html
https://bugs.webkit.org/show_bug.cgi?id=197007

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Update the test from the Web Platform Tests repository following the fix for https://github.com/web-platform-tests/wpt/issues/16406.

* web-platform-tests/pointerevents/pointerlock/pointerevent_coordinates_when_locked-expected.txt: Added.
* web-platform-tests/pointerevents/pointerlock/pointerevent_coordinates_when_locked.html:

LayoutTests:

This test now works reliably, even if it fails the actual assertions.

* platform/mac/TestExpectations:

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

4 months ago[Pointer Events WPT] Unskip imported/w3c/web-platform-tests/pointerevents/pointereven...
graouts@webkit.org [Mon, 24 Jun 2019 19:00:17 +0000 (19:00 +0000)]
[Pointer Events WPT] Unskip imported/w3c/web-platform-tests/pointerevents/pointerevent_lostpointercapture_is_first.html
https://bugs.webkit.org/show_bug.cgi?id=197005

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/pointerevents/pointerevent_lostpointercapture_is_first-expected.txt: Added.
* web-platform-tests/resources/testdriver-vendor.js:
(dispatchMouseActions): We need to disable dragMode for the eventSender or else the "pointermove" events in the test will
not be dispatched as there is no mouseUp() call in the test's event sequence.

Source/WebCore:

We were calling processPendingPointerCapture() at the wrong time, calling in after dispatching a PointerEvent rather than before.
We now do this correctly in the consolidated PointerCaptureController::dispatchEvent() method, which we call for dispatching all
PointerEvents, save for gotpointercapture and lostpointercapture since these should not yield the processing of the pending pointer
capture per the spec.

This uncovered a couple of new issues. First, since we would now call processPendingPointerCapture() and dispatch a lostpointercapture
event earlier, the alternative lostpointercapture dispatch when an element is removed (which is dispatched asynchronously on the
document) would be dispatched *after* dispatching the event in processPendingPointerCapture(). We now check in processPendingPointerCapture()
whether the event target is connected to fix this. This makes sure pointerevent_lostpointercapture_for_disconnected_node.html doesn't regress.

Finally, we must also call processPendingPointerCapture() when implicitly releasing pointer capture during handling of a "pointerup" event.
This ensures that pointerevent_releasepointercapture_invalid_pointerid.html doesn't regress.

As a result of all these changes, we now pass imported/w3c/web-platform-tests/pointerevents/pointerevent_lostpointercapture_is_first.html reliably.

* page/PointerCaptureController.cpp:
(WebCore::PointerCaptureController::dispatchEventForTouchAtIndex):
(WebCore::PointerCaptureController::dispatchEvent): We now more closely adhere to the spec when determining what the pointer capture target is by
only checking for the target override. We can now do this safely since we call processPendingPointerCapture() before and not after event dispatch.
(WebCore::PointerCaptureController::pointerEventWasDispatched):
(WebCore::PointerCaptureController::processPendingPointerCapture): Cache the pending target override to make sure that dispatching a "gotpointercapture"
or "lostpointercapture" event during this function does not alter it until the next call is made when the next event is dispatched.

LayoutTests:

* platform/mac-wk1/imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_capture_change_hover-expected.txt: Removed.
* platform/mac-highsierra-wk1/imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_capture_change_hover-expected.txt: Removed.
* platform/mac-highsierra/imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_capture_change_hover-expected.txt: Removed.
Since we've fixed the issue with event dispatch in WK1, we can remove these platform-specific expectations.
* platform/mac/TestExpectations: We no longer skip this test which works reliably.
* pointerevents/mouse/pointer-capture.html: We modify this test to correctly expect the "gotpointercapture" event only once the next
pointer event has been dispatched.

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

4 months agocontributors.json not canonicalized since r243297
mcatanzaro@igalia.com [Mon, 24 Jun 2019 18:59:41 +0000 (18:59 +0000)]
contributors.json not canonicalized since r243297
https://bugs.webkit.org/show_bug.cgi?id=199161

Reviewed by Alexey Proskuryakov.

Canonicalize it using 'validate-committer-lists --canonicalize'

* Scripts/webkitpy/common/config/contributors.json:

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

4 months ago[bmalloc] IsoHeap shared tier threshold is small
ysuzuki@apple.com [Mon, 24 Jun 2019 18:49:09 +0000 (18:49 +0000)]
[bmalloc] IsoHeap shared tier threshold is small
https://bugs.webkit.org/show_bug.cgi?id=199145

Reviewed by Saam Barati.

We accidentally picked 3 for the shared tier threshold. While this is OK because the important part of IsoHeap shared tier is putting
small # of shared objects before tiering up to the page-based allocation, increasing this threshold can potentially improve memory footprint.
This patch increases this threshold from 3 to 8. A/B test says that this offers stable 0.25% improvement in PLUM2.

* bmalloc/IsoHeapImpl.h:

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

4 months ago[perf.webkit.org] Update summary page calculations to use mean instead of median
dean_johnson@apple.com [Mon, 24 Jun 2019 18:20:43 +0000 (18:20 +0000)]
[perf.webkit.org] Update summary page calculations to use mean instead of median
https://bugs.webkit.org/show_bug.cgi?id=199050

Reviewed by Dewei Zhu.

* public/v3/pages/summary-page.js:
(SummaryPageConfigurationGroup): Updated 'median' references to 'mean'.
(SummaryPageConfigurationGroup.set _startAndEndPointForTimeRange): Factored out logic for finding data
points in a timeSeries, within a specified timeRange.
(SummaryPageConfigurationGroup.set _meanForTimeRange): New. Returns the mean of a timeSeries across a
given timeRange.

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

4 months agowebkitpy: Build style should be lower-case
jbedard@apple.com [Mon, 24 Jun 2019 18:18:46 +0000 (18:18 +0000)]
webkitpy: Build style should be lower-case
https://bugs.webkit.org/show_bug.cgi?id=199158

Reviewed by Aakash Jain.

* Scripts/webkitpy/test/main.py:
(Tester._run_tests): Make all styles lower-case.

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

4 months ago[ews-build] Remove iOS queue from old EWS and dashboard
aakash_jain@apple.com [Mon, 24 Jun 2019 18:06:02 +0000 (18:06 +0000)]
[ews-build] Remove iOS queue from old EWS and dashboard
https://bugs.webkit.org/show_bug.cgi?id=199150

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueueServer.js:
* QueueStatusServer/config/queues.py:

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

4 months agoArraySlice needs to keep the source array alive.
mark.lam@apple.com [Mon, 24 Jun 2019 17:38:12 +0000 (17:38 +0000)]
ArraySlice needs to keep the source array alive.
https://bugs.webkit.org/show_bug.cgi?id=197374
<rdar://problem/50304429>

Reviewed by Michael Saboff and Filip Pizlo.

JSTests:

* stress/array-slice-must-keep-source-array-alive.js: Added.

Source/JavaScriptCore:

The implementation of the FTL ArraySlice intrinsics may GC while allocating the
result array and its butterfly.  Previously, ArraySlice already keeps the source
butterfly alive in order to copy from it to the new butterfly after the allocation.
Unfortunately, this is not enough.  We also need to keep the source array alive
so that GC will scan the values in the butterfly as well.  Note: the butterfly
does not have a visitChildren() method to do this scan.  It's the parent object's
responsibility to do the scanning.

This patch fixes this by introducing a keepAlive() utility method, and we use it
to keep the source array alive while allocating the result array and butterfly.

keepAlive() works by using a patchpoint to communicate to B3 that a value (the
source array in this case) is still in use.  It also uses a fence to keep B3 from
relocating the patchpoint, which may defeat the fix.

For the DFG's SpeculativeJIT::compileArraySlice(), we may have lucked out and the
source array cell is kept alive.  This patch makes it explicit that we should
keep its cell alive till after the result array has been allocated.

For the Baseline JIT and LLInt, we use the arrayProtoFuncSlice() runtime function
and there is no issue because the source array (in "thisObj") is in the element
copying loop that follows the allocation of the result array.  However, for
documentation purposes, this patch adds a call to HeapCell::use() to indicate that
the source array need to kept alive at least until after the allocation of the
result array.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileArraySlice):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileArraySlice):
(JSC::FTL::DFG::LowerDFGToB3::allocateJSArray):
(JSC::FTL::DFG::LowerDFGToB3::keepAlive):
* runtime/ArrayPrototype.cpp:
(JSC::arrayProtoFuncSlice):

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

4 months agoAPI Test [Mojave+ WK2 Debug ] TestWebKitAPI.WKAttachmentTestsMac.InsertDroppedFilePro...
ryanhaddad@apple.com [Mon, 24 Jun 2019 17:37:51 +0000 (17:37 +0000)]
API Test [Mojave+ WK2 Debug ] TestWebKitAPI.WKAttachmentTestsMac.InsertDroppedFilePromisesAsAttachments is a flaky crash
https://bugs.webkit.org/show_bug.cgi?id=198795

Unreviewed test gardening.

* TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm:
(TestWebKitAPI::TEST): Disable flaky test.

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

4 months ago[ews-build] Enable iOS-12-Build queue on new EWS
aakash_jain@apple.com [Mon, 24 Jun 2019 15:26:49 +0000 (15:26 +0000)]
[ews-build] Enable iOS-12-Build queue on new EWS
https://bugs.webkit.org/show_bug.cgi?id=199149

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/config.json: Enable iOS-12-Build-EWS trigger. Also temporarily share ews152 and ews154 with
this queue.
* BuildSlaveSupport/ews-app/ews/views/statusbubble.py:
(StatusBubble): Enable ios status-bubble. Also display the ios bubble first (left). Going forward
will keep the builders to the left and testers to the right.

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

4 months ago[ews-build] Upload test results after running layout-tests
aakash_jain@apple.com [Mon, 24 Jun 2019 15:11:02 +0000 (15:11 +0000)]
[ews-build] Upload test results after running layout-tests
https://bugs.webkit.org/show_bug.cgi?id=199120

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/steps.py:
(RunWebKitTests.evaluateCommand):
* BuildSlaveSupport/ews-build/steps_unittest.py: Added unit-tests.

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

4 months agoWeb Inspector: AXI: Audit: image label test is throwing spurious errors on elements...
commit-queue@webkit.org [Mon, 24 Jun 2019 15:03:46 +0000 (15:03 +0000)]
Web Inspector: AXI: Audit: image label test is throwing spurious errors on elements with existing alt attr, but no value: <img alt>
https://bugs.webkit.org/show_bug.cgi?id=194754

Patch by Greg Doolittle <gr3g@apple.com> on 2019-06-24
Reviewed by Chris Fleizach.

Source/WebCore:

Test: accessibility/img-alt-attribute-unassigned-value.html

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::computedRoleString const):

LayoutTests:

* accessibility/img-alt-attribute-unassigned-value-expected.txt: Added.
* accessibility/img-alt-attribute-unassigned-value.html: Added.
* inspector/dom/getAccessibilityPropertiesForNode-expected.txt:

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

4 months ago[ews-build] EWS should provide option to download layout test results zip file
aakash_jain@apple.com [Mon, 24 Jun 2019 14:58:25 +0000 (14:58 +0000)]
[ews-build] EWS should provide option to download layout test results zip file
https://bugs.webkit.org/show_bug.cgi?id=199121

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/steps.py:
(ExtractTestResults.resultsDownloadURL): Method to return layout test result zip file url.
(ExtractTestResults.addCustomURLs): Add url to download layout test results zip file.

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

4 months ago[WPE][GTK] Fixes for compilation with unified builds disabled
aperez@igalia.com [Mon, 24 Jun 2019 14:52:53 +0000 (14:52 +0000)]
[WPE][GTK] Fixes for compilation with unified builds disabled
https://bugs.webkit.org/show_bug.cgi?id=199155

Reviewed by Michael Catanzaro.

Source/WebCore:

No new tests needed.

* rendering/LayerAncestorClippingStack.h: Add missing inclusion of RenderLayer.h

Source/WebKit:

* NetworkProcess/glib/DNSCache.cpp: Add missing inclusion of wtf/glib/RunLoopSourcePriority.h
* NetworkProcess/glib/DNSCache.h: Add missing forward declaration for GInetAddress

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

4 months agoAdd user agent quirk for Google Drive
mcatanzaro@igalia.com [Mon, 24 Jun 2019 14:35:42 +0000 (14:35 +0000)]
Add user agent quirk for Google Drive
https://bugs.webkit.org/show_bug.cgi?id=199153

Reviewed by Carlos Garcia Campos.

Source/WebCore:

This suppresses an unsupported browser warning.

* platform/UserAgentQuirks.cpp:
(WebCore::urlRequiresMacintoshPlatform):
(WebCore::urlRequiresLinuxDesktopPlatform):

Tools:

* TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp:
(TestWebKitAPI::TEST):

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

4 months ago[GTK] Navigation gesture should use dark fallback bg color on dark themes
commit-queue@webkit.org [Mon, 24 Jun 2019 14:34:47 +0000 (14:34 +0000)]
[GTK] Navigation gesture should use dark fallback bg color on dark themes
https://bugs.webkit.org/show_bug.cgi?id=199104

Patch by Alexander Mikhaylenko <exalm7659@gmail.com> on 2019-06-24
Reviewed by Michael Catanzaro.

Use theme_base_color instead of white background for swipe gesture fallback if no snapshot is found and
the page did not specify a color. This allows it to use dark colors for dark themes. If the color was
not found, still fall back to white.

* UIProcess/gtk/ViewGestureControllerGtk.cpp:
(WebKit::ViewGestureController::beginSwipeGesture):

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

4 months ago[GStreamer][MSE] Pausing video sometimes causes skip to finish
cturner@igalia.com [Mon, 24 Jun 2019 11:33:30 +0000 (11:33 +0000)]
[GStreamer][MSE] Pausing video sometimes causes skip to finish
https://bugs.webkit.org/show_bug.cgi?id=197355

Reviewed by Philippe Normand.

Covered by existing tests.

* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::currentMediaTime const):
Assuming that when m_eosPending is on and we're paused() that the
network resource is fully loaded and the end is reached is clearly
wrong. Whether this is now correct is unclear...

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

4 months ago[GStreamer] Volume level sometimes changes inappropriately
cturner@igalia.com [Mon, 24 Jun 2019 11:27:05 +0000 (11:27 +0000)]
[GStreamer] Volume level sometimes changes inappropriately
https://bugs.webkit.org/show_bug.cgi?id=197358

Reviewed by Xabier Rodriguez-Calvar.

Be consistent with our application of volume scaling. We were
setting volumes using cubic interpolation in setVolume() and using
the inverse in volume(); however setting initial volumes was done
linearly in setStreamVolumeElement, which was causing strange
jumps in the volume level at non-deterministic times. The fix
looks to be that we should use linear interpolation consistently,
since PulseAudio already applies cubic scaling to software
volumes.

Covered by existing tests.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::paused const): Bump the
logging here to LOG level, it's very spammy at DEBUG.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::setVolume): Switch to
linear interpolation.
(WebCore::MediaPlayerPrivateGStreamerBase::volume const): Ditto.
(WebCore::MediaPlayerPrivateGStreamerBase::notifyPlayerOfVolumeChange):
Ditto.
(WebCore::MediaPlayerPrivateGStreamerBase::setStreamVolumeElement):
Ditto, and be consistent here with the API, do not set the raw
volume managed by MediaElement.

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

4 months ago[Pointer Events] Respect pointer capture when dispatching mouse boundary events and...
graouts@webkit.org [Mon, 24 Jun 2019 10:45:34 +0000 (10:45 +0000)]
[Pointer Events] Respect pointer capture when dispatching mouse boundary events and updating :hover
https://bugs.webkit.org/show_bug.cgi?id=198999
<rdar://problem/51979477>

Unreviewed.

Rolling back all changes made for this bug (r246728 + r246716 + r246674) as it regressed one test
(imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_pointercapture_in_frame.html).

LayoutTests/imported/w3c:

* web-platform-tests/pointerevents/pointerevent_boundary_events_at_implicit_release_hoverable_pointers-expected.txt:
* web-platform-tests/pointerevents/pointerevent_click_during_capture-expected.txt:
* web-platform-tests/pointerevents/pointerevent_mouse_capture_change_hover-expected.txt:
* web-platform-tests/pointerevents/pointerevent_setpointercapture_relatedtarget-expected.txt:

Source/WebCore:

* dom/Document.cpp:
(WebCore::Document::prepareMouseEvent):
(WebCore::Document::updateHoverActiveState):
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::handleMouseMoveEvent):
(WebCore::EventHandler::handleMouseReleaseEvent):
(WebCore::EventHandler::setCapturingMouseEventsElement):
* page/EventHandler.h:
* page/PointerCaptureController.cpp:
(WebCore::PointerCaptureController::releasePointerCapture):
(WebCore::PointerCaptureController::hasPointerCapture):
(WebCore::PointerCaptureController::dispatchEventForTouchAtIndex):
(WebCore::PointerCaptureController::dispatchEvent):
(WebCore::PointerCaptureController::processPendingPointerCapture):
(WebCore::PointerCaptureController::pointerCaptureElement): Deleted.
* page/PointerCaptureController.h:
* rendering/HitTestRequest.h:
(WebCore::HitTestRequest::includesAllElementsUnderPoint const):
(WebCore::HitTestRequest::pointerCaptureElementChanged const): Deleted.

LayoutTests:

* platform/mac-highsierra-wk1/imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_capture_change_hover-expected.txt: Added.
* platform/mac-highsierra/imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_capture_change_hover-expected.txt: Added.
* platform/mac-wk1/imported/w3c/web-platform-tests/pointerevents/pointerevent_boundary_events_at_implicit_release_hoverable_pointers-expected.txt:
* platform/mac-wk1/imported/w3c/web-platform-tests/pointerevents/pointerevent_click_during_capture-expected.txt: Removed.
* platform/mac-wk1/imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_pointercapture_in_frame-expected.txt: Added.
* platform/mac-wk1/imported/w3c/web-platform-tests/pointerevents/pointerevent_setpointercapture_relatedtarget-expected.txt:

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