WebKit-https.git
6 months agoExpose WebPageProxy identifier to the Network Process
cdumez@apple.com [Wed, 4 Sep 2019 22:57:50 +0000 (22:57 +0000)]
Expose WebPageProxy identifier to the Network Process
https://bugs.webkit.org/show_bug.cgi?id=201467

Reviewed by Geoffrey Garen.

Source/WebCore:

* loader/EmptyFrameLoaderClient.h:
(isType):
* loader/FrameLoaderClient.h:

Source/WebKit:

Expose WebPageProxy identifier to the Network Process (similarly to WebPage / WebFrame identifiers)
so that it can use it whenever it IPCs the UIProcess. The IPCs from the network process were the
last one requiring the UIProcess to lookup a WebPageProxy object from a WebPageIdentifier (rather
than a WebPageProxyIdentifier).

* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* NetworkProcess/NetworkCORSPreflightChecker.cpp:
(WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
* NetworkProcess/NetworkCORSPreflightChecker.h:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
(WebKit::NetworkConnectionToWebProcess::requestStorageAccess):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::didReceiveChallenge):
* NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::NetworkLoadChecker):
(WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
* NetworkProcess/NetworkLoadChecker.h:
* NetworkProcess/NetworkLoadParameters.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::didCommitCrossSiteLoadWithDataTransfer):
(WebKit::NetworkProcess::logDiagnosticMessage):
(WebKit::NetworkProcess::logDiagnosticMessageWithResult):
(WebKit::NetworkProcess::logDiagnosticMessageWithValue):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::encode const):
(WebKit::NetworkResourceLoadParameters::decode):
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
(WebKit::NetworkResourceLoader::retrieveCacheEntry):
(WebKit::NetworkResourceLoader::startNetworkLoad):
(WebKit::NetworkResourceLoader::didReceiveResponse):
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/PingLoad.cpp:
(WebKit::PingLoad::PingLoad):
(WebKit::PingLoad::didReceiveChallenge):
* NetworkProcess/cache/NetworkCache.h:
(WebKit::NetworkCache::GlobalFrameID::hash const):
(WebKit::NetworkCache::operator==):
(WTF::GlobalFrameIDHash::hash):
(WTF::GlobalFrameIDHash::equal):
(WTF::HashTraits<WebKit::NetworkCache::GlobalFrameID>::emptyValue):
(WTF::HashTraits<WebKit::NetworkCache::GlobalFrameID>::constructDeletedValue):
(WTF::HashTraits<WebKit::NetworkCache::GlobalFrameID>::isDeletedValue):
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
(WebKit::NetworkCache::logSpeculativeLoadingDiagnosticMessage):
* Shared/Authentication/AuthenticationManager.cpp:
(WebKit::AuthenticationManager::shouldCoalesceChallenge const):
(WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
* Shared/Authentication/AuthenticationManager.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
(WebKit::NetworkProcessProxy::logDiagnosticMessage):
(WebKit::NetworkProcessProxy::logDiagnosticMessageWithResult):
(WebKit::NetworkProcessProxy::logDiagnosticMessageWithValue):
(WebKit::NetworkProcessProxy::requestStorageAccessConfirm):
(WebKit::NetworkProcessProxy::didCommitCrossSiteLoadWithDataTransfer):
(WebKit::NetworkProcessProxy::didCommitCrossSiteLoadWithDataTransferFromPrevalentResource):
(WebKit::NetworkProcessProxy::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/ServiceWorkerProcessProxy.cpp:
(WebKit::ServiceWorkerProcessProxy::start):
* UIProcess/ServiceWorkerProcessProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didCommitLoadForFrame):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::isServiceWorkerPageID const):
(WebKit::WebProcessPool::didCommitCrossSiteLoadWithDataTransfer):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.cpp:
* UIProcess/WebProcessProxy.h:
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoad):
(WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
(WebKit::WebLoaderStrategy::loadResourceSynchronously):
(WebKit::WebLoaderStrategy::preconnectTo):
* WebProcess/Network/WebResourceLoader.h:
* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::ServiceWorkerFrameLoaderClient::ServiceWorkerFrameLoaderClient):
(WebKit::ServiceWorkerFrameLoaderClient::createDocumentLoader):
(WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection):
(WebKit::WebSWContextManagerConnection::installServiceWorker):
* WebProcess/Storage/WebSWContextManagerConnection.h:
(isType):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::webPageProxyID const):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::requestStorageAccess):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::establishWorkerContextConnectionToNetworkProcess):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

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

6 months agorun-api-tests: Add support for specifying additional environment variables
jbedard@apple.com [Wed, 4 Sep 2019 21:25:54 +0000 (21:25 +0000)]
run-api-tests: Add support for specifying additional environment variables
https://bugs.webkit.org/show_bug.cgi?id=201311
<rdar://problem/54852698>

Reviewed by Daniel Bates.

* Scripts/webkitpy/api_tests/run_api_tests.py:
(parse_args): Add --additional-env-var flag.
* Scripts/webkitpy/port/base.py:
(Port._append_value_colon_separated): Use os.pathsep instead of ':'.
(Port.environment_for_api_tests): Add the values from --additional-env-var to the
environment.

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

6 months agoStructure::storedPrototype() and storedPrototypeObject() should assert with isCompila...
mark.lam@apple.com [Wed, 4 Sep 2019 21:12:47 +0000 (21:12 +0000)]
Structure::storedPrototype() and storedPrototypeObject() should assert with isCompilationThread(), not !isMainThread().
https://bugs.webkit.org/show_bug.cgi?id=201449

Reviewed by Yusuke Suzuki.

Using !isMainThread() in the assertion also disables the assertion for the mutator
of worker threads.  This is not what we intended.

* runtime/StructureInlines.h:
(JSC::Structure::storedPrototype const):
(JSC::Structure::storedPrototypeObject const):

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

6 months agoRemove unused SPI that accesses MemoryCache directly
achristensen@apple.com [Wed, 4 Sep 2019 21:11:04 +0000 (21:11 +0000)]
Remove unused SPI that accesses MemoryCache directly
https://bugs.webkit.org/show_bug.cgi?id=201468

Reviewed by Tim Horton.

Source/WebCore:

* loader/cache/MemoryCache.cpp:
(WebCore::dummyCachedImageClient): Deleted.
(WebCore::MemoryCache::addImageToCache): Deleted.
(WebCore::MemoryCache::removeImageFromCache): Deleted.
* loader/cache/MemoryCache.h:

Source/WebKitLegacy/mac:

* Misc/WebCache.h:
* Misc/WebCache.mm:
(+[WebCache addImageToCache:forURL:]): Deleted.
(+[WebCache addImageToCache:forURL:forFrame:]): Deleted.
(+[WebCache removeImageFromCacheForURL:]): Deleted.
(+[WebCache removeImageFromCacheForURL:forFrame:]): Deleted.

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

6 months ago[LFC] Assert on FormattingContext escaping
zalan@apple.com [Wed, 4 Sep 2019 20:42:08 +0000 (20:42 +0000)]
[LFC] Assert on FormattingContext escaping
https://bugs.webkit.org/show_bug.cgi?id=201464
<rdar://problem/55029574>

Reviewed by Antti Koivisto.

This patch asserts on accidental formatting context escaping. This is only a correctness issue at the moment,
since we don't support multithreaded subtree layout yet.
Normally we should not need to access display boxes in different formatting contexts during layout, but there are a few, justified cases when it is required.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::displayBoxForLayoutBox const):
* layout/FormattingContext.h:
(WebCore::Layout::FormattingContext::displayBoxForLayoutBox const): Deleted.
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const):
(WebCore::Layout::FormattingContext::Geometry::staticVerticalPositionForOutOfFlowPositioned const):
(WebCore::Layout::FormattingContext::Geometry::staticHorizontalPositionForOutOfFlowPositioned const):
* layout/FormattingContextQuirks.cpp:
(WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
* layout/floats/FloatingContext.cpp:
(WebCore::Layout::FloatingContext::absoluteDisplayBoxCoordinates const):
(WebCore::Layout::FloatingContext::mapToFloatingStateRoot const):
(WebCore::Layout::FloatingContext::mapTopToFloatingStateRoot const):
(WebCore::Layout::FloatingContext::mapPointFromFormattingContextRootToFloatingStateRoot const):
* page/FrameViewLayoutContext.cpp:
(WebCore::layoutUsingFormattingContext):

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

6 months agoDisambiguate a symbol used in JSDollarVM.
mark.lam@apple.com [Wed, 4 Sep 2019 20:08:24 +0000 (20:08 +0000)]
Disambiguate a symbol used in JSDollarVM.
https://bugs.webkit.org/show_bug.cgi?id=201466
<rdar://problem/51826672>

Reviewed by Tadeu Zagallo.

This was causing a build issue on some internal build.

* tools/JSDollarVM.cpp:

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

6 months ago[LFC] FormattingContext::map* functions are too generic.
zalan@apple.com [Wed, 4 Sep 2019 19:53:41 +0000 (19:53 +0000)]
[LFC] FormattingContext::map* functions are too generic.
https://bugs.webkit.org/show_bug.cgi?id=201447
<rdar://problem/55005733>

Reviewed by Antti Koivisto.

We don't need such generic mapping functions yet. This patch is also in preparation for
asserting on formatting context escaping.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::mapTopToFormattingContextRoot const):
(WebCore::Layout::FormattingContext::mapLeftToFormattingContextRoot const):
(WebCore::Layout::FormattingContext::mapRightToFormattingContextRoot const):
(WebCore::Layout::FormattingContext::mapLeftToAncestor const): Deleted.
(WebCore::Layout::FormattingContext::mapRightToAncestor const): Deleted.
(WebCore::Layout::FormattingContext::mapBoxToAncestor const): Deleted.
(WebCore::Layout::FormattingContext::mapTopToAncestor const): Deleted.
(WebCore::Layout::FormattingContext::mapPointToAncestor const): Deleted.
(WebCore::Layout::FormattingContext::mapPointToDescendent const): Deleted.
* layout/FormattingContext.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::usedAvailableWidthForFloatAvoider const):
* layout/floats/FloatingContext.cpp:
(WebCore::Layout::FloatingContext::positionForFloat const):
(WebCore::Layout::FloatingContext::positionForFormattingContextRoot const):
(WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
(WebCore::Layout::FloatingContext::constraints const):
(WebCore::Layout::FloatingContext::append):
(WebCore::Layout::FloatingContext::absoluteDisplayBoxCoordinates const):
(WebCore::Layout::FloatingContext::mapToFloatingStateRoot const):
(WebCore::Layout::FloatingContext::mapTopToFloatingStateRoot const):
(WebCore::Layout::FloatingContext::mapPointFromFormattingContextRootToFloatingStateRoot const):
(WebCore::Layout::mapToFormattingContextRoot): Deleted.
* layout/floats/FloatingContext.h:
* page/FrameViewLayoutContext.cpp:
(WebCore::layoutUsingFormattingContext):

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

6 months ago[iPadOS] Unable to change sheets on Airtable.com
commit-queue@webkit.org [Wed, 4 Sep 2019 19:38:37 +0000 (19:38 +0000)]
[iPadOS] Unable to change sheets on Airtable.com
https://bugs.webkit.org/show_bug.cgi?id=201456
<rdar://problem/51557377>

Patch by Antoine Quint <graouts@apple.com> on 2019-09-04
Reviewed by Dean Jackson.

Simulated mouse events are required to be able to manipulate cells and and columns on Airtable.com. However, dispatching a "mousedown" event on
tabs allowing to pick a different sheet ends up calling preventDefault() and prevent "click" events from being dispatched, which makes it
impossible to change sheet. We now limit the dispatch of simulated mouse events to the grid.

* page/Quirks.cpp:
(WebCore::Quirks::simulatedMouseEventTypeForTarget const):

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

6 months agomacCatalyst: Re-enable iOS WKWebView printing API
timothy_horton@apple.com [Wed, 4 Sep 2019 19:37:38 +0000 (19:37 +0000)]
macCatalyst: Re-enable iOS WKWebView printing API
https://bugs.webkit.org/show_bug.cgi?id=201392
<rdar://problem/54690252>

Reviewed by Wenson Hsieh.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _webViewPrintFormatter]):
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/_WKWebViewPrintFormatter.mm:
* UIProcess/_WKWebViewPrintFormatterInternal.h:
* UIProcess/ios/WKContentView.mm:
_WKWwebViewPrintFormatter was disabled during bringup because requisite
UIKit bits were missing, but they are not anymore (and have not been for
quite some time), so remove these unnecessary platform ifdefs.

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

6 months agoAddress review comments after r249364
commit-queue@webkit.org [Wed, 4 Sep 2019 18:28:12 +0000 (18:28 +0000)]
Address review comments after r249364
https://bugs.webkit.org/show_bug.cgi?id=201432

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

Fix the <img> CSS width properties by adding the "px" units.

* fast/images/exif-orientation-background-expected.html:
* fast/images/exif-orientation-canvas-expected.html:
* fast/images/exif-orientation-canvas.html:
* fast/images/exif-orientation-composited-expected.html:
* fast/images/exif-orientation-composited.html:
Remove the CSS border to enable the composited image code path.

* fast/images/exif-orientation-content-expected.html:
* fast/images/exif-orientation-element-expected.html:
* fast/images/exif-orientation-element.html:
* fast/images/exif-orientation-image-document-expected.html:
* fast/images/exif-orientation-image-document.html:
* fast/images/exif-orientation-image-object-expected.html:
* fast/images/exif-orientation-image-object.html:
* fast/images/exif-orientation-svg-feimage-expected.html:
* fast/images/exif-orientation-svg-feimage.html:
* fast/images/exif-orientation-svg-image-expected.html:
* fast/images/exif-orientation-svg-image.html:

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

6 months ago[WPE][GTK] Fix sandbox parsing DISPLAY on X11
pgriffis@igalia.com [Wed, 4 Sep 2019 18:13:02 +0000 (18:13 +0000)]
[WPE][GTK] Fix sandbox parsing DISPLAY on X11
https://bugs.webkit.org/show_bug.cgi?id=201462

Reviewed by Michael Catanzaro.

On some setups the DISPLAY env var was incorrectly parsed.

* UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
(WebKit::bindX11):

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

6 months agoSelenium test 'interactions_tests.py::testContextClick' is hanging
bburg@apple.com [Wed, 4 Sep 2019 18:08:22 +0000 (18:08 +0000)]
Selenium test 'interactions_tests.py::testContextClick' is hanging
https://bugs.webkit.org/show_bug.cgi?id=201161
<rdar://problem/54728541>

Reviewed by Chris Dumez.

A web page should not show native context menus if user interactions are being simulated for WebDriver.
Showing a native context menu spawns a nested run loop. Since there's no way to interact
with native UI via WebDriver, the test will hang until the context menu is manually dismissed.

To fix this, pretend to show the context menu in UIProcess and dismiss it immediately.
This is necessary to trigger oncontextmenu events appropriately and resume handling mouse events.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::showContextMenu): Hook into isControlledByAutomation here.
We could short circuit this on the WebProcess side, but the check would be more crude
and suppress context menus even if user interaction isn't being simulated. This would be
problematic for a user who wants to interrupt their test session and interact with it.
The main use case for this is right clicking on the test page and choose "Inspect".

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

6 months agoEWS bubbles should indicate builder vs tester
aakash_jain@apple.com [Wed, 4 Sep 2019 17:27:17 +0000 (17:27 +0000)]
EWS bubbles should indicate builder vs tester
https://bugs.webkit.org/show_bug.cgi?id=201253

Reviewed by Jonathan Bedard.

Tools:

* BuildSlaveSupport/ews-app/ews/views/statusbubble.py:
(StatusBubble._build_bubble): Add icons to the bubbles appropriately.
(StatusBubble._is_tester_queue): Method to determine if the queue is tester queue.
(StatusBubble._is_builder_queue): Method to determine if the queue is builder queue.
(StatusBubble.get):
* BuildSlaveSupport/ews-app/ews/common/buildbot.py:
(Buildbot.fetch_config): Method to fetch the config from Buildbot server.
(Buildbot.update_icons_for_queues_mapping): Method to update the icons for queues mapping.
* BuildSlaveSupport/ews-app/ews/fetcher.py:
(FetchLoop.run): Update the icons for queues mapping.
* BuildSlaveSupport/ews-build/config.json: Add icon information for the queues.
* BuildSlaveSupport/ews-build/loadConfig.py: Remove 'icon' key from builder before passing it to Buildbot.
* BuildSlaveSupport/ews-build/loadConfig_unittest.py: .
(test_builder_keys): Update unit-test accordingly. Also minor drive-by fix to improve failure string formatting.

Websites/bugs.webkit.org:

* code-review.js: Do not display the icons in status-bubbles on this page.
* template/en/default/attachment/edit.html.tmpl: Ditto.
* template/en/default/attachment/reviewform.html.tmpl: Ditto.

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

6 months agoAbstract out WebSocketChannel message queue
youenn@apple.com [Wed, 4 Sep 2019 16:46:55 +0000 (16:46 +0000)]
Abstract out WebSocketChannel message queue
https://bugs.webkit.org/show_bug.cgi?id=201359

Reviewed by Alex Christensen.

Source/WebCore:

Move BlobLoader in its own file.
Introduce NetworkSendQueue class to handle the sending of messages, some of them being blobs.
This class ensures that messages will be sent in order, even though blob data is resolved asynchronously.

Covered by existing tests.

* Headers.cmake:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* fileapi/BlobLoader.h: Added.
(WebCore::BlobLoader::BlobLoader):
(WebCore::BlobLoader::~BlobLoader):
(WebCore::BlobLoader::didFinishLoading):
(WebCore::BlobLoader::didFail):
(WebCore::BlobLoader::complete):
* fileapi/NetworkSendQueue.cpp: Added.
(WebCore::NetworkSendQueue::NetworkSendQueue):
(WebCore::NetworkSendQueue::enqueue):
(WebCore::NetworkSendQueue::clear):
(WebCore::NetworkSendQueue::processMessages):
* fileapi/NetworkSendQueue.h: Added.

Source/WebKit:

Make use of newly added NetworkSendQueue.

* WebProcess/Network/WebSocketChannel.cpp:
(WebKit::WebSocketChannel::createMessageQueue):
(WebKit::WebSocketChannel::WebSocketChannel):
(WebKit::WebSocketChannel::send):
(WebKit::WebSocketChannel::disconnect):
* WebProcess/Network/WebSocketChannel.h:

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

6 months agoAllow checking whether image was created from JavaScript
commit-queue@webkit.org [Wed, 4 Sep 2019 15:19:11 +0000 (15:19 +0000)]
Allow checking whether image was created from JavaScript
https://bugs.webkit.org/show_bug.cgi?id=200662

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

No behavior change.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::HTMLImageElement):
(WebCore::HTMLImageElement::create):
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::createdByParser const):
* html/HTMLTagNames.in:

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

6 months agoMove MessageRegistry to NetworkProcess
youenn@apple.com [Wed, 4 Sep 2019 12:46:24 +0000 (12:46 +0000)]
Move MessageRegistry to NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=201299

Reviewed by Alex Christensen.

Move message registry to NetworkProcess.
Take benefit of this move to use async reply IPC as much as possible.
This also allows to remove the IPC message to UIProcess when doing postMessage with service workers.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::createNewMessagePortChannel):
(WebKit::NetworkConnectionToWebProcess::entangleLocalPortInThisProcessToRemote):
(WebKit::NetworkConnectionToWebProcess::messagePortDisentangled):
(WebKit::NetworkConnectionToWebProcess::messagePortClosed):
(WebKit::NetworkConnectionToWebProcess::nextMessageBatchIdentifier):
(WebKit::NetworkConnectionToWebProcess::takeAllMessagesForPort):
(WebKit::NetworkConnectionToWebProcess::didDeliverMessagePortMessages):
(WebKit::NetworkConnectionToWebProcess::postMessageToRemote):
(WebKit::NetworkConnectionToWebProcess::checkRemotePortForActivity):
(WebKit::NetworkConnectionToWebProcess::checkProcessLocalPortForActivity):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkMessagePortChannelProvider.cpp: Added.
(WebKit::NetworkMessagePortChannelProvider::NetworkMessagePortChannelProvider):
(WebKit::NetworkMessagePortChannelProvider::createNewMessagePortChannel):
(WebKit::NetworkMessagePortChannelProvider::entangleLocalPortInThisProcessToRemote):
(WebKit::NetworkMessagePortChannelProvider::messagePortDisentangled):
(WebKit::NetworkMessagePortChannelProvider::messagePortClosed):
(WebKit::NetworkMessagePortChannelProvider::takeAllMessagesForPort):
(WebKit::NetworkMessagePortChannelProvider::postMessageToRemote):
(WebKit::NetworkMessagePortChannelProvider::checkRemotePortForActivity):
(WebKit::NetworkMessagePortChannelProvider::checkProcessLocalPortForActivity):
* NetworkProcess/NetworkMessagePortChannelProvider.h: Added.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::m_messagePortChannelProvider):
(WebKit::NetworkProcess::webProcessConnection const):
* NetworkProcess/NetworkProcess.h:
(WebKit::NetworkProcess::messagePortChannelRegistry):
* Sources.txt:
* UIProcess/Downloads/DownloadProxyMap.cpp:
* UIProcess/WebPageProxy.cpp:
* UIProcess/WebProcessPool.cpp:
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessPool.messages.in:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::~WebProcessProxy):
(WebKit::WebProcessProxy::shutDown):
* UIProcess/WebProcessProxy.h:
* UIProcess/WebProcessProxy.messages.in:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::initializeSWClientConnection):
(WebKit::NetworkProcessConnection::messagesAvailableForPort):
(WebKit::NetworkProcessConnection::checkProcessLocalPortForActivity):
* WebProcess/Network/NetworkProcessConnection.h:
* WebProcess/Network/NetworkProcessConnection.messages.in:
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::postMessageToServiceWorker):
* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient):
* WebProcess/WebCoreSupport/WebMessagePortChannelProvider.cpp:
(WebKit::networkProcessConnection):
(WebKit::WebMessagePortChannelProvider::createNewMessagePortChannel):
(WebKit::WebMessagePortChannelProvider::entangleLocalPortInThisProcessToRemote):
(WebKit::WebMessagePortChannelProvider::messagePortDisentangled):
(WebKit::WebMessagePortChannelProvider::messagePortClosed):
(WebKit::WebMessagePortChannelProvider::takeAllMessagesForPort):
(WebKit::WebMessagePortChannelProvider::postMessageToRemote):
(WebKit::WebMessagePortChannelProvider::checkRemotePortForActivity):
* WebProcess/WebCoreSupport/WebMessagePortChannelProvider.h:
* WebProcess/WebProcess.cpp:
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

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

6 months agoRemove unused ScrollingTreeOverflowScrollProxyNode implementation
zandobersek@gmail.com [Wed, 4 Sep 2019 12:27:00 +0000 (12:27 +0000)]
Remove unused ScrollingTreeOverflowScrollProxyNode implementation
https://bugs.webkit.org/show_bug.cgi?id=201376

Reviewed by Simon Fraser.

Remove the unused ScrollingTreeOverflowScrollProxyNode implementation
and header files that were added in r246723 but are not included in any
build. Cocoa-specific implementation remains untouched, and other
scrolling systems should be providing their own (as is the case with
other types of nodes).

* page/scrolling/ScrollingTreeOverflowScrollProxyNode.cpp: Removed.
* page/scrolling/ScrollingTreeOverflowScrollProxyNode.h: Removed.

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

6 months ago[GStreamer] Sound is down-pitched when playing video from YLE Areena
philn@webkit.org [Wed, 4 Sep 2019 09:04:50 +0000 (09:04 +0000)]
[GStreamer] Sound is down-pitched when playing video from YLE Areena
https://bugs.webkit.org/show_bug.cgi?id=201399

Reviewed by Xabier Rodriguez-Calvar.

If the FDK-AAC decoder is available, promote it and downrank the
libav AAC decoders, due to their broken LC support, as reported in:
https://ffmpeg.org/pipermail/ffmpeg-devel/2019-July/247063.html

* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::initializeGStreamer):

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

6 months ago[GTK] Build failure in Debian Stable and Ubuntu LTS bots after r249427
psaavedra@igalia.com [Wed, 4 Sep 2019 08:29:13 +0000 (08:29 +0000)]
[GTK] Build failure in Debian Stable and Ubuntu LTS bots after r249427
https://bugs.webkit.org/show_bug.cgi?id=201434

Reviewed by Xabier Rodriguez-Calvar.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::GstVideoFrameHolder::waitForCPUSync):

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

6 months ago[bmalloc] IsoTLSLayout and AllIsoHeaps registration is racy with derived class initia...
ysuzuki@apple.com [Wed, 4 Sep 2019 08:16:33 +0000 (08:16 +0000)]
[bmalloc] IsoTLSLayout and AllIsoHeaps registration is racy with derived class initialization with virtual functions
https://bugs.webkit.org/show_bug.cgi?id=201448

Reviewed by Mark Lam.

Source/bmalloc:

In the base class of IsoTLSEntry and IsoHeapImplBase, we register each instance with the per-process linked-list singleton to
offer a way to iterate all these instances. But since derived classes of IsoTLSEntry and IsoHeapImplBase have virtual functions,
the instance is not fully instantiated yet when executing the base constructor! In particular, the register instance needs vtable pointer
initialization in the derived constructor.

So, there is a race condition,

1. IsoTLSEntry adds itself to the global linked-list.
2. IsoTLSEntry's derived class is initializing the instance including vtable pointer, this happens because base and derived classes have virtual functions.
3. While doing (2), other thread iterates instances through (1)'s linked-list and call virtual functions

Then, crash happens because the instance vtable pointer hasn't been set to the derived class' vtable yet. IsoHeapImpl has the same problem.
This issue causes some crashes in bmalloc::Scavenger::scavenge / bmalloc::IsoTLS::ensureEntries.

In this patch,

1. We introduce IsoTLSEntryHolder, which initialize the TLS entry. And after fully initializing it, the holder registers the entry with the IsoTLSLayout singleton.
2. We call IsoHeapImplBase::addToAllIsoHeaps after IsoHeapImpl is fully initialized.
3. We put memory barrier in IsoTLSLayout since IsoTLSLayout::head does not take a lock.
4. We add unit-test that reliably reproduces IsoHeapImpl crash if we run this test ~10 times!

* bmalloc/AllIsoHeaps.h:
* bmalloc/IsoHeapImpl.h:
* bmalloc/IsoHeapImplInlines.h:
(bmalloc::IsoHeapImpl<Config>::IsoHeapImpl):
(bmalloc::IsoHeapImpl<Config>::allocatorOffset):
(bmalloc::IsoHeapImpl<Config>::deallocatorOffset):
* bmalloc/IsoHeapInlines.h:
(bmalloc::api::IsoHeap<Type>::initialize):
* bmalloc/IsoTLSAllocatorEntry.h:
* bmalloc/IsoTLSDeallocatorEntry.h:
* bmalloc/IsoTLSEntry.cpp:
(bmalloc::IsoTLSEntry::IsoTLSEntry):
* bmalloc/IsoTLSEntry.h:
(bmalloc::IsoTLSEntryHolder::IsoTLSEntryHolder):
(bmalloc::IsoTLSEntryHolder::operator* const):
(bmalloc::IsoTLSEntryHolder::operator*):
(bmalloc::IsoTLSEntryHolder::operator-> const):
(bmalloc::IsoTLSEntryHolder::operator->):
* bmalloc/IsoTLSLayout.cpp:
(bmalloc::IsoTLSLayout::add):
* bmalloc/IsoTLSLayout.h:

Tools:

* TestWebKitAPI/Tests/WTF/bmalloc/IsoHeap.cpp:
(TEST):

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

6 months agoREGRESSION (r249364): Layout Test webgpu/texture-triangle-strip.html is Failing
commit-queue@webkit.org [Wed, 4 Sep 2019 08:14:48 +0000 (08:14 +0000)]
REGRESSION (r249364): Layout Test webgpu/texture-triangle-strip.html is Failing
https://bugs.webkit.org/show_bug.cgi?id=201425

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-09-04
Reviewed by Myles C. Maxfield.

The orientation of webgpu/resources/blue-checkered.png is OriginRightTop.
Because r249364 made the image orientation respected everywhere including
the canvas drawImage(), the expected result does not match the output of
the test anymore.

The fix is to change the the expected result to match the image drawing
when the image orientation is respected.

* webgpu/js/webgpu-functions.js:
(drawGreenAndBlueCheckerboardInSoftware):

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

6 months agoAssertions in JSArrayBufferView::byteOffset() are only valid for the mutator thread.
mark.lam@apple.com [Wed, 4 Sep 2019 06:13:46 +0000 (06:13 +0000)]
Assertions in JSArrayBufferView::byteOffset() are only valid for the mutator thread.
https://bugs.webkit.org/show_bug.cgi?id=201309
<rdar://problem/54832121>

Reviewed by Yusuke Suzuki.

JSTests:

* stress/JSArrayBufferView-byteOffset-is-racy-from-compiler-thread.js: Added.

Source/JavaScriptCore:

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* runtime/JSArrayBufferView.h:
* runtime/JSArrayBufferViewInlines.h:
(JSC::JSArrayBufferView::possiblySharedBufferImpl):
(JSC::JSArrayBufferView::possiblySharedBuffer):
(JSC::JSArrayBufferView::byteOffsetImpl):
(JSC::JSArrayBufferView::byteOffset):
(JSC::JSArrayBufferView::byteOffsetConcurrently):

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

6 months ago[macCatalyst] Unable to upload non-image files using drag and drop
wenson_hsieh@apple.com [Wed, 4 Sep 2019 05:15:38 +0000 (05:15 +0000)]
[macCatalyst] Unable to upload non-image files using drag and drop
https://bugs.webkit.org/show_bug.cgi?id=201438

Reviewed by Tim Horton.

On recent builds of macOS 10.15, NSItemProviders that are produced when dropping files from Finder into a
macCatalyst app no longer contain `kUTTypeFileURL` as a registered type identifier. This means that the current
heuristic for figuring out whether or not an item provider can be represented as a file upload is broken, since
it thinks all dropped content is inline data.

On iOS, we treat an NSItemProvider as an "uploaded" file as long as it hasn't been explicitly marked as inline
data, such as a dragged selection from a native text field. However, on macCatalyst, all item providers return
preferredPresentationStyle of UIPreferredPresentationStyleUnspecified, regardless of the source, so this check
is useless on macCatalyst since it would consider all dropped content as a file upload (text selections, plain
URLs, etc.).

Luckily, NSItemProvider's -suggestedName is now populated in recent macOS builds, which means we have a much
stronger (and more robust) hint that a dropped item provider is actually a file. For the time being, use this
instead of always returning `NO`.

* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderLoadResult canBeRepresentedAsFileUpload]):

Make a minor tweak to move the UIPreferredPresentationStyleInline check to shared code, such that when
<rdar://55002929> is fixed, our code will automatically correctly treat inline item providers that have been
explicitly marked as such.

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

6 months agoRemove redundant painting phase arguments from GraphicsLayerClient functions
antti@apple.com [Wed, 4 Sep 2019 04:54:55 +0000 (04:54 +0000)]
Remove redundant painting phase arguments from GraphicsLayerClient functions
https://bugs.webkit.org/show_bug.cgi?id=201443

Reviewed by Simon Fraser.

Source/WebCore:

It is available from the GraphicsLayer.

* page/PageOverlayController.cpp:
(WebCore::PageOverlayController::paintContents):
* page/PageOverlayController.h:
* page/mac/ServicesOverlayController.h:
* page/mac/ServicesOverlayController.mm:
(WebCore::ServicesOverlayController::Highlight::paintContents):
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::paintGraphicsLayerContents):
* platform/graphics/GraphicsLayerClient.h:
(WebCore::GraphicsLayerClient::paintContents):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::paintIntoLayer):
(WebCore::RenderLayerBacking::paintFlagsForLayer const):

Factor into a function.

(WebCore::RenderLayerBacking::paintContents):
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::paintContents):
* rendering/RenderLayerCompositor.h:

Source/WebKitLegacy/win:

* WebView.cpp:
(WebView::paintContents):
* WebView.h:

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

6 months ago[macOS] Unable to open local file from favorites bar
pvollan@apple.com [Wed, 4 Sep 2019 04:11:08 +0000 (04:11 +0000)]
[macOS] Unable to open local file from favorites bar
https://bugs.webkit.org/show_bug.cgi?id=201444

Reviewed by Brent Fulgham.

The sandbox extension handle should be created providing the pid of the receiving process.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):

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

6 months ago[WHLSL] Implement SampleLevel(), SampleBias(), and SampleGrad()
mmaxfield@apple.com [Wed, 4 Sep 2019 03:30:21 +0000 (03:30 +0000)]
[WHLSL] Implement SampleLevel(), SampleBias(), and SampleGrad()
https://bugs.webkit.org/show_bug.cgi?id=201385

Reviewed by Dean Jackson.

Source/WebCore:

These are used in the Babylon.js demo.

Tests: webgpu/whlsl/textures-sample-bias.html
       webgpu/whlsl/textures-sample-grad.html
       webgpu/whlsl/textures-sample-level.html

* Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h:
* Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
(WebCore::WHLSL::Metal::sampleType):
(WebCore::WHLSL::Metal::inlineNativeFunction):
* Modules/webgpu/WHLSL/WHLSLIntrinsics.cpp:
(WebCore::WHLSL::Intrinsics::addFullTexture):
(WebCore::WHLSL::Intrinsics::addDepthTexture):
* Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt:

LayoutTests:

* webgpu/whlsl/textures-sample-bias-expected.html: Added.
* webgpu/whlsl/textures-sample-bias.html: Added.
* webgpu/whlsl/textures-sample-grad-expected.html: Added.
* webgpu/whlsl/textures-sample-grad.html: Added.
* webgpu/whlsl/textures-sample-level-expected.html: Added.
* webgpu/whlsl/textures-sample-level.html: Added.

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

6 months agoFrameLoader::FrameProgressTracker::progressCompleted() does not need a pageID
cdumez@apple.com [Wed, 4 Sep 2019 03:13:45 +0000 (03:13 +0000)]
FrameLoader::FrameProgressTracker::progressCompleted() does not need a pageID
https://bugs.webkit.org/show_bug.cgi?id=201431

Reviewed by Antti Koivisto.

Source/WebCore:

FrameLoader::FrameProgressTracker::progressCompleted() does not need to request a pageID
from the client. It can merely pass the Page object and the upper layers can very easily
get the identifier of that page.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::FrameProgressTracker::progressCompleted):
* loader/LoaderStrategy.h:

Source/WebKit:

* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::pageLoadCompleted):
* WebProcess/Network/WebLoaderStrategy.h:

Source/WebKitLegacy:

* WebCoreSupport/WebResourceLoadScheduler.cpp:
(WebResourceLoadScheduler::pageLoadCompleted):
* WebCoreSupport/WebResourceLoadScheduler.h:

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

6 months agoWeb Inspector: provide a way to view XML/HTML/SVG resource responses as a DOM tree
drousso@apple.com [Wed, 4 Sep 2019 02:57:26 +0000 (02:57 +0000)]
Web Inspector: provide a way to view XML/HTML/SVG resource responses as a DOM tree
https://bugs.webkit.org/show_bug.cgi?id=201046
<rdar://problem/54446087>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/ResourceClusterContentView.js:
(WI.ResourceClusterContentView):
(WI.ResourceClusterContentView.prototype.showRequest):
(WI.ResourceClusterContentView.prototype.showResponse):
(WI.ResourceClusterContentView.prototype.get customRequestDOMContentView): Added.
(WI.ResourceClusterContentView.prototype.get customRequestJSONContentView): Added.
(WI.ResourceClusterContentView.prototype.get customResponseDOMContentView): Added.
(WI.ResourceClusterContentView.prototype.get customResponseJSONContentView): Added.
(WI.ResourceClusterContentView.prototype.get customResponseTextContentView): Added.
(WI.ResourceClusterContentView.prototype._createPathComponent): Added.
(WI.ResourceClusterContentView.prototype._canShowCustomRequestContentView):
(WI.ResourceClusterContentView.prototype._canShowCustomResponseContentView):
(WI.ResourceClusterContentView.prototype._contentViewForResourceType):
(WI.ResourceClusterContentView.prototype._pathComponentForContentView):
(WI.ResourceClusterContentView.prototype._identifierForContentView):
(WI.ResourceClusterContentView.prototype._showContentViewForIdentifier):
(WI.ResourceClusterContentView.prototype._resourceLoadingDidFinish):
(WI.ResourceClusterContentView.prototype._canUseDOMContentViewForContent): Added.
(WI.ResourceClusterContentView.prototype._normalizeMIMETypeForDOM): Added.
(WI.ResourceClusterContentView.prototype._tryEnableCustomRequestContentViews): Added.
(WI.ResourceClusterContentView.prototype._tryEnableCustomResponseContentViews): Added.
(WI.ResourceClusterContentView.createPathComponent): Deleted.
(WI.ResourceClusterContentView.prototype._tryEnableCustomRequestContentView): Deleted.
(WI.ResourceClusterContentView.prototype._tryEnableCustomResponseContentView): Deleted.
* UserInterface/Base/Main.js:
(WI.showResourceRequest):
* UserInterface/Views/PathComponentIcons.css:
(.object-icon .icon): Added.
* UserInterface/Main.html:
* UserInterface/Views/SVGImageResourceClusterContentView.js: Removed.
Reworked to allow more than one custom request/response content view at the same time. As
such, merge the `WI.SVGImageResourceClusterContentView` into this class.

* UserInterface/Views/LocalRemoteObjectContentView.js: Added.
(WI.LocalRemoteObjectContentView):
(WI.LocalRemoteObjectContentView.prototype.get expression):
(WI.LocalRemoteObjectContentView.prototype.renderRemoteObject):
(WI.LocalRemoteObjectContentView.prototype.initialLayout):
(WI.LocalRemoteObjectContentView.prototype.attached):
(WI.LocalRemoteObjectContentView.prototype.closed):
* UserInterface/Views/LocalRemoteObjectContentView.css: Added.
(.content-view.local-remote-object):
* UserInterface/Views/LocalDOMContentView.js: Added.
(WI.LocalDOMContentView):
(WI.LocalDOMContentView.prototype.get expression):
(WI.LocalDOMContentView.prototype.renderRemoteObject):
* UserInterface/Views/LocalJSONContentView.js: Added.
(WI.LocalJSONContentView):
(WI.LocalJSONContentView.prototype.get expression):
(WI.LocalJSONContentView.prototype.renderRemoteObject):
* UserInterface/Views/JSONContentView.js: Removed.
* UserInterface/Views/JSONContentView.css: Removed.
Rework `WI.JSONContentView` into a more generic set of classes that render an object we send
to the inspected page for instrumentation.

* UserInterface/Views/DOMTreeOutline.js:
(WI.DOMTreeOutline.prototype.populateContextMenu):
(WI.DOMTreeOutline.prototype._onmousemove):
(WI.DOMTreeOutline.prototype._onmouseout):
(WI.DOMTreeOutline.prototype._ondragstart):
(WI.DOMTreeOutline.prototype._ondragover):
(WI.DOMTreeOutline.prototype._ondragleave):
(WI.DOMTreeOutline.prototype._ondragend):
(WI.DOMTreeOutline.prototype._hideElements):
* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype.populateDOMNodeContextMenu):
* UserInterface/Views/ContextMenuUtilities.js:
(WI.appendContextMenuItemsForDOMNode):
Ensure that interactions that would modify the DOM tree only happen when editable. If the
`WI.DOMTreeOutline` represents a "local" `WI.DOMNode` (one that's been sent to the inspected
page for instrumentation, and shouldn't be part of the main #document), don't allow any
editing actions to be performed.

* UserInterface/Views/TextContentView.js:
(WI.TextContentView):
Allow a `representedObject` object to be provided and used instead of the given `string`.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Images/Object.svg: Added.

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

6 months agoWeb Inspector: implement blackboxing of script resources
drousso@apple.com [Wed, 4 Sep 2019 02:26:37 +0000 (02:26 +0000)]
Web Inspector: implement blackboxing of script resources
https://bugs.webkit.org/show_bug.cgi?id=17240
<rdar://problem/5732847>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

When a script is blackboxed and the debugger attempts to pause in that script, the pause
reason/data will be saved and execution will continue until it has left the blackboxed
script. Once outside, execution is paused with the saved reason/data.

This is especially useful when debugging issues using libraries/frameworks, as it allows the
developer to "skip" the internal logic of the library/framework and instead focus only on
how they're using it.

* inspector/protocol/Debugger.json:
Add `setShouldBlackboxURL` command.

* inspector/agents/InspectorDebuggerAgent.h:
* inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::InspectorDebuggerAgent):
(Inspector::InspectorDebuggerAgent::enable):
(Inspector::InspectorDebuggerAgent::updatePauseReasonAndData): Added.
(Inspector::InspectorDebuggerAgent::schedulePauseOnNextStatement):
(Inspector::InspectorDebuggerAgent::cancelPauseOnNextStatement):
(Inspector::InspectorDebuggerAgent::setShouldBlackboxURL): Added.
(Inspector::InspectorDebuggerAgent::setPauseForInternalScripts):
(Inspector::InspectorDebuggerAgent::didParseSource):
(Inspector::InspectorDebuggerAgent::didPause):
(Inspector::InspectorDebuggerAgent::didContinue):
(Inspector::InspectorDebuggerAgent::breakProgram):
(Inspector::InspectorDebuggerAgent::clearDebuggerBreakpointState):
(Inspector::InspectorDebuggerAgent::clearPauseDetails): Added.
(Inspector::InspectorDebuggerAgent::clearBreakDetails): Deleted.
Renamed "break" to "pause" to match `Debugger` naming.

* debugger/Debugger.h:
* debugger/Debugger.cpp:
(JSC::Debugger::pauseIfNeeded):
(JSC::Debugger::setBlackboxType): Added.
(JSC::Debugger::clearBlackbox): Added.
(JSC::Debugger::isBlacklisted const): Deleted.
(JSC::Debugger::addToBlacklist): Deleted.
(JSC::Debugger::clearBlacklist): Deleted.

Source/WebInspectorUI:

When a script is blackboxed and the debugger attempts to pause in that script, the pause
reason/data will be saved and execution will continue until it has left the blackboxed
script. Once outside, execution is paused with the saved reason/data.

This is especially useful when debugging issues using libraries/frameworks, as it allows the
developer to "skip" the internal logic of the library/framework and instead focus only on
how they're using it.

* UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager):
(WI.DebuggerManager.prototype.initializeTarget):
(WI.DebuggerManager.supportsBlackboxingScripts): Added.
(WI.DebuggerManager.pauseReasonFromPayload): Added.
(WI.DebuggerManager.prototype.isScriptBlackboxed): Added.
(WI.DebuggerManager.prototype.setShouldBlackboxScript): Added.
(WI.DebuggerManager.prototype._pauseReasonFromPayload):
(WI.DebuggerManager.prototype._pauseReasonFromPayload): Deleted.

* UserInterface/Models/SourceCode.js:
(WI.SourceCode.prototype.get isScript): Added.
(WI.SourceCode.prototype.get supportsScriptBlackboxing): Added.
* UserInterface/Models/Script.js:
(WI.Script.prototype.get isScript): Added.
* UserInterface/Models/Resource.js:
(WI.Resource.prototype.get isScript): Added.
Provide a more straightforward way of determining if a `WI.SourceCode` is a script.

* UserInterface/Views/DebuggerSidebarPanel.js:
(WI.DebuggerSidebarPanel.prototype._updatePauseReason):
(WI.DebuggerSidebarPanel.prototype._updatePauseReasonSection):
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel.prototype._updatePauseReason):
(WI.SourcesNavigationSidebarPanel.prototype._updatePauseReasonSection):
Display the original pause reason and breakpoint (if applicable) when pausing after leaving
a blackboxed script.

* UserInterface/Views/SourceCodeTreeElement.js:
(WI.SourceCodeTreeElement.prototype.canSelectOnMouseDown): Added.
(WI.SourceCodeTreeElement.prototype.updateStatus): Added.
(WI.SourceCodeTreeElement.prototype._updateSourceCode):
(WI.SourceCodeTreeElement.prototype._updateToggleBlackboxImageElementState): Added.
(WI.SourceCodeTreeElement.prototype._handleToggleBlackboxedImageElementClick): Added.
* UserInterface/Views/SourceCodeTreeElement.css: Added.
(.tree-outline .item .status > .toggle-script-blackboxed):
(.tree-outline:not(.navigation-sidebar-panel-content-tree-outline) .item .status > .toggle-script-blackboxed,):
(.tree-outline:focus .item.selected .status > .toggle-script-blackboxed):
(.tree-outline .item .status > .toggle-script-blackboxed.blackboxed):
(@media (prefers-color-scheme: dark) .tree-outline .item .status > .toggle-script-blackboxed):

* UserInterface/Views/ResourceTreeElement.js:
(WI.ResourceTreeElement.prototype._updateResource):
(WI.ResourceTreeElement.prototype.updateStatus): Added.
(WI.ResourceTreeElement.prototype._updateStatus): Deleted.
Make sure that the loading indicator doesn't override the blackbox toggle.

* UserInterface/Base/Setting.js:
(WI.Setting.prototype.set value):
(WI.Setting.prototype.save): Added.
When modifying an array value, that doesn't go through `WI.Setting.prototype.set value`, so
we need a more "manual" way of saving the new value.

* UserInterface/Main.html:
* Localizations/en.lproj/localizedStrings.js:

* UserInterface/Test/TestHarness.js:
(TestHarness.prototype.newline): Added.
(TestHarness.prototype.expectException):
Add a special case for logging error message objects when running protocol tests.

LayoutTests:

* inspector/debugger/setShouldBlackboxURL.html: Added.
* inspector/debugger/setShouldBlackboxURL-expected.txt: Added.

* inspector/model/remote-object-api-expected.txt:
Update output since `WI.TestHarness.prototype.expectException` now logs the `.constructor.name`.

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

6 months agoRemove the need to pass performJITMemcpy as a pointer.
mark.lam@apple.com [Wed, 4 Sep 2019 01:47:02 +0000 (01:47 +0000)]
Remove the need to pass performJITMemcpy as a pointer.
https://bugs.webkit.org/show_bug.cgi?id=201413

Reviewed by Michael Saboff.

We want performJITMemcpy to always be inlined.  In this patch, we also clean up
some template parameters to use enums instead of booleans to better document the
intent of the code.

* assembler/ARM64Assembler.h:
(JSC::ARM64Assembler::fillNops):
(JSC::ARM64Assembler::linkJump):
(JSC::ARM64Assembler::linkCall):
(JSC::ARM64Assembler::relinkJump):
(JSC::ARM64Assembler::relinkCall):
(JSC::ARM64Assembler::link):
(JSC::ARM64Assembler::linkJumpOrCall):
(JSC::ARM64Assembler::linkCompareAndBranch):
(JSC::ARM64Assembler::linkConditionalBranch):
(JSC::ARM64Assembler::linkTestAndBranch):
(JSC::ARM64Assembler::relinkJumpOrCall):
(JSC::ARM64Assembler::CopyFunction::CopyFunction): Deleted.
(JSC::ARM64Assembler::CopyFunction::operator()): Deleted.
* assembler/ARMv7Assembler.h:
(JSC::ARMv7Assembler::fillNops):
(JSC::ARMv7Assembler::link):
(JSC::ARMv7Assembler::linkJumpT1):
(JSC::ARMv7Assembler::linkJumpT2):
(JSC::ARMv7Assembler::linkJumpT3):
(JSC::ARMv7Assembler::linkJumpT4):
(JSC::ARMv7Assembler::linkConditionalJumpT4):
(JSC::ARMv7Assembler::linkBX):
(JSC::ARMv7Assembler::linkConditionalBX):
* assembler/AbstractMacroAssembler.h:
(JSC::AbstractMacroAssembler::emitNops):
* assembler/LinkBuffer.cpp:
(JSC::LinkBuffer::copyCompactAndLinkCode):
* assembler/MIPSAssembler.h:
(JSC::MIPSAssembler::fillNops):
* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::link):
* assembler/MacroAssemblerARMv7.h:
(JSC::MacroAssemblerARMv7::link):
* assembler/X86Assembler.h:
(JSC::X86Assembler::fillNops):
* jit/ExecutableAllocator.h:
(JSC::performJITMemcpy):
* runtime/JSCPtrTag.h:

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

6 months agoTest for ContextMenus with images
dino@apple.com [Wed, 4 Sep 2019 00:39:10 +0000 (00:39 +0000)]
Test for ContextMenus with images
https://bugs.webkit.org/show_bug.cgi?id=201437

Reviewed by Wenson Hsieh.

Add a test for ContextMenus that trigger on images, and make
sure that they ask for alternate URLs (added in r249171).

* TestWebKitAPI/Tests/WebKitCocoa/ContextMenus.mm:
(contextMenuWebViewDriver):
(-[TestContextMenuImageUIDelegate _webView:contextMenuConfigurationForElement:completionHandler:]):
(-[TestContextMenuImageUIDelegate _webView:alternateURLFromImage:userInfo:]):
(-[TestContextMenuImageUIDelegate webView:contextMenuWillPresentForElement:]):
(-[TestContextMenuImageUIDelegate webView:contextMenuForElement:willCommitWithAnimator:]):
(-[TestContextMenuImageUIDelegate webView:contextMenuDidEndForElement:]):
(TEST):

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

6 months agoREGRESSION (r249132): [macOS WK2] Layout Test inspector/layers/layerTreeDidChange...
drousso@apple.com [Wed, 4 Sep 2019 00:35:12 +0000 (00:35 +0000)]
REGRESSION (r249132): [macOS WK2] Layout Test inspector/layers/layerTreeDidChange.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=201435

Reviewed by Joseph Pecoraro.

r249132 changed the `InspectorLayerTreeAgent` to reset the flag that controls whether the
frontend should be notified about layer changes when `disable` is called, which happens when
Web Inspector disconnects.

Sometimes, a layer change event can be "in flight" when this happens, meaning that the Web
Inspector frontend can receive a layer change event before it requests the new layer data.

This is normally handled by the Web Inspector UI, as the associated DOM node would no longer
exist, so the UI paths would early return.

* inspector/layers/layerTreeDidChange.html:
Only listen for layer change events once we've triggered a guaranteed layer update, as any
"in flight" events from previous tests could be incorrectly logged as part of this test.

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

6 months ago[WebGPU] Add compute-boids to WebGPU demo page
justin_fan@apple.com [Wed, 4 Sep 2019 00:20:57 +0000 (00:20 +0000)]
[WebGPU] Add compute-boids to WebGPU demo page
https://bugs.webkit.org/show_bug.cgi?id=201416

Reviewed by Dean Jackson.

Add the compute-boids demo for use with STP 91.

* demos/webgpu/compute-boids.html: Added.
* demos/webgpu/index.html:
* demos/webgpu/resources/compute-boids.png: Added.

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

6 months agoREGRESSION (r249078): Flaky crash in com.apple.JavaScriptCore: Inspector::InjectedScr...
drousso@apple.com [Tue, 3 Sep 2019 23:37:12 +0000 (23:37 +0000)]
REGRESSION (r249078): Flaky crash in com.apple.JavaScriptCore: Inspector::InjectedScriptModule::ensureInjected
https://bugs.webkit.org/show_bug.cgi?id=201201
<rdar://problem/54771560>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/InjectedScriptSource.js:
(let.InjectedScript.prototype.injectModule):
(let.InjectedScript.prototype._evaluateOn):
(CommandLineAPI):
(let.InjectedScript.prototype.setInspectObject): Deleted.
(let.InjectedScript.prototype.addCommandLineAPIGetter): Deleted.
(let.InjectedScript.prototype.addCommandLineAPIMethod.func.toString): Deleted.
(let.InjectedScript.prototype.addCommandLineAPIMethod): Deleted.
(InjectedScript.CommandLineAPI): Deleted.
Allow injected script "extensions" (e.g. CommandLineAPIModuleSource.js) to modify objects
directly, instead of having them call functions.

* inspector/InjectedScriptModule.cpp:
(Inspector::InjectedScriptModule::ensureInjected):
Make sure to reset `hadException` to `false` before making another call.

Source/WebCore:

Tests: inspector/debugger/tail-deleted-frames-this-value.html
       inspector/heap/getRemoteObject.html

* inspector/CommandLineAPIModuleSource.js:
Avoid executing functions when injecting. Instead, modify the `CommandLineAPI` directly.

LayoutTests:

* inspector/debugger/tail-deleted-frames-this-value.html:
* inspector/debugger/tail-deleted-frames-this-value-expected.txt:
* inspector/debugger/resources/tail-deleted-frames-this-value.js:
* inspector/timeline/line-column-expected.txt:

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

6 months agoNull deref under -[WKWebView _addUpdateVisibleContentRectPreCommitHandler]'s handler...
timothy_horton@apple.com [Tue, 3 Sep 2019 23:21:38 +0000 (23:21 +0000)]
Null deref under -[WKWebView _addUpdateVisibleContentRectPreCommitHandler]'s handler block
https://bugs.webkit.org/show_bug.cgi?id=201436
<rdar://problem/40640475>

Reviewed by Simon Fraser.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView dealloc]):
(-[WKWebView _addUpdateVisibleContentRectPreCommitHandler]):
We crash sending a message to a deallocated WKWebView inside the handler block
passed to +[CATransaction addCommitHandler:]. This seems impossible, because
we carefully retain it, but it's possible that it could be the result of
the handler block being installed under -dealloc (in which case retaining
the WKWebView wouldn't actually extend its lifetime). -[WKWebView dealloc]
is fairly sizable, and it's hard to follow all paths from it, so instead
add a RELEASE_LOG_FAULT, so we'll get simulated crash logs, and bail,
so we'll stop actually crashing (if this is the cause).

This is just a speculative fix, but a hopeful one, since intentionally calling
-_addUpdateVisibleContentRectPreCommitHandler: from dealloc yields a similar-looking
crash under the handler block.

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

6 months agoresults.webkit.org: Move legend into sidebar
jbedard@apple.com [Tue, 3 Sep 2019 21:52:16 +0000 (21:52 +0000)]
results.webkit.org: Move legend into sidebar
https://bugs.webkit.org/show_bug.cgi?id=201258

Rubber-stamped by Aakash Jain.

* resultsdbpy/resultsdbpy/view/static/js/timeline.js:
(Legend): Make the legend vertical instead of horizontal, add ToolTip to dots in the legend.
* resultsdbpy/resultsdbpy/view/static/js/tooltip.css: Add left and right tooltip arrows.
* resultsdbpy/resultsdbpy/view/static/js/tooltip.js:
(isPointInElement): Make bound check include borders.
(_ToolTip.toString): Add left/right cases.
(_ToolTip.prototype.setByElement): Set the tooltip location given an element.
* resultsdbpy/resultsdbpy/view/templates/search.html: Put the legend into the sidebar.
* resultsdbpy/resultsdbpy/view/templates/suite_results.html: Ditto.

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

6 months ago[LFC][TFC] Initialize <thead><tbody><tfoot> display boxes.
zalan@apple.com [Tue, 3 Sep 2019 20:35:06 +0000 (20:35 +0000)]
[LFC][TFC] Initialize <thead><tbody><tfoot> display boxes.
https://bugs.webkit.org/show_bug.cgi?id=201235
<rdar://problem/54807060>

Reviewed by Antti Koivisto.

Set them as blank for now.

* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::layout const):

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

6 months ago[LFC][Floating] Replace all LayoutState::displayBoxForLayoutBox() calls with Formatti...
zalan@apple.com [Tue, 3 Sep 2019 20:05:49 +0000 (20:05 +0000)]
[LFC][Floating] Replace all LayoutState::displayBoxForLayoutBox() calls with FormattingContext::displayBoxForLayoutBox()
https://bugs.webkit.org/show_bug.cgi?id=201414
<rdar://problem/54963302>

Reviewed by Antti Koivisto.

Fix the final LayoutState::displayBoxForLayoutBox() callsites. Now all displayBoxForLayoutBox() calls are directed to the
established FormattingContext.

* layout/FormattingContext.cpp:
(WebCore::Layout::mapHorizontalPositionToAncestor):
(WebCore::Layout::FormattingContext::mapLeftToAncestor const):
(WebCore::Layout::FormattingContext::mapRightToAncestor const):
(WebCore::Layout::FormattingContext::mapBoxToAncestor const):
(WebCore::Layout::FormattingContext::mapTopToAncestor const):
(WebCore::Layout::FormattingContext::mapPointToAncestor const):
(WebCore::Layout::FormattingContext::mapPointToDescendent const):
(WebCore::Layout::FormattingContext::mapLeftToAncestor): Deleted.
(WebCore::Layout::FormattingContext::mapRightToAncestor): Deleted.
(WebCore::Layout::FormattingContext::mapBoxToAncestor): Deleted.
(WebCore::Layout::FormattingContext::mapTopToAncestor): Deleted.
(WebCore::Layout::FormattingContext::mapPointToAncestor): Deleted.
(WebCore::Layout::FormattingContext::mapPointToDescendent): Deleted.
* layout/FormattingContext.h:
(WebCore::Layout::FormattingContext::root const):
(WebCore::Layout::FormattingContext::formattingState const):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout):
(WebCore::Layout::BlockFormattingContext::usedAvailableWidthForFloatAvoider const):
* layout/floats/FloatingContext.cpp:
(WebCore::Layout::mapToFormattingContextRoot):
(WebCore::Layout::FloatingContext::FloatingContext):
(WebCore::Layout::FloatingContext::positionForFloat const):
(WebCore::Layout::FloatingContext::positionForFormattingContextRoot const):
(WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
(WebCore::Layout::FloatingContext::constraints const):
(WebCore::Layout::FloatingContext::append):
* layout/floats/FloatingContext.h:
(WebCore::Layout::FloatingContext::formattingContext const):
(WebCore::Layout::FloatingContext::root const):
* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::InlineFormattingContext::InlineLayout::layout const):
(WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const):

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

6 months agoCache "compositingAncestor" during the compositing updateBackingAndHierarchy() tree...
simon.fraser@apple.com [Tue, 3 Sep 2019 19:55:11 +0000 (19:55 +0000)]
Cache "compositingAncestor" during the compositing updateBackingAndHierarchy() tree walk
https://bugs.webkit.org/show_bug.cgi?id=201403

Reviewed by Antti Koivisto.

Finding a layer's compositingAncestor requires an ancestor tree walk. We can avoid this during
compositing updates, since we're already in the middle of a paint-order tree walk, and can just
keep track of the current compositingAncestor on the way down.

Shaves a few % off time in updateCompositingLayers().

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateConfiguration):
(WebCore::ComputedOffsets::ComputedOffsets):
(WebCore::ComputedOffsets::fromAncestorGraphicsLayer):
(WebCore::RenderLayerBacking::computePrimaryGraphicsLayerRect const):
(WebCore::RenderLayerBacking::updateGeometry):
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::UpdateBackingTraversalState::UpdateBackingTraversalState):
(WebCore::RenderLayerCompositor::UpdateBackingTraversalState::stateForDescendants const):
(WebCore::RenderLayerCompositor::updateCompositingLayers):
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
(WebCore::RenderLayerCompositor::updateLayerCompositingState):
(WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
(WebCore::RenderLayerCompositor::coordinatedScrollingRolesForLayer const):
(WebCore::RenderLayerCompositor::updateScrollCoordinationForLayer):
(WebCore::RenderLayerCompositor::updateScrollingNodeForPositioningRole):
* rendering/RenderLayerCompositor.h:

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

6 months ago[LFC] FloatingState should not need to query for display boxes.
zalan@apple.com [Tue, 3 Sep 2019 19:53:49 +0000 (19:53 +0000)]
[LFC] FloatingState should not need to query for display boxes.
https://bugs.webkit.org/show_bug.cgi?id=201408
<rdar://problem/54958348>

Reviewed by Antti Koivisto.

This is in preparation for transitioning the floating codebase to use the formatting context for
retrieving display boxes.
FloatingContext should be responsible for adding/removing the new/existing float boxes to the state.

* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot):
* layout/floats/FloatingContext.cpp:
(WebCore::Layout::FloatingContext::append):
(WebCore::Layout::FloatingContext::remove):
* layout/floats/FloatingContext.h:
* layout/floats/FloatingState.cpp:
(WebCore::Layout::FloatingState::append):
(WebCore::Layout::belongsToThisFloatingContext): Deleted.
* layout/floats/FloatingState.h:
(WebCore::Layout::FloatingState::FloatItem::horizontalMargin const):
* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const):

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

6 months ago[LFC][Floats] Do not pass FloatingState to FloatItem
zalan@apple.com [Tue, 3 Sep 2019 19:48:03 +0000 (19:48 +0000)]
[LFC][Floats] Do not pass FloatingState to FloatItem
https://bugs.webkit.org/show_bug.cgi?id=201406
<rdar://problem/54957097>

Reviewed by Antti Koivisto.

This is in preparation for transitioning the floating codebase to use the formatting context for
retrieving display boxes. Now FloatItems don't need the FloatingState to compute absolute display boxes.

* layout/floats/FloatingState.cpp:
(WebCore::Layout::FloatingState::FloatItem::FloatItem):
(WebCore::Layout::FloatingState::append):
* layout/floats/FloatingState.h:

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

6 months ago[LFC][Floats] Do not pass FloatingState to FloatAvoider/FloatBox
zalan@apple.com [Tue, 3 Sep 2019 19:21:48 +0000 (19:21 +0000)]
[LFC][Floats] Do not pass FloatingState to FloatAvoider/FloatBox
https://bugs.webkit.org/show_bug.cgi?id=201405
<rdar://problem/54956381>

Reviewed by Antti Koivisto.

This is in preparation for transitioning the floating codebase to use the formatting context for
retrieving display boxes. Now FloatAvoiders/FloatBoxes don't need the FloatingState to compute absolute display boxes.

* layout/floats/FloatAvoider.cpp:
(WebCore::Layout::FloatAvoider::FloatAvoider):
(WebCore::Layout::FloatAvoider::setHorizontalConstraints):
(WebCore::Layout::FloatAvoider::initialHorizontalPosition const):
(WebCore::Layout::FloatAvoider::overflowsContainingBlock const):
(WebCore::Layout::FloatAvoider::rectInContainingBlock const):
* layout/floats/FloatAvoider.h:
(WebCore::Layout::FloatAvoider::floatingState const): Deleted.
* layout/floats/FloatBox.cpp:
(WebCore::Layout::FloatBox::FloatBox):
(WebCore::Layout::FloatBox::initialVerticalPosition const):
* layout/floats/FloatBox.h:
* layout/floats/FloatingContext.cpp:
(WebCore::Layout::mapToFormattingContextRoot):
(WebCore::Layout::FloatingContext::positionForFloat const):
(WebCore::Layout::FloatingContext::positionForFormattingContextRoot const):
* platform/graphics/LayoutPoint.h:
(WebCore::LayoutPoint::isZero const):

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

6 months ago[WebAuthn] Enable WebAuthn by default for MobileSafari and SafariViewService
jiewen_tan@apple.com [Tue, 3 Sep 2019 18:56:10 +0000 (18:56 +0000)]
[WebAuthn] Enable WebAuthn by default for MobileSafari and SafariViewService
https://bugs.webkit.org/show_bug.cgi?id=201369
<rdar://problem/54903724>

Reviewed by Brent Fulgham.

Source/WebCore:

* platform/RuntimeApplicationChecks.h:
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::IOSApplication::isSafariViewService):
Adds a way to detect SafariViewService.

Source/WebKit:

Communications to security keys require entitlements, which are not guaranteed to be present in third party
WKWebView clients. Therefore, only enable WebAuthn by default for MobileSafari and SafariViewService.

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

LayoutTests:

* http/wpt/webauthn/public-key-credential-get-success-nfc.https.html:
Imporves the test a bit.

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

6 months agoRename WebPage::pageID() to WebPage::identifier()
cdumez@apple.com [Tue, 3 Sep 2019 18:37:36 +0000 (18:37 +0000)]
Rename WebPage::pageID() to WebPage::identifier()
https://bugs.webkit.org/show_bug.cgi?id=201428

Reviewed by Antti Koivisto.

* Shared/API/Cocoa/WKBrowsingContextHandle.mm:
(-[WKBrowsingContextHandle _initWithPage:]):
* WebProcess/ApplePay/WebPaymentCoordinator.cpp:
(WebKit::WebPaymentCoordinator::WebPaymentCoordinator):
(WebKit::WebPaymentCoordinator::showPaymentUI):
(WebKit::WebPaymentCoordinator::messageSenderDestinationID const):
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::loadResourceSynchronously):
(WebKit::WebLoaderStrategy::preconnectTo):
* WebProcess/Notifications/WebNotificationManager.cpp:
(WebKit::WebNotificationManager::show):
(WebKit::WebNotificationManager::cancel):
(WebKit::WebNotificationManager::clearNotifications):
(WebKit::WebNotificationManager::didDestroyNotification):
* WebProcess/WebAuthentication/WebAuthenticatorCoordinator.cpp:
(WebKit::WebAuthenticatorCoordinator::WebAuthenticatorCoordinator):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::windowRect):
(WebKit::WebChromeClient::focusedFrameChanged):
(WebKit::WebChromeClient::createWindow):
(WebKit::WebChromeClient::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
(WebKit::WebChromeClient::toolbarsVisible):
(WebKit::WebChromeClient::statusbarVisible):
(WebKit::WebChromeClient::menubarVisible):
(WebKit::WebChromeClient::wrapCryptoKey const):
(WebKit::WebChromeClient::unwrapCryptoKey const):
(WebKit::WebChromeClient::signedPublicKeyAndChallengeString const):
* WebProcess/WebCoreSupport/WebColorChooser.cpp:
(WebKit::WebColorChooser::WebColorChooser):
(WebKit::WebColorChooser::reattachColorChooser):
(WebKit::WebColorChooser::setSelectedColor):
(WebKit::WebColorChooser::endChooser):
* WebProcess/WebCoreSupport/WebDataListSuggestionPicker.cpp:
(WebKit::WebDataListSuggestionPicker::handleKeydownWithIdentifier):
(WebKit::WebDataListSuggestionPicker::close):
(WebKit::WebDataListSuggestionPicker::displayWithActivationType):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::pageID const):
(WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
(WebKit::WebFrameLoaderClient::dispatchDidFailLoad):
* WebProcess/WebCoreSupport/WebPopupMenu.cpp:
(WebKit::WebPopupMenu::show):
(WebKit::WebPopupMenu::hide):
* WebProcess/WebCoreSupport/WebSearchPopupMenu.cpp:
(WebKit::WebSearchPopupMenu::saveRecentSearches):
(WebKit::WebSearchPopupMenu::loadRecentSearches):
* WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm:
(WebKit::WebFrameLoaderClient::createPreviewLoaderClient):
* WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.mm:
(WebKit::TextCheckingControllerProxy::TextCheckingControllerProxy):
(WebKit::TextCheckingControllerProxy::~TextCheckingControllerProxy):
* WebProcess/WebPage/Cocoa/WebRemoteObjectRegistry.cpp:
(WebKit::WebRemoteObjectRegistry::WebRemoteObjectRegistry):
(WebKit::WebRemoteObjectRegistry::close):
* WebProcess/WebPage/EventDispatcher.cpp:
(WebKit::EventDispatcher::addScrollingTreeForPage):
(WebKit::EventDispatcher::removeScrollingTreeForPage):
(WebKit::EventDispatcher::clearQueuedTouchEventsForPage):
(WebKit::EventDispatcher::getQueuedTouchEventsForPage):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
* WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm:
(WebKit::RemoteScrollingCoordinator::RemoteScrollingCoordinator):
(WebKit::RemoteScrollingCoordinator::~RemoteScrollingCoordinator):
* WebProcess/WebPage/RemoteWebInspectorUI.cpp:
(WebKit::RemoteWebInspectorUI::sendMessageToBackend):
(WebKit::RemoteWebInspectorUI::changeSheetRect):
(WebKit::RemoteWebInspectorUI::startWindowDrag):
(WebKit::RemoteWebInspectorUI::bringToFront):
(WebKit::RemoteWebInspectorUI::closeWindow):
(WebKit::RemoteWebInspectorUI::reopen):
(WebKit::RemoteWebInspectorUI::resetState):
(WebKit::RemoteWebInspectorUI::openInNewTab):
(WebKit::RemoteWebInspectorUI::save):
(WebKit::RemoteWebInspectorUI::append):
(WebKit::RemoteWebInspectorUI::showCertificate):
* WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
(WebKit::ViewGestureGeometryCollector::ViewGestureGeometryCollector):
(WebKit::ViewGestureGeometryCollector::~ViewGestureGeometryCollector):
* WebProcess/WebPage/WebBackForwardListProxy.cpp:
(WebKit::WebBackForwardListProxy::itemAtIndex):
(WebKit::WebBackForwardListProxy::backListCount const):
(WebKit::WebBackForwardListProxy::forwardListCount const):
* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::openLocalInspectorFrontend):
(WebKit::WebInspector::closeFrontendConnection):
(WebKit::WebInspector::bringToFront):
(WebKit::WebInspector::elementSelectionChanged):
(WebKit::WebInspector::timelineRecordingChanged):
(WebKit::WebInspector::setMockCaptureDevicesEnabledOverride):
(WebKit::WebInspector::updateDockingAvailability):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
(WebKit::m_textAutoSizingAdjustmentTimer):
(WebKit::WebPage::messageSenderDestinationID const):
(WebKit::WebPage::close):
(WebKit::WebPage::goToBackForwardItem):
(WebKit::WebPage::setFixedLayoutSize):
(WebKit::WebPage::freezeLayerTree):
(WebKit::WebPage::unfreezeLayerTree):
(WebKit::WebPage::restoreSessionInternal):
(WebKit::WebPage::setCurrentHistoryItemForReattach):
(WebKit::WebPage::updateIsInWindow):
(WebKit::WebPage::setActivityState):
(WebKit::WebPage::mainFrameDidLayout):
(WebKit::WebPage::didCommitLoad):
(WebKit::WebPage::hasStorageAccess):
(WebKit::WebPage::requestStorageAccess):
(WebKit::WebPage::textInputContextsInRect):
(WebKit::WebPage::elementForTextInputContext):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::identifier const):
(WebKit::WebPage::pageID const): Deleted.
* WebProcess/WebPage/WebPageInspectorTarget.cpp:
(WebKit::WebPageInspectorTarget::identifier const):
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
(-[WKAccessibilityWebPageObjectBase setWebPage:]):
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::executeKeypressCommandsInternal):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::transformObjectsToHandles):
* WebProcess/WebStorage/StorageNamespaceImpl.cpp:
(WebKit::StorageNamespaceImpl::copy):
* WebProcess/WebStorage/WebStorageNamespaceProvider.cpp:
(WebKit::WebStorageNamespaceProvider::createSessionStorageNamespace):
* WebProcess/cocoa/PlaybackSessionManager.mm:
(WebKit::PlaybackSessionManager::PlaybackSessionManager):
(WebKit::PlaybackSessionManager::~PlaybackSessionManager):
(WebKit::PlaybackSessionManager::invalidate):
* WebProcess/cocoa/VideoFullscreenManager.mm:
(WebKit::VideoFullscreenManager::VideoFullscreenManager):
(WebKit::VideoFullscreenManager::~VideoFullscreenManager):
(WebKit::VideoFullscreenManager::invalidate):

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

6 months agoMake "clips compositing descendants" an indirect compositing reason
simon.fraser@apple.com [Tue, 3 Sep 2019 18:25:27 +0000 (18:25 +0000)]
Make "clips compositing descendants" an indirect compositing reason
https://bugs.webkit.org/show_bug.cgi?id=201381

Reviewed by Antti Koivisto.

Whether a layer has to composite to clip composited descendants is an "indirect" reason,
just like having to composite for filters if there's a composited descendant. So add
IndirectCompositingReason::Clipping, and have computeIndirectCompositingReason() compute this,
replacing the code that ran in computeCompositingRequirements().

This is some preparatory cleanup for webkit.org/b/201330.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayer.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::requiresCompositingLayer const):
(WebCore::RenderLayerCompositor::reasonsForCompositing const):
(WebCore::RenderLayerCompositor::computeIndirectCompositingReason const):
(WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const): Deleted.
* rendering/RenderLayerCompositor.h:

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

6 months ago[LFC][Floats] Move FloatingState::constraints to FloatingContext
zalan@apple.com [Tue, 3 Sep 2019 18:21:41 +0000 (18:21 +0000)]
[LFC][Floats] Move FloatingState::constraints to FloatingContext
https://bugs.webkit.org/show_bug.cgi?id=201393
<rdar://problem/54939361>

Reviewed by Antti Koivisto.

This is in preparation for transitioning the floating codebase to use the formatting context for
retrieving display boxes. Now FloatingContext (just like any other formatting context) holds on to the formatting
context root.

* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout):
(WebCore::Layout::BlockFormattingContext::usedAvailableWidthForFloatAvoider const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFloatClear):
(WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats):
* layout/floats/FloatingContext.cpp:
(WebCore::Layout::FloatingContext::FloatingContext):
(WebCore::Layout::FloatingContext::positionForFloat const):
(WebCore::Layout::FloatingContext::positionForFormattingContextRoot const):
(WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
(WebCore::Layout::FloatingContext::constraints const):
* layout/floats/FloatingContext.h:
(WebCore::Layout::FloatingContext::isEmpty const):
(WebCore::Layout::FloatingContext::root const):
* layout/floats/FloatingState.cpp:
(WebCore::Layout::FloatingState::constraints const): Deleted.
* layout/floats/FloatingState.h:
(WebCore::Layout::FloatingState::last const):
(WebCore::Layout::FloatingState::isEmpty const): Deleted.
* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::InlineFormattingContext::InlineLayout::layout const):
(WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const):

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

6 months agoresults.webkit.org: Increase default limit for LimitSlider
jbedard@apple.com [Tue, 3 Sep 2019 18:06:58 +0000 (18:06 +0000)]
results.webkit.org: Increase default limit for LimitSlider
https://bugs.webkit.org/show_bug.cgi?id=201424

Reviewed by Aakash Jain.

* resultsdbpy/resultsdbpy/view/static/js/drawer.js:
(LimitSlider): Increase the default limit, make limit slider linear instead of logarithmic.

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

6 months ago[iOS] Treat a two-finger single tap as if the user tapped with the Cmd key pressed
commit-queue@webkit.org [Tue, 3 Sep 2019 16:38:09 +0000 (16:38 +0000)]
[iOS] Treat a two-finger single tap as if the user tapped with the Cmd key pressed
https://bugs.webkit.org/show_bug.cgi?id=201420
<rdar://problem/53207786>

Patch by Antoine Quint <graouts@apple.com> on 2019-09-03
Reviewed by Simon Fraser.

Source/WebKit:

Set the metaKey modifier to true when generating a click event based on a two-finger single tap. This is important so that sites like Google and DuckDuckGo
correctly open links in their search results page in a new tab in Safari on iOS. This currently doesn't work because those sites will call preventDefault()
if the metaKey flag isn't set on a "click" event, and if it is set, they let the browser handle the navigation themselves.

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

Tools:

Add a new twoFingerSingleTapAtPoint() method to UIScriptController, which just calls into the existing (but unused)
-[HIDEventGenerator twoFingerTap:completionBlock:].

* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.h:
(WTR::UIScriptController::twoFingerSingleTapAtPoint):
* WebKitTestRunner/ios/UIScriptControllerIOS.h:
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptControllerIOS::twoFingerSingleTapAtPoint):

LayoutTests:

Add a new event that checks that a two-finger single tap on a clickable element yields a "click" event with the metaKey flag set to true.

* fast/events/ios/click-event-two-finger-single-tap-meta-key-expected.txt: Added.
* fast/events/ios/click-event-two-finger-single-tap-meta-key.html: Added.

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

6 months ago[macOS] Correct sandbox violation in Flash plugin
bfulgham@apple.com [Tue, 3 Sep 2019 16:08:43 +0000 (16:08 +0000)]
[macOS] Correct sandbox violation in Flash plugin
https://bugs.webkit.org/show_bug.cgi?id=201228
<rdar://problem/54347503>

Reviewed by Alex Christensen.

* PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:

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

6 months ago[GStreamer] Add support to copy YUV video textures into images
commit-queue@webkit.org [Tue, 3 Sep 2019 14:58:38 +0000 (14:58 +0000)]
[GStreamer] Add support to copy YUV video textures into images
https://bugs.webkit.org/show_bug.cgi?id=200922

Patch by Chris Lord <clord@igalia.com> on 2019-09-03
Reviewed by Philippe Normand and Xabier Rodriguez-Calvar.

Use gst_gl_color_convert to convert to RGB before using ImageGStreamer
with gstreamer-gl.

No new tests, not changing behavior.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::paint):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:

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

6 months ago[GStreamer] Add support to copy YUV video textures into platform textures
commit-queue@webkit.org [Tue, 3 Sep 2019 14:14:57 +0000 (14:14 +0000)]
[GStreamer] Add support to copy YUV video textures into platform textures
https://bugs.webkit.org/show_bug.cgi?id=200914

Patch by Chris Lord <clord@igalia.com> on 2019-09-03
Reviewed by Xabier Rodriguez-Calvar and Miguel Gomez.

Enable YUV (including planar and semi-planar) video texture to platform
texture copy in VideoTextureCopierGStreamer.

No new tests, not changing behavior.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::GstVideoFrameHolder::platformLayerBuffer):
(WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
(WebCore::MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture):
(WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
* platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
(WebCore::VideoTextureCopierGStreamer::VideoTextureCopierGStreamer):
(WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
* platform/graphics/gstreamer/VideoTextureCopierGStreamer.h:
* platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
(WebCore::TextureMapperPlatformLayerBuffer::textureVariant):

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

6 months ago[Texmap][GStreamer] Add support to upload more color formats into the texture
commit-queue@webkit.org [Tue, 3 Sep 2019 14:00:39 +0000 (14:00 +0000)]
[Texmap][GStreamer] Add support to upload more color formats into the texture
https://bugs.webkit.org/show_bug.cgi?id=132869

Patch by Zan Dobersek  <zdobersek@igalia.com>  and  Chris Lord <clord@igalia.com> on 2019-09-03
Reviewed by Xabier Rodriguez-Calvar.

Support non-interleaved YUV color for gstreamer-gl

This adds direct support for rendering I420, I444, YV12, YV21, Y42B,
NV12, NV21 and VUYA color formats using GLGL shaders when using
gstreamer-gl for video rendering. This avoids a surface copy on the GPU
in those cases.

No new tests, not changing behavior.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::GstVideoFrameHolder::GstVideoFrameHolder):
(WebCore::GstVideoFrameHolder::waitForCPUSync):
(WebCore::GstVideoFrameHolder::hasMappedTextures const):
(WebCore::GstVideoFrameHolder::videoFrame const):
(WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
(WebCore::MediaPlayerPrivateGStreamerBase::createVideoSinkGL):
* platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
(WebCore::VideoTextureCopierGStreamer::VideoTextureCopierGStreamer):
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::optionsForFilterType):
(WebCore::TextureMapperGL::drawTexture):
(WebCore::prepareTransformationMatrixWithFlags):
(WebCore::TextureMapperGL::drawTexturePlanarYUV):
(WebCore::TextureMapperGL::drawTextureSemiPlanarYUV):
(WebCore::TextureMapperGL::drawTexturePackedYUV):
(WebCore::TextureMapperGL::drawTexturedQuadWithProgram):
* platform/graphics/texmap/TextureMapperGL.h:
* platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
(WebCore::TextureMapperPlatformLayerBuffer::TextureMapperPlatformLayerBuffer):
(WebCore::TextureMapperPlatformLayerBuffer::~TextureMapperPlatformLayerBuffer):
(WebCore::TextureMapperPlatformLayerBuffer::clone):
(WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):
* platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
* platform/graphics/texmap/TextureMapperShaderProgram.cpp:
(WebCore::TextureMapperShaderProgram::create):
* platform/graphics/texmap/TextureMapperShaderProgram.h:

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

6 months agoRemove support for load/error on link=prefetch
commit-queue@webkit.org [Tue, 3 Sep 2019 11:48:11 +0000 (11:48 +0000)]
Remove support for load/error on link=prefetch
https://bugs.webkit.org/show_bug.cgi?id=201348

Patch by Rob Buis <rbuis@igalia.com> on 2019-09-03
Reviewed by Youenn Fablet.

Source/WebCore:

Remove support for firing load/error on link=prefetch
to address tracking concerns.

Tests: http/wpt/prefetch/load-events-dynamic.html
       http/wpt/prefetch/load-events.html

* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::linkLoaded):
(WebCore::HTMLLinkElement::linkLoadingErrored):
* html/HTMLLinkElement.h:
* testing/Internals.cpp:
(WebCore::Internals::addPrefetchLoadEventListener):

LayoutTests:

Adjust beforeload tests to also test load/error events.

* http/tests/cache/link-prefetch-main-resource-iframe.html:
* http/tests/cache/link-prefetch-main-resource.html:
* http/wpt/prefetch/beforeload-dynamic-expected.txt: Removed.
* http/wpt/prefetch/beforeload-expected.txt: Removed.
* http/wpt/prefetch/load-events-dynamic-expected.txt: Added.
* http/wpt/prefetch/load-events-dynamic.html: Renamed from LayoutTests/http/wpt/prefetch/beforeload-dynamic.html.
* http/wpt/prefetch/load-events-expected.txt: Added.
* http/wpt/prefetch/load-events.html: Renamed from LayoutTests/http/wpt/prefetch/beforeload.html.
* http/wpt/prefetch/resources/navigate-skip-disk-cache.html:
* http/wpt/prefetch/resources/navigate.html:
* platform/mac-wk1/TestExpectations:
* platform/win/TestExpectations:

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

6 months ago[WPE] MiniBrowser should handle the WebKitWebView::create signal
zandobersek@gmail.com [Tue, 3 Sep 2019 10:46:45 +0000 (10:46 +0000)]
[WPE] MiniBrowser should handle the WebKitWebView::create signal
https://bugs.webkit.org/show_bug.cgi?id=201417

Reviewed by Carlos Garcia Campos.

WPE's MiniBrowser should connect to and handle the
WebKitWebView::create signal, constructing a new bit related
WebKitWebView object upon invocation.

* MiniBrowser/wpe/main.cpp:
(webViewClose):
(createWebView):
(main):

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

6 months ago[WPE] Make view backends multi-view-friendly
zandobersek@gmail.com [Tue, 3 Sep 2019 10:45:45 +0000 (10:45 +0000)]
[WPE] Make view backends multi-view-friendly
https://bugs.webkit.org/show_bug.cgi?id=201415

Reviewed by Carlos Garcia Campos.

Have the Wayland EGL connection for WindowViewBackend instances managed
through a per-process singleton, allowing multiple backend objects
use it for different views. HeadlessViewBackend already does this, but
the code there is refurbished into a singleton structure.

The ViewBackend classes are adjusted to work with the backend-specific
EGLDisplay objects (as constructed through the backend-specific EGL
connection approach).

* wpe/backends/HeadlessViewBackend.cpp:
(WPEToolingBackends::HeadlessEGLConnection::singleton):
(WPEToolingBackends::HeadlessViewBackend::HeadlessViewBackend):
(WPEToolingBackends::HeadlessViewBackend::~HeadlessViewBackend):
(WPEToolingBackends::HeadlessViewBackend::createSnapshot):
(WPEToolingBackends::getEGLDisplay): Deleted.
* wpe/backends/ViewBackend.cpp:
(WPEToolingBackends::ViewBackend::initialize):
(WPEToolingBackends::ViewBackend::deinitialize):
(WPEToolingBackends::ViewBackend::~ViewBackend): Deleted.
* wpe/backends/ViewBackend.h:
* wpe/backends/WindowViewBackend.cpp:
(WPEToolingBackends::WaylandEGLConnection::singleton):
(WPEToolingBackends::WindowViewBackend::WindowViewBackend):
(WPEToolingBackends::WindowViewBackend::~WindowViewBackend):
(WPEToolingBackends::WindowViewBackend::displayBuffer):

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

6 months ago[WPE][GTK] Deprecate nonfunctional process limit APIs
carlosgc@webkit.org [Tue, 3 Sep 2019 09:57:32 +0000 (09:57 +0000)]
[WPE][GTK] Deprecate nonfunctional process limit APIs
https://bugs.webkit.org/show_bug.cgi?id=193749

Reviewed by Žan Doberšek.

Source/WebKit:

* UIProcess/API/glib/WebKitWebContext.cpp:
(webkitWebContextConstructed):
(webkit_web_context_set_process_model):
(webkit_web_context_get_process_model):
(webkit_web_context_set_web_process_count_limit):
(webkit_web_context_get_web_process_count_limit):
* UIProcess/API/gtk/WebKitWebContext.h:
* UIProcess/API/wpe/WebKitWebContext.h:

Tools:

* MiniBrowser/gtk/main.c:
(main):
* TestWebKitAPI/Tests/WebKitGLib/TestMultiprocess.cpp:
(beforeAll):
(testWebProcessLimit): Deleted.

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

6 months ago[JSC] Remove BytecodeGenerator::emitPopScope
ysuzuki@apple.com [Tue, 3 Sep 2019 07:26:55 +0000 (07:26 +0000)]
[JSC] Remove BytecodeGenerator::emitPopScope
https://bugs.webkit.org/show_bug.cgi?id=201395

Reviewed by Saam Barati.

Use emitGetParentScope. And this patch also removes several unnecessary mov bytecode emissions.

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::popLexicalScopeInternal):
(JSC::BytecodeGenerator::prepareLexicalScopeForNextForLoopIteration):
(JSC::BytecodeGenerator::emitPopWithScope):
(JSC::BytecodeGenerator::emitPopScope): Deleted.
* bytecompiler/BytecodeGenerator.h:

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

6 months ago[WebCore] Resource usage accounting should accept non KERN_SUCCESS
ysuzuki@apple.com [Tue, 3 Sep 2019 05:59:35 +0000 (05:59 +0000)]
[WebCore] Resource usage accounting should accept non KERN_SUCCESS
https://bugs.webkit.org/show_bug.cgi?id=201409

Reviewed by Andreas Kling.

While iterating threads, we are not suspending these threads. Underlying threads can have gone
at any time and we will get non KERN_SUCCESS error code when a thread has gone. We should ignore
these threads.

* page/cocoa/ResourceUsageThreadCocoa.mm:
(WebCore::threadInfos):

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

6 months ago[SVG] fragment-only url 'url(#fragment)' should be resolved against the current docum...
Hironori.Fujii@sony.com [Tue, 3 Sep 2019 01:55:27 +0000 (01:55 +0000)]
[SVG] fragment-only url 'url(#fragment)' should be resolved against the current document with regardless to HTML <base> element
https://bugs.webkit.org/show_bug.cgi?id=189499
<rdar://problem/44466206>

Reviewed by Said Abou-Hallawa.

Source/WebCore:

Fragment-only URL 'url(#fragment)' should be resolved against the
current document even if HTML <base> element is specified.
Spec: <https://drafts.csswg.org/css-values/#local-urls>

Tests: css3/filters/effect-reference-local-url-with-base.html
       css3/masking/clip-path-reference-local-url-with-base.html
       http/tests/svg/local-url-with-valid-base-and-resource.html
       svg/animations/local-url-target-reference.html
       svg/custom/local-url-reference-clip-path.html
       svg/custom/local-url-reference-fill.html
       svg/custom/local-url-reference-filter.html
       svg/custom/local-url-reference-marker.html
       svg/custom/local-url-reference-mask.html
       svg/custom/local-url-reference-pattern.html
       svg/custom/local-url-reference-radial-gradient.html
       svg/custom/local-url-reference-srcdoc.html
       svg/custom/local-url-reference-stroke.html
       svg/custom/local-url-reference-use.html
       svg/text/textpath-local-url-reference.html

* svg/SVGURIReference.cpp:
(WebCore::SVGURIReference::fragmentIdentifierFromIRIString): Return the fragment if the URL starts with '#'.

LayoutTests:

These test cases are imported from Blink's commit, and modified for WebKit.
<https://chromium.googlesource.com/chromium/src/+/e7d7225c33aa7fc42ee390125b01df9167fad106%5E%21/>

* TestExpectations:
* css3/filters/effect-reference-local-url-with-base-expected.html: Added.
* css3/filters/effect-reference-local-url-with-base.html: Added.
* css3/filters/effect-reference.html:
* css3/masking/clip-path-reference-local-url-with-base-expected.html: Added.
* css3/masking/clip-path-reference-local-url-with-base.html: Added.
* http/tests/svg/local-url-with-valid-base-and-resource-expected.html: Added.
* http/tests/svg/local-url-with-valid-base-and-resource.html: Added.
* http/tests/svg/resources/red100x100.svg: Added.
* platform/gtk/TestExpectations: Marked svg/custom/local-url-reference-marker.html as ImageOnlyFailure for Bug 113849.
* platform/wpe/TestExpectations: Ditto.
* svg/animations/local-url-target-reference-expected.html: Added.
* svg/animations/local-url-target-reference.html: Added.
* svg/custom/linking-base-external-reference-expected.txt: Removed. This was a test for old spec.
* svg/custom/linking-base-external-reference.xhtml: Ditto.
* svg/custom/local-url-reference-clip-path-expected.html: Added.
* svg/custom/local-url-reference-clip-path.html: Added.
* svg/custom/local-url-reference-fill-expected.html: Added.
* svg/custom/local-url-reference-fill.html: Added.
* svg/custom/local-url-reference-filter-expected.html: Added.
* svg/custom/local-url-reference-filter.html: Added.
* svg/custom/local-url-reference-marker-expected.html: Added.
* svg/custom/local-url-reference-marker.html: Added.
* svg/custom/local-url-reference-mask-expected.html: Added.
* svg/custom/local-url-reference-mask.html: Added.
* svg/custom/local-url-reference-pattern-expected.html: Added.
* svg/custom/local-url-reference-pattern.html: Added.
* svg/custom/local-url-reference-radial-gradient-expected.html: Added.
* svg/custom/local-url-reference-radial-gradient.html: Added.
* svg/custom/local-url-reference-srcdoc-expected.html: Added.
* svg/custom/local-url-reference-srcdoc.html: Added.
* svg/custom/local-url-reference-stroke-expected.html: Added.
* svg/custom/local-url-reference-stroke.html: Added.
* svg/custom/local-url-reference-use-expected.html: Added.
* svg/custom/local-url-reference-use.html: Added.
* svg/text/textpath-local-url-reference-expected.html: Added.
* svg/text/textpath-local-url-reference.html: Added.

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

6 months ago[Win] Remove a unused PlatformWheelEvent constructor
Hironori.Fujii@sony.com [Tue, 3 Sep 2019 01:53:00 +0000 (01:53 +0000)]
[Win] Remove a unused PlatformWheelEvent constructor
https://bugs.webkit.org/show_bug.cgi?id=201398

Reviewed by Don Olmstead.

No behavior change.

* platform/PlatformWheelEvent.h:
* platform/win/WheelEventWin.cpp:
Removed a unused PlatformWheelEvent constructor.

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

6 months ago[FTW] NativeImagePtr is drawn with invalid scaling
bfulgham@apple.com [Mon, 2 Sep 2019 21:37:06 +0000 (21:37 +0000)]
[FTW] NativeImagePtr is drawn with invalid scaling
https://bugs.webkit.org/show_bug.cgi?id=201391

Reviewed by Don Olmstead.

The current implementation of FTW improperly applies scaling factors to native images,
resulting in blocky images (in some cases).

This patch corrects the handling of native images, corrects a bug in bitmap render
context scaling, and retrieves more data from the ImageDecoder's metadata system.

* platform/graphics/win/Direct2DUtilities.cpp:
(WebCore::Direct2D::createBitmapRenderTargetOfSize): Supply an appropriately sized
pixel dimension for non-unity scale factors.
* platform/graphics/win/ImageBufferDirect2D.cpp:
(WebCore::ImageBuffer::ImageBuffer): Include the scale factor when creating a
bitmap render target.
* platform/graphics/win/ImageDecoderDirect2D.cpp:
(WebCore::ImageDecoderDirect2D::frameOrientationAtIndex const): Read the orientation
data form the image metadata.
(WebCore::ImageDecoderDirect2D::frameAllowSubsamplingAtIndex const): Always return
true, to match the CG implementation.
(WebCore::ImageDecoderDirect2D::frameHasAlphaAtIndex const): Correct to match the
behavior of CG.
* platform/graphics/win/NativeImageDirect2D.cpp:
(WebCore::drawNativeImage): Pass through the Direct2DOperations helper method, which
handles scaling and subsampling properly.

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

6 months agoMake NetworkConnectionToWebProcess keyed by their WebProcess identifier
youenn@apple.com [Mon, 2 Sep 2019 09:31:39 +0000 (09:31 +0000)]
Make NetworkConnectionToWebProcess keyed by their WebProcess identifier
https://bugs.webkit.org/show_bug.cgi?id=201300

Reviewed by Alex Christensen.

Make sure to create each NetworkConnectionToWebProcess for a given WebProcess.
Pass the process identifier at creation time.
This will allow to have the message registry be moved to NetworkProcess
so as to check port activity between processes.
This identifier might also be used in the future for other connections like
service worker context/client/server identifiers.

No observable change of behavior.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::create):
(WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
* NetworkProcess/NetworkConnectionToWebProcess.h:
(WebKit::NetworkConnectionToWebProcess::webProcessIdentifier const):
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::removeNetworkConnectionToWebProcess):
(WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
(WebKit::NetworkProcess::actualPrepareToSuspend):
(WebKit::NetworkProcess::resume):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* Platform/IPC/Connection.h:
(IPC::Connection::sendWithAsyncReply):
Allow to pass send options.
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::NetworkProcessProxy):
(WebKit::NetworkProcessProxy::getNetworkProcessConnection):
Make use of async reply to simplify the handling of lambdas.
(WebKit::NetworkProcessProxy::openNetworkProcessConnection):
(WebKit::NetworkProcessProxy::didFinishLaunching):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:

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

6 months agoIntroduce WorkerMessagePortChannelRegistry
youenn@apple.com [Mon, 2 Sep 2019 09:31:14 +0000 (09:31 +0000)]
Introduce WorkerMessagePortChannelRegistry
https://bugs.webkit.org/show_bug.cgi?id=201333

Reviewed by Alex Christensen.

Source/WebCore:

This patch introduces a dedicated registry for workers.
This registry will hop to the main thread and use the
regular main thread registry to do the actual processing.

Covered by existing tests.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/Document.cpp:
(WebCore::Document::messagePortChannelProvider):
* dom/Document.h:
* dom/MessageChannel.cpp:
(WebCore::MessageChannel::MessageChannel):
* dom/MessagePort.cpp:
(WebCore::MessagePort::entangle):
(WebCore::MessagePort::postMessage):
(WebCore::MessagePort::disentangle):
(WebCore::MessagePort::close):
(WebCore::MessagePort::dispatchMessages):
(WebCore::MessagePort::hasPendingActivity const):
* dom/messageports/MessagePortChannel.cpp:
(WebCore::MessagePortChannel::takeAllMessagesForPort):
(WebCore::MessagePortChannel::checkRemotePortForActivity):
* dom/messageports/MessagePortChannel.h:
* dom/messageports/MessagePortChannelProvider.cpp:
(WebCore::MessagePortChannelProvider::singleton):
(WebCore::MessagePortChannelProvider::fromContext):
* dom/messageports/MessagePortChannelProvider.h:
* dom/messageports/MessagePortChannelProviderImpl.cpp:
(WebCore::MessagePortChannelProviderImpl::takeAllMessagesForPort):
(WebCore::MessagePortChannelProviderImpl::checkRemotePortForActivity):
* dom/messageports/MessagePortChannelProviderImpl.h:
* dom/messageports/MessagePortChannelRegistry.cpp:
(WebCore::MessagePortChannelRegistry::takeAllMessagesForPort):
(WebCore::MessagePortChannelRegistry::checkRemotePortForActivity):
* dom/messageports/MessagePortChannelRegistry.h:
* dom/messageports/WorkerMessagePortChannelProvider.cpp: Added.
(WebCore::WorkerMessagePortChannelProvider::WorkerMessagePortChannelProvider):
(WebCore::WorkerMessagePortChannelProvider::~WorkerMessagePortChannelProvider):
(WebCore::WorkerMessagePortChannelProvider::createNewMessagePortChannel):
(WebCore::WorkerMessagePortChannelProvider::entangleLocalPortInThisProcessToRemote):
(WebCore::WorkerMessagePortChannelProvider::messagePortDisentangled):
(WebCore::WorkerMessagePortChannelProvider::messagePortClosed):
(WebCore::WorkerMessagePortChannelProvider::postMessageToRemote):
(WebCore::WorkerMessagePortChannelProvider::takeAllMessagesForPort):
(WebCore::WorkerMessagePortChannelProvider::checkRemotePortForActivity):
(WebCore::WorkerMessagePortChannelProvider::checkProcessLocalPortForActivity):
* dom/messageports/WorkerMessagePortChannelProvider.h: Added.
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::messagePortChannelProvider):
* workers/WorkerGlobalScope.h:

Source/WebKit:

By introducing WorkerMessagePortChannelRegistry, we are making
sure UIMessagePortChannelProvider is only called from the main thread.
This will help when moving the registry to network process.

* UIProcess/UIMessagePortChannelProvider.cpp:
(WebKit::UIMessagePortChannelProvider::takeAllMessagesForPort):
(WebKit::UIMessagePortChannelProvider::checkRemotePortForActivity):
* UIProcess/UIMessagePortChannelProvider.h:
* WebProcess/WebCoreSupport/WebMessagePortChannelProvider.cpp:
(WebKit::WebMessagePortChannelProvider::takeAllMessagesForPort):
(WebKit::WebMessagePortChannelProvider::didTakeAllMessagesForPort):
(WebKit::WebMessagePortChannelProvider::didCheckRemotePortForActivity):
(WebKit::WebMessagePortChannelProvider::checkRemotePortForActivity):
* WebProcess/WebCoreSupport/WebMessagePortChannelProvider.h:

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

6 months ago[WPE] WindowBackend should do resizing properly
zandobersek@gmail.com [Mon, 2 Sep 2019 08:52:15 +0000 (08:52 +0000)]
[WPE] WindowBackend should do resizing properly
https://bugs.webkit.org/show_bug.cgi?id=201386

Reviewed by Carlos Garcia Campos.

The WindowBackend implementation is resized via the XDG protocol. The
initial size is stored for the object's lifetime and fallen back to when
the XDG protocol reports (0,0) configuration size.

Upon each resize, we have to recreate the texture. We also have to size
the GL viewport accordingly.

* wpe/backends/WindowViewBackend.cpp:
(WPEToolingBackends::WindowViewBackend::WindowViewBackend):
(WPEToolingBackends::WindowViewBackend::createViewTexture):
(WPEToolingBackends::WindowViewBackend::resize):
(WPEToolingBackends::WindowViewBackend::displayBuffer):
* wpe/backends/WindowViewBackend.h:

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

6 months agoAbstract out LibWebRTCSocketClient so that rtc sockets can be implemented without...
youenn@apple.com [Mon, 2 Sep 2019 06:20:18 +0000 (06:20 +0000)]
Abstract out LibWebRTCSocketClient so that rtc sockets can be implemented without libwebrtc sockets
https://bugs.webkit.org/show_bug.cgi?id=201302

Reviewed by Alex Christensen.

Introduce NetworkRTCProvider::Socket to be able to implement RTC socket support with non libwebrtc API

* NetworkProcess/webrtc/LibWebRTCSocketClient.h:
* NetworkProcess/webrtc/NetworkRTCProvider.cpp:
(WebKit::NetworkRTCProvider::createSocket):
(WebKit::NetworkRTCProvider::createUDPSocket):
(WebKit::NetworkRTCProvider::createServerTCPSocket):
(WebKit::NetworkRTCProvider::proxyInfoFromSession):
(WebKit::NetworkRTCProvider::createClientTCPSocket):
(WebKit::NetworkRTCProvider::wrapNewTCPConnection):
(WebKit::NetworkRTCProvider::addSocket):
(WebKit::NetworkRTCProvider::takeSocket):
(WebKit::NetworkRTCProvider::newConnection):
(WebKit::NetworkRTCProvider::closeListeningSockets):
(WebKit::NetworkRTCProvider::callSocket):
* NetworkProcess/webrtc/NetworkRTCProvider.h:
* NetworkProcess/webrtc/NetworkRTCProvider.mm:
(WebKit::NetworkRTCProvider::createClientTCPSocket):
* NetworkProcess/webrtc/NetworkRTCSocket.cpp:
(WebKit::NetworkRTCSocket::sendTo):
(WebKit::NetworkRTCSocket::close):
(WebKit::NetworkRTCSocket::setOption):

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

6 months ago[Cairo] out-of-bounds read in ShareableBitmap::paint if a fractional device scale...
Hironori.Fujii@sony.com [Mon, 2 Sep 2019 06:03:07 +0000 (06:03 +0000)]
[Cairo] out-of-bounds read in ShareableBitmap::paint if a fractional device scale factor is used
https://bugs.webkit.org/show_bug.cgi?id=196340

Reviewed by Brent Fulgham.

In ShareableBitmap::paint, srcRectScaled can be out-of-bounds of
the surface if a fractional device scale factor is used.

* Shared/cairo/ShareableBitmapCairo.cpp:
(WebKit::ShareableBitmap::paint): Use cairoSurfaceSetDeviceScale
to set a device scale factor to the surface instead of multiplying
srcRect with a device scale factor.

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

6 months ago[WHLSL] Resources don't work when only a subset of a bind group is referenced by...
mmaxfield@apple.com [Mon, 2 Sep 2019 05:23:51 +0000 (05:23 +0000)]
[WHLSL] Resources don't work when only a subset of a bind group is referenced by a shader
https://bugs.webkit.org/show_bug.cgi?id=201383

Reviewed by Dean Jackson.

Source/WebCore:

Bind groups correspond to argument buffers in Metal. Both the Metal API and Metal Shading Language
have to agree on the layout of exactly which resources lie at which byte offsets within an argument
buffer.

Before this patch, we only emitted code for the items in the argument buffer that were actually
referenced by the shader source code. However, because these items are held inside a struct, if
we omit one item from the middle of the struct, the byte offets of all the successive items would
be wrong. This means that the Metal API and the shader would disagree about how to access these
resources, making the resources inaccessible (and causing security problems).

Tests: webgpu/whlsl/sparse-bind-group-2.html
       webgpu/whlsl/sparse-bind-group-3.html
       webgpu/whlsl/sparse-bind-group.html

* Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
(WebCore::WHLSL::Metal::EntryPointScaffolding::emitResourceHelperTypes):
(WebCore::WHLSL::Metal::VertexEntryPointScaffolding::emitHelperTypes):
(WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::emitHelperTypes):
(WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::emitHelperTypes):
* Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h:
* Modules/webgpu/WHLSL/WHLSLSemanticMatcher.cpp:
(WebCore::WHLSL::matchResources):
(WebCore::WHLSL::matchVertexAttributes):
(WebCore::WHLSL::matchColorAttachments):

LayoutTests:

* webgpu/whlsl/compute.html:
* webgpu/whlsl/sparse-bind-group-2-expected.txt: Added.
* webgpu/whlsl/sparse-bind-group-2.html: Added.
* webgpu/whlsl/sparse-bind-group-3-expected.txt: Added.
* webgpu/whlsl/sparse-bind-group-3.html: Added.
* webgpu/whlsl/sparse-bind-group-expected.txt: Added.
* webgpu/whlsl/sparse-bind-group.html: Added.

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

6 months agoUnreviewed, rolling out r249369.
commit-queue@webkit.org [Mon, 2 Sep 2019 04:38:38 +0000 (04:38 +0000)]
Unreviewed, rolling out r249369.
https://bugs.webkit.org/show_bug.cgi?id=201394

broke WHLSL tests (Requested by litherum on #webkit).

Reverted changeset:

"[WHLSL] Resources don't work when only a subset of a bind
group is referenced by a shader"
https://bugs.webkit.org/show_bug.cgi?id=201383
https://trac.webkit.org/changeset/249369

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

6 months ago[JSC] Merge op_check_traps into op_enter and op_loop_hint
ysuzuki@apple.com [Mon, 2 Sep 2019 03:44:32 +0000 (03:44 +0000)]
[JSC] Merge op_check_traps into op_enter and op_loop_hint
https://bugs.webkit.org/show_bug.cgi?id=201373

Reviewed by Mark Lam.

This patch removes op_check_traps. Previously we were conditionally emitting op_check_traps based on Options and Platform configurations.
But now we are always emitting op_check_traps. So it is not necessary to have separate bytecode as op_check_traps. We can do checking in
op_enter and op_loop_hint.

While this patch moves check_traps implementation to op_enter and op_loop_hint, we keep separate DFG nodes (CheckTraps or InvalidationPoint),
since inserted nodes are different based on configurations and options. And emitting multiple DFG nodes from one bytecode is easy.

We also inline op_enter's slow path's write-barrier emission in LLInt.

* bytecode/BytecodeList.rb:
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::emitLoopHint):
(JSC::BytecodeGenerator::emitCheckTraps): Deleted.
* bytecompiler/BytecodeGenerator.h:
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleRecursiveTailCall):
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel):
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
(JSC::JIT::privateCompileSlowCases):
(JSC::JIT::emitEnterOptimizationCheck): Deleted.
* jit/JIT.h:
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_loop_hint):
(JSC::JIT::emitSlow_op_loop_hint):
(JSC::JIT::emit_op_enter):
(JSC::JIT::emitSlow_op_enter):
(JSC::JIT::emit_op_check_traps): Deleted.
(JSC::JIT::emitSlow_op_check_traps): Deleted.
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_enter): Deleted.
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/CommonSlowPaths.cpp:
* runtime/CommonSlowPaths.h:

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

6 months agoUnreviewed, rolling out r249366.
Hironori.Fujii@sony.com [Mon, 2 Sep 2019 02:11:25 +0000 (02:11 +0000)]
Unreviewed, rolling out r249366.

WinCairo WebKit2 crashes in some websites and the device scale
factor is not correct in high DPI.

Reverted changeset:

"[WinCairo, FTW] Properly handle device scale factor"
https://bugs.webkit.org/show_bug.cgi?id=201361
https://trac.webkit.org/changeset/249366

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

6 months ago[JSC] Fix testb3 debug failures
ysuzuki@apple.com [Sun, 1 Sep 2019 23:35:51 +0000 (23:35 +0000)]
[JSC] Fix testb3 debug failures
https://bugs.webkit.org/show_bug.cgi?id=201382

Reviewed by Mark Lam.

Fix testb3 debug failures due to incorrect types of operations like pointer + int32.

* b3/testb3_8.cpp:
(testByteCopyLoop):
(testByteCopyLoopStartIsLoopDependent):
(testByteCopyLoopBoundIsLoopDependent):

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

6 months ago[WHLSL] Resources don't work when only a subset of a bind group is referenced by...
mmaxfield@apple.com [Sun, 1 Sep 2019 23:08:38 +0000 (23:08 +0000)]
[WHLSL] Resources don't work when only a subset of a bind group is referenced by a shader
https://bugs.webkit.org/show_bug.cgi?id=201383

Reviewed by Dean Jackson.

Source/WebCore:

Bind groups correspond to argument buffers in Metal. Both the Metal API and Metal Shading Language
have to agree on the layout of exactly which resources lie at which byte offsets within an argument
buffer.

Before this patch, we only emitted code for the items in the argument buffer that were actually
referenced by the shader source code. However, because these items are held inside a struct, if
we omit one item from the middle of the struct, the byte offets of all the successive items would
be wrong. This means that the Metal API and the shader would disagree about how to access these
resources, making the resources inaccessible (and causing security problems).

Tests: webgpu/whlsl/sparse-bind-group-2.html
       webgpu/whlsl/sparse-bind-group-3.html
       webgpu/whlsl/sparse-bind-group.html

* Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
(WebCore::WHLSL::Metal::EntryPointScaffolding::emitResourceHelperTypes):
(WebCore::WHLSL::Metal::VertexEntryPointScaffolding::emitHelperTypes):
(WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::emitHelperTypes):
(WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::emitHelperTypes):
* Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h:
* Modules/webgpu/WHLSL/WHLSLSemanticMatcher.cpp:
(WebCore::WHLSL::matchResources):
(WebCore::WHLSL::matchVertexAttributes):
(WebCore::WHLSL::matchColorAttachments):

LayoutTests:

* webgpu/whlsl/compute.html:
* webgpu/whlsl/sparse-bind-group-2-expected.txt: Added.
* webgpu/whlsl/sparse-bind-group-2.html: Added.
* webgpu/whlsl/sparse-bind-group-3-expected.txt: Added.
* webgpu/whlsl/sparse-bind-group-3.html: Added.
* webgpu/whlsl/sparse-bind-group-expected.txt: Added.
* webgpu/whlsl/sparse-bind-group.html: Added.

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

6 months agoLong presses that interrupt accelerated scrolling dispatch clicks on apps linked...
wenson_hsieh@apple.com [Sun, 1 Sep 2019 20:42:36 +0000 (20:42 +0000)]
Long presses that interrupt accelerated scrolling dispatch clicks on apps linked against iOS 12 or earlier
https://bugs.webkit.org/show_bug.cgi?id=201346
<rdar://problem/54885784>

Reviewed by Dean Jackson.

Source/WebKit:

For apps that are linked on or after iOS 13, we add a context menu interaction to the content view, which
requires us to disable (or avoid adding) the highlight long press gesture recognizer. However, for apps that are
linked on the iOS 12 SDK or prior, this gesture is still present, and fires when long pressing for (roughly) up
to 0.75 seconds if a tap gesture was not recognized instead. Firing this gesture sends a click event to the
page; this brings back some form of <rdar://problem/53889373>, but only when holding for slightly longer than a
normal tap, and also only in apps linked on iOS 12 or earlier. To fix this, we apply a similar solution as in
r248433 and detect whether a long press gesture interrupted scroll view deceleration in
-gestureRecognizerShouldBegin:. If so, we return NO to avoid clicking. See per-method comments below for more
details.

Testing this bug as-is was tricky, since there's no way in layout tests to simulate being linked on or before a
given SDK version. Luckily, recall that:
1. This bug occurs when the highlight gesture recognizer is enabled and added to the content view.
2. The highlight gesture recognizer only needs to be disabled or removed when context menu interaction is added.
As such, we should be able to restore the highlight gesture recognizer by suppressing the context menu
interaction in an app linked-on-or-after iOS 13, by setting allowsLinkPreview to NO. Unfortunately, this doesn't
quite work, since we currently always avoid adding the highlight gesture recognizer if the app is linked on
iOS 13 or later.

However, this means that the highlight gesture recognizer is absent from the content view in apps linked against
iOS 13 that disable link previews, even though its absence is not required. This means that long pressing a
clickable element in a web view that disables link previews does not show a tap highlight on iOS 13, whereas it
would on iOS 12; this is a regression, albeit a very subtle one. To fix this subtle issue and make it possible
to write a test for this bug, we refactor some logic for creating and configuring the highlight long press
gesture, such that we now unconditionally add the highlight gesture, but only enable it in apps linked on or
after iOS 13 if link previews (i.e. context menu interaction) are not allowed.

Test: fast/scrolling/ios/click-events-after-long-press-during-momentum-scroll-in-overflow.html

* SourcesCocoa.txt:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView setAllowsLinkPreview:]):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):

Refactor our gesture setup logic to always create and add the long press and highlight long press gestures, but
conditionally disable them based on whether or not (1) the context menu is available, and (2) WKWebView's
allowsLinkPreview property.

(-[WKContentView _didChangeLinkPreviewAvailability]):
(-[WKContentView _updateLongPressAndHighlightLongPressGestures]):

Add a new helper to update the enabled state of the long press and highlight long press gestures, by consulting
-_shouldUseContextMenu and -allowsLinkPreview. This is called when setting up the gestures, as well as whenever
-allowsLinkPreview changes.

(-[WKContentView gestureRecognizerShouldBegin:]):

Factor out logic to ascend the view hierarchy in search of a UIScrollView that was interrupted while
decelerating into a local lambda function; use this for both the highlight gesture and the single tap gesture,
to determine whether they should begin.

* UIProcess/ios/WKHighlightLongPressGestureRecognizer.h: Added.
* UIProcess/ios/WKHighlightLongPressGestureRecognizer.mm: Added.

In order to remember the UIScrollView (if any) tracked by the highlight long press gesture, we subclass
_UIWebHighlightLongPressGestureRecognizer. While UILongPressGestureRecognizer does have SPI to ask for a list of
UITouches, by the time the gesture has been recognized and the gesture delegates are invoked, these UITouches
no longer correspond to UIViews. As such, the only time we have access to the list of UITouches with their
UIViews is during the touches* subclass hooks.

(-[WKHighlightLongPressGestureRecognizer reset]):

Clear out the tracked UIScrollView here, when the gesture is reset (i.e. after ending, or being canceled).

(-[WKHighlightLongPressGestureRecognizer touchesBegan:withEvent:]):

Remember the last touched UIScrollView here.

(-[WKHighlightLongPressGestureRecognizer lastTouchedScrollView]):
* WebKit.xcodeproj/project.pbxproj:

Tools:

Add a new test option to allow tests to disable link previews.

* WebKitTestRunner/TestController.cpp:
(WTR::updateTestOptionsFromTestHeader):
* WebKitTestRunner/TestOptions.h:

Drive-by fix: also check enableLazyImageLoading when determining whether two TestOptions are the same.

(WTR::TestOptions::hasSameInitializationOptions const):
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::platformCreateWebView):

LayoutTests:

Add a couple of new layout tests to verify that using a long press gesture to interrupt momentum scrolling in a
web view that uses API to disable link previews does not result in a click.

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

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

6 months agoHTMLImageElement::decode() should return a resolved promise for decoding non bitmap...
commit-queue@webkit.org [Sun, 1 Sep 2019 18:28:35 +0000 (18:28 +0000)]
HTMLImageElement::decode() should return a resolved promise for decoding non bitmap images
https://bugs.webkit.org/show_bug.cgi?id=201243

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-09-01
Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/decode/image-decode-picture-expected.txt:

Source/WebCore:

The specs: https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-decode
states that, decode() should resolve the pending promise if the decoding
was requested for a non bitmap image.

Test: fast/images/decode-non-bitmap-image-resolve.html

* loader/ImageLoader.cpp:
(WebCore::resolveDecodePromises):
(WebCore::rejectDecodePromises):
(WebCore::ImageLoader::notifyFinished):
(WebCore::ImageLoader::decode):
(WebCore::ImageLoader::decodeError): Deleted.
* loader/ImageLoader.h:
(WebCore::ImageLoader::hasPendingDecodePromises const):

LayoutTests:

* fast/images/decode-non-bitmap-image-resolve-expected.txt: Added.
* fast/images/decode-non-bitmap-image-resolve.html: Added.
* fast/images/resources/green-100x100.svg: Added.

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

6 months ago[WinCairo, FTW] Properly handle device scale factor
bfulgham@apple.com [Sun, 1 Sep 2019 18:13:03 +0000 (18:13 +0000)]
[WinCairo, FTW] Properly handle device scale factor
https://bugs.webkit.org/show_bug.cgi?id=201361

Reviewed by Don Olmstead.

Source/WebCore:

Update the Direct2D ImageBuffer/ImageBufferData classes to correctly handle
the device scale factor.

* platform/graphics/win/ImageBufferDataDirect2D.cpp:
(WebCore::ImageBufferData::putData):
* platform/graphics/win/ImageBufferDirect2D.cpp:
(WebCore::ImageBuffer::putByteArray):

Source/WebKit:

Update the WebView and WebProcess to correctly handle
the device scale factor.

* UIProcess/win/WebView.cpp:
(WebKit::WebView::WebView): Tell the page the current device scale factor.
* WebProcess/win/WebProcessMainWin.cpp:
(WebKit::WebProcessMainWin): Tell the process to be aware of device scale.

Tools:

Reset zoom to 1.0; device scale is handled elsewhere.

* MiniBrowser/win/WebKitBrowserWindow.cpp:
(WebKitBrowserWindow::resetZoom):

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

6 months agoSpeculative build fix for ARMv7 and MIPS.
mark.lam@apple.com [Sun, 1 Sep 2019 16:31:51 +0000 (16:31 +0000)]
Speculative build fix for ARMv7 and MIPS.
https://bugs.webkit.org/show_bug.cgi?id=201389

Not reviewed.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::jettison):

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

6 months agoSource/WebCore:
commit-queue@webkit.org [Sun, 1 Sep 2019 00:47:39 +0000 (00:47 +0000)]
Source/WebCore:
EXIF orientation should be respected when rendering images
https://bugs.webkit.org/show_bug.cgi?id=201123

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

-- Image::size() will return the rendered size based on the image
   orientation. If image orientation is FromImage, ImageSource will query
   the actual image orientation from the ImageDecoder. The low level APIs
   might transpose the size just before calling the system API to draw
   the image.

-- RenderElement::imageOrientation() will return ImageOrientation::FromImage
   for all images and for all ports till the CSS image-orientation specs
   is finalized.

-- The default of ImagePaintingOptions argument of GraphicsContext::drawImage()
   will be changed to { ImageOrientation::FromImage }.

-- Image element: RenderImage::paintIntoRect() will pass imageOrientation()
   which returns ImageOrientation::FromImage to GraphicsContext::drawImage().

-- CSS background image: RenderBoxModelObject::paintFillLayerExtended will
   pass ImageOrientation::FromImage by default to GraphicsContext::drawTiledImage().

-- Images on canvas: CanvasRenderingContext2DBase::drawImage() will pass
   ImageOrientation::FromImage by default to GraphicsContext::drawImage().

-- SVG images: RenderSVGImage::paintForeground() calls GraphicsContext::drawImage()
   with the default ImagePaintingOptions which is now { ImageOrientation::FromImage }.

-- SVG feImage filters: FEImage::platformApplySoftware() calls
   GraphicsContext::drawImage() with the default ImagePaintingOptions
   which is now { ImageOrientation::FromImage }.

-- ImageDocument: RenderElement::imageOrientation() returns FromImage
   always and for all ports.

Tests: fast/images/exif-orientation-background.html
       fast/images/exif-orientation-canvas.html
       fast/images/exif-orientation-content.html
       fast/images/exif-orientation-element-object-fit.html
       fast/images/exif-orientation-element.html
       fast/images/exif-orientation-image-object.html
       fast/images/exif-orientation-svg-feimage.html
       fast/images/exif-orientation-svg-image.html

* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::drawImage):
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::imageSizeForRenderer const):
* platform/graphics/BitmapImage.h:
* platform/graphics/CrossfadeGeneratedImage.h:
* platform/graphics/GeneratedImage.h:
* platform/graphics/GraphicsContext.h:
(WebCore::GraphicsContext::drawImage):
* platform/graphics/Image.h:
* platform/graphics/ImageFrame.h:
(WebCore::ImageFrame::sizeRespectingOrientation const): Deleted.
* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::ImageSource):
(WebCore::ImageSource::orientation):
(WebCore::ImageSource::size):
(WebCore::ImageSource::sizeRespectingOrientation): Deleted.
* platform/graphics/ImageSource.h:
* platform/graphics/cg/PDFDocumentImage.cpp:
(WebCore::PDFDocumentImage::size const):
* platform/graphics/cg/PDFDocumentImage.h:
* platform/mac/DragImageMac.mm:
(WebCore::createDragImageFromImage):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::imageOrientation const):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintIntoRect):
* svg/graphics/SVGImage.h:
* svg/graphics/SVGImageForContainer.cpp:
(WebCore::SVGImageForContainer::size const):
* svg/graphics/SVGImageForContainer.h:

LayoutTests:
EXIF orientation should be respected when rendering images
https://bugs.webkit.org/show_bug.cgi?id=201123

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

Existing tests are made ref-tests. New tests were added to cover more
cases for drawing images.

* fast/images/exif-orientation-background-expected.html: Added.
* fast/images/exif-orientation-background.html: Added.
* fast/images/exif-orientation-canvas-expected.html: Added.
* fast/images/exif-orientation-canvas.html: Added.
* fast/images/exif-orientation-composited-expected.html: Added.
* fast/images/exif-orientation-composited-expected.txt: Removed.
* fast/images/exif-orientation-composited.html:
* fast/images/exif-orientation-content-expected.html: Added.
* fast/images/exif-orientation-content.html: Added.
* fast/images/exif-orientation-css-expected.txt: Removed.
* fast/images/exif-orientation-css.html: Removed.
* fast/images/exif-orientation-element-expected.html: Added.
* fast/images/exif-orientation-element-object-fit-expected.html: Added.
* fast/images/exif-orientation-element-object-fit.html: Added.
* fast/images/exif-orientation-element.html: Added.
* fast/images/exif-orientation-expected.txt: Removed.
* fast/images/exif-orientation-image-document-expected.html: Added.
* fast/images/exif-orientation-image-document-expected.txt: Removed.
* fast/images/exif-orientation-image-document.html:
* fast/images/exif-orientation-image-object-expected.html: Added.
* fast/images/exif-orientation-image-object.html: Added.
* fast/images/exif-orientation-svg-feimage-expected.html: Added.
* fast/images/exif-orientation-svg-feimage.html: Added.
* fast/images/exif-orientation-svg-image-expected.html: Added.
* fast/images/exif-orientation-svg-image.html: Added.
* fast/images/exif-orientation.html: Removed.
* platform/gtk/TestExpectations:
* platform/mac/fast/images/exif-orientation-composited-expected.png: Removed.
* platform/win/TestExpectations:

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

6 months ago[iOS] Add a test to ensure that a tap in editable content shows the callout bar if...
wenson_hsieh@apple.com [Sat, 31 Aug 2019 23:02:29 +0000 (23:02 +0000)]
[iOS] Add a test to ensure that a tap in editable content shows the callout bar if the selection did not change
https://bugs.webkit.org/show_bug.cgi?id=200082

Reviewed by Dean Jackson.

Adds a layout test to cover the UIKit change in <rdar://problem/53106460>.

* editing/selection/ios/show-callout-bar-after-tap-expected.txt: Added.
* editing/selection/ios/show-callout-bar-after-tap.html: Added.

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

6 months ago[JSC] LLInt op should not emit the same code three times
ysuzuki@apple.com [Sat, 31 Aug 2019 11:31:33 +0000 (11:31 +0000)]
[JSC] LLInt op should not emit the same code three times
https://bugs.webkit.org/show_bug.cgi?id=201370

Reviewed by Mark Lam.

LLInt op macro (not llintOp macro) is used to generate some stub code like llint_program_prologue.
But now it generates the same code three times for narrow, wide16, and wide32. We should emit code only once.

* llint/LowLevelInterpreter.asm:

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

6 months agoXMLHttpRequest: responseXML returns null if the Content-Type is valid (end in +xml...
commit-queue@webkit.org [Sat, 31 Aug 2019 10:16:40 +0000 (10:16 +0000)]
XMLHttpRequest: responseXML returns null if the Content-Type is valid (end in +xml) in some cases
https://bugs.webkit.org/show_bug.cgi?id=46146

Patch by Rob Buis <rbuis@igalia.com> on 2019-08-31
Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Updated expected result.

* web-platform-tests/xhr/responsexml-media-type-expected.txt:

Source/WebCore:

Make response MIME type fallback to text/xml in case mimeType could
not be extracted [1] and use the stricter ParsedContentType for that.

Behavior matches Firefox.

Test: web-platform-tests/xhr/responsexml-media-type.htm

[1] https://xhr.spec.whatwg.org/#response-mime-type

* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::responseMIMEType const):

LayoutTests:

Adjust test to match the specification: make response MIME type fallback to
text/xml in case mimeType could not be extracted.

Behavior matches Firefox.

* http/tests/xmlhttprequest/supported-xml-content-types-expected.txt:
* http/tests/xmlhttprequest/supported-xml-content-types.html:

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

6 months agoFix interpretation of fraction shifts
commit-queue@webkit.org [Sat, 31 Aug 2019 09:05:05 +0000 (09:05 +0000)]
Fix interpretation of fraction shifts
https://bugs.webkit.org/show_bug.cgi?id=201242

Patch by Frederic Wang <fwang@igalia.com> on 2019-08-31
Reviewed by Rob Buis.

LayoutTests/imported/w3c:

Update tests and support files for fractions/stacks parameters.

* web-platform-tests/mathml/presentation-markup/fractions/frac-parameters-2-expected.txt:
Update expectation now that AxisHeight is no longer involved in stacks.
* web-platform-tests/fonts/math/fraction-denominatordisplaystyleshiftdown6000-axisheight1000-rulethickness1000.woff: Added.
* web-platform-tests/fonts/math/fraction-denominatorshiftdown3000-axisheight1000-rulethickness1000.woff: Added.
* web-platform-tests/fonts/math/fraction-numeratordisplaystyleshiftup2000-axisheight1000-rulethickness1000.woff: Added.
* web-platform-tests/fonts/math/fraction-numeratorshiftup11000-axisheight1000-rulethickness1000.woff: Added.
* web-platform-tests/fonts/math/stack-bottomdisplaystyleshiftdown5000-axisheight1000.woff: Added.
* web-platform-tests/fonts/math/stack-bottomshiftdown6000-axisheight1000.woff: Added.
* web-platform-tests/fonts/math/stack-topdisplaystyleshiftup3000-axisheight1000.woff: Added.
* web-platform-tests/fonts/math/stack-topshiftup9000-axisheight1000.woff: Added.
* web-platform-tests/mathml/presentation-markup/fractions/frac-parameters-1.html:
* web-platform-tests/mathml/presentation-markup/fractions/frac-parameters-2.html:
* web-platform-tests/mathml/support/feature-detection.js: Added.
(MathMLFeatureDetection.has_mspace):
(MathMLFeatureDetection.has_operator_spacing):
(MathMLFeatureDetection.has_mfrac):
(MathMLFeatureDetection.has_msqrt):
(MathMLFeatureDetection.has_menclose):
(MathMLFeatureDetection.has_dir):
(MathMLFeatureDetection.ensure_for_match_reftest):

Source/WebCore:

In fractions, numerator/denominator shifts are currently interpreted relative to the math
axis while they should be relative to the baseline [1]. This patch refactors the
RenderMathMLFraction to do that and aligns more on MathML Core [2] [3]. This fixes serious
rendering bugs in fractions.

[1] https://github.com/mathml-refresh/mathml/issues/123
[2] https://mathml-refresh.github.io/mathml-core/#fraction-with-nonzero-line-thickness
[3] https://mathml-refresh.github.io/mathml-core/#fraction-with-zero-line-thickness

No new tests, existing tests updated.

* rendering/mathml/RenderMathMLFraction.h: ascentOverHorizontalAxis() is replaced with
fractionAscent() which gives the actual baseline position rather than the math axis position.
fractionParameters() and stackParameters() are modified so that they only return the shifts,
now stored in a shared FractionParameters struct.
* rendering/mathml/RenderMathMLFraction.cpp:
(WebCore::RenderMathMLFraction::fractionParameters const): Store existing parameters in local
variables and perform adjustments to the shift values so that the minimal gap constraints
are satisfied. Return them as a FractionParameters.
(WebCore::RenderMathMLFraction::stackParameters const): Ditto.
(WebCore::RenderMathMLFraction::fractionAscent const): This calculates the ascent above
the baseline as described in [2] [3] and replaces ascentOverHorizontalAxis. To minimize
changeset, this continues to ignore contribution of denominator size and not to distinguish
ink or non-ink metrics.
(WebCore::RenderMathMLFraction::layoutBlock): The position of the denominator is now just
calculated as a shift from the baseline. The height is given by the bottom of the
denominator. The old "ascent + mathAxisHeight() + denominatorDescent" does not make any
sense.
(WebCore::RenderMathMLFraction::paint): Use fractionAscent() instead of
ascentOverHorizontalAxis().
(WebCore::RenderMathMLFraction::firstLineBaseline const): Ditto.

LayoutTests:

* TestExpectations: Skip mathml/presentation/stretchy-depth-height-symmetric.html since it
cannot work in a reliable way and should be rewritten. Equivalent checks seem essentially
covered by WPT test mathml/presentation-markup/operators/mo-axis-height-1.html.
See bug 201356.
* platform/win/mathml/presentation/roots-expected.txt: Update windows expectation.

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

6 months agoDocumentStorageAccess::hasStorageAccess() / requestStorageAccess() don't need to...
cdumez@apple.com [Sat, 31 Aug 2019 07:52:19 +0000 (07:52 +0000)]
DocumentStorageAccess::hasStorageAccess() / requestStorageAccess() don't need to know about pageID / frameID
https://bugs.webkit.org/show_bug.cgi?id=201364

Reviewed by John Wilander.

Source/WebCore:

DocumentStorageAccess::hasStorageAccess() / requestStorageAccess() don't need to know about pageID / frameID. pageID is
redundant since it is being ignored by the callee. For the frame, simply pass the frame object in.

* dom/DocumentStorageAccess.cpp:
(WebCore::DocumentStorageAccess::hasStorageAccess):
(WebCore::DocumentStorageAccess::requestStorageAccess):
* page/ChromeClient.h:
(WebCore::ChromeClient::hasStorageAccess):
(WebCore::ChromeClient::requestStorageAccess):

Source/WebKit:

* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::hasStorageAccess):
(WebKit::WebChromeClient::requestStorageAccess):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::hasStorageAccess):
(WebKit::WebPage::requestStorageAccess):
* WebProcess/WebPage/WebPage.h:

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

6 months ago[results.webkit.org Timeline] Add notify rerender API for timeline
zhifei_fang@apple.com [Sat, 31 Aug 2019 04:11:21 +0000 (04:11 +0000)]
[results.webkit.org Timeline] Add notify rerender API for timeline
https://bugs.webkit.org/show_bug.cgi?id=201363

Reviewed by Jonathan Bedard.

* resultsdbpy/resultsdbpy/view/static/js/timeline.js: Export notifyRerender API to timeline class
* resultsdbpy/resultsdbpy/view/static/library/js/components/TimelineComponents.js:
(XScrollableCanvasProvider): Add an event stream to receive notification that it will need to render
(prototype.ExpandableSeriesComponent): Notify the rerender when expanded, because this may change the layout.
(prototype.Timeline.CanvasContainer):

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

6 months ago[LFC] Transition from Geometry(formattingContext()) to formattingContext().quirks()
zalan@apple.com [Sat, 31 Aug 2019 04:03:54 +0000 (04:03 +0000)]
[LFC] Transition from Geometry(formattingContext()) to formattingContext().quirks()
https://bugs.webkit.org/show_bug.cgi?id=201372
<rdar://problem/54905514>

Reviewed by Antti Koivisto.

* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::computedHeightValue const):
* layout/FormattingContextQuirks.cpp:
(WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
* layout/blockformatting/BlockFormattingContextQuirks.cpp:
(WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::InlineFormattingContext::InlineLayout::layout const):
(WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
(WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const):
* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::close):

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

6 months ago[LFC] Proxy LayoutState::displayBoxForLayoutBox() calls through FormattingContext
zalan@apple.com [Sat, 31 Aug 2019 02:37:55 +0000 (02:37 +0000)]
[LFC] Proxy LayoutState::displayBoxForLayoutBox() calls through FormattingContext
https://bugs.webkit.org/show_bug.cgi?id=201365
<rdar://problem/54900815>

Reviewed by Antti Koivisto.

This patch is in preparation for enforcing displayBoxForLayoutBox() calls to stay within the current formatting context.
(There are a few odd cases left (floats and coordinate mapping) and they are going to be addressed in a separate patch.)

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry):
(WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry):
(WebCore::Layout::FormattingContext::computeBorderAndPadding):
(WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
* layout/FormattingContext.h:
(WebCore::Layout::FormattingContext::displayBoxForLayoutBox const):
(WebCore::Layout::FormattingContext::hasDisplayBox const):
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::computedHeightValue const):
(WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const):
(WebCore::Layout::FormattingContext::Geometry::staticVerticalPositionForOutOfFlowPositioned const):
(WebCore::Layout::FormattingContext::Geometry::staticHorizontalPositionForOutOfFlowPositioned const):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry const):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry const):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry const):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin const):
(WebCore::Layout::FormattingContext::Geometry::inFlowPositionedPositionOffset const):
* layout/FormattingContextQuirks.cpp:
(WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::usedAvailableWidthForFloatAvoider const):
(WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren):
(WebCore::Layout::BlockFormattingContext::computeStaticVerticalPosition):
(WebCore::Layout::BlockFormattingContext::computeStaticHorizontalPosition):
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition):
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFloatClear):
(WebCore::Layout::BlockFormattingContext::computeFloatingPosition):
(WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats):
(WebCore::Layout::BlockFormattingContext::computeWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::verticalPositionWithMargin const):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin const):
(WebCore::Layout::BlockFormattingContext::Geometry::staticVerticalPosition const):
(WebCore::Layout::BlockFormattingContext::Geometry::staticHorizontalPosition const):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
* layout/blockformatting/BlockFormattingContextQuirks.cpp:
(WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::hasClearance):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore const):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter const):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore const):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance const):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter const):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::updateMarginAfterForPreviousSibling const):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::updatePositiveNegativeMarginValues):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout):
(WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
(WebCore::Layout::InlineFormattingContext::initializeMarginBorderAndPaddingForGenericInlineBox):
(WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPaddingForInlineContainer):
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot):
(WebCore::Layout::InlineFormattingContext::computeHorizontalMargin):
(WebCore::Layout::InlineFormattingContext::computeWidthAndMargin):
(WebCore::Layout::InlineFormattingContext::computeHeightAndMargin):
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot):
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin const):
* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::inlineItemWidth):
(WebCore::Layout::LineLayout::formattingContext const):
(WebCore::Layout::LineLayout::LineLayout):
(WebCore::Layout::LineLayout::placeInlineItem):
(WebCore::Layout::InlineFormattingContext::InlineLayout::layout const):
(WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
(WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const):
(WebCore::Layout::LineLayout::layoutState const): Deleted.
* layout/inlineformatting/InlineFormattingContextQuirks.cpp:
(WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::isInlineContainerConsideredEmpty):
(WebCore::Layout::Line::isVisuallyEmpty const):
(WebCore::Layout::Line::close):
(WebCore::Layout::Line::appendNonReplacedInlineBox):
(WebCore::Layout::Line::inlineItemContentHeight const):
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::layout):
(WebCore::Layout::TableFormattingContext::computedTableWidth):

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

6 months ago[ews-build] 're-run-layout-tests' step on macOS-High-Sierra-Debug-WK1-Tests-EWS runs...
aakash_jain@apple.com [Sat, 31 Aug 2019 02:01:10 +0000 (02:01 +0000)]
[ews-build] 're-run-layout-tests' step on macOS-High-Sierra-Debug-WK1-Tests-EWS runs WK2 tests
https://bugs.webkit.org/show_bug.cgi?id=201350

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/steps.py:
(RunWebKit1Tests.start): Set build property to use dump-render-tree.
(RunWebKitTests.start): Use dump-render-tree whenever the corresponding build property is set.

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

6 months agoWebPage::fromCorePage() to take and return a C++ reference
cdumez@apple.com [Sat, 31 Aug 2019 00:45:17 +0000 (00:45 +0000)]
WebPage::fromCorePage() to take and return a C++ reference
https://bugs.webkit.org/show_bug.cgi?id=201367

Reviewed by Antti Koivisto.

Source/WebCore:

* page/Chrome.cpp:
(WebCore::Chrome::createWindow const):

Source/WebKit:

* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
* WebProcess/WebPage/VisitedLinkTableController.cpp:
(WebKit::VisitedLinkTableController::addVisitedLink):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::page const):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::fromCorePage):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPageOverlay.cpp:
(WebKit::WebPageOverlay::willMoveToPage):
(WebKit::WebPageOverlay::didMoveToPage):
* WebProcess/WebStorage/StorageNamespaceImpl.cpp:
(WebKit::StorageNamespaceImpl::copy):
* WebProcess/WebStorage/StorageNamespaceImpl.h:
* WebProcess/WebStorage/WebStorageNamespaceProvider.cpp:
(WebKit::WebStorageNamespaceProvider::createSessionStorageNamespace):

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

6 months agoAdd support for postMessage buffering between the service worker and window
cdumez@apple.com [Sat, 31 Aug 2019 00:34:07 +0000 (00:34 +0000)]
Add support for postMessage buffering between the service worker and window
https://bugs.webkit.org/show_bug.cgi?id=201169

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Rebaseline WPT test that is now passing.

* web-platform-tests/service-workers/service-worker/postmessage-to-client-message-queue.https-expected.txt:

Source/WebCore:

As per the Service Worker specification, a service worker client's message
queue is initially disabled and only gets enabled after:
- The DOMContentLoaded event has been fired
or
- The client sets the navigator.serviceWorker.onmessage event handler
or
- navigator.serviceWorker.startMessages() is called

While the message queue is disabled, messages posted by the service worker
to the client simply get queued and only get processed once the queue gets
enabled.

No new tests, rebaselined existing test.

* dom/Document.cpp:
(WebCore::Document::finishedParsing):
Call startMessages() on the ServiceWorkerContainer once the DOMContentLoaded event has
been fired.

* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::ensureServiceWorkerContainer):
* dom/ScriptExecutionContext.h:
* workers/service/SWClientConnection.cpp:
(WebCore::SWClientConnection::postMessageToServiceWorkerClient):
Fix a bug where a service worker would not be able to post a message to a client until
that client has accessed navigator.serviceWorker (since the ServiceWorkerContainer is
lazy initialized). To address the issue, we now initialize the ServiceWorkerContainer
when a message is received from the service worker. Previously, messages were just
getting dropped.

* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::ServiceWorkerContainer):
When the ServiceWorkerContainer is constructed, suspend its message queue if its context
document is still parsing.

(WebCore::ServiceWorkerContainer::startMessages):
Resume the message queue when startMessages() is called.

(WebCore::ServiceWorkerContainer::postMessage):
Enqueue the event instead of firing it right away.

(WebCore::ServiceWorkerContainer::addEventListener):
if navigator.serviceWorker.onmessage event handler gets set by the JavaScript, call
startMessages().

* workers/service/ServiceWorkerContainer.h:

LayoutTests:

* TestExpectations:
Unskip test that is no longer timing out.

* resources/testharnessreport.js:
(self.testRunner.add_completion_callback):
Use testRunner.forceImmediateCompletion() instead of notifyDone() for WPT tests.
testRunner.notifyDone() does not work in case of load error or when the load
does not finish. The WPT test was timing out because the load does not finish for
testing purposes.

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

6 months agoMinor optimization in determineNonLayerDescendantsPaintedContent()
simon.fraser@apple.com [Sat, 31 Aug 2019 00:29:02 +0000 (00:29 +0000)]
Minor optimization in determineNonLayerDescendantsPaintedContent()
https://bugs.webkit.org/show_bug.cgi?id=201352

Reviewed by Antti Koivisto.

It's cheaper to call renderText.hasRenderedText() than renderText.linesBoundingBox(), because
the latter has to traverse all the InlineTextBoxes. This code path is fairly hot when
scrolling twitter feeds, since it's called from RenderLayer::updateLayerPositionsAfterScroll()
which calls RenderLayer::isVisuallyNonEmpty().

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects const):

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

6 months ago[WHLSL] Remove getters/setters/anders
sbarati@apple.com [Sat, 31 Aug 2019 00:13:42 +0000 (00:13 +0000)]
[WHLSL] Remove getters/setters/anders
https://bugs.webkit.org/show_bug.cgi?id=201008

Reviewed by Robin Morisset.

Source/WebCore:

This patch changes WHLSL in a significant way. This patch removes getters/setters/anders
from the language. In our experience writing WHLSL shaders, these parts of the language
went unused, and they added a lot of complexity to the implementation of the compiler.

This patch now treats field accesses and array indexes as intrinsics inside the compiler.
This patch removes all notions of named operators, anders, and indexed operators
from the compiler and the standard library. The checker now intrinsically knows the
return type for property accesses and indexed expressions based on what the
base type is.

To make this work in practice was difficult, since getters/setters/anders
solved a lot of the difficult problems we had in generating metal code. For
example, all swizzle operators were getters and setters, so assigning to a
swizzle fell out naturally from implementing setters. However, during metal
codegen, all we see is a dot expression with "xy" as a property. Our previous
architecture of emitting Metal code using pointers which represent lvalues
doesn't work because you can't take the address of a swizzle. For example,
"auto* x = &vector.yz" is invalid metal code.

So, this patch changes the entire metal code generator to emit WHLSL expressions
as Metal expressions. To do this, I had to change a lot about how the compiler
was implemented:
- I changed the indexed accesses of matrices to return columns instead of
rows. This allowed WHLSL code like `mat[0].xy = 42` to be compiled into
the equivalent metal code of `mat[0].xy = 42`.
- I changed the native function inliner to emit expressions instead of
statements.
- We also simplify the language by removing null and requiring all
reference type variables to have an initializer. This means that
null is no longer a valid value, which allows us to omit null checks
inside the metal code generator. To make this work with array
accesses, we now clamp accesses instead of returning null for OOB
accesses.

I've also filed one required bug as a followup. I didn't include it in this
patch to make it easier to review along. Currently, there are two places in
metal codegen where we evaluate effects twice. That will be fixed in:
https://bugs.webkit.org/show_bug.cgi?id=201251

Tests: webgpu/whlsl/address-of-swizzle.html
       webgpu/whlsl/array-oob-alias.html
       webgpu/whlsl/matrix-index-assign.html
       webgpu/whlsl/matrix-index-order.html
       webgpu/whlsl/oob-access-2.html
       webgpu/whlsl/operator-syntax.html

* Modules/webgpu/WHLSL/AST/WHLSLAST.h:
* Modules/webgpu/WHLSL/AST/WHLSLConstantExpression.h:
* Modules/webgpu/WHLSL/AST/WHLSLDotExpression.h:
* Modules/webgpu/WHLSL/AST/WHLSLExpression.cpp:
(WebCore::WHLSL::AST::Expression::destroy):
(WebCore::WHLSL::AST::Expression::destruct):
(WebCore::WHLSL::AST::PropertyAccessExpression::getterFunctionName const): Deleted.
(WebCore::WHLSL::AST::PropertyAccessExpression::setterFunctionName const): Deleted.
(WebCore::WHLSL::AST::PropertyAccessExpression::anderFunctionName const): Deleted.
* Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
(WebCore::WHLSL::AST::Expression::copyTypeTo const):
(WebCore::WHLSL::AST::Expression::isMakePointerExpression const):
(WebCore::WHLSL::AST::Expression::isNullLiteral const): Deleted.
* Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h:
* Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h:
* Modules/webgpu/WHLSL/AST/WHLSLNullLiteral.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLNullLiteralType.cpp: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLNullLiteralType.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h:
(WebCore::WHLSL::AST::PropertyAccessExpression::getterFunction): Deleted.
(WebCore::WHLSL::AST::PropertyAccessExpression::anderFunction): Deleted.
(WebCore::WHLSL::AST::PropertyAccessExpression::threadAnderFunction): Deleted.
(WebCore::WHLSL::AST::PropertyAccessExpression::setterFunction): Deleted.
(WebCore::WHLSL::AST::PropertyAccessExpression::setGetterFunction): Deleted.
(WebCore::WHLSL::AST::PropertyAccessExpression::setAnderFunction): Deleted.
(WebCore::WHLSL::AST::PropertyAccessExpression::setThreadAnderFunction): Deleted.
(WebCore::WHLSL::AST::PropertyAccessExpression::setSetterFunction): Deleted.
(): Deleted.
* Modules/webgpu/WHLSL/AST/WHLSLType.cpp:
(WebCore::WHLSL::AST::Type::destroy):
(WebCore::WHLSL::AST::Type::destruct):
(WebCore::WHLSL::AST::ResolvableType::canResolve const):
(WebCore::WHLSL::AST::ResolvableType::conversionCost const):
* Modules/webgpu/WHLSL/AST/WHLSLType.h:
(WebCore::WHLSL::AST::Type::isIntegerLiteralType const):
(WebCore::WHLSL::AST::Type::isNullLiteralType const): Deleted.
* Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::HoistedVariableCollector::HoistedVariableCollector):
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::emitLoop):
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::emitConstantExpressionString):
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::appendRightValueWithNullability): Deleted.
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::appendRightValue): Deleted.
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::appendLeftValue): Deleted.
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::takeLastValue): Deleted.
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::takeLastValueAndNullability): Deleted.
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::takeLastLeftValue): Deleted.
* Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.cpp:
(WebCore::WHLSL::Metal::metalCodePrologue):
(WebCore::WHLSL::Metal::generateMetalCode):
(WebCore::WHLSL::Metal::metalCodeProlog): Deleted.
* Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
(WebCore::WHLSL::Metal::inlineNativeFunction):
(WebCore::WHLSL::Metal::vectorInnerType): Deleted.
* Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.h:
* Modules/webgpu/WHLSL/Metal/WHLSLNativeTypeWriter.cpp:
(WebCore::WHLSL::Metal::writeNativeType):
* Modules/webgpu/WHLSL/WHLSLASTDumper.cpp:
(WebCore::WHLSL::ASTDumper::visit):
* Modules/webgpu/WHLSL/WHLSLASTDumper.h:
* Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp:
(WebCore::WHLSL::checkDuplicateFunctions):
* Modules/webgpu/WHLSL/WHLSLChecker.cpp:
(WebCore::WHLSL::resolveByInstantiation):
(WebCore::WHLSL::checkOperatorOverload):
(WebCore::WHLSL::Checker::wrappedUintType):
(WebCore::WHLSL::Checker::normalizedTypeForFunctionKey):
(WebCore::WHLSL::Checker::visit):
(WebCore::WHLSL::matchAndCommit):
(WebCore::WHLSL::Checker::resolveFunction):
(WebCore::WHLSL::Checker::assignConcreteType):
(WebCore::WHLSL::resolveWithOperatorLength): Deleted.
(WebCore::WHLSL::Checker::genericPointerType): Deleted.
(WebCore::WHLSL::Checker::finishVisiting): Deleted.
* Modules/webgpu/WHLSL/WHLSLHighZombieFinder.cpp:
(WebCore::WHLSL::findHighZombies):
(): Deleted.
* Modules/webgpu/WHLSL/WHLSLInferTypes.cpp:
(WebCore::WHLSL::matchAndCommit):
(WebCore::WHLSL::commit):
* Modules/webgpu/WHLSL/WHLSLIntrinsics.h:
(WebCore::WHLSL::Intrinsics::boolVectorTypeForSize const):
(WebCore::WHLSL::Intrinsics::uintVectorTypeForSize const):
(WebCore::WHLSL::Intrinsics::intVectorTypeForSize const):
(WebCore::WHLSL::Intrinsics::floatVectorTypeForSize const):
* Modules/webgpu/WHLSL/WHLSLLexer.cpp:
(WebCore::WHLSL::Lexer::consumeTokenFromStream):
* Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.cpp:
* Modules/webgpu/WHLSL/WHLSLParser.cpp:
(WebCore::WHLSL::Parser::parseConstantExpression):
(WebCore::WHLSL::Parser::parseEnumerationMember):
(WebCore::WHLSL::Parser::parseTerm):
* Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
(WebCore::WHLSL::prepareShared):
* Modules/webgpu/WHLSL/WHLSLProgram.cpp: Added.
(WebCore::WHLSL::Program::isValidVectorProperty):
* Modules/webgpu/WHLSL/WHLSLProgram.h:
* Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
(WebCore::WHLSL::resolveProperties):
(WebCore::WHLSL::PropertyResolver::visit): Deleted.
(WebCore::WHLSL::wrapAnderCallArgument): Deleted.
(WebCore::WHLSL::anderCallArgument): Deleted.
(WebCore::WHLSL::setterCall): Deleted.
(WebCore::WHLSL::getterCall): Deleted.
(WebCore::WHLSL::modify): Deleted.
(WebCore::WHLSL::PropertyResolver::simplifyRightValue): Deleted.
(WebCore::WHLSL::LeftValueSimplifier::finishVisiting): Deleted.
(WebCore::WHLSL::LeftValueSimplifier::visit): Deleted.
(WebCore::WHLSL::PropertyResolver::simplifyLeftValue): Deleted.
* Modules/webgpu/WHLSL/WHLSLPruneUnreachableStandardLibraryFunctions.cpp:
* Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt:
* Modules/webgpu/WHLSL/WHLSLStandardLibraryUtilities.cpp:
* Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp: Removed.
* Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.h: Removed.
* Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp:
(WebCore::WHLSL::synthesizeEnumerationFunctions):
* Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
(WebCore::WHLSL::Visitor::visit):
* Modules/webgpu/WHLSL/WHLSLVisitor.h:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

LayoutTests:

* webgpu/whlsl/address-of-swizzle-expected.txt: Added.
* webgpu/whlsl/address-of-swizzle.html: Added.
* webgpu/whlsl/array-oob-alias-expected.txt: Copied from LayoutTests/webgpu/whlsl/structure-field-access-on-null-expected.txt.
* webgpu/whlsl/array-oob-alias.html: Copied from LayoutTests/webgpu/whlsl/structure-field-access-on-null.html.
* webgpu/whlsl/bad-ander-expected.txt: Removed.
* webgpu/whlsl/bad-ander.html: Removed.
* webgpu/whlsl/duplicate-types-should-not-produce-duplicate-ctors.html:
* webgpu/whlsl/increment-setter.html:
* webgpu/whlsl/index-ander-expected.txt: Removed.
* webgpu/whlsl/index-ander.html: Removed.
* webgpu/whlsl/index-setter-getter-expected.txt: Removed.
* webgpu/whlsl/index-setter-getter.html: Removed.
* webgpu/whlsl/make-array-reference.html:
* webgpu/whlsl/matrix-index-assign-expected.txt: Added.
* webgpu/whlsl/matrix-index-assign.html: Added.
* webgpu/whlsl/matrix-index-order-expected.txt: Added.
* webgpu/whlsl/matrix-index-order.html: Added.
* webgpu/whlsl/matrix-memory-layout.html:
* webgpu/whlsl/matrix.html:
* webgpu/whlsl/null-arg-expected.txt:
* webgpu/whlsl/null-arg.html:
* webgpu/whlsl/null-dereference-expected.txt: Removed.
* webgpu/whlsl/null-dereference.html: Removed.
* webgpu/whlsl/oob-access-2-expected.txt: Added.
* webgpu/whlsl/oob-access-2.html: Added.
* webgpu/whlsl/oob-access.html:
* webgpu/whlsl/operator-syntax-expected.txt: Added.
* webgpu/whlsl/operator-syntax.html: Added.
* webgpu/whlsl/operator-vector-assign.html:
* webgpu/whlsl/operator-vector-load.html:
* webgpu/whlsl/override-subscript-expected.txt: Removed.
* webgpu/whlsl/override-subscript.html: Removed.
* webgpu/whlsl/propertyresolver/ander-abstract-lvalue-expected.html: Removed.
* webgpu/whlsl/propertyresolver/ander-abstract-lvalue.html: Removed.
* webgpu/whlsl/propertyresolver/ander-expected.html: Removed.
* webgpu/whlsl/propertyresolver/ander-lvalue-3-levels-expected.html: Removed.
* webgpu/whlsl/propertyresolver/ander-lvalue-3-levels.html: Removed.
* webgpu/whlsl/propertyresolver/ander-lvalue-expected.html: Removed.
* webgpu/whlsl/propertyresolver/ander-lvalue.html: Removed.
* webgpu/whlsl/propertyresolver/ander.html: Removed.
* webgpu/whlsl/propertyresolver/getter-expected.html: Removed.
* webgpu/whlsl/propertyresolver/getter.html: Removed.
* webgpu/whlsl/propertyresolver/indexer-ander-abstract-lvalue-expected.html: Removed.
* webgpu/whlsl/propertyresolver/indexer-ander-abstract-lvalue.html: Removed.
* webgpu/whlsl/propertyresolver/indexer-ander-expected.html: Removed.
* webgpu/whlsl/propertyresolver/indexer-ander-lvalue-3-levels-expected.html: Removed.
* webgpu/whlsl/propertyresolver/indexer-ander-lvalue-3-levels.html: Removed.
* webgpu/whlsl/propertyresolver/indexer-ander-lvalue-expected.html: Removed.
* webgpu/whlsl/propertyresolver/indexer-ander-lvalue.html: Removed.
* webgpu/whlsl/propertyresolver/indexer-ander.html: Removed.
* webgpu/whlsl/propertyresolver/indexer-getter-expected.html: Removed.
* webgpu/whlsl/propertyresolver/indexer-getter.html: Removed.
* webgpu/whlsl/propertyresolver/indexer-setter-abstract-lvalue-3-levels-expected.html: Removed.
* webgpu/whlsl/propertyresolver/indexer-setter-abstract-lvalue-3-levels.html: Removed.
* webgpu/whlsl/propertyresolver/indexer-setter-abstract-lvalue-expected.html: Removed.
* webgpu/whlsl/propertyresolver/indexer-setter-abstract-lvalue.html: Removed.
* webgpu/whlsl/propertyresolver/indexer-setter-expected.html: Removed.
* webgpu/whlsl/propertyresolver/indexer-setter-lvalue-expected.html: Removed.
* webgpu/whlsl/propertyresolver/indexer-setter-lvalue.html: Removed.
* webgpu/whlsl/propertyresolver/indexer-setter.html: Removed.
* webgpu/whlsl/propertyresolver/setter-abstract-lvalue-3-levels-expected.html: Removed.
* webgpu/whlsl/propertyresolver/setter-abstract-lvalue-3-levels.html: Removed.
* webgpu/whlsl/propertyresolver/setter-abstract-lvalue-expected.html: Removed.
* webgpu/whlsl/propertyresolver/setter-abstract-lvalue.html: Removed.
* webgpu/whlsl/propertyresolver/setter-lvalue-expected.html: Removed.
* webgpu/whlsl/propertyresolver/setter-lvalue.html: Removed.
* webgpu/whlsl/setter-spec-tests.html:
* webgpu/whlsl/simple-getter-setter-expected.txt:
* webgpu/whlsl/simple-getter-setter.html:
* webgpu/whlsl/structure-field-access-on-null-expected.txt: Removed.
* webgpu/whlsl/structure-field-access-on-null.html: Removed.
* webgpu/whlsl/test-harness-test.html:

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

6 months ago[PSON] We no longer need to throw away suspended pages in a process before using...
cdumez@apple.com [Fri, 30 Aug 2019 22:59:10 +0000 (22:59 +0000)]
[PSON] We no longer need to throw away suspended pages in a process before using it for a navigation
https://bugs.webkit.org/show_bug.cgi?id=201344

Reviewed by Antti Koivisto.

We no longer need to throw away suspended pages in a process before using it for a navigation, now that
Bug 201225 has been fixed. WebPage objects (suspended or live) in the process now have distinct
identifiers and can coexist.

* Shared/API/Cocoa/RemoteObjectRegistry.h:
* Shared/API/Cocoa/RemoteObjectRegistry.mm:
(WebKit::RemoteObjectRegistry::RemoteObjectRegistry):
* UIProcess/Cocoa/UIRemoteObjectRegistry.cpp:
(WebKit::UIRemoteObjectRegistry::UIRemoteObjectRegistry):
* WebProcess/WebPage/Cocoa/WebRemoteObjectRegistry.cpp:
(WebKit::WebRemoteObjectRegistry::WebRemoteObjectRegistry):
(WebKit::WebRemoteObjectRegistry::close):

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

6 months ago[LFC] Pass FormattingContext to Geometry/Quirks/BlockMarginCollapsing classes
zalan@apple.com [Fri, 30 Aug 2019 22:45:49 +0000 (22:45 +0000)]
[LFC] Pass FormattingContext to Geometry/Quirks/BlockMarginCollapsing classes
https://bugs.webkit.org/show_bug.cgi?id=201355
<rdar://problem/54895959>

Reviewed by Antti Koivisto.

This is in preparation for enforcing LFC to not call outside of the formatting context.
LayoutState::displayBoxForLayoutBox calls will be forced to go through the FormattingContext class to
check LFC escaping.

* layout/FormattingContext.h:
(WebCore::Layout::FormattingContext::isBlockFormattingContext const):
(WebCore::Layout::FormattingContext::isInlineFormattingContext const):
(WebCore::Layout::FormattingContext::isTableFormattingContext const):
(WebCore::Layout::FormattingContext::Geometry::layoutState const):
(WebCore::Layout::FormattingContext::Geometry::layoutState):
(WebCore::Layout::FormattingContext::Geometry::formattingContext const):
(WebCore::Layout::FormattingContext::geometry const):
(WebCore::Layout::FormattingContext::Quirks::layoutState const):
(WebCore::Layout::FormattingContext::Quirks::layoutState):
(WebCore::Layout::FormattingContext::Quirks::formattingContext const):
(WebCore::Layout::FormattingContext::quirks const):
(WebCore::Layout::FormattingContext::Geometry::Geometry):
(WebCore::Layout::FormattingContext::Quirks::Quirks):
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::computedHeightValue const):
* layout/FormattingContextQuirks.cpp:
(WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
* layout/blockformatting/BlockFormattingContext.h:
(WebCore::Layout::BlockFormattingContext::Geometry::formattingContext const):
(WebCore::Layout::BlockFormattingContext::geometry const):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::layoutState):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::layoutState const):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::formattingContext const):
(WebCore::Layout::BlockFormattingContext::marginCollapse const):
(WebCore::Layout::BlockFormattingContext::Quirks::formattingContext const):
(WebCore::Layout::BlockFormattingContext::quirks const):
(WebCore::Layout::BlockFormattingContext::Geometry::Geometry):
(WebCore::Layout::BlockFormattingContext::Quirks::Quirks):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::MarginCollapse):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
* layout/blockformatting/BlockFormattingContextQuirks.cpp:
(WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
* layout/inlineformatting/InlineFormattingContext.h:
(WebCore::Layout::InlineFormattingContext::InlineLayout::layoutState const):
(WebCore::Layout::InlineFormattingContext::InlineLayout::formattingContext const):
(WebCore::Layout::InlineFormattingContext::InlineLayout::formattingRoot const):
(WebCore::Layout::InlineFormattingContext::Quirks::formattingContext const):
(WebCore::Layout::InlineFormattingContext::quirks const):
(WebCore::Layout::InlineFormattingContext::Geometry::formattingContext const):
(WebCore::Layout::InlineFormattingContext::geometry const):
(WebCore::Layout::InlineFormattingContext::Geometry::Geometry):
(WebCore::Layout::InlineFormattingContext::Quirks::Quirks):
* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::LineLayout::LineLayout):
(WebCore::Layout::InlineFormattingContext::InlineLayout::InlineLayout):
(WebCore::Layout::InlineFormattingContext::InlineLayout::layout const):
(WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
(WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const):
* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::Line):
(WebCore::Layout::Line::isVisuallyEmpty const):
(WebCore::Layout::Line::close):
(WebCore::Layout::Line::appendNonReplacedInlineBox):
(WebCore::Layout::Line::adjustBaselineAndLineHeight):
(WebCore::Layout::Line::inlineItemContentHeight const):
(WebCore::Layout::Line::layoutState const):
(WebCore::Layout::Line::formattingContext const):
* layout/inlineformatting/InlineLine.h:
* layout/tableformatting/TableFormattingContext.h:
(WebCore::Layout::TableFormattingContext::Geometry::formattingContext const):
(WebCore::Layout::TableFormattingContext::geometry const):
(WebCore::Layout::TableFormattingContext::Geometry::Geometry):
* page/FrameViewLayoutContext.cpp:
(WebCore::layoutUsingFormattingContext):

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

6 months agoresults.webkit.org: Add endpoints to upload and download archives
jbedard@apple.com [Fri, 30 Aug 2019 22:03:46 +0000 (22:03 +0000)]
results.webkit.org: Add endpoints to upload and download archives
https://bugs.webkit.org/show_bug.cgi?id=201100

Reviewed by Aakash Jain.

Add the endpoint to upload and download a zip archive associated with a test run.

* resultsdbpy/resultsdbpy/controller/api_routes.py:
(APIRoutes.__init__): Add archive endpoint.
* resultsdbpy/resultsdbpy/controller/archive_controller.py: Added.
(ArchiveController):
(ArchiveController.__init__):
(ArchiveController.endpoint):
(ArchiveController.download):
(ArchiveController.upload):
* resultsdbpy/resultsdbpy/controller/archive_controller_unittest.py: Added.
(ArchiveControllerUnittest):
* resultsdbpy/resultsdbpy/model/configuration_context.py:
(ClusteredByConfiguration.register_configuration): Make error message more clear.

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

6 months agoRemove some obsolete statements that have no effect.
mark.lam@apple.com [Fri, 30 Aug 2019 22:02:37 +0000 (22:02 +0000)]
Remove some obsolete statements that have no effect.
https://bugs.webkit.org/show_bug.cgi?id=201357

Reviewed by Saam Barati.

This patch removes 3 statements that look like this:

    result->butterfly(); // Ensure that the butterfly is in to-space.

The statement just reads a field and does nothing with it.  This is a no-op
logic-wise, and the comment that accompanies it is obsolete.

* dfg/DFGOperations.cpp:

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

6 months agoAssertion hit when saving to PDF from printing dialog
cdumez@apple.com [Fri, 30 Aug 2019 21:45:54 +0000 (21:45 +0000)]
Assertion hit when saving to PDF from printing dialog
https://bugs.webkit.org/show_bug.cgi?id=201351

Reviewed by Tim Horton.

[WKPrintingView knowsPageRange:] may get called from a background thread and ends up calling
WeakPtr::get() which asserts because it is generally unsafe to get the raw pointer from a
WeakPtr to an object owned by another thread. However, the methods here merely want to null
check it so add a thread-safe method (pageIsClosed()) to WebFrameProxy for it.

* UIProcess/WebFrameProxy.h:
(WebKit::WebFrameProxy::pageIsClosed const):
* UIProcess/mac/WKPrintingView.mm:
(-[WKPrintingView knowsPageRange:]):

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

6 months agoFix a bug in SlotVisitor::reportZappedCellAndCrash() and also capture more information.
mark.lam@apple.com [Fri, 30 Aug 2019 21:18:16 +0000 (21:18 +0000)]
Fix a bug in SlotVisitor::reportZappedCellAndCrash() and also capture more information.
https://bugs.webkit.org/show_bug.cgi?id=201345

Reviewed by Yusuke Suzuki.

This patch fixes a bug where SlotVisitor::reportZappedCellAndCrash() was using
the wrong pointer for capture the cell headerWord and zapReason.  As a result,
we get junk for those 2 values.

Previously, we were only capturing the upper 32-bits of the cell header slot,
and the lower 32-bit of the next slot in the zapped cell.  We now capture the
full 64-bits of both slots.  If the second slot did not contain a zapReason as we
expect, the upper 32-bits might give us a clue as to what type of value the slot
contains.

This patch also adds capturing of the found MarkedBlock address for the zapped
cell, as well as some state bit values.

* heap/SlotVisitor.cpp:
(JSC::SlotVisitor::reportZappedCellAndCrash):

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

6 months agoUnreviewed, rolling out r249338.
ryanhaddad@apple.com [Fri, 30 Aug 2019 20:33:44 +0000 (20:33 +0000)]
Unreviewed, rolling out r249338.

Caused 500+ layout test failures on WK1

Reverted changeset:

"Add support for postMessage buffering between the service
worker and window"
https://bugs.webkit.org/show_bug.cgi?id=201169
https://trac.webkit.org/changeset/249338

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

6 months agoRemove HAVE_CFNETWORK_WITH_AUTO_ADDED_HTTP_HEADER_SUPPRESSION_SUPPORT conditional
achristensen@apple.com [Fri, 30 Aug 2019 20:27:33 +0000 (20:27 +0000)]
Remove HAVE_CFNETWORK_WITH_AUTO_ADDED_HTTP_HEADER_SUPPRESSION_SUPPORT conditional
https://bugs.webkit.org/show_bug.cgi?id=201280

Reviewed by Youenn Fablet.

Source/WebCore/PAL:

* pal/spi/cf/CFNetworkSPI.h:

Source/WebKit:

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):

Source/WTF:

* wtf/Platform.h:

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

6 months agoRemove HAVE_CFNETWORK_WITH_IGNORE_HSTS conditional
achristensen@apple.com [Fri, 30 Aug 2019 20:26:08 +0000 (20:26 +0000)]
Remove HAVE_CFNETWORK_WITH_IGNORE_HSTS conditional
https://bugs.webkit.org/show_bug.cgi?id=201279

Reviewed by Darin Adler.

Source/WebCore:

* platform/network/mac/WebCoreURLResponse.mm:
(WebCore::synthesizeRedirectResponseIfNecessary):
(WebCore::schemeWasUpgradedDueToDynamicHSTS): Deleted.

Source/WebKit:

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(ignoreHSTS):
(updateIgnoreStrictTransportSecuritySettingIfNecessary):
(-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
(-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):

Source/WTF:

* wtf/Platform.h:

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

6 months agoAllow process cache to cache processes when using a non-default persistent WebsiteDat...
achristensen@apple.com [Fri, 30 Aug 2019 20:23:00 +0000 (20:23 +0000)]
Allow process cache to cache processes when using a non-default persistent WebsiteDataStore
https://bugs.webkit.org/show_bug.cgi?id=201329

Reviewed by Chris Dumez.

Treat all persistent sessions the same when deciding whether to clear all cached web processes using a particular website data store.
This removes a huge performance regression on warm plt when switching to using a non-default persistent session.
I also removed a call to removeSession which is redundant with the one in the WebsiteDataStore destructor, which is where it should be.

* UIProcess/WebProcessCache.cpp:
(WebKit::WebProcessCache::canCacheProcess const):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
(WebKit::WebProcessPool::pageEndUsingWebsiteDataStore):

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