WebKit-https.git
5 months agoDisable CSSOM View Scrolling API for IMDb iOS app
commit-queue@webkit.org [Fri, 9 Aug 2019 20:20:49 +0000 (20:20 +0000)]
Disable CSSOM View Scrolling API for IMDb iOS app
https://bugs.webkit.org/show_bug.cgi?id=200586
<rdar://problem/53645833>

Patch by Alex Christensen <achristensen@webkit.org> on 2019-08-09
Reviewed by Simon Fraser.

Source/WebCore:

They are calling scrollHeight on the HTML element and it is running new code introduced in r235806
Disable this new feature until they update their app to use the iOS13 SDK.

* platform/RuntimeApplicationChecks.h:
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::IOSApplication::isIMDb):

Source/WebKit:

Change the CSSOMViewScrollingAPIEnabled default value to be off for the IMDb app's WKWebViews.
I manually verified this is effective in those WKWebViews but no other WKWebViews and that it fixes the radar.

* Shared/WebPreferences.yaml:
* Shared/WebPreferencesDefaultValues.cpp:
(WebKit::defaultCSSOMViewScrollingAPIEnabled):
* Shared/WebPreferencesDefaultValues.h:

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

5 months ago[ews] Add buildbot.tac to repository
aakash_jain@apple.com [Fri, 9 Aug 2019 19:51:39 +0000 (19:51 +0000)]
[ews] Add buildbot.tac to repository
https://bugs.webkit.org/show_bug.cgi?id=200580

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/buildbot.tac: Added.

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

5 months agoTapping buttons in Data Detectors lookup previews doesn't work
timothy_horton@apple.com [Fri, 9 Aug 2019 19:50:44 +0000 (19:50 +0000)]
Tapping buttons in Data Detectors lookup previews doesn't work
https://bugs.webkit.org/show_bug.cgi?id=200579
<rdar://problem/54056519>

Reviewed by Megan Gardner.

Source/WebCore/PAL:

* pal/spi/ios/DataDetectorsUISPI.h:

Source/WebKit:

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _contextMenuInteraction:styleForMenuWithConfiguration:]):
If a Data Detectors context menu wants the action menu style, provide it.

(-[WKContentView contextMenuInteraction:willPerformPreviewActionForMenuWithConfiguration:animator:]):
If a Data Detectors context menu provides a view controller to present
on context menu commit, present it. We present on top of the same view
controller that is currently presenting the context menu, but modally
instead of inside the context menu.

If a Data Detectors context menu instead provides a URL to launch on
context menu commit, call openURL.

In both cases, change the commit style to pop, since we're committing
instead of dismissing.

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

5 months agoCorrecting Expectation Typo from r248388.
russell_e@apple.com [Fri, 9 Aug 2019 17:46:12 +0000 (17:46 +0000)]
Correcting Expectation Typo from r248388.
rdar://54049321

Unreviewed Test Gardening.

* platform/ios-12/TestExpectations:
* platform/ios/TestExpectations:

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

5 months agoRemove MediaStreamRegistry
youenn@apple.com [Fri, 9 Aug 2019 16:58:47 +0000 (16:58 +0000)]
Remove MediaStreamRegistry
https://bugs.webkit.org/show_bug.cgi?id=200570

Reviewed by Eric Carlson.

MediaStream cannot be registered as an URL by JavaScript.
Remove MediaStreamRegistry and the 'src' loading specific handling in HTMLMediaElement.
Implement ending of capture track by directly handling MediaStreamTrack which is more accurate.
No change of behavior.

* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::MediaStream):
(WebCore::MediaStream::~MediaStream):
(WebCore::MediaStream::stop):
* Modules/mediastream/MediaStream.h:
* Modules/mediastream/MediaStreamRegistry.cpp: Removed.
* Modules/mediastream/MediaStreamRegistry.h: Removed.
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::MediaStreamTrack):
(WebCore::MediaStreamTrack::~MediaStreamTrack):
(WebCore::MediaStreamTrack::endCapture):
* Modules/mediastream/MediaStreamTrack.h:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/Document.cpp:
(WebCore::Document::stopMediaCapture):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::loadResource):

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

5 months ago[GTK] Add missing spellchecking packages to dependencies script
csaavedra@igalia.com [Fri, 9 Aug 2019 14:54:33 +0000 (14:54 +0000)]
[GTK] Add missing spellchecking packages to dependencies script
https://bugs.webkit.org/show_bug.cgi?id=200574

Reviewed by Philippe Normand.

These are needed for the spellchecking test in WebContext API tests.

* gtk/install-dependencies:

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

5 months ago[GL][GStreamer] activate wrapped shared context
commit-queue@webkit.org [Fri, 9 Aug 2019 09:36:45 +0000 (09:36 +0000)]
[GL][GStreamer] activate wrapped shared context
https://bugs.webkit.org/show_bug.cgi?id=196966

Patch by Víctor Manuel Jáquez Leal <vjaquez@igalia.com> on 2019-08-09
Reviewed by Žan Doberšek.

This patch consists in four parts:

1\ When the media player is instantiated, and it is intended to
render textures, it will create a wrapped object of the
application's GL context, and in order to populate the wrapped
object with the GL vtable, the context has to be current. Thus,
this patch makes current the shared WebKit application context,
and populate the wrapped GstGLContext by activating it and filling
in it. Afterwards, the wrapped context is deactivated.

2\ This patch makes GL texture use the RGBA color space, thus the
color transformation is done in GStreamer, and no further color
transformation is required in WebKit.

3\ Since it is not necessary to modify behavior if the decoder is
imxvpudecoder, its identification and label were removed.

4\ As only RGBA is used, the old color conversions when rendering
using Cairo (fallback) were changed to convert the RGBA, as in
GStreamer's format, to ARGB32, as in Cairo format -which depends
on endianness.

No new tests because there is no behavior change.

* platform/graphics/gstreamer/ImageGStreamerCairo.cpp:
(WebCore::ImageGStreamer::ImageGStreamer): Only convert GStreamer
RGBA to Cairo RGB32.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Removes
the IMX VPU identification.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
Intializes the wrapped GL Context.
(WebCore::MediaPlayerPrivateGStreamerBase::updateTextureMapperFlags):
Removes frame's color conversion.
(WebCore::MediaPlayerPrivateGStreamerBase::createVideoSinkGL):
Instead of parsing a string, the GstCaps are created manually, and
it is set to appsink, rather than a filtered linking.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
Removes ImxVPU enumeration value.
* platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
Adds NoConvert option to texture copier, setting an identity
matrix.
(WebCore::VideoTextureCopierGStreamer::updateColorConversionMatrix):
* platform/graphics/gstreamer/VideoTextureCopierGStreamer.h: Adds
NoConvert enumeration value.

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

5 months agoREGRESSION (iOS 13): united.com web forms do not respond to taps
rniwa@webkit.org [Fri, 9 Aug 2019 07:17:44 +0000 (07:17 +0000)]
REGRESSION (iOS 13): united.com web forms do not respond to taps
https://bugs.webkit.org/show_bug.cgi?id=200531

Reviewed by Antti Koivisto and Wenson Hsieh.

The bug is caused by the content change observer detecting “Site Feedback” link at the bottom of
the page (https://www.united.com/ual/en/US/account/enroll/default) constantly getting re-generated
in every frame via requestAnimationFrame when the page is opened with iPhone UA string.
Note that the content re-generation can be reproduced even in Chrome if iPhone UA string is used.

Ignore this constant content change in ContentChangeObserver as a site specific quirk.

In the future, we should make ContentChangeObserver observe the final location of each element
being observed so that we can ignore content that like this which is placed outside the viewport,
and/or far away from where the user tapped.

* page/Quirks.cpp:
(WebCore::Quirks::shouldIgnoreContentChange const): Added.
* page/Quirks.h:
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::shouldObserveVisibilityChangeForElement):

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

5 months ago[Win] Fix internal build
pvollan@apple.com [Fri, 9 Aug 2019 05:51:44 +0000 (05:51 +0000)]
[Win] Fix internal build
https://bugs.webkit.org/show_bug.cgi?id=200519

Reviewed by Alex Christensen.

Source/JavaScriptCore:

The script 'generate-js-builtins.py' cannot be found when building WebCore. Copy the JavaScriptCore Scripts
folder after building JSC.

* JavaScriptCore.vcxproj/JavaScriptCore.proj:

Source/WebKitLegacy/win:

Switch to the String::wideCharacers method, since its return type is compatible with the Win32 api.

* WebDownloadCFNet.cpp:
(WebDownload::didFinish):

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

5 months agoREGRESSION (52279987): Most of the WKUIDelegate contextMenu delegate methods are...
dino@apple.com [Fri, 9 Aug 2019 02:11:18 +0000 (02:11 +0000)]
REGRESSION (52279987): Most of the WKUIDelegate contextMenu delegate methods are not being called
https://bugs.webkit.org/show_bug.cgi?id=200557
<rdar://problem/53717962>

Reviewed by Wenson Hsieh.

UIKit changed the name of delegates recently. We ignored the warning because
it was still calling the old methods. However, it will only do so for applications
authored by Apple, breaking 3rd parties.

The change here is just adopting the new methods in place of the old ones.
It does not change the API that WebKit vends (they still use the older names).

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView contextMenuInteraction:willDisplayMenuForConfiguration:animator:]):
(-[WKContentView contextMenuInteraction:willPerformPreviewActionForMenuWithConfiguration:animator:]):
(-[WKContentView contextMenuInteraction:willEndForConfiguration:animator:]):
(-[WKContentView contextMenuInteractionWillPresent:]): Deleted.
(-[WKContentView contextMenuInteraction:willCommitWithAnimator:]): Deleted.
(-[WKContentView contextMenuInteractionDidEnd:]): Deleted.

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

5 months ago[iOS WK2] Hide previews when an inner overflow or frame scrollview scrolls
simon.fraser@apple.com [Fri, 9 Aug 2019 01:57:49 +0000 (01:57 +0000)]
[iOS WK2] Hide previews when an inner overflow or frame scrollview scrolls
https://bugs.webkit.org/show_bug.cgi?id=200552
rdar://problem/54086338

Reviewed by Wenson Hsieh.

Give UITargetedPreview the UIScrollView that the target element is inside of,
so it can clean up if the user starts to scroll that view.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _createTargetedPreviewIfPossible]):

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

5 months agoWeb Inspector: Page: don't allow the domain to be disabled
drousso@apple.com [Fri, 9 Aug 2019 01:10:41 +0000 (01:10 +0000)]
Web Inspector: Page: don't allow the domain to be disabled
https://bugs.webkit.org/show_bug.cgi?id=200109

Reviewed by Brian Burg.

Source/JavaScriptCore:

The `PageAgent` is relied on by many of the other agents, so much so that it doesn't make
sense to support the ability to "disable" (as well as "enable") the agent.

When the first frontend connects, we should treat the `PageAgent` as active and available.

* inspector/protocol/Page.json:
Remove `enable`/`disable`.

Source/WebCore:

The `PageAgent` is relied on by many of the other agents, so much so that it doesn't make
sense to support the ability to "disable" (as well as "enable") the agent.

When the first frontend connects, we should treat the `PageAgent` as active and available.

* inspector/agents/InspectorPageAgent.h:
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::didCreateFrontendAndBackend):
(WebCore::InspectorPageAgent::willDestroyFrontendAndBackend):
(WebCore::InspectorPageAgent::timestamp):
(WebCore::InspectorPageAgent::enable): Deleted.
(WebCore::InspectorPageAgent::disable): Deleted.

* inspector/agents/InspectorApplicationCacheAgent.cpp:
(WebCore::InspectorApplicationCacheAgent::updateApplicationCacheStatus):
(WebCore::InspectorApplicationCacheAgent::getFramesWithManifests):
(WebCore::InspectorApplicationCacheAgent::assertFrameWithDocumentLoader):
* inspector/agents/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::createStyleSheet):
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::highlightSelector):
(WebCore::InspectorDOMAgent::highlightFrame):
(WebCore::InspectorDOMAgent::buildObjectForNode):
* inspector/agents/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::setFrameIdentifier):
* inspector/agents/page/PageNetworkAgent.cpp:
(WebCore::PageNetworkAgent::loaderIdentifier):
(WebCore::PageNetworkAgent::frameIdentifier):
(WebCore::PageNetworkAgent::scriptExecutionContext):
* inspector/agents/page/PageRuntimeAgent.cpp:
(WebCore::PageRuntimeAgent::didCreateMainWorldContext):
(WebCore::PageRuntimeAgent::reportExecutionContextCreation):

* testing/Internals.cpp:
(WebCore::InspectorStubFrontend::InspectorStubFrontend):
(WebCore::InspectorStubFrontend::frontendLoaded): Added.
(WebCore::InspectorStubFrontend::closeWindow):
(WebCore::InspectorStubFrontend::sendMessageToFrontend):
(WebCore::InspectorStubFrontend::frontendPage): Deleted.
Ensure that the backend always gets notified via `InspectorFrontendHost.loaded` so that
messages being sent to the frontend are batched.

Source/WebInspectorUI:

The `PageAgent` is relied on by many of the other agents, so much so that it doesn't make
sense to support the ability to "disable" (as well as "enable") the agent.

When the first frontend connects, we should treat the `PageAgent` as active and available.

* UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager.prototype.initializeTarget):

* Test/Test.js:
(WI.loaded):
(WI.initializeBackendTarget):
(WI.contentLoaded):
(WI.targetsAvailable): Added.
(WI.whenTargetsAvailable): Added.
* Test/TestStub.js:
Ensure that the backend always gets notified via `InspectorFrontendHost.loaded` so that
messages being sent to the frontend are batched.

LayoutTests:

* http/tests/inspector/page/loading-iframe-document-node.html:
* inspector/page/archive.html:
* inspector/page/frameScheduledNavigation.html:
* inspector/page/frameScheduledNavigation-async-delegates.html:
* inspector/page/frameStartedLoading.html:
* inspector/page/media-query-list-listener-exception.html:
* inspector/timeline/line-column.html:

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

5 months agoUnreviewed. Get rid of extraneous whitespace in ChangeLog.
jonlee@apple.com [Fri, 9 Aug 2019 01:05:06 +0000 (01:05 +0000)]
Unreviewed. Get rid of extraneous whitespace in ChangeLog.

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

5 months agoAdd threading assertions to WebStorage code
cdumez@apple.com [Fri, 9 Aug 2019 00:08:07 +0000 (00:08 +0000)]
Add threading assertions to WebStorage code
https://bugs.webkit.org/show_bug.cgi?id=200550

Reviewed by Geoffrey Garen.

Add threading assertions to WebStorage code for extra safety.

* NetworkProcess/WebStorage/LocalStorageNamespace.cpp:
(WebKit::LocalStorageNamespace::LocalStorageNamespace):
(WebKit::LocalStorageNamespace::~LocalStorageNamespace):
(WebKit::LocalStorageNamespace::getOrCreateStorageArea):
(WebKit::LocalStorageNamespace::clearStorageAreasMatchingOrigin):
(WebKit::LocalStorageNamespace::clearAllStorageAreas):
(WebKit::LocalStorageNamespace::ephemeralOrigins const):
(WebKit::LocalStorageNamespace::cloneTo):
* NetworkProcess/WebStorage/SessionStorageNamespace.cpp:
(WebKit::SessionStorageNamespace::SessionStorageNamespace):
(WebKit::SessionStorageNamespace::~SessionStorageNamespace):
(WebKit::SessionStorageNamespace::addAllowedConnection):
(WebKit::SessionStorageNamespace::removeAllowedConnection):
(WebKit::SessionStorageNamespace::getOrCreateStorageArea):
(WebKit::SessionStorageNamespace::cloneTo):
(WebKit::SessionStorageNamespace::origins const):
(WebKit::SessionStorageNamespace::clearStorageAreasMatchingOrigin):
(WebKit::SessionStorageNamespace::clearAllStorageAreas):
* NetworkProcess/WebStorage/StorageArea.cpp:
(WebKit::StorageArea::StorageArea):
(WebKit::StorageArea::~StorageArea):
(WebKit::StorageArea::addListener):
(WebKit::StorageArea::removeListener):
(WebKit::StorageArea::hasListener const):
(WebKit::StorageArea::clone const):
(WebKit::StorageArea::setItem):
(WebKit::StorageArea::setItems):
(WebKit::StorageArea::removeItem):
(WebKit::StorageArea::clear):
(WebKit::StorageArea::items const):
(WebKit::StorageArea::openDatabaseAndImportItemsIfNeeded const):
(WebKit::StorageArea::dispatchEvents const):
* NetworkProcess/WebStorage/StorageManager.cpp:
(WebKit::StorageManager::createSessionStorageNamespace):
(WebKit::StorageManager::destroySessionStorageNamespace):
(WebKit::StorageManager::addAllowedSessionStorageNamespaceConnection):
(WebKit::StorageManager::removeAllowedSessionStorageNamespaceConnection):
(WebKit::StorageManager::cloneSessionStorageNamespace):
(WebKit::StorageManager::processDidCloseConnection):
(WebKit::StorageManager::getSessionStorageOrigins):
(WebKit::StorageManager::deleteSessionStorageOrigins):
(WebKit::StorageManager::deleteSessionStorageEntriesForOrigins):
(WebKit::StorageManager::getLocalStorageOrigins):
(WebKit::StorageManager::getLocalStorageOriginDetails):
(WebKit::StorageManager::deleteLocalStorageEntriesForOrigin):
(WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
(WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
(WebKit::StorageManager::waitUntilTasksFinished):
(WebKit::StorageManager::suspend):
(WebKit::StorageManager::resume):
(WebKit::StorageManager::findStorageArea const):
(WebKit::StorageManager::getOrCreateLocalStorageNamespace):
(WebKit::StorageManager::getOrCreateTransientLocalStorageNamespace):
* NetworkProcess/WebStorage/TransientLocalStorageNamespace.cpp:
(WebKit::TransientLocalStorageNamespace::TransientLocalStorageNamespace):
(WebKit::TransientLocalStorageNamespace::~TransientLocalStorageNamespace):
(WebKit::TransientLocalStorageNamespace::getOrCreateStorageArea):
(WebKit::TransientLocalStorageNamespace::origins const):
(WebKit::TransientLocalStorageNamespace::clearStorageAreasMatchingOrigin):
(WebKit::TransientLocalStorageNamespace::clearAllStorageAreas):

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

5 months agowebkitpy: Disable shared clipboard between Simulators
jbedard@apple.com [Thu, 8 Aug 2019 23:31:12 +0000 (23:31 +0000)]
webkitpy: Disable shared clipboard between Simulators
https://bugs.webkit.org/show_bug.cgi?id=200546

Reviewed by Aakash Jain.

* Scripts/webkitpy/xcode/simulated_device.py:
(SimulatedDeviceManager.initialize_devices): Disable PasteboardAutomaticSync in Simulator.app
managed by run-webkit-tests.

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

5 months agoShort-cut WebGLRenderingContext::getParameter() for ALPHA_BITS when alpha channel...
commit-queue@webkit.org [Thu, 8 Aug 2019 23:25:08 +0000 (23:25 +0000)]
Short-cut WebGLRenderingContext::getParameter() for ALPHA_BITS when alpha channel is disabled
https://bugs.webkit.org/show_bug.cgi?id=200499

Source/WebCore:

Patch by Chris Lord <clord@igalia.com> on 2019-08-08
Reviewed by Darin Adler.

This patch adds a shortcut when a framebuffer isn't bound on WebGL
canvases when retrieving ALPHA_BITS.

No new tests, covered by existing tests.

* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getParameter):
Return 0 for ALPHA_BITS if canvas has no alpha component.
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGLRenderingContext::getParameter):
Return 0 for ALPHA_BITS if canvas has no alpha component.

LayoutTests:

Patch by Chris Lord <chrislord.net@gmail.com> on 2019-08-08
Reviewed by Darin Adler.

* platform/ios-simulator/webgl/2.0.0/conformance/context/context-attributes-alpha-depth-stencil-antialias-expected.txt:
1 more passing test.

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

5 months agoAdd to InteractionInformationAtPosition information about whether the element is...
simon.fraser@apple.com [Thu, 8 Aug 2019 23:01:25 +0000 (23:01 +0000)]
Add to InteractionInformationAtPosition information about whether the element is in a subscrollable region
https://bugs.webkit.org/show_bug.cgi?id=200374
rdar://problem/54095519

Reviewed by Tim Horton.
Source/WebCore:

Add to InteractionInformationAtPosition a ScrollingNodeID which represents the enclosing scrolling
node that affects the targeted element's position. We use this to find a UIScrollView in the UI process.

The entrypoint to finding the enclosing scrolling node is ScrollingCoordinator::scrollableContainerNodeID(),
which calls RenderLayerCompositor::asyncScrollableContainerNodeID() to look for a scrolling ancestor in
the current frame, and then looks for an enclosing scrollable frame, or a scrolling ancestor in
the enclosing frame.

There's a bit of subtlety in RenderLayerCompositor::asyncScrollableContainerNodeID() because if you're asking
for the node that scrolls the renderer, if the renderer itself has a layer and is scrollable, you want
its enclosing scroller.

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::scrollableContainerNodeID const):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::scrollableContainerNodeID const):
* page/scrolling/ScrollingCoordinator.h:
* rendering/RenderLayer.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::asyncScrollableContainerNodeID):
* rendering/RenderLayerCompositor.h:

Source/WebKit:

Add InteractionInformationAtPosition.containerScrollingNodeID and initialize it in elementPositionInformation()
by asking the scrolling coordinator.

Also add a way to get from a ScrollingNodeID to a UIScrollView to RemoteScrollingCoordinatorProxy,
which gets the scrolling node and asks the delegate for the UIView.

* Shared/ios/InteractionInformationAtPosition.h:
* Shared/ios/InteractionInformationAtPosition.mm:
(WebKit::InteractionInformationAtPosition::encode const):
(WebKit::InteractionInformationAtPosition::decode):
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
* UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::scrollViewForScrollingNodeID const):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollView const):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::elementPositionInformation):

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

5 months agoFix thread safety issue in AudioSampleDataSource() constructor
cdumez@apple.com [Thu, 8 Aug 2019 22:57:10 +0000 (22:57 +0000)]
Fix thread safety issue in AudioSampleDataSource() constructor
https://bugs.webkit.org/show_bug.cgi?id=200547

Reviewed by Alex Christensen.

Make Logger ThreadSafeRefCounted as it is ref'd / deref'd from various
threads (including the main thread and the WebKitWebRTCAudioModule thread).

* wtf/Logger.h:

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

5 months agoScrollingStateNode is not ThreadSafeRefCounted but is ref'd / deref'd from several...
cdumez@apple.com [Thu, 8 Aug 2019 22:10:36 +0000 (22:10 +0000)]
ScrollingStateNode is not ThreadSafeRefCounted but is ref'd / deref'd from several threads
https://bugs.webkit.org/show_bug.cgi?id=200545

Reviewed by Antti Koivisto.

The ScrollingStateTree and its ScrollingStateNodes are being passed to the scrolling thread.
ScrollingStateNode is not ThreadSafeRefCounted, which is potentially unsafe. Make it
ThreadSafeRefCounted for safety in this patch given that using RefCounted here is either
wrong or fragile.

* page/scrolling/ScrollingStateNode.h:

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

5 months ago[FTW] Get WebKit, WebKit2, and MiniBrowser building and executing
bfulgham@apple.com [Thu, 8 Aug 2019 22:03:58 +0000 (22:03 +0000)]
[FTW] Get WebKit, WebKit2, and MiniBrowser building and executing
https://bugs.webkit.org/show_bug.cgi?id=200539
.:

<rdar://problem/54082550>

Reviewed by Dean Jackson.

* Source/cmake/OptionsFTW.cmake:

Source/ThirdParty/ANGLE:

Reviewed by Dean Jackson.

* PlatformFTW.cmake: Added.

Source/WebCore:

<rdar://problem/54082550>

Reviewed by Dean Jackson.

* platform/graphics/win/BackingStoreBackendDirect2D.h:
(WebCore::BackingStoreBackendDirect2D::renderTarget const):
(WebCore::BackingStoreBackendDirect2D::surface const):
(): Deleted.
* platform/graphics/win/BackingStoreBackendDirect2DImpl.cpp:
(WebCore::BackingStoreBackendDirect2DImpl::~BackingStoreBackendDirect2DImpl):
(WebCore::BackingStoreBackendDirect2DImpl::scroll):
(WebCore::createDirect2DImageSurfaceWithFastMalloc): Deleted.
* platform/graphics/win/BackingStoreBackendDirect2DImpl.h:
* platform/graphics/win/DIBPixelData.cpp:
(WebCore::DIBPixelData::DIBPixelData):
* platform/graphics/win/DIBPixelData.h:
* platform/graphics/win/Direct2DOperations.cpp:
(WebCore::Direct2D::fillRectWithRoundedHole):
(WebCore::Direct2D::fillRectWithGradient):
(WebCore::Direct2D::drawGlyphs):
(WebCore::Direct2D::PlatformContextStateSaver::PlatformContextStateSaver): Deleted.
(WebCore::Direct2D::PlatformContextStateSaver::~PlatformContextStateSaver): Deleted.
(WebCore::Direct2D::PlatformContextStateSaver::save): Deleted.
(WebCore::Direct2D::PlatformContextStateSaver::restore): Deleted.
(WebCore::Direct2D::PlatformContextStateSaver::didSave const): Deleted.
* platform/graphics/win/Direct2DOperations.h:
* platform/graphics/win/Direct2DUtilities.cpp:
(WebCore::Direct2D::bitmapSize):
(WebCore::Direct2D::bitmapResolution):
(WebCore::Direct2D::createWicBitmap):
(WebCore::Direct2D::createBitmap):
(WebCore::Direct2D::createGDIRenderTarget):
(WebCore::Direct2D::copyRectFromOneSurfaceToAnother):
* platform/graphics/win/Direct2DUtilities.h:
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContext::GraphicsContext):
(WebCore::GraphicsContext::platformContext const):
(WebCore::GraphicsContextPlatformPrivate::setAlpha):
(WebCore::GraphicsContext::savePlatformState):
(WebCore::GraphicsContext::restorePlatformState):
(WebCore::GraphicsContext::releaseWindowsContext):
(WebCore::GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate):
(WebCore::GraphicsContextPlatformPrivate::beginDraw):
(WebCore::GraphicsContextPlatformPrivate::endDraw):
(WebCore::GraphicsContext::beginDraw):
(WebCore::GraphicsContext::endDraw):
(WebCore::GraphicsContext::setCTM):
(WebCore::GraphicsContext::isAcceleratedContext const):
* platform/graphics/win/GraphicsContextImplDirect2D.cpp:
(WebCore::GraphicsContextImplDirect2D::fillRect):
(WebCore::GraphicsContextImplDirect2D::fillRectWithRoundedHole):
(WebCore::GraphicsContextImplDirect2D::drawGlyphs):
* platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h:
(WebCore::GraphicsContextPlatformPrivate::platformContext):
* platform/graphics/win/PathDirect2D.cpp:
(WebCore::Path::transform):
* platform/graphics/win/PlatformContextDirect2D.cpp:
(WebCore::PlatformContextDirect2D::beginDraw):
(WebCore::PlatformContextDirect2D::endDraw):
* platform/graphics/win/PlatformContextDirect2D.h:
(WebCore::PlatformContextStateSaver::PlatformContextStateSaver):
(WebCore::PlatformContextStateSaver::~PlatformContextStateSaver):
(WebCore::PlatformContextStateSaver::save):
(WebCore::PlatformContextStateSaver::restore):
(WebCore::PlatformContextStateSaver::didSave const):

Source/WebKit:

<rdar://problem/54082550>

Reviewed by Dean Jackson.

* PlatformFTW.cmake: Added.
* Shared/ShareableBitmap.h:
* Shared/win/ShareableBitmapDirect2D.cpp: Added.
* UIProcess/BackingStore.cpp:
* UIProcess/BackingStore.h:
(WebKit::BackingStore::renderTarget):
* UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
* UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h:
* UIProcess/win/BackingStoreDirect2D.cpp: Added.
* UIProcess/win/WebInspectorProxyWin.cpp:
(WebKit::WebInspectorProxy::inspectorPageURL):
(WebKit::WebInspectorProxy::inspectorTestPageURL):
(WebKit::WebInspectorProxy::inspectorBaseURL):
* UIProcess/win/WebView.cpp:
(WebKit::WebView::paint):
* UIProcess/win/WebView.h:
* WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
(WebKit::DrawingAreaCoordinatedGraphics::display):
* WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h:
* WebProcess/WebPage/win/WebInspectorUIWin.cpp:
(WebKit::WebInspectorUI::localizedStringsURL):
(WebKit::RemoteWebInspectorUI::localizedStringsURL):
* WebProcess/win/WebProcessMainWin.cpp:
(WebKit::WebProcessMainWin):

Source/WebKitLegacy:

<rdar://problem/54082550>

Reviewed by Dean Jackson.

* CMakeLists.txt:
* PlatformFTW.cmake: Added.

Source/WebKitLegacy/win:

<rdar://problem/54082550>

Reviewed by Dean Jackson.

* AccessibleBase.cpp:
(AccessibleBase::get_locale):
* CFDictionaryPropertyBag.cpp:
(ConvertCFTypeToVariant):
(CFDictionaryPropertyBag::Read):
(CFDictionaryPropertyBag::Write):
* CFDictionaryPropertyBag.h:
* COMPropertyBag.h:
(HashType>::Read):
(HashType>::GetPropertyInfo):
* MarshallingHelpers.cpp:
* MarshallingHelpers.h:
* WebApplicationCache.cpp:
* WebArchive.cpp:
* WebArchive.h:
* WebCache.cpp:
* WebCoreSupport/WebFrameLoaderClient.cpp:
* WebDatabaseManager.cpp:
* WebHistory.cpp:
* WebHistoryItem.cpp:
* WebKitCOMAPI.cpp:
* WebKitCOMAPI.h:
* WebKitDLL.cpp:
* WebLocalizableStrings.cpp:
* WebLocalizableStrings.h:
* WebMutableURLRequest.cpp:
* WebPreferences.cpp:
* WebPreferences.h:
* WebView.cpp:
* WebView.h:

Tools:

<rdar://problem/54082550>

Reviewed by Dean Jackson.

* MiniBrowser/win/WebKitLegacyBrowserWindow.cpp:
* PlatformFTW.cmake: Added.

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

5 months agoOpenSource MemoryFootprint API for JSC command line tool
msaboff@apple.com [Thu, 8 Aug 2019 20:48:37 +0000 (20:48 +0000)]
OpenSource MemoryFootprint API for JSC command line tool
https://bugs.webkit.org/show_bug.cgi?id=200541

Reviewed by Saam Barati.

Source/JavaScriptCore:

Use wtf/spi/darwin/ProcessMemoryFootprint.h instead of WebKitAdditions/MemoryFootprint.h
for process memory stats.

* jsc.cpp:
(MemoryFootprint::MemoryFootprint):

Source/WTF:

OpenSource version of WebKitAdditions/MemoryFootprint.h.

* WTF.xcodeproj/project.pbxproj:
* wtf/spi/darwin/ProcessMemoryFootprint.h: Added.
(ProcessMemoryFootprint::now):
(ProcessMemoryFootprint::resetPeak):

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

5 months ago[Mac] Use the PID of the WebContent process when issuing local file read sandbox...
pvollan@apple.com [Thu, 8 Aug 2019 20:32:41 +0000 (20:32 +0000)]
[Mac] Use the PID of the WebContent process when issuing local file read sandbox extensions
https://bugs.webkit.org/show_bug.cgi?id=200543
Source/WebKit:

Reviewed by Brent Fulgham.

Adopt SPI to issue a process-specific sandbox extension for local file read, passing it the process
identifier of the WebContent process.

* Shared/Cocoa/SandboxExtensionCocoa.mm:
(WebKit::SandboxExtensionImpl::sandboxExtensionForType):
(WebKit::SandboxExtension::createHandleForReadByPid):
* Shared/SandboxExtension.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):

Source/WTF:

<rdar://problem/49394015>

Reviewed by Brent Fulgham.

Add new SPI.

* wtf/Platform.h:
* wtf/spi/darwin/SandboxSPI.h:

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

5 months agoUnreviewed, address post-landing review comments for r248431.
cdumez@apple.com [Thu, 8 Aug 2019 19:58:29 +0000 (19:58 +0000)]
Unreviewed, address post-landing review comments for r248431.

* Modules/indexeddb/IDBRequest.h:

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

5 months ago[iOS] Position image information should respect the image orientation
commit-queue@webkit.org [Thu, 8 Aug 2019 19:13:11 +0000 (19:13 +0000)]
[iOS] Position image information should respect the image orientation
https://bugs.webkit.org/show_bug.cgi?id=200487

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-08-08
Reviewed by Simon Fraser.

Source/WebCore:

Re-factor CachedImage::imageSizeForRenderer() into another overriding
function which does not scale the imageSize. Therefore the new function
returns FloatSize while the original function returns LayoutSize.

* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::imageSizeForRenderer const):
* loader/cache/CachedImage.h:
* rendering/RenderElement.h:

Source/WebKit:

imagePositionInformation() should respect the image orientation when
drawing an Image to a ShareableBitmap context.

boundsPositionInformation() already takes care of the image orientation
because it gets RenderImage::enclosingBoundingBox().

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

Tools:

Add an API test to verify the position image information is drawn rotated
because of respecting its image orientation.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/WKRequestActivatedElementInfo.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitCocoa/exif-orientation-8-llo.jpg: Added.
* TestWebKitAPI/Tests/WebKitCocoa/img-with-rotated-image.html: Added.

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

5 months ago[GTK] Fix WebContext languages test
csaavedra@igalia.com [Thu, 8 Aug 2019 19:07:50 +0000 (19:07 +0000)]
[GTK] Fix WebContext languages test
https://bugs.webkit.org/show_bug.cgi?id=200538

Reviewed by Alex Christensen.

This test broke after the format of Accepted-Languages
was changed in r238236, update.

* TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebContext.cpp:
(testWebContextLanguages):

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

5 months agoSet WKWebView opaque based on drawsBackground in PageConfiguration.
timothy@apple.com [Thu, 8 Aug 2019 19:04:36 +0000 (19:04 +0000)]
Set WKWebView opaque based on drawsBackground in PageConfiguration.
https://bugs.webkit.org/show_bug.cgi?id=200528

Reviewed by Tim Horton.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]): Set self.opaque = NO when !self.opaque || !pageConfiguration->drawsBackground().
It is almost impossible to have !self.opaque be NO at this point, since we are still inside initWithFrame:. A subclass could
override opaque and return NO, but checking pageConfiguration's drawsBackground is a good alternative.
* WebProcess/WebPage/WebPage.h: Remove unused m_drawsBackground member.

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

5 months ago[GTK] Fix /webkit/WebKitWebsiteData/databases failure
csaavedra@igalia.com [Thu, 8 Aug 2019 19:04:35 +0000 (19:04 +0000)]
[GTK] Fix /webkit/WebKitWebsiteData/databases failure
https://bugs.webkit.org/show_bug.cgi?id=200536

Reviewed by Carlos Alberto Lopez Perez.

* TestWebKitAPI/Tests/WebKitGLib/TestWebsiteData.cpp:
(testWebsiteDataDatabases): Databases take a moment to be written,
wait before fetching the data as it's done in other tests.

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

5 months agoWeb Inspector: rename `queryObjects` to `queryInstances` for clarity
drousso@apple.com [Thu, 8 Aug 2019 18:59:04 +0000 (18:59 +0000)]
Web Inspector: rename `queryObjects` to `queryInstances` for clarity
https://bugs.webkit.org/show_bug.cgi?id=200520

Reviewed by Brian Burg.

Source/JavaScriptCore:

* inspector/InjectedScriptSource.js:
(queryInstances): Added.
(queryObjects):
* inspector/JSInjectedScriptHost.h:
* inspector/JSInjectedScriptHost.cpp:
(Inspector::JSInjectedScriptHost::queryInstances): Added.
(Inspector::JSInjectedScriptHost::queryObjects): Deleted.
* inspector/JSInjectedScriptHostPrototype.cpp:
(Inspector::JSInjectedScriptHostPrototype::finishCreation):
(Inspector::jsInjectedScriptHostPrototypeFunctionQueryInstances): Added.
(Inspector::jsInjectedScriptHostPrototypeFunctionQueryObjects): Deleted.

Source/WebCore:

Test: inspector/console/queryInstances.html

* inspector/CommandLineAPIModuleSource.js:
(CommandLineAPIImpl.prototype.queryInstances): Added.
(CommandLineAPIImpl.prototype.queryObjects):

Source/WebInspectorUI:

* UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:

LayoutTests:

* inspector/console/queryInstances.html: Renamed from LayoutTests/inspector/console/queryObjects.html.
* inspector/console/queryInstances-expected.txt: Renamed from LayoutTests/inspector/console/queryObjects-expected.txt.

* http/tests/inspector/console/cross-domain-inspected-node-access-expected.txt:

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

5 months ago[iOS 13] Taps that interrupt momentum scrolling are recognized as clicks
wenson_hsieh@apple.com [Thu, 8 Aug 2019 18:54:06 +0000 (18:54 +0000)]
[iOS 13] Taps that interrupt momentum scrolling are recognized as clicks
https://bugs.webkit.org/show_bug.cgi?id=200516
<rdar://problem/53889373>

Reviewed by Tim Horton.

Source/WebKit:

After <https://trac.webkit.org/r247656>, the -tracksImmediatelyWhileDecelerating property of WKScrollView and
WKChildScrollView is set to NO. This means that if a user interacts with the page while the scroll view is
decelerating (e.g. after momentum scrolling), the pan gesture recognizer will not be immediately recognized.
This gives other gesture recognizers, such as the synthetic click (single tap) gesture a chance to instead
recognize first. In this particular bug, this causes taps on the web view that are intended to only stop
momentum scrolling to instead activate clickable elements beneath the touch, such as links and buttons.

To mitigate this, we add some logic to prevent the click gesture recognizer from firing in the case where the
tap also causes the scroll view to decelerate. This heuristic is similar to the one introduced in r219310, which
has the same purpose of hiding gestures that stop momentum scrolling from the page, and also consults
-[UIScrollView _isInterruptingDeceleration].

Tests:  fast/scrolling/ios/click-events-during-momentum-scroll-in-main-frame.html
        fast/scrolling/ios/click-events-during-momentum-scroll-in-overflow-after-tap-on-body.html
        fast/scrolling/ios/click-events-during-momentum-scroll-in-overflow.html

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

Return NO in the case of the single tap gesture if the UIScrollView most recently touched by the single tap
gesture (or one of its enclosing scroll views, up to the main WKScrollView) is being interrupted while
decelerating.

* UIProcess/ios/WKSyntheticTapGestureRecognizer.h:
* UIProcess/ios/WKSyntheticTapGestureRecognizer.mm:
(-[WKSyntheticTapGestureRecognizer reset]):
(-[WKSyntheticTapGestureRecognizer touchesBegan:withEvent:]):

Teach WKSyntheticTapGestureRecognizer to keep track of the last WKScrollView that was touched, for later use in
-gestureRecognizerShouldBegin:. To do this, we keep a weak reference to the first UIScrollView we find in the
set of touches.

(-[WKSyntheticTapGestureRecognizer lastTouchedScrollView]):

LayoutTests:

Add new layout tests. See below for details.

* fast/scrolling/ios/click-events-during-momentum-scroll-in-main-frame-expected.txt: Added.
* fast/scrolling/ios/click-events-during-momentum-scroll-in-main-frame.html: Added.

Add a test to verify that interrupting scrolling in the main frame using a tap doesn't fire a click event.

* fast/scrolling/ios/click-events-during-momentum-scroll-in-overflow-after-tap-on-body-expected.txt: Added.
* fast/scrolling/ios/click-events-during-momentum-scroll-in-overflow-after-tap-on-body.html: Added.

Add a test to verify that after triggering momentum scrolling in a fast subscrollable region, tapping outside of
the scroller will still fire a click event.

* fast/scrolling/ios/click-events-during-momentum-scroll-in-overflow-expected.txt: Added.
* fast/scrolling/ios/click-events-during-momentum-scroll-in-overflow.html: Added.

Add a test to verify that interrupting scrolling in a fast subscrollable region using a tap doesn't fire a
click event.

* resources/ui-helper.js:
(window.UIHelper.dragFromPointToPoint):
(window.UIHelper):

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

5 months agoFix thread safety bug in AudioSourceProviderAVFObjC::prepare()
cdumez@apple.com [Thu, 8 Aug 2019 18:42:16 +0000 (18:42 +0000)]
Fix thread safety bug in AudioSourceProviderAVFObjC::prepare()
https://bugs.webkit.org/show_bug.cgi?id=200542

Reviewed by Jer Noble.

Fix thread safety bug in AudioSourceProviderAVFObjC::prepare(). It calls callOnMainThread()
from a background thread and captures makeRef(*this) in the lambda, even though |this| is a
AudioSourceProviderAVFObjC, which subclasses RefCounted, not ThreadSafeRefCounted.

* platform/graphics/avfoundation/AudioSourceProviderAVFObjC.h:

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

5 months agoMake IDBRequest ThreadSafeRefCounted
cdumez@apple.com [Thu, 8 Aug 2019 18:41:23 +0000 (18:41 +0000)]
Make IDBRequest ThreadSafeRefCounted
https://bugs.webkit.org/show_bug.cgi?id=200540

Reviewed by Alex Christensen.

Make IDBRequest ThreadSafeRefCounted, as it looks like it is being ref'd / deref'd
from several threads, in IDBConnectionProxy::notifyOpenDBRequestBlocked() for
example.

* Modules/indexeddb/IDBRequest.h:

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

5 months agoUse "safari" glyph for "Show Link Previews" contextual menu
dino@apple.com [Thu, 8 Aug 2019 18:40:38 +0000 (18:40 +0000)]
Use "safari" glyph for "Show Link Previews" contextual menu
https://bugs.webkit.org/show_bug.cgi?id=200544
<rdar://problem/54087842>

Reviewed by Tim Horton.

Use the system image for the compass.

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

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

5 months ago[JSC] Add "jump if (not) undefined or null" bytecode ops
ross.kirsling@sony.com [Thu, 8 Aug 2019 18:23:18 +0000 (18:23 +0000)]
[JSC] Add "jump if (not) undefined or null" bytecode ops
https://bugs.webkit.org/show_bug.cgi?id=200480

Reviewed by Saam Barati.

JSTests:

* stress/destructuring-assignment-require-object-coercible.js:
* stress/nullish-coalescing.js:

Source/JavaScriptCore:

This patch introduces fused jumps for op_is_undefined_or_null, which ignores "masquerade as undefined" behavior.

This lets us fix a edge-case bug in RequireObjectCoercible (where `({ length } = document.all)` was a TypeError)
and moreover provides a very useful optimization for the new ?. and ?? operators, which have semantics centered
around op_jundefined_or_null and op_jnundefined_or_null, respectively.

* bytecode/BytecodeList.rb:
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):
* bytecode/Opcode.h:
(JSC::isBranch):
* bytecode/PreciseJumpTargetsInlines.h:
* bytecompiler/BytecodeGenerator.cpp:
(JSC::Label::setLocation):
(JSC::BytecodeGenerator::emitJumpIfTrue):
(JSC::BytecodeGenerator::emitJumpIfFalse):
(JSC::BytecodeGenerator::emitRequireObjectCoercible):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel):
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
* jit/JIT.h:
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_jundefined_or_null): Added.
(JSC::JIT::emit_op_jnundefined_or_null): Added.
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_jundefined_or_null): Added.
(JSC::JIT::emit_op_jnundefined_or_null): Added.
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:

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

5 months agoresults.webkit.org: Use canvas for timeline
jbedard@apple.com [Thu, 8 Aug 2019 17:53:51 +0000 (17:53 +0000)]
results.webkit.org: Use canvas for timeline
https://bugs.webkit.org/show_bug.cgi?id=200172

Rubber-stamped by Aakash Jain.

* resultsdbpy/resultsdbpy/view/static/js/commit.js:
(Commit.constructor): Make uuid a member variable instead of a member function for efficiency.
(Commit.compare): Ditto.
(_CommitBank.commitByUuid): Ditto.
(_CommitBank._loadSiblings): Ditto.
(_CommitBank._load): Ditto.
* resultsdbpy/resultsdbpy/view/static/js/timeline.js:
(tickForCommit): Deleted.
(minimumUuidForResults): Given a dictionary of result lists, determine the minimum UUID
which encompasses all results. Crucially, this function must exclude an UUIDs which may
refer to results excluded because of the limit argument.
(renderTimeline): Deleted.
(commitsForResults): Given a dictionary of result lists, return a list of commits associated
with those results.
(scaleForCommits): Given a list of commits, generate a scale to be consumed by the canvas Timeline.
(repositoriesForCommits): Given a list of commits, return a sorted list of associated repository ids.
(xAxisFromScale): Create a canvas-based x-axis based on the provided scale and a repository id.
(inPlaceCombine): Combine result objects together.
(statsForSingleResult): Turn a single result into a stat object.
(combineResults): Given lists of results, combine these lists while keeping the original lists unchanged.
(Dot): Deleted.
(TimelineFromEndpoint): Renamed from Timeline.
(TimelineFromEndpoint.constructor): Canvas Timeline manages expansion and collapsing of nested timelines.
(TimelineFromEndpoint.teardown): Detach callbacks from CommitBank.
(TimelineFromEndpoint.update): Update with any new commit information, force a re-draw of the current
cache contents.
(TimelineFromEndpoint.reload): Remove management of nested timelines.
(TimelineFromEndpoint.render): Use canvas Timeline instead of html timeline to visualize results.
* resultsdbpy/resultsdbpy/view/templates/search.html: Use TimelineFromEndpoint class.
* resultsdbpy/resultsdbpy/view/templates/suite_results.html: Ditto.

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

5 months agoAdd Catalina Baselines for Font-related Tests.
russell_e@apple.com [Thu, 8 Aug 2019 17:27:33 +0000 (17:27 +0000)]
Add Catalina Baselines for Font-related Tests.
rdar://53836015

Unreviewed Test Gardening.

* platform/mac-mojave/css1/basic/inheritance-expected.txt: Copied from LayoutTests/platform/mac/css1/basic/inheritance-expected.txt.
* platform/mac-mojave/css2.1/t0602-c13-inh-underlin-00-e-expected.txt: Copied from LayoutTests/platform/mac/css2.1/t0602-c13-inh-underlin-00-e-expected.txt.
* platform/mac-mojave/css2.1/t0805-c5522-brdr-02-e-expected.txt: Copied from LayoutTests/platform/mac/css2.1/t0805-c5522-brdr-02-e-expected.txt.
* platform/mac-mojave/css3/selectors3/html/css3-modsel-18-expected.txt: Copied from LayoutTests/platform/mac/css3/selectors3/html/css3-modsel-18-expected.txt.
* platform/mac-mojave/css3/selectors3/xhtml/css3-modsel-18-expected.txt: Copied from LayoutTests/platform/mac/css3/selectors3/xhtml/css3-modsel-18-expected.txt.
* platform/mac-mojave/css3/selectors3/xml/css3-modsel-18-expected.txt: Copied from LayoutTests/platform/mac/css3/selectors3/xml/css3-modsel-18-expected.txt.
* platform/mac-mojave/fast/block/basic/001-expected.txt: Copied from LayoutTests/platform/mac/fast/block/basic/001-expected.txt.
* platform/mac-mojave/fast/css/css3-nth-child-expected.txt: Copied from LayoutTests/platform/mac/fast/css/css3-nth-child-expected.txt.
* platform/mac-mojave/fast/dom/34176-expected.txt: Copied from LayoutTests/platform/mac/fast/dom/34176-expected.txt.
* platform/mac-mojave/fast/dom/clone-node-dynamic-style-expected.txt: Copied from LayoutTests/platform/mac/fast/dom/clone-node-dynamic-style-expected.txt.
* platform/mac-mojave/fast/forms/plaintext-mode-2-expected.txt: Copied from LayoutTests/platform/mac/fast/forms/plaintext-mode-2-expected.txt.
* platform/mac-mojave/fast/invalid/003-expected.txt: Copied from LayoutTests/platform/mac/fast/invalid/003-expected.txt.
* platform/mac-mojave/fast/invalid/004-expected.txt: Copied from LayoutTests/platform/mac/fast/invalid/004-expected.txt.
* platform/mac-mojave/fast/invalid/nestedh3s-expected.txt: Copied from LayoutTests/platform/mac/fast/invalid/nestedh3s-expected.txt.
* platform/mac-mojave/fast/selectors/018-expected.txt: Copied from LayoutTests/platform/mac/fast/selectors/018-expected.txt.
* platform/mac-mojave/fast/table/frame-and-rules-expected.txt: Copied from LayoutTests/platform/mac/fast/table/frame-and-rules-expected.txt.
* platform/mac-mojave/fast/text/atsui-multiple-renderers-expected.txt: Copied from LayoutTests/platform/mac/fast/text/atsui-multiple-renderers-expected.txt.
* platform/mac-mojave/fast/text/bidi-embedding-pop-and-push-same-expected.txt: Copied from LayoutTests/platform/mac/fast/text/bidi-embedding-pop-and-push-same-expected.txt.
* platform/mac-mojave/fast/text/font-weights-expected.txt: Copied from LayoutTests/platform/mac/fast/text/font-weights-expected.txt.
* platform/mac-mojave/fast/text/font-weights-zh-expected.txt: Copied from LayoutTests/platform/mac/fast/text/font-weights-zh-expected.txt.
* platform/mac-mojave/svg/W3C-SVG-1.1/animate-elem-46-t-expected.txt: Copied from LayoutTests/platform/mac/svg/W3C-SVG-1.1/animate-elem-46-t-expected.txt.
* platform/mac-mojave/svg/W3C-SVG-1.1/struct-use-01-t-expected.txt: Copied from LayoutTests/platform/mac/svg/W3C-SVG-1.1/struct-use-01-t-expected.txt.
* platform/mac-mojave/svg/batik/text/textStyles-expected.txt: Copied from LayoutTests/platform/mac/svg/batik/text/textStyles-expected.txt.
* platform/mac-mojave/tables/mozilla/other/wa_table_thtd_rowspan-expected.txt: Copied from LayoutTests/platform/mac/tables/mozilla/other/wa_table_thtd_rowspan-expected.txt.
* platform/mac-mojave/tables/mozilla/other/wa_table_tr_align-expected.txt: Copied from LayoutTests/platform/mac/tables/mozilla/other/wa_table_tr_align-expected.txt.
* platform/mac/css1/basic/inheritance-expected.txt:
* platform/mac/css2.1/t0602-c13-inh-underlin-00-e-expected.txt:
* platform/mac/css2.1/t0805-c5522-brdr-02-e-expected.txt:
* platform/mac/css3/selectors3/html/css3-modsel-18-expected.txt:
* platform/mac/css3/selectors3/xhtml/css3-modsel-18-expected.txt:
* platform/mac/css3/selectors3/xml/css3-modsel-18-expected.txt:
* platform/mac/fast/block/basic/001-expected.txt:
* platform/mac/fast/css/css3-nth-child-expected.txt:
* platform/mac/fast/dom/34176-expected.txt:
* platform/mac/fast/dom/clone-node-dynamic-style-expected.txt:
* platform/mac/fast/forms/plaintext-mode-2-expected.txt:
* platform/mac/fast/invalid/003-expected.txt:
* platform/mac/fast/invalid/004-expected.txt:
* platform/mac/fast/invalid/nestedh3s-expected.txt:
* platform/mac/fast/selectors/018-expected.txt:
* platform/mac/fast/table/frame-and-rules-expected.txt:
* platform/mac/fast/text/atsui-multiple-renderers-expected.txt:
* platform/mac/fast/text/bidi-embedding-pop-and-push-same-expected.txt:
* platform/mac/fast/text/font-weights-expected.txt:
* platform/mac/fast/text/font-weights-zh-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/animate-elem-46-t-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/struct-use-01-t-expected.txt:
* platform/mac/svg/batik/text/textStyles-expected.txt:
* platform/mac/tables/mozilla/other/wa_table_thtd_rowspan-expected.txt:
* platform/mac/tables/mozilla/other/wa_table_tr_align-expected.txt:

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

5 months agoMove classes declared inside StorageManager.cpp into their own headers
cdumez@apple.com [Thu, 8 Aug 2019 16:46:57 +0000 (16:46 +0000)]
Move classes declared inside StorageManager.cpp into their own headers
https://bugs.webkit.org/show_bug.cgi?id=200527

Reviewed by Alex Christensen.

Move classes declared inside StorageManager.cpp into their own headers
for clarity. StorageManager.cpp was getting really big.

* NetworkProcess/WebStorage/LocalStorageNamespace.cpp: Added.
(WebKit::LocalStorageNamespace::LocalStorageNamespace):
(WebKit::LocalStorageNamespace::~LocalStorageNamespace):
(WebKit::LocalStorageNamespace::getOrCreateStorageArea):
(WebKit::LocalStorageNamespace::clearStorageAreasMatchingOrigin):
(WebKit::LocalStorageNamespace::clearAllStorageAreas):
(WebKit::LocalStorageNamespace::ephemeralOrigins const):
(WebKit::LocalStorageNamespace::cloneTo):
* NetworkProcess/WebStorage/LocalStorageNamespace.h: Added.
(WebKit::LocalStorageNamespace::create):
(WebKit::LocalStorageNamespace::storageManager const):
* NetworkProcess/WebStorage/SessionStorageNamespace.cpp: Added.
(WebKit::SessionStorageNamespace::SessionStorageNamespace):
(WebKit::SessionStorageNamespace::~SessionStorageNamespace):
(WebKit::SessionStorageNamespace::addAllowedConnection):
(WebKit::SessionStorageNamespace::removeAllowedConnection):
(WebKit::SessionStorageNamespace::getOrCreateStorageArea):
(WebKit::SessionStorageNamespace::cloneTo):
(WebKit::SessionStorageNamespace::origins const):
(WebKit::SessionStorageNamespace::clearStorageAreasMatchingOrigin):
(WebKit::SessionStorageNamespace::clearAllStorageAreas):
* NetworkProcess/WebStorage/SessionStorageNamespace.h: Added.
(WebKit::SessionStorageNamespace::create):
(WebKit::SessionStorageNamespace::isEmpty const):
(WebKit::SessionStorageNamespace::allowedConnections const):
* NetworkProcess/WebStorage/StorageArea.cpp: Added.
(WebKit::StorageArea::StorageArea):
(WebKit::StorageArea::~StorageArea):
(WebKit::StorageArea::addListener):
(WebKit::StorageArea::removeListener):
(WebKit::StorageArea::hasListener const):
(WebKit::StorageArea::clone const):
(WebKit::StorageArea::setItem):
(WebKit::StorageArea::setItems):
(WebKit::StorageArea::removeItem):
(WebKit::StorageArea::clear):
(WebKit::StorageArea::items const):
(WebKit::StorageArea::openDatabaseAndImportItemsIfNeeded const):
(WebKit::StorageArea::dispatchEvents const):
* NetworkProcess/WebStorage/StorageArea.h: Added.
(WebKit::StorageArea::create):
(WebKit::StorageArea::securityOrigin const):
(WebKit::StorageArea::isEphemeral const):
* NetworkProcess/WebStorage/StorageManager.cpp:
(WebKit::StorageManager::createLocalStorageMap):
(WebKit::StorageManager::findStorageArea const):
(WebKit::StorageManager::getOrCreateLocalStorageNamespace):
(WebKit::StorageManager::getOrCreateTransientLocalStorageNamespace):
* NetworkProcess/WebStorage/StorageManager.h:
(WebKit::StorageManager::create):
(WebKit::StorageManager::localStorageDatabaseTracker const):
(WebKit::StorageManager::workQueue const):
* NetworkProcess/WebStorage/TransientLocalStorageNamespace.cpp: Added.
(WebKit::TransientLocalStorageNamespace::TransientLocalStorageNamespace):
(WebKit::TransientLocalStorageNamespace::~TransientLocalStorageNamespace):
(WebKit::TransientLocalStorageNamespace::getOrCreateStorageArea):
(WebKit::TransientLocalStorageNamespace::origins const):
(WebKit::TransientLocalStorageNamespace::clearStorageAreasMatchingOrigin):
(WebKit::TransientLocalStorageNamespace::clearAllStorageAreas):
* NetworkProcess/WebStorage/TransientLocalStorageNamespace.h: Added.
(WebKit::TransientLocalStorageNamespace::create):
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::canRequestUseSpeculativeRevalidation):
* Sources.txt:
* WebKit.xcodeproj/project.pbxproj:

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

5 months agoDo not allow navigations of frames about to get replaced by the result of evaluating...
beidson@apple.com [Thu, 8 Aug 2019 15:54:37 +0000 (15:54 +0000)]
Do not allow navigations of frames about to get replaced by the result of evaluating javascript: URLs
<rdar://problem/53788893> and https://bugs.webkit.org/show_bug.cgi?id=198786

Reviewed by Geoff Garen.

Source/WebCore:

Covered by API Test

Add a "willReplaceWithResultOfExecutingJavascriptURL" flag which is respected inside FrameLoader::isNavigationAllowed

* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::executeIfJavaScriptURL):
* bindings/js/ScriptController.h:
(WebCore::ScriptController::willReplaceWithResultOfExecutingJavascriptURL const):

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::isNavigationAllowed const):

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/mac/JavascriptURLNavigation.mm: Added.

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

5 months agoAdd runtime flag for lazy image loading
commit-queue@webkit.org [Thu, 8 Aug 2019 14:55:21 +0000 (14:55 +0000)]
Add runtime flag for lazy image loading
https://bugs.webkit.org/show_bug.cgi?id=199794

Patch by Rob Buis <rbuis@igalia.com> on 2019-08-08
Reviewed by Darin Adler.

Source/WebCore:

Add loading attribute and expose it on HTMLImageElement.

* html/HTMLAttributeNames.in:
* html/HTMLImageElement.idl:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setLazyImageLoadingEnabled):
(WebCore::RuntimeEnabledFeatures::lazyImageLoadingEnabled const):

Source/WebKit:

Add LazyImageLoading preference.

* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetLazyImageLoadingEnabled):
(WKPreferencesGetLazyImageLoadingEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:

Source/WebKitLegacy/mac:

Set lazyImageLoading runtime flag if preference is set.

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

Source/WebKitLegacy/win:

Set lazyImageLoading runtime flag if preference is set.

* Interfaces/IWebPreferencesPrivate.idl:
* WebPreferenceKeysPrivate.h:
* WebPreferences.cpp:
(WebPreferences::initializeDefaultSettings):
(WebPreferences::lazyImageLoadingEnabled):
(WebPreferences::setLazyImageLoadingEnabled):
* WebPreferences.h:
* WebView.cpp:
(WebView::notifyPreferencesChanged):

Tools:

Set lazyImageLoading preference as part of experimental features. Add
TestOption for lazy image loading.

* DumpRenderTree/TestOptions.cpp:
(TestOptions::TestOptions):
* DumpRenderTree/TestOptions.h:
* DumpRenderTree/mac/DumpRenderTree.mm:
(enableExperimentalFeatures):
(setWebPreferencesForTestOptions):
* DumpRenderTree/win/DumpRenderTree.cpp:
(enableExperimentalFeatures):

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

5 months agoUnreviewed GTK+ gardening. Update expectations after r248403.
magomez@igalia.com [Thu, 8 Aug 2019 14:20:19 +0000 (14:20 +0000)]
Unreviewed GTK+ gardening. Update expectations after r248403.

* platform/gtk/TestExpectations:

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

5 months ago[GTK][WPE] Remove the reference to WebCore::Animation from TextureMapperAnimation
magomez@igalia.com [Thu, 8 Aug 2019 14:13:20 +0000 (14:13 +0000)]
[GTK][WPE] Remove the reference to WebCore::Animation from TextureMapperAnimation
https://bugs.webkit.org/show_bug.cgi?id=200533

Reviewed by Žan Doberšek.

Pass the relevant parameters to TextureMapperAnimation instead of creating a new WebCore::Animation
inside it.

* platform/graphics/texmap/TextureMapperAnimation.cpp:
(WebCore::timingFunctionForAnimationValue):
(WebCore::TextureMapperAnimation::TextureMapperAnimation):
(WebCore::TextureMapperAnimation::apply):
(WebCore::TextureMapperAnimation::isActive const):
* platform/graphics/texmap/TextureMapperAnimation.h:
(WebCore::TextureMapperAnimation::keyframes const):
(WebCore::TextureMapperAnimation::timingFunction const):
(WebCore::TextureMapperAnimation::animation const): Deleted.

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

5 months ago[GTK] WebKitWebProcess crashes when viewing an HTML with a <video> element referencin...
cturner@igalia.com [Thu, 8 Aug 2019 12:08:50 +0000 (12:08 +0000)]
[GTK] WebKitWebProcess crashes when viewing an HTML with a <video> element referencing unknown file
https://bugs.webkit.org/show_bug.cgi?id=200530

Reviewed by Xabier Rodriguez-Calvar.

Not amenable to unit testing.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):

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

5 months agoImport lazy loading WPT tests
commit-queue@webkit.org [Thu, 8 Aug 2019 08:20:41 +0000 (08:20 +0000)]
Import lazy loading WPT tests
https://bugs.webkit.org/show_bug.cgi?id=199795

Patch by Rob Buis <rbuis@igalia.com> on 2019-08-08
Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Import lazy loading WPT tests.

* resources/import-expectations.json:
* web-platform-tests/loading/lazyload/iframe-loading-eager.tentative-expected.txt: Added.
* web-platform-tests/loading/lazyload/iframe-loading-eager.tentative.html: Added.
* web-platform-tests/loading/lazyload/iframe-loading-lazy.tentative.html: Added.
* web-platform-tests/loading/lazyload/image-loading-eager.tentative-expected.txt: Added.
* web-platform-tests/loading/lazyload/image-loading-eager.tentative.html: Added.
* web-platform-tests/loading/lazyload/image-loading-lazy.tentative.html: Added.
* web-platform-tests/loading/lazyload/resources/image.png: Added.
* web-platform-tests/loading/lazyload/resources/subframe.html: Added.
* web-platform-tests/loading/lazyload/resources/w3c-import.log: Added.
* web-platform-tests/loading/lazyload/w3c-import.log: Added.

Tools:

Only do loading/ exception for WebKit specific, non WPT tests.

* DumpRenderTree/mac/DumpRenderTree.mm:
(shouldLogFrameLoadDelegates):
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::TestInvocation):

LayoutTests:

Skip the lazy tests for now.

* TestExpectations:
* http/wpt/loading/redirect-headers-expected.txt:

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

5 months ago[WHLSL] Prune unreachable stdlib functions after the Checker runs
sbarati@apple.com [Thu, 8 Aug 2019 06:22:58 +0000 (06:22 +0000)]
[WHLSL] Prune unreachable stdlib functions after the Checker runs
https://bugs.webkit.org/show_bug.cgi?id=200518

Reviewed by Robin Morisset.

We now prune unreachable stdlib functions after the checker runs. We must
do this after the checker runs because that's when we resolve all remaining
function calls. While we can't prune unreachable user code, because we must
still report errors in it, we can prune unreachable standard library code
because we know a priori that it has no errors. This is a 10ms end-to-end
speedup in compute_boids.

* Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
(WebCore::WHLSL::prepareShared):
* Modules/webgpu/WHLSL/WHLSLPruneUnreachableStandardLibraryFunctions.cpp: Added.
(WebCore::WHLSL::pruneUnreachableStandardLibraryFunctions):
* Modules/webgpu/WHLSL/WHLSLPruneUnreachableStandardLibraryFunctions.h: Added.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

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

5 months agoTurn some ITP threading ASSERTs into RELEASE_ASSERTs
cdumez@apple.com [Thu, 8 Aug 2019 03:31:40 +0000 (03:31 +0000)]
Turn some ITP threading ASSERTs into RELEASE_ASSERTs
https://bugs.webkit.org/show_bug.cgi?id=200521

Reviewed by Ryosuke Niwa.

Turn some ITP threading ASSERTs into RELEASE_ASSERTs to help catch more bugs.

* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::ResourceLoadStatisticsMemoryStore):
(WebKit::ResourceLoadStatisticsMemoryStore::isEmpty const):
* NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp:
(WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage):
(WebKit::ResourceLoadStatisticsPersistentStorage::~ResourceLoadStatisticsPersistentStorage):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
(WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore):
(WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):

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

5 months agoFix construction of `WI.EventBreakpoint` after r248201
drousso@apple.com [Thu, 8 Aug 2019 02:36:33 +0000 (02:36 +0000)]
Fix construction of `WI.EventBreakpoint` after r248201

Reviewed by Joseph Pecoraro.

* UserInterface/Controllers/DOMManager.js:
(WI.DOMManager.prototype.setBreakpointForEventListener):

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

5 months ago[Win][MiniBrowser] Add key accelerators for reload and close window
Hironori.Fujii@sony.com [Thu, 8 Aug 2019 01:34:39 +0000 (01:34 +0000)]
[Win][MiniBrowser] Add key accelerators for reload and close window
https://bugs.webkit.org/show_bug.cgi?id=200497

Reviewed by Brent Fulgham.

Added short cuts Ctrl-W to close window, Ctrl-R to reload.

* MiniBrowser/win/MainWindow.cpp:
(MainWindow::WndProc): Added IDM_CLOSE_WINDOW case.
* MiniBrowser/win/MiniBrowserLib.rc: Added "Close" menu item. Added accelerators.
* MiniBrowser/win/MiniBrowserLibResource.h: Added IDM_CLOSE_WINDOW.

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

5 months agoAdopt non-deprecated CGColorSpace API
commit-queue@webkit.org [Wed, 7 Aug 2019 23:52:20 +0000 (23:52 +0000)]
Adopt non-deprecated CGColorSpace API
https://bugs.webkit.org/show_bug.cgi?id=184358

Patch by Kate Cheney <katherine_cheney@apple.com> on 2019-08-07
Reviewed by Darin Adler.

Source/WebCore:

* platform/ScreenProperties.h:
(WebCore::ScreenData::decode):

We changed the deprecated CGColorSpaceCreateWithICCProfile function to
CGColorSpaceCreateWithICCData.

Source/WebKit:

* Shared/mac/ColorSpaceData.mm:
(WebKit::ColorSpaceData::decode):

We changed the deprecated CGColorSpaceCreateWithICCProfile function to
CGColorSpaceCreateWithICCData.

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

5 months ago[WHLSL] Metal code generation takes a long time uniquing UnnamedTypes
weinig@apple.com [Wed, 7 Aug 2019 23:47:49 +0000 (23:47 +0000)]
[WHLSL] Metal code generation takes a long time uniquing UnnamedTypes
https://bugs.webkit.org/show_bug.cgi?id=200512

Reviewed by Saam Barati.

Instead of using a trie for unnamed type uniquing, use the same technique used
in SynthesizeConstructors and use a HashMap of UnnamedTypeKeys. To make this
profitable, we also need to devirtualize the hash and equality functions on
UnnamedType, instead using an enum + switch. While this change only devirtualizes
the UnnamedType subtree, we should probably do it for the entire AST in a future
change.

* Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h:
* Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
* Modules/webgpu/WHLSL/AST/WHLSLPointerType.h:
* Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
* Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
* Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.cpp: Added.
(WebCore::WHLSL::AST::UnnamedType::hash const):
(WebCore::WHLSL::AST::UnnamedType::operator== const):
 * Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h:
Devirtualize hash, operator== and type predicates.

* Modules/webgpu/WHLSL/AST/WHLSLUnnamedTypeHash.h: Added.
(WebCore::WHLSL::UnnamedTypeKey::UnnamedTypeKey):
* Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
(WebCore::WHLSL::UnnamedTypeKey::UnnamedTypeKey): Deleted.
Moved UnnamedTypeKey into it's own header from WHLSLSynthesizeConstructors.cpp

* Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
(WebCore::WHLSL::Metal::BaseTypeNameNode::BaseTypeNameNode):
(WebCore::WHLSL::Metal::BaseTypeNameNode::kind):
(WebCore::WHLSL::Metal::BaseTypeNameNode::isReferenceTypeNameNode const):
(WebCore::WHLSL::Metal::BaseTypeNameNode::isPointerTypeNameNode const):
(WebCore::WHLSL::Metal::BaseTypeNameNode::isArrayReferenceTypeNameNode const):
(WebCore::WHLSL::Metal::BaseTypeNameNode::isArrayTypeNameNode const):
Devirtualize BaseTypeNameNode as well. In a future change, we should consider removing
this class entirely and instead mapping directly to a parent/mangled name pair.

(WebCore::WHLSL::Metal::TypeNamer::visit):
(WebCore::WHLSL::Metal::TypeNamer::find):
(WebCore::WHLSL::Metal::TypeNamer::createNameNode):
(WebCore::WHLSL::Metal::parent):
(WebCore::WHLSL::Metal::TypeNamer::insert):
(WebCore::WHLSL::Metal::TypeNamer::emitUnnamedTypeDefinition):
(WebCore::WHLSL::Metal::TypeNamer::emitMetalTypeDefinitions):
(WebCore::WHLSL::Metal::TypeNamer::mangledNameForType):
(WebCore::WHLSL::Metal::findInVector): Deleted.
(WebCore::WHLSL::Metal::find): Deleted.
(WebCore::WHLSL::Metal::TypeNamer::emitAllUnnamedTypeDefinitions): Deleted.
* Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.h:
Switch from a Vector based trie to a HashMap for UnnamedType uniquing. Also
use UnnamedType::Kind where possible with switch statements to clarify code.

* WebCore.xcodeproj/project.pbxproj:
Add new files.

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

5 months agoRemove speculative workaround for upload crash
commit-queue@webkit.org [Wed, 7 Aug 2019 23:36:27 +0000 (23:36 +0000)]
Remove speculative workaround for upload crash
https://bugs.webkit.org/show_bug.cgi?id=200514

Patch by Alex Christensen <achristensen@webkit.org> on 2019-08-07
Reviewed by Geoffrey Garen.

This workaround didn't help anyways, and the crash has been resolved.  Let's clean up.

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:needNewBodyStream:]):

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

5 months agoRegression(r247784) ResourceLoadStatisticsMemoryStore / ResourceLoadStatisticsPersist...
cdumez@apple.com [Wed, 7 Aug 2019 22:29:18 +0000 (22:29 +0000)]
Regression(r247784) ResourceLoadStatisticsMemoryStore / ResourceLoadStatisticsPersistentStorage may get destroyed on the wrong thread
https://bugs.webkit.org/show_bug.cgi?id=200517

Reviewed by Geoffrey Garen.

The issue is that WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore() is null checking
m_persistentStorage and m_statisticsStore on the main thread, even though those members are initialized
and destroyed on the background thread. As a result, if flushAndDestroyPersistentStore() is called *before*
the background task to initialize those members has had a chance to run, then we'd return early without
destroying those members. Later on, the background task would then initialize those data members and we
would then destroy them on the main thread when the WebResourceLoadStatisticsStore is destroyed on the
main thread.

* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):

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

5 months agoLayoutTest inspector/worker/debugger-scripts.html is a flaky failure
commit-queue@webkit.org [Wed, 7 Aug 2019 21:51:16 +0000 (21:51 +0000)]
LayoutTest inspector/worker/debugger-scripts.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=165582

Patch by Yury Semikhatsky <yurys@chromium.org> on 2019-08-07
Reviewed by Joseph Pecoraro.

Unflake the test. Main resource in the worker target is populated asychronously
when the script is parsed and sent to the debugger, so we need to wait for it
before performing further checks.

* inspector/worker/debugger-scripts.html:
* platform/mac/TestExpectations:

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

5 months agoWeb Inspector: Settings: add an Engineering pane to expose useful settings for other...
drousso@apple.com [Wed, 7 Aug 2019 21:49:08 +0000 (21:49 +0000)]
Web Inspector: Settings: add an Engineering pane to expose useful settings for other WebKit engineers
https://bugs.webkit.org/show_bug.cgi?id=200492

Reviewed by Joseph Pecoraro.

Other WebKit engineers might find being able to see internal objects or pause in internal
scripts useful, so we should allow them to do so without having to enable Web Inspector's
debug "mode".

A new "Engineering" pane is added to the Settings Tab:
 - Debugging
    - Show WebKit-internal scripts
    - Pause in WebKit-internal scripts
 - Heap Snapshot
    - Show Internal Objects
    - Show Private Symbols

* UserInterface/Base/Setting.js:
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype.initialLayout):
(WI.SettingsTabContentView.prototype._createEngineeringSettingsView): Added.
(WI.SettingsTabContentView.prototype._createDebugSettingsView):

* UserInterface/Base/Main.js:
(WI.resolvedLayoutDirection):
(WI.setLayoutDirection):
* UserInterface/Base/Object.js:

* UserInterface/Protocol/InspectorBackend.js:
(InspectorBackendClass):
(InspectorBackendClass.prototype.set dumpInspectorProtocolMessages):
(InspectorBackendClass.prototype.get dumpInspectorProtocolMessages):
(InspectorBackendClass.prototype.set dumpInspectorTimeStats):
(InspectorBackendClass.prototype.get dumpInspectorTimeStats):
(InspectorBackendClass.prototype.set filterMultiplexingBackendInspectorProtocolMessages):
(InspectorBackendClass.prototype.get filterMultiplexingBackendInspectorProtocolMessages):
* UserInterface/Protocol/RemoteObject.js:
(WI.RemoteObject.prototype.findFunctionSourceCodeLocation):
* UserInterface/Debug/Bootstrap.js:
(WI.runBootstrapOperations):
* UserInterface/Debug/UncaughtExceptionReporter.js:
(handleUncaughtExceptionRecord):
* UserInterface/Models/CSSProperty.js:
(WI.CSSProperty.prototype._updateOwnerStyleText):
* UserInterface/Models/CSSStyleDeclaration.js:
(WI.CSSStyleDeclaration.prototype.update):
* UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager):
(WI.DebuggerManager.prototype.initializeTarget):
(WI.DebuggerManager.prototype.get knownNonResourceScripts):
(WI.DebuggerManager.prototype.debuggerDidPause):
(WI.DebuggerManager.prototype.scriptDidParse):
(WI.DebuggerManager.prototype._handleEngineeringShowInternalScriptsSettingChanged): Added.
(WI.DebuggerManager.prototype._handleEngineeringPauseForInternalScriptsSettingChanged): Added.
(WI.DebuggerManager.prototype._pauseForInternalScriptsDidChange): Deleted.
(WI.DebuggerManager.prototype._debugUIEnabledDidChange): Deleted.
* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype._appendLocationLink):
* UserInterface/Views/HeapSnapshotDataGridTree.js:
(WI.HeapSnapshotInstancesDataGridTree.prototype.populateTopLevel):
* UserInterface/Views/OpenResourceDialog.js:
(WI.OpenResourceDialog.prototype._addScriptsForTarget):
* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
(WI.SpreadsheetCSSStyleDeclarationEditor):
* UserInterface/Views/StackTraceView.js:
(WI.StackTraceView):
* UserInterface/Views/View.js:
(WI.View.prototype._layoutSubtree):

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

5 months agoWeb Inspector: RTL: content of Variables section should always be LTR
nvasilyev@apple.com [Wed, 7 Aug 2019 21:32:46 +0000 (21:32 +0000)]
Web Inspector: RTL: content of Variables section should always be LTR
https://bugs.webkit.org/show_bug.cgi?id=200481

Reviewed by Devin Rousso.

* UserInterface/Views/ComputedStyleDetailsPanel.js:
(WI.ComputedStyleDetailsPanel.prototype.initialLayout):

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

5 months agoWeb Inspector: Uncaught Exception: TimelineAgent already enabled
drousso@apple.com [Wed, 7 Aug 2019 21:17:36 +0000 (21:17 +0000)]
Web Inspector: Uncaught Exception: TimelineAgent already enabled
https://bugs.webkit.org/show_bug.cgi?id=200513

Reviewed by Joseph Pecoraro.

Source/WebCore:

Call `disable` when the last frontend disconnects, so that if Web Inspector is reopened the
`TimelineAgent` is back to being in a disabled state.

* inspector/agents/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):

Source/WebInspectorUI:

Update some incorrect compatibility comments from r248286.

* UserInterface/Protocol/InspectorFrontendAPI.js:
* UserInterface/Controllers/TimelineManager.js:

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

5 months agoUpdating TestExpectations for editing/pasteboard/paste-does-not-fire-promises-while...
russell_e@apple.com [Wed, 7 Aug 2019 21:12:54 +0000 (21:12 +0000)]
Updating TestExpectations for editing/pasteboard/paste-does-not-fire-promises-while-sanitizing-web-content.html.
rdar://54049321

Unreviewed Test Gardening.

* platform/ios-12/TestExpectations:
* platform/ios/TestExpectations:

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

5 months agoMuted <video> elements can block display from sleeping.
jer.noble@apple.com [Wed, 7 Aug 2019 21:12:03 +0000 (21:12 +0000)]
Muted <video> elements can block display from sleeping.
https://bugs.webkit.org/show_bug.cgi?id=200511

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/video-muted-holds-sleep-assertion.html

Modify the shouldDisableSleep() method to take muting into account.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::shouldDisableSleep const):

LayoutTests:

* media/video-muted-holds-sleep-assertion-expected.txt: Added.
* media/video-muted-holds-sleep-assertion.html: Added.

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

5 months agoTighten WeakPtr threading assertions for GC threads
cdumez@apple.com [Wed, 7 Aug 2019 20:35:11 +0000 (20:35 +0000)]
Tighten WeakPtr threading assertions for GC threads
https://bugs.webkit.org/show_bug.cgi?id=200451

Reviewed by Youenn Fablet.

Make sure our GC threads do not dereference WeakPtr for main thread
objects by tightening our threading assertions in WeakPtr. They are
still allowed to call WeakPtr::get() for now though.

* wtf/WeakPtr.h:
(WTF::WeakPtrImpl::get):
(WTF::WeakPtrImpl::wasConstructedOnMainThread const):
(WTF::WeakPtr::get const):
(WTF::WeakPtr::operator-> const):
(WTF::WeakPtr::operator* const):

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

5 months agoAdd WHLSL and WebGPU to the watchlist file
mmaxfield@apple.com [Wed, 7 Aug 2019 20:32:30 +0000 (20:32 +0000)]
Add WHLSL and WebGPU to the watchlist file
https://bugs.webkit.org/show_bug.cgi?id=200509

Reviewed by Robin Morisset.

* Scripts/webkitpy/common/config/watchlist:

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

5 months ago[WHLSL] Simplify and eliminate redundant work in WHLSLFunctionWriter.cpp
rmorisset@apple.com [Wed, 7 Aug 2019 19:58:15 +0000 (19:58 +0000)]
[WHLSL] Simplify and eliminate redundant work in WHLSLFunctionWriter.cpp
https://bugs.webkit.org/show_bug.cgi?id=200460

Reviewed by Myles Maxfield.

2 trivial simplifications:
- Replace FunctionDeclarationWriter by a standalone function, there was no reason to make it a subclass of Visitor
- Avoid an exponential blow-up in the computation of reachable functions.

I have way too much noise on my system (swings back and forth between 7 and 12ms for this phase) to measure a performance win,
but since this patch simplifies things without adding complexity I think it is worth it.

No new test as there is no functional change intended.

* Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
(WebCore::WHLSL::Metal::declareFunction):
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::FunctionDefinitionWriter):
(WebCore::WHLSL::Metal::RenderFunctionDefinitionWriter::RenderFunctionDefinitionWriter):
(WebCore::WHLSL::Metal::ComputeFunctionDefinitionWriter::ComputeFunctionDefinitionWriter):
(WebCore::WHLSL::Metal::sharedMetalFunctions):
(WebCore::WHLSL::Metal::metalFunctions):

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

5 months agoUnreviewed build fix after r248317 -- disable XCBuild because it
krollin@apple.com [Wed, 7 Aug 2019 19:50:04 +0000 (19:50 +0000)]
Unreviewed build fix after r248317 -- disable XCBuild because it
breaks incremental builds.

* Scripts/webkitdirs.pm:
(canUseXCBuild):

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

5 months ago[WHLSL] checkRecursion, checkTextureReferences, and EscapedVariableCollector should...
sbarati@apple.com [Wed, 7 Aug 2019 19:48:29 +0000 (19:48 +0000)]
[WHLSL] checkRecursion, checkTextureReferences, and EscapedVariableCollector should skip stdlib functions
https://bugs.webkit.org/show_bug.cgi?id=200510

Reviewed by Myles C. Maxfield.

We can skip walking the stdlib part of the AST in various semantic checking phases:
- checkRecursion: the stdlib does not have recursion
- checkTextureReferences: the stdlib does not have references to textures
- EscapedVariableCollector: this is used inside preserveVariableLifetimes, and
  the stdlib never escapes any variables.

This patch speeds up checkRecursion, checkTextureReferences, and preserveVariableLifetimes
by about 1ms each, leading to a 3ms compile time speedup in compute_boids.

* Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.cpp:
(WebCore::WHLSL::TextureReferencesChecker::visit):
* Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp:
(WebCore::WHLSL::preserveVariableLifetimes):
(WebCore::WHLSL::EscapedVariableCollector::escapeVariableUse): Deleted.
(WebCore::WHLSL::EscapedVariableCollector::takeEscapedVariables): Deleted.
* Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp:

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

5 months agoContext menu on a universal link produces a blank preview
dino@apple.com [Wed, 7 Aug 2019 19:43:51 +0000 (19:43 +0000)]
Context menu on a universal link produces a blank preview
https://bugs.webkit.org/show_bug.cgi?id=200485
<rdar://problem/53699620>

Reviewed by Tim Horton.

Use the umbrella #import.

* pal/spi/cocoa/LaunchServicesSPI.h:

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

5 months agoContext menu on a universal link produces a blank preview
dino@apple.com [Wed, 7 Aug 2019 19:05:43 +0000 (19:05 +0000)]
Context menu on a universal link produces a blank preview
https://bugs.webkit.org/show_bug.cgi?id=200485
<rdar://problem/53699620>

Reviewed by Dean Jackson.

Source/WebCore/PAL:

Define iTunesStoreURL from CoreServices.

* pal/spi/cocoa/LaunchServicesSPI.h:

Source/WebKit:

If the context menu is activated on an iTunesStore URL, pass it
on to DataDetectors, who should know how to handle it.

Two drive-by fixes:
- make it clear that early returns do not produce a value. Instead call the
  completion handler first, then return.
- The new API DataDetectors case doesn't need to worry about hiding link previews
  as DataDetectors itself will handle that.

* UIProcess/ios/WKContentViewInteraction.mm: If the URL is an iTunesStoreURL
(as defined by CoreServices), let DataDetectors handle it.
(-[WKContentView assignLegacyDataForContextMenuInteraction]):
(-[WKContentView continueContextMenuInteraction:]):
(-[WKContentView continueContextMenuInteractionWithDataDetectors:]): New method to
use DataDetectors if possible.

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

5 months agoUpdating TestExpectations for Two Failing Layout Tests.
russell_e@apple.com [Wed, 7 Aug 2019 18:23:31 +0000 (18:23 +0000)]
Updating TestExpectations for Two Failing Layout Tests.
rdar://53779679

Unreviewed Test Gardening.

* platform/ios-12/TestExpectations:
* platform/ios/TestExpectations:

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

5 months ago[WHLSL] cache results of argumentTypeForAndOverload inside Checker
sbarati@apple.com [Wed, 7 Aug 2019 18:13:57 +0000 (18:13 +0000)]
[WHLSL] cache results of argumentTypeForAndOverload inside Checker
https://bugs.webkit.org/show_bug.cgi?id=200462

Reviewed by Robin Morisset.

When I profiled the time we spent in the checker, it turned out that
argumentTypeForAndOverload is one of the most expensive functions. If
we just cache the results of that function, we can avoid 99% of the
duplicate allocations that function does in compute_boids. This patch
is a ~4ms speedup in the checker on compute_boids.

* Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp:
* Modules/webgpu/WHLSL/WHLSLChecker.cpp:
(WebCore::WHLSL::AndOverloadTypeKey::AndOverloadTypeKey):
(WebCore::WHLSL::AndOverloadTypeKey::isEmptyValue const):
(WebCore::WHLSL::AndOverloadTypeKey::isHashTableDeletedValue const):
(WebCore::WHLSL::AndOverloadTypeKey::hash const):
(WebCore::WHLSL::AndOverloadTypeKey::operator== const):
(WebCore::WHLSL::AndOverloadTypeKey::Hash::hash):
(WebCore::WHLSL::AndOverloadTypeKey::Hash::equal):
(WebCore::WHLSL::AndOverloadTypeKey::Traits::isEmptyValue):
(WebCore::WHLSL::Checker::argumentTypeForAndOverload):
(WebCore::WHLSL::Checker::finishVisiting):
(WebCore::WHLSL::argumentTypeForAndOverload): Deleted.

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

5 months agoRemove IDBDatabaseIdentifier::m_sessionID
youenn@apple.com [Wed, 7 Aug 2019 18:05:12 +0000 (18:05 +0000)]
Remove IDBDatabaseIdentifier::m_sessionID
https://bugs.webkit.org/show_bug.cgi?id=200489

Reviewed by Darin Adler.

IDBDatabaseIdentifier can be created without a valid session ID.
Its session ID is only used in NetworkProcess where it can be retrieved from the IDBServer.
In WebProcess, session ID is also known from the IDB connection.
Update SQLiteIDBBackingStore to store a session ID which is given from its IDBServer.
No observable change of behavior.

* Modules/indexeddb/IDBDatabaseIdentifier.cpp:
(WebCore::IDBDatabaseIdentifier::IDBDatabaseIdentifier):
(WebCore::IDBDatabaseIdentifier::isolatedCopy const):
* Modules/indexeddb/IDBDatabaseIdentifier.h:
(WebCore::IDBDatabaseIdentifier::hash const):
(WebCore::IDBDatabaseIdentifier::databaseName const):
(WebCore::IDBDatabaseIdentifier::encode const):
(WebCore::IDBDatabaseIdentifier::decode):
(WebCore::IDBDatabaseIdentifier::sessionID const): Deleted.
* Modules/indexeddb/IDBFactory.cpp:
(WebCore::IDBFactory::openInternal):
(WebCore::IDBFactory::deleteDatabase):
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::createBackingStore):
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::SQLiteIDBBackingStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey):
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:
(WebCore::IDBServer::SQLiteIDBBackingStore::sessionID const):
* Modules/indexeddb/server/SQLiteIDBCursor.cpp:
(WebCore::IDBServer::SQLiteIDBCursor::internalFetchNextRecord):

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

5 months agoFix thread safety issue under JSHistory::visitAdditionalChildren()
cdumez@apple.com [Wed, 7 Aug 2019 17:31:10 +0000 (17:31 +0000)]
Fix thread safety issue under JSHistory::visitAdditionalChildren()
https://bugs.webkit.org/show_bug.cgi?id=200504

Reviewed by Darin Adler.

JSHistory::visitAdditionalChildren() is called from a GC thread and was calling
History::cachedState() whose implementation goes deep into WebCore
(FrameLoader / HistoryController). Among other things, it null checks m_window
which is a WeakPtr and then later dereferences it to get the Frame object, which
is not safe from the non-main thread.

To address the issue, introduce a simpler cachedStateForGC() getter which is
thread safe, and use it in JSHistory::visitAdditionalChildren().

* bindings/js/JSHistoryCustom.cpp:
(WebCore::JSHistory::visitAdditionalChildren):
* page/History.h:

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

5 months agoRebase inspector generator tests.
drousso@apple.com [Wed, 7 Aug 2019 17:25:26 +0000 (17:25 +0000)]
Rebase inspector generator tests.

Rubber-stamped by Brian Burg.

* inspector/scripts/tests/all/expected/definitions-with-mac-platform.json-result:
* inspector/scripts/tests/generic/expected/commands-with-async-attribute.json-result:
* inspector/scripts/tests/generic/expected/commands-with-optional-call-return-parameters.json-result:
* inspector/scripts/tests/generic/expected/events-with-optional-parameters.json-result:
* inspector/scripts/tests/generic/expected/generate-domains-with-feature-guards.json-result:
* inspector/scripts/tests/generic/expected/shadowed-optional-type-setters.json-result:
* inspector/scripts/tests/generic/expected/type-declaration-object-type.json-result:
* inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result:
* inspector/scripts/tests/generic/expected/type-with-open-parameters.json-result:
* inspector/scripts/tests/mac/expected/definitions-with-mac-platform.json-result:

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

5 months agoAllow clients to toggle a text input field between being viewable and having characte...
commit-queue@webkit.org [Wed, 7 Aug 2019 17:24:19 +0000 (17:24 +0000)]
Allow clients to toggle a text input field between being viewable and having characters hidden while maintaining
a yellow auto-filled appearance
https://bugs.webkit.org/show_bug.cgi?id=200037
rdar://problem/51900961

Patch by Priyanka Agarwal <pagarwal999@apple.com> on 2019-08-07
Reviewed by Daniel Bates.

Source/WebCore:

Tests: fast/forms/auto-fill-button/hide-auto-fill-strong-password-viewable-treatment-when-form-is-reset.html
       fast/forms/auto-fill-button/input-strong-password-viewable.html

* css/CSSSelector.cpp:
(WebCore::CSSSelector::selectorText const):
Adding CSSSelector case for new pseudo class of AutofillStrongPasswordViewable.

* css/CSSSelector.h: Added PseudoClassAutofillStrongPasswordViewable

* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne const): Added handling for SelectorChecker.cpp

* css/SelectorCheckerTestFunctions.h:
(WebCore::isAutofilledStrongPasswordViewable):
Checking if the element is an input element and considered to be
AutoFilled and Viewable. Returns a boolean accordingly.

* css/SelectorPseudoClassAndCompatibilityElementMap.in:
Add -webkit-autofill-strong-password-viewable css class.

* css/html.css:
(input:-webkit-autofill, input:-webkit-autofill-strong-password, input:-webkit-autofill-strong-password-viewable):
(input:-webkit-autofill-strong-password-viewable):
(input:-webkit-autofill, input:-webkit-autofill-strong-password): Deleted. Updated to include viewable pseudo class.

* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::addPseudoClassType):
Add case handling for PseudoClassAutofillStrongPasswordViewable.

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::HTMLInputElement):
Add boolean m_isAutoFilledAndViewable for representing if the
input element is both AutoFilled and should be viewable.
Don't update the viewable treatment in setValueFromRenderer() because even if the user makes edits to the input field
the visual treatment should still be applied.

(WebCore::HTMLInputElement::resignStrongPasswordAppearance):
Updates boolean representing if input element is autofilled and viewable to false.

(WebCore::HTMLInputElement::reset):
Updates boolean representing if input element is autofilled and viewable to false.

(WebCore::HTMLInputElement::setAutoFilledAndViewable):
Setter function for the boolean of m_isAutoFilledAndViewable.

* html/HTMLInputElement.h:
(WebCore::HTMLInputElement::isAutoFilledAndViewable const):
Creating boolean value for m_isAutoFilledAndViewable.

* testing/Internals.cpp:
(WebCore::Internals::setAutoFilledAndViewable): Adding for testing purposes.
* testing/Internals.h: Adding for testing purposes.
* testing/Internals.idl:

Source/WebKit:

* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
(-[WKWebProcessPlugInNodeHandle HTMLInputElementIsAutoFilledAndViewable]):
Accessor function for boolean which represents if the input element is autofilled and viewable.

(-[WKWebProcessPlugInNodeHandle setHTMLInputElementIsAutoFilledAndViewable:]):
Setter function for boolean which represents if the input element is autofilled and viewable.

* WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
(WKBundleNodeHandleSetHTMLInputElementAutoFilledAndViewable):
Accessor function for boolean which represents if the input element is autofilled and viewable.

       * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:
Creating function declaration for boolean setter.

* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
Accessor function for boolean which represents if the input element is autofilled and viewable.

(WebKit::InjectedBundleNodeHandle::isHTMLInputElementAutoFilledAndViewable const):
Setter function for boolean which represents if the input element is autofilled and viewable.

(WebKit::InjectedBundleNodeHandle::setHTMLInputElementAutoFilledAndViewable):
Setter function for boolean which represents if the input element is autofilled and viewable.

* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
Adding setter and getter functions for the boolean which represents if the input element is autofilled
and viewable.

Source/WebKitLegacy/mac:

* DOM/WebDOMOperations.mm:
(-[DOMHTMLInputElement _isAutoFilledAndViewable]):
(-[DOMHTMLInputElement _setAutoFilledAndViewable:]):
* DOM/WebDOMOperationsPrivate.h:

LayoutTests:

* fast/forms/auto-fill-button/hide-auto-fill-strong-password-viewable-treatment-when-form-is-reset.html: Added.
Test for when the form is reset to no longer be autofilled.

* fast/forms/auto-fill-button/input-strong-password-viewable.html: Added.
Test for when the form is set to being autofilled and viewable.

* fast/forms/auto-fill-button/resources/process-auto-fill-button-type-and-invoke-runTest.js:
(window.onload): Javascript used by test to set the element to be autofilled and viewable added

* platform/mac/fast/forms/auto-fill-button/hide-auto-fill-strong-password-viewable-treatment-when-form-is-reset-expected.txt: Added.
* platform/mac/fast/forms/auto-fill-button/input-strong-password-viewable-expected.txt:

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

5 months agoAdd more threading assertions to ITP code
cdumez@apple.com [Wed, 7 Aug 2019 17:22:38 +0000 (17:22 +0000)]
Add more threading assertions to ITP code
https://bugs.webkit.org/show_bug.cgi?id=200505

Reviewed by Brent Fulgham.

Add more threading assertions to ITP code to help catch bugs and protect against future bad usage.

* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::isEmpty const):
(WebKit::ResourceLoadStatisticsMemoryStore::setPersistentStorage):
(WebKit::ResourceLoadStatisticsMemoryStore::incrementRecordsDeletedCountForDomains):
(WebKit::ResourceLoadStatisticsMemoryStore::classifyPrevalentResources):
(WebKit::ResourceLoadStatisticsMemoryStore::syncStorageIfNeeded):
(WebKit::ResourceLoadStatisticsMemoryStore::syncStorageImmediately):
(WebKit::ResourceLoadStatisticsMemoryStore::grandfatherDataForDomains):
(WebKit::ResourceLoadStatisticsMemoryStore::ensurePrevalentResourcesForDebugMode):
* NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
(WebKit::ResourceLoadStatisticsStore::statisticsEpirationTime const):
(WebKit::ResourceLoadStatisticsStore::mergeOperatingDates):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::hasStorageAccessForFrame):
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate):
(WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
(WebKit::WebResourceLoadStatisticsStore::logWebSocketLoading):
(WebKit::WebResourceLoadStatisticsStore::logSubresourceLoading):
(WebKit::WebResourceLoadStatisticsStore::logSubresourceRedirect):
(WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::removePrevalentDomains):
(WebKit::WebResourceLoadStatisticsStore::networkSession):
(WebKit::WebResourceLoadStatisticsStore::invalidateAndCancel):
(WebKit::WebResourceLoadStatisticsStore::sendDiagnosticMessageWithValue const):
(WebKit::WebResourceLoadStatisticsStore::notifyPageStatisticsTelemetryFinished const):

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

5 months agoUnreviewed, rolling out r248330.
ryanhaddad@apple.com [Wed, 7 Aug 2019 17:19:08 +0000 (17:19 +0000)]
Unreviewed, rolling out r248330.

Breaks internal builds.

Reverted changeset:

"Context menu on a universal link produces a blank preview"
https://bugs.webkit.org/show_bug.cgi?id=200485
https://trac.webkit.org/changeset/248330

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

5 months agoDeclarations and implementations of findCaret(Min|Max)imumOffset have inconsistent...
wenson_hsieh@apple.com [Wed, 7 Aug 2019 17:17:05 +0000 (17:17 +0000)]
Declarations and implementations of findCaret(Min|Max)imumOffset have inconsistent signatures
https://bugs.webkit.org/show_bug.cgi?id=200503

Reviewed by Darin Adler.

No change in behavior.

* rendering/SimpleLineLayoutFunctions.h:

Update these function declarations to take "const RenderText&", which matches the signatures of their inline
implementations below.

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

5 months agoExtra space inserted at start of line when inserting a newline in Mail compose
wenson_hsieh@apple.com [Wed, 7 Aug 2019 16:23:52 +0000 (16:23 +0000)]
Extra space inserted at start of line when inserting a newline in Mail compose
https://bugs.webkit.org/show_bug.cgi?id=200490
<rdar://problem/53501354>

Reviewed by Antti Koivisto.

Source/WebCore:

This started happening after r244494, which deferred editor state computation until the next layer tree flush
when changing selection. After inserting a paragraph, the act of computing an editor state ensured that the text
node containing the caret drops out of simple line layout, while grabbing the characters near the selection
(i.e., calling charactersAroundPosition). This meant that when we subsequently ask positionAfterSplit whether it
isRenderedCharacter() at the end of the command, we are guaranteed to have line boxes, so we get a meaningful
answer and avoid inserting an extra non-breaking space.

However, after r244494, we defer the editor state computation until the end of the edit command; this means that
we may not have line boxes for positionAfterSplit's text node renderer, due to remaining in simple line layout.
In turn, this means that we end up hitting the assertion in containsRenderedCharacterOffset in debug builds; on
release builds, we simply return false from containsRenderedCharacterOffset, which causes us to insert an extra
space.

To fix this, we educate RenderText::containsRenderedCharacterOffset about simple line layout.

Test: editing/inserting/insert-paragraph-in-designmode-document.html

* rendering/RenderText.cpp:
(WebCore::RenderText::containsRenderedCharacterOffset const):
(WebCore::RenderText::containsCaretOffset const):

Changed to use SimpleLineLayout::containsOffset.

* rendering/SimpleLineLayoutFunctions.h:
(WebCore::SimpleLineLayout::containsOffset):

I first contrasted the behavior of RenderTextLineBoxes::containsOffset in the cases where the OffsetType is
CaretOffset or CharacterOffset, and found that the only interesting differences were:

1. The caret offset type case has special handling for line breaks.
2. Both offset types have handling for reversed text.
3. The end offset of a line box contains a caret offset, but not a character offset.

For the purposes of OffsetType CharacterOffset, (1) is irrelevant; furthermore, (2) is already not handled by
logic in containsCaretOffset(). Thus, the only major difference in the CharacterOffset case should be (3), which
we handle by only allowing the case where the given offset is equal to the very end of a text run for caret
offsets, and not character offsets.

(WebCore::SimpleLineLayout::containsCaretOffset): Deleted.

Renamed to just containsOffset.

LayoutTests:

Add a new test to verify that inserting a newline in the middle of text in a document with designMode "on"
doesn't insert an extra space at the beginning of the newly inserted line.

* editing/inserting/insert-paragraph-in-designmode-document-expected.txt: Added.
* editing/inserting/insert-paragraph-in-designmode-document.html: Added.

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

5 months agoASSERT that a sessionID is valid when encoding it
youenn@apple.com [Wed, 7 Aug 2019 16:08:58 +0000 (16:08 +0000)]
ASSERT that a sessionID is valid when encoding it
https://bugs.webkit.org/show_bug.cgi?id=199302

Reviewed by Darin Adler.

Source/WebCore:

For IDBValue, instead of encoding an invalid session ID, encode a boolean that tells there is no sessionID.
For IDBRequestData, keep track of whether there is an IDBDatabaseIdentifier
and encode/decode accordingly to not encode an invalid sessionID.
No observable change of behavior.

* Modules/indexeddb/IDBValue.h:
(WebCore::IDBValue::sessionID const):
(WebCore::IDBValue::encode const):
(WebCore::IDBValue::decode):
* Modules/indexeddb/shared/IDBRequestData.cpp:
(WebCore::IDBRequestData::isolatedCopy):
* Modules/indexeddb/shared/IDBRequestData.h:
(WebCore::IDBRequestData::databaseIdentifier const):
(WebCore::IDBRequestData::decode):

Source/WebCore/PAL:

ASSERT that a sessionID is valid at encoding/decoding time.

* pal/SessionID.h:
(PAL::SessionID::encode const):
(PAL::SessionID::decode):

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

5 months ago[LFC] Rename FormattingContext::layoutOutOfFlowDescendants to layoutOutOfFlowContent
zalan@apple.com [Wed, 7 Aug 2019 15:32:55 +0000 (15:32 +0000)]
[LFC] Rename FormattingContext::layoutOutOfFlowDescendants to layoutOutOfFlowContent
https://bugs.webkit.org/show_bug.cgi?id=200502
<rdar://problem/54032534>

Reviewed by Antti Koivisto.

The layoutOutOfFlowDescendants name is not entirely accurate. In a formatting context we only
lay out the out-of-flow boxes that actually belong to the current formatting context.

<div style="float: left">
  <div id=outer style="position: absolute">
    <div id=inner style="position: absolute"></div>
  </div>
</div>

The float's formatting context only lays out the outer absolutely positioned box. The inner box
(which is also an out-of-flow descendant of the float box) is taken care of by the outer box.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::layoutOutOfFlowContent const):
(WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
(WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const): Deleted.
* layout/FormattingContext.h:
* layout/LayoutState.cpp:
(WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):

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

5 months ago[LFC] Introduce Layout::Phase class
zalan@apple.com [Wed, 7 Aug 2019 14:23:54 +0000 (14:23 +0000)]
[LFC] Introduce Layout::Phase class
https://bugs.webkit.org/show_bug.cgi?id=200473
<rdar://problem/53996061>

Reviewed by Antti Koivisto.

It helps to check whether we could run certain actions like layout while constructing the tree.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/LayoutState.h:
* layout/floats/FloatingContext.cpp:
* layout/inlineformatting/InlineLine.cpp:
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::establishesFormattingContext const):
(WebCore::Layout::Box::containingBlock const):
(WebCore::Layout::Box::formattingContextRoot const):
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::TreeBuilder::createLayoutTree):

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

5 months agoHigh number of cache miss on localTimeOffset
ticaiolima@gmail.com [Wed, 7 Aug 2019 12:41:01 +0000 (12:41 +0000)]
High number of cache miss on localTimeOffset
https://bugs.webkit.org/show_bug.cgi?id=200444

Reviewed by Darin Adler.

This patch is separating the `LocalTimeOffsetCache` for each
`WTF::TimeType` to avoid constant cache miss on pathological cases
where `gregorianDateTimeToMS` and `msToGregorianDateTime` are
intercaleted with `inputTimeType ==  WTF::LocalTime`. Such case
happens during execution of Facebook Messenger
(https://www.messenger.com).

* runtime/JSDateMath.cpp:
(JSC::localTimeOffset):
(JSC::gregorianDateTimeToMS):
* runtime/VM.cpp:
(JSC::VM::resetDateCache):
* runtime/VM.h:
(JSC::LocalTimeOffsetCache::LocalTimeOffsetCache):
(JSC::LocalTimeOffsetCache::reset):

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

5 months agocontext-attributes-alpha-depth-stencil-antialias fails on WPE WebKit
commit-queue@webkit.org [Wed, 7 Aug 2019 10:44:17 +0000 (10:44 +0000)]
context-attributes-alpha-depth-stencil-antialias fails on WPE WebKit
https://bugs.webkit.org/show_bug.cgi?id=200434

Patch by Chris Lord <clord@igalia.com> on 2019-08-07
Reviewed by Žan Doberšek.

This patch fixes 16-bit surfaces being used for FBOs with no
alpha component when using the GLES implementation of GraphicsContext3D.

* platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
(WebCore::GraphicsContext3D::reshapeFBOs):
Use GL_UNSIGNED_BYTE instead of GL_UNSIGNED_SHORT_5_6_5 for surfaces with no alpha.

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

5 months ago[WHLSL] Make resolveFunction in Checker faster
sbarati@apple.com [Wed, 7 Aug 2019 04:17:29 +0000 (04:17 +0000)]
[WHLSL] Make resolveFunction in Checker faster
https://bugs.webkit.org/show_bug.cgi?id=200287

Reviewed by Robin Morisset.

This patch makes compute_boids faster by making function overload
resolution faster inside the Checker. It's a ~6ms speedup in the
checker. The main idea is to limit the number of overloads we need
to look for by using a hash table that describes a function's type
instead of just using a hash table keyed by a function's name.

The interesting implementation detail here is we must construct entries
in the hash table such that they still allow constants to be resolved to
various types. This means that the key in the hash table must normalize
the vector of types it uses to express a function's identity. The normalization
rules are:
- int => float
- uint => float
- T* => float*
- T[] => float*

The first two rules are because int constants can be matched against
the float and uint types. The latter two rules are because the null
literal can be matched against any pointer or any array reference
(we pick float* arbitrarily). Even though it seems like these
normalization rules would drastically broaden the efficacy of the hash
table, we still see a 100x reduction in the number of overloads we must
resolve inside compute_boids. We go from having to resolve 400,000
overloads to just resolving 4,000.

* Modules/webgpu/WHLSL/WHLSLChecker.cpp:
(WebCore::WHLSL::FunctionKey::FunctionKey):
(WebCore::WHLSL::FunctionKey::isEmptyValue const):
(WebCore::WHLSL::FunctionKey::isHashTableDeletedValue const):
(WebCore::WHLSL::FunctionKey::hash const):
(WebCore::WHLSL::FunctionKey::operator== const):
(WebCore::WHLSL::FunctionKey::Hash::hash):
(WebCore::WHLSL::FunctionKey::Hash::equal):
(WebCore::WHLSL::FunctionKey::Traits::isEmptyValue):
(WebCore::WHLSL::Checker::Checker):
(WebCore::WHLSL::Checker::wrappedFloatType):
(WebCore::WHLSL::Checker::genericPointerType):
(WebCore::WHLSL::Checker::normalizedTypeForFunctionKey):
(WebCore::WHLSL::Checker::resolveFunction):
(WebCore::WHLSL::Checker::finishVisiting):
(WebCore::WHLSL::Checker::visit):
(WebCore::WHLSL::resolveFunction): Deleted.

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

5 months ago[iPadOS] slides.google.com: tapping near cursor in a slide title focuses the speaker...
rniwa@webkit.org [Wed, 7 Aug 2019 03:15:19 +0000 (03:15 +0000)]
[iPadOS] slides.google.com: tapping near cursor in a slide title focuses the speaker notes
https://bugs.webkit.org/show_bug.cgi?id=200216

Reviewed by Wenson Hsieh.

Source/WebKit:

The bug was caused by a race condition between Google slides removing inputmode="none" from the hidden
content editable and updating the focused region upon receiving a pointerup event, which happens after
the Google slides had already updated its page layout & coordinates based on new visual viewport with
the software keyboard's boudning rect taken into account.

Delay bringing up the software keyboard for a inputmode change until all touches are released.

In the future, we could consider also delaying the software keyboard to be brought in general until
touchend / pointerup events are dispatched but this is rather risky since that could affact random
other websites while Google suites is the only major site to make use of inputmode="none".

This patch also reverts r243044, which was added for Google slides, since it's no longer needed and
interferes with this patch by adding another way to bring up the software keyboard.

Note: Adjusting touchend / pointerup coordinates while the keyboard is being brought up doesn't work
because the page had already updated the layout by then based on new visual viewport size.

Test: fast/forms/ios/inputmode-change-update-keyboard-after-pointerup.html

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::handleTouchEventSynchronously): Call didReleaseAllTouchPoints when all
touches are released.
(WebKit::WebPageProxy::handleTouchEventAsynchronously): Ditto.
(WebKit::WebPageProxy::handleTouchEvent): Ditto.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::didReleaseAllTouchPoints): Added for non-iOS platforms.
(WebKit::WebPageProxy::m_pendingInputModeChange): Added. Used when inputmode is changed while
there is an on-going touch interaction.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::elementDidFocus): Clear m_pendingInputModeChange when a new element is focused.
(WebKit::WebPageProxy::elementDidBlur): Ditto for bluring.
(WebKit::WebPageProxy::focusedElementDidChangeInputMode): Don't bring up the software keyboard now if
there are on-going touches by exiting early after setting m_pendingInputModeChange.
(WebKit::WebPageProxy::didReleaseAllTouchPoints): Bring up the software keyboard if inputmode
had changed from "none" to something else.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::dispatchTouchEvent): Removed the code added by r243044.

LayoutTests:

Added a new regression test and removed the one added for r243044.

* fast/events/touch/ios/show-keyboard-after-preventing-touchstart-expected.txt: Removed.
* fast/events/touch/ios/show-keyboard-after-preventing-touchstart.html: Removed.
* fast/forms/ios/inputmode-change-update-keyboard-after-pointerup-expected.txt: Added.
* fast/forms/ios/inputmode-change-update-keyboard-after-pointerup.html: Added.
* fast/forms/ios/inputmode-change-update-keyboard.html: Fixed the test for manual testing.

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

5 months ago[JSC] sampling-profiler can see garbage Wasm::Callee* pointer which is HashTable...
ysuzuki@apple.com [Wed, 7 Aug 2019 02:48:07 +0000 (02:48 +0000)]
[JSC] sampling-profiler can see garbage Wasm::Callee* pointer which is HashTable deleted / empty values
https://bugs.webkit.org/show_bug.cgi?id=200494

Reviewed by Saam Barati.

The sampling-profiler can see a garbage pointer which is like Wasm::Callee*. This can be filtered by HashSet<Callee*>.
But this is safe only when the garbage pointer is not deleted / empty values. We saw occasional crash with JetStream2/tsf-wasm.
This patch filters out these values with `HashSet<Callee*>::isValidValue`.

* wasm/WasmCalleeRegistry.h:
(JSC::Wasm::CalleeRegistry::isValidCallee):

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

5 months agoASSERTION FAILED: m_observers.isEmpty() if WKPageSetPageStateClient is used
Hironori.Fujii@sony.com [Wed, 7 Aug 2019 01:44:55 +0000 (01:44 +0000)]
ASSERTION FAILED: m_observers.isEmpty() if WKPageSetPageStateClient is used
https://bugs.webkit.org/show_bug.cgi?id=200465

Reviewed by Alex Christensen.

Source/WebKit:

PageLoadState::Observer should be removed before destructing
WebPageProxy.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::~WebPageProxy): Call
setPageLoadStateObserver with nullptr to remove
PageLoadState::Observer.

Tools:

* TestWebKitAPI/Tests/WebKit/PageLoadState.cpp:
(TestWebKitAPI::WebKit.PageLoadState): Set PageStateClient before
finishing the test.
* TestWebKitAPI/win/PlatformWebViewWin.cpp:
(TestWebKitAPI::PlatformWebView::~PlatformWebView): Release m_view.

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

5 months agoFix 32-bit Linux build after r248282
commit-queue@webkit.org [Wed, 7 Aug 2019 01:16:22 +0000 (01:16 +0000)]
Fix 32-bit Linux build after r248282
https://bugs.webkit.org/show_bug.cgi?id=200491

Patch by Loïc Yhuel <loic.yhuel@softathome.com> on 2019-08-06
Reviewed by Youenn Fablet.

minInterToneGapMs must be a size_t like interToneGap for std::max call.
The other constants are updated for consistency, even if the compiler
was able to cast them automatically.

* Modules/mediastream/RTCDTMFSender.cpp:

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

5 months agoAdd release assertions to help catch a bug in our WebProcessCache implementation
cdumez@apple.com [Wed, 7 Aug 2019 00:33:34 +0000 (00:33 +0000)]
Add release assertions to help catch a bug in our WebProcessCache implementation
https://bugs.webkit.org/show_bug.cgi?id=200483

Reviewed by Geoffrey Garen.

Add release assertions to help catch a bug in our WebProcessCache implementation. We
have evidence (rdar://problem/53962494) that we have processes with a page which
starts a provisional load while the process is in the WebProcessCache. This should
not be possible.

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::setIsInProcessCache):
(WebKit::WebProcessProxy::addExistingWebPage):

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

5 months agoContext menu on a universal link produces a blank preview
dino@apple.com [Wed, 7 Aug 2019 00:17:24 +0000 (00:17 +0000)]
Context menu on a universal link produces a blank preview
https://bugs.webkit.org/show_bug.cgi?id=200485
<rdar://problem/53699620>

Reviewed by Dean Jackson.

Source/WebCore/PAL:

Define iTunesStoreURL from CoreServices.

* pal/spi/cocoa/LaunchServicesSPI.h:

Source/WebKit:

If the context menu is activated on an iTunesStore URL, pass it
on to DataDetectors, who should know how to handle it.

Two drive-by fixes:
- make it clear that early returns do not produce a value. Instead call the
  completion handler first, then return.
- The new API DataDetectors case doesn't need to worry about hiding link previews
  as DataDetectors itself will handle that.

* UIProcess/ios/WKContentViewInteraction.mm: If the URL is an iTunesStoreURL
(as defined by CoreServices), let DataDetectors handle it.
(-[WKContentView assignLegacyDataForContextMenuInteraction]):
(-[WKContentView continueContextMenuInteraction:]):
(-[WKContentView continueContextMenuInteractionWithDataDetectors:]): New method to
use DataDetectors if possible.

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

5 months agoAvoid unnecessary ResourceRequest copy under NetworkResourceLoader::isCrossOriginPref...
cdumez@apple.com [Wed, 7 Aug 2019 00:06:59 +0000 (00:06 +0000)]
Avoid unnecessary ResourceRequest copy under NetworkResourceLoader::isCrossOriginPrefetch()
https://bugs.webkit.org/show_bug.cgi?id=200478

Reviewed by Youenn Fablet.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::isCrossOriginPrefetch const):

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

5 months agoWeb Inspector: Show radius values in box model metrics view
drousso@apple.com [Tue, 6 Aug 2019 23:46:22 +0000 (23:46 +0000)]
Web Inspector: Show radius values in box model metrics view
https://bugs.webkit.org/show_bug.cgi?id=160993
<rdar://problem/27919035>

Reviewed by Brian Burg.

* UserInterface/Views/BoxModelDetailsSectionRow.js:
(WI.BoxModelDetailsSectionRow.prototype._getPropertyValue): Added.
(WI.BoxModelDetailsSectionRow.prototype._getPropertyValueAsPx):
(WI.BoxModelDetailsSectionRow.prototype._getBox):
(WI.BoxModelDetailsSectionRow.prototype._getComponentPrefix): Added.
(WI.BoxModelDetailsSectionRow.prototype._getComponentSuffix):
(WI.BoxModelDetailsSectionRow.prototype._updateMetrics):
(WI.BoxModelDetailsSectionRow.prototype._updateMetrics.createBoxPartElement):
(WI.BoxModelDetailsSectionRow.prototype._updateMetrics.createContentAreaElement):
(WI.BoxModelDetailsSectionRow.prototype._applyUserInput):
(WI.BoxModelDetailsSectionRow.prototype._applyUserInput.inspectedPage_node_toggleInlineStyleProperty):
* UserInterface/Views/BoxModelDetailsSectionRow.css:
(.details-section .row.box-model .box): Added.
(.details-section .row.box-model .box > .label): Added.
(.details-section .row.box-model .box.position): Added.
(.details-section .row.box-model .box.margin): Added.
(.details-section .row.box-model:not(.hovered) .box.margin, .details-section .row.box-model .box.margin.active): Added.
(.details-section .row.box-model .box.border): Added.
(.details-section .row.box-model:not(.hovered) .box.border, .details-section .row.box-model .box.border.active): Added.
(.details-section .row.box-model .box.border > .label): Added.
(.details-section .row.box-model .box.border.has-top-left-radius, .details-section .row.box-model .box.border.has-top-left-radius .box): Added.
(.details-section .row.box-model .box.border.has-top-right-radius, .details-section .row.box-model .box.border.has-top-right-radius .box): Added.
(.details-section .row.box-model .box.border.has-bottom-right-radius, .details-section .row.box-model .box.border.has-bottom-right-radius .box): Added.
(.details-section .row.box-model .box.border.has-bottom-left-radius, .details-section .row.box-model .box.border.has-bottom-left-radius .box): Added.
(.details-section .row.box-model .box.padding): Added.
(.details-section .row.box-model:not(.hovered) .box.padding, .details-section .row.box-model .box.padding.active): Added.
(.details-section .row.box-model .box.content): Added.
(.details-section .row.box-model:not(.hovered) .box.content, .details-section .row.box-model .box.content.active): Added.
(.details-section .row.box-model :matches(.top, .right, .bottom, .left)): Added.
(.details-section .row.box-model :matches(.top, .right, .bottom, .left):not(.editing), .details-section .row.box-model :matches(.top-left, .top-right, .bottom-right, .bottom-left)): Added.
(.details-section .row.box-model :matches(.top-left, .top-right, .bottom-right, .bottom-left)): Added.
(.details-section .row.box-model :matches(.top-left, .top-right)): Added.
(.details-section .row.box-model :matches(.bottom-left, .bottom-right):not(.editing)): Added.
(.details-section .row.box-model :matches(.bottom-left, .bottom-right).editing): Added.
(.details-section .row.box-model :matches(.top-left, .bottom-left):not(.editing)): Added.
(.details-section .row.box-model :matches(.top-left, .bottom-left).editing): Added.
(.details-section .row.box-model :matches(.top-right, .bottom-right):not(.editing)): Added.
(.details-section .row.box-model :matches(.top-right, .bottom-right).editing): Added.
(@media (prefers-color-scheme: dark) .details-section .row.box-model .box): Added.
(@media (prefers-color-scheme: dark) .details-section .row.box-model:not(.hovered) .box:matches(.margin, .border, .padding, .content), .details-section .row.box-model .box.active:matches(.margin, .border, .padding, .content)): Added.
(@media (prefers-color-scheme: dark) .details-section .row.box-model .box.margin): Added.
(@media (prefers-color-scheme: dark) .details-section .row.box-model .box.border): Added.
(.details-section .row.box-model :matches(.position, .margin, .border, .padding, .content)): Deleted.
(.details-section .row.box-model .position): Deleted.
(.details-section .row.box-model .margin): Deleted.
(.details-section .row.box-model:not(.hovered) .margin, .details-section .row.box-model .margin.active): Deleted.
(.details-section .row.box-model .border): Deleted.
(.details-section .row.box-model:not(.hovered) .border, .details-section .row.box-model .border.active): Deleted.
(.details-section .row.box-model .padding): Deleted.
(.details-section .row.box-model:not(.hovered) .padding, .details-section .row.box-model .padding.active): Deleted.
(.details-section .row.box-model .content): Deleted.
(.details-section .row.box-model:not(.hovered) .content, .details-section .row.box-model .content.active): Deleted.
(.details-section .row.box-model :matches(.content span, .top, .right, .bottom, .left)): Deleted.
(.details-section .row.box-model :matches(.right, .left)): Deleted.
(.details-section .row.box-model:not(.hovered) :matches(.margin, .border, .padding, .content), .details-section .row.box-model .active:matches(.margin, .border, .padding, .content)): Deleted.

* UserInterface/Models/CSSProperty.js:
(WI.CSSProperty.prototype.update):
Ensure that the `_value` is updated whenever the `_rawValue` is updated.

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

5 months agoUnreviewed, rolling out r248289.
commit-queue@webkit.org [Tue, 6 Aug 2019 23:38:03 +0000 (23:38 +0000)]
Unreviewed, rolling out r248289.
https://bugs.webkit.org/show_bug.cgi?id=200488

Broke internal builds (Requested by drousso on #webkit).

Reverted changeset:

"Web Inspector: Styles: show @supports CSS groupings"
https://bugs.webkit.org/show_bug.cgi?id=200419
https://trac.webkit.org/changeset/248289

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

5 months agoMake JSC memory benchmark available on OpenSource
msaboff@apple.com [Tue, 6 Aug 2019 23:24:26 +0000 (23:24 +0000)]
Make JSC memory benchmark available on OpenSource
https://bugs.webkit.org/show_bug.cgi?id=195012

Reviewed by Saam Barati.

This patch upstreams the RAMification memory benchmark to open source.

The prior RAMification.py driver script in the Internal directory has been moved here
with the device execution code seperated out to a new Internal driver script.
As a result, command line argument parsing as well as acting on the resulting argument
values has changed.  The remote device Runner creates an ArgumentParser object that is
passed through main().  In main(), if we have an ArgumentParser, we use it otherwise we
create one for benchmarking locally.  The arguments object returned from argument
parsing is now passed to the Runner constructor so it can extract the settings appropriate
for that particular runner.

Added some sane argument default values for the JSC command patch and the JetStream2
source directory.

Updated the Lua tests to eliminate the testing harness and its overhead, matching what was
done in the Internal tree.

* JetStream2/LuaJSFight/hello_world.js:
(Benchmark.prototype.runIteration): Deleted.
(Benchmark): Deleted.
* JetStream2/LuaJSFight/list_search.js:
(run): Deleted.
(Benchmark.prototype.runIteration): Deleted.
(Benchmark): Deleted.
* JetStream2/LuaJSFight/lists.js:
(): Deleted.
(Benchmark.prototype.runIteration): Deleted.
(Benchmark): Deleted.
* JetStream2/LuaJSFight/richards.js: Added.
(runRichards):
(Scheduler):
(Scheduler.prototype.addIdleTask):
(Scheduler.prototype.addWorkerTask):
(Scheduler.prototype.addHandlerTask):
(Scheduler.prototype.addDeviceTask):
(Scheduler.prototype.addRunningTask):
(Scheduler.prototype.addTask):
(Scheduler.prototype.schedule):
(Scheduler.prototype.release):
(Scheduler.prototype.holdCurrent):
(Scheduler.prototype.suspendCurrent):
(Scheduler.prototype.queue):
(TaskControlBlock):
(TaskControlBlock.prototype.setRunning):
(TaskControlBlock.prototype.markAsNotHeld):
(TaskControlBlock.prototype.markAsHeld):
(TaskControlBlock.prototype.isHeldOrSuspended):
(TaskControlBlock.prototype.markAsSuspended):
(TaskControlBlock.prototype.markAsRunnable):
(TaskControlBlock.prototype.run):
(TaskControlBlock.prototype.checkPriorityAdd):
(TaskControlBlock.prototype.toString):
(IdleTask):
(IdleTask.prototype.run):
(IdleTask.prototype.toString):
(DeviceTask):
(DeviceTask.prototype.run):
(DeviceTask.prototype.toString):
(WorkerTask):
(WorkerTask.prototype.run):
(WorkerTask.prototype.toString):
(HandlerTask):
(HandlerTask.prototype.run):
(HandlerTask.prototype.toString):
(Packet):
(Packet.prototype.addTo):
(Packet.prototype.toString):
* JetStream2/LuaJSFight/string_lists.js:
(): Deleted.
(Benchmark.prototype.runIteration): Deleted.
(Benchmark): Deleted.
* JetStream2/RAMification.py: Added.
(mean):
(geomean):
(frameworkPathFromExecutablePath):
(parseArgs):
(parseArgs.optStrToBool):
(BaseRunner):
(BaseRunner.__init__):
(BaseRunner.setup):
(BaseRunner.setEnv):
(BaseRunner.unsetEnv):
(BaseRunner.resetForTest):
(BaseRunner.processLine):
(BaseRunner.setReturnCode):
(BaseRunner.getResults):
(LocalRunner):
(LocalRunner.__init__):
(LocalRunner.runOneTest):
(main):
(main.runTestList):
* JetStream2/__init__.py: Added.

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

5 months agoUnreviewed, a build fix after r248308
jiewen_tan@apple.com [Tue, 6 Aug 2019 23:20:43 +0000 (23:20 +0000)]
Unreviewed, a build fix after r248308

Don't use WK_ENGINEERING_CODE_SIGN_IDENTITY for Production build.

* WebKitTestRunner/Configurations/WebKitTestRunner.xcconfig:

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

5 months agoUnreviewed, a build fix after r248319
jiewen_tan@apple.com [Tue, 6 Aug 2019 22:40:16 +0000 (22:40 +0000)]
Unreviewed, a build fix after r248319

Use HAVE(DATA_PROTECTION_KEYCHAIN) instead of HAVE_DATA_PROTECTION_KEYCHAIN.

Source/WebKit:

* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
(WebKit::LocalAuthenticator::makeCredential):
(WebKit::LocalAuthenticator::continueMakeCredentialAfterUserConsented):
(WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested):
(WebKit::LocalAuthenticator::getAssertion):
(WebKit::LocalAuthenticator::continueGetAssertionAfterUserConsented):

Tools:

* WebKitTestRunner/Configurations/WebKitTestRunner.xcconfig:
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::addTestKeyToKeychain):
(WTR::TestController::cleanUpKeychain):
(WTR::TestController::keyExistsInKeychain):

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

5 months agoWeb Inspector: allow comments in protocol JSON
drousso@apple.com [Tue, 6 Aug 2019 22:20:31 +0000 (22:20 +0000)]
Web Inspector: allow comments in protocol JSON
https://bugs.webkit.org/show_bug.cgi?id=200104

Reviewed by Brian Burg.

* inspector/scripts/generate-inspector-protocol-bindings.py:
(generate_from_specification.load_specification):

* inspector/scripts/tests/generic/should-strip-comments.json: Added.
* inspector/scripts/tests/generic/expected/should-strip-comments.json-result: Added.

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

5 months agoUnreviewed, a build fix after r248308
jiewen_tan@apple.com [Tue, 6 Aug 2019 22:12:48 +0000 (22:12 +0000)]
Unreviewed, a build fix after r248308

Use kSecUseDataProtectionKeychain for iOS 13 and macOS Catalina or newer.

Source/WebKit:

* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
(WebKit::LocalAuthenticator::makeCredential):
(WebKit::LocalAuthenticator::continueMakeCredentialAfterUserConsented):
(WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested):
(WebKit::LocalAuthenticator::getAssertion):
(WebKit::LocalAuthenticator::continueGetAssertionAfterUserConsented):

Source/WTF:

* wtf/Platform.h:

Tools:

* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::addTestKeyToKeychain):
(WTR::TestController::cleanUpKeychain):
(WTR::TestController::keyExistsInKeychain):

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

5 months agoUnreviewed, fix internal iOS build after r248308.
cdumez@apple.com [Tue, 6 Aug 2019 22:04:22 +0000 (22:04 +0000)]
Unreviewed, fix internal iOS build after r248308.

* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
(WebKit::LocalAuthenticator::makeCredential):

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

5 months agoEnable XCBuild for `make` and `build-webkit` builds
krollin@apple.com [Tue, 6 Aug 2019 21:57:52 +0000 (21:57 +0000)]
Enable XCBuild for `make` and `build-webkit` builds
https://bugs.webkit.org/show_bug.cgi?id=200476
<rdar://problem/50771065>

Reviewed by Jonathan Bedard.

All projects have now been tested under XCBuild and successfully
build. Enable the use of XCBuild when performing builds with `make` or
`build-webkit` and when using a sufficient version of Xcode. We set
this version to Xcode 11 since Xcode 10 -- even though it supports
XCBuild -- does not support a build facility needed to build WebKit
(Bug 197072, Bug 197116, Bug 197340).

Do not enable XCBuild in the Xcode projects themselves since these
projects may need to be used under older versions of Xcode and there's
no way to make those project changes sensitive to the version of Xcode
being used. This means that builds performed in the Xcode IDE will not
use XCBuild.

* Scripts/webkitdirs.pm:
(canUseXCBuild):

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

5 months agoFix inefficiency in HTTPHeaderMap::set(CFStringRef, const String&)
cdumez@apple.com [Tue, 6 Aug 2019 21:45:32 +0000 (21:45 +0000)]
Fix inefficiency in HTTPHeaderMap::set(CFStringRef, const String&)
https://bugs.webkit.org/show_bug.cgi?id=200475

Reviewed by Darin Adler.

Source/WebCore:

In the case where CFStringGetCStringPtr() succeeds in returning us a pointer
to the CFStringRef underlying characters but it is not a common header, we
would fall back to calling HTTPHeaderMap::set(const String&, const String&)
which would unecessarily call findHTTPHeaderName() again to try and determine
if it is a common header. Avoid this by introducing a new setUncommonHeader()
private method and calling this one instead. Also got rid of some code
duplication at the same time.

* platform/network/HTTPHeaderMap.cpp:
(WebCore::HTTPHeaderMap::set):
(WebCore::HTTPHeaderMap::setUncommonHeader):
* platform/network/HTTPHeaderMap.h:
* platform/network/HTTPParsers.cpp:
(WebCore::parseHTTPHeader):
* testing/MockCDMFactory.cpp:
(WebCore::MockCDMInstance::setServerCertificate):

Source/WTF:

Add convenience constuctor to StringView which takes in a const char*
and an unsigned length, similarly to what we already have for String.

* wtf/URL.cpp:
(WTF::URL::protocolIs const):
(WTF::protocolIsInternal):
* wtf/text/StringView.h:
(WTF::StringView::StringView):
(WTF::StringView::empty):

Tools:

* TestWebKitAPI/Tests/WTF/StringView.cpp:
(TestWebKitAPI::stringViewFromLiteral):
(TestWebKitAPI::stringViewFromUTF8):

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

5 months agoUpdate my status in contributors.json to reviewer.
clopez@igalia.com [Tue, 6 Aug 2019 21:34:08 +0000 (21:34 +0000)]
Update my status in contributors.json to reviewer.

Regained the status after following the procedure for inactive contributors.
See r247136 for further explanation.

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

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

5 months agoUpdating Test Expectations for <rdar://53957264>, <rdar://53946482>, <rdar://53866783>
russell_e@apple.com [Tue, 6 Aug 2019 20:38:47 +0000 (20:38 +0000)]
Updating Test Expectations for <rdar://53957264>, <rdar://53946482>, <rdar://53866783>

Unreviewed Test Gardening.

* platform/ios-12/TestExpectations:
* platform/ios/TestExpectations:

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

5 months agoWeb Inspector: RTL: go-to arrows and expand triangles in Computed panel should match...
nvasilyev@apple.com [Tue, 6 Aug 2019 20:33:16 +0000 (20:33 +0000)]
Web Inspector: RTL: go-to arrows and expand triangles in Computed panel should match their context
https://bugs.webkit.org/show_bug.cgi?id=200449

Reviewed by Joseph Pecoraro.

* UserInterface/Views/ComputedStyleSection.css:
(body[dir=rtl] .computed-style-section .computed-property-item .disclosure-button): Deleted.

* UserInterface/Views/Main.css:
(body[dir=rtl] [dir=ltr] .go-to-arrow): Added.
In the RTL mode, LTR "islands" should have their contents to be still LTR.

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

5 months ago[WHLSL] Remove the auto initialize variables pass
sbarati@apple.com [Tue, 6 Aug 2019 20:31:04 +0000 (20:31 +0000)]
[WHLSL] Remove the auto initialize variables pass
https://bugs.webkit.org/show_bug.cgi?id=200472

Reviewed by Robin Morisset.

From a separation of concerns perspective, it's a bit nicer to make variables
without initializers call their default constructors as a transformation over the AST.
This removes the need for the lowering to need to worry about such things. However,
changing metal lowering to deal with this is trivial. It means we need to change one
line of code in Metal code generation, and we get to remove a ~50 LOC AST pass.
Also, in this case, it saves us from the compile time hit of having to run the
auto initialize variables phase, which takes ~1.2ms on compute_boids.

* Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
* Modules/webgpu/WHLSL/WHLSLAutoInitializeVariables.cpp: Removed.
* Modules/webgpu/WHLSL/WHLSLAutoInitializeVariables.h: Removed.
* Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
(WebCore::WHLSL::prepareShared):
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

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