WebKit-https.git
2 months agoThe maximum subframe count check should not be skipped for empty URLs.
rniwa@webkit.org [Mon, 29 Jul 2019 21:57:39 +0000 (21:57 +0000)]
The maximum subframe count check should not be skipped for empty URLs.
https://bugs.webkit.org/show_bug.cgi?id=200032

Patch by Sergei Glazunov <glazunov@google.com> on 2019-07-29
Reviewed by Ryosuke Niwa.

Source/WebCore:

Move the check closer to the actual frame creation code in `loadSubframe`.

Test: fast/dom/connected-subframe-counter-overflow.html

* dom/Document.cpp:
(WebCore::Document::prepareForDestruction): Assert that all child frames have been detached.
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::canLoad const):
(WebCore::HTMLFrameElementBase::canLoadURL const):
* html/HTMLFrameOwnerElement.cpp:
(WebCore::HTMLFrameOwnerElement::canAddSubframe const): Deleted.
* html/HTMLFrameOwnerElement.h:
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::canLoadURL const):
* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::loadSubframe):

LayoutTests:

* fast/dom/connected-subframe-counter-overflow-expected.txt: Added.
* fast/dom/connected-subframe-counter-overflow.html: Added.
* fast/frames/lots-of-iframes-expected.txt:

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

2 months agoREGRESSION: WebSockets no longer work in Service Workers
youenn@apple.com [Mon, 29 Jul 2019 21:43:42 +0000 (21:43 +0000)]
REGRESSION: WebSockets no longer work in Service Workers
https://bugs.webkit.org/show_bug.cgi?id=199906
<rdar://problem/53516732>

Reviewed by Geoffrey Garen.

Source/WebKit:

Use WebSocketProvider so that network calls are done in the network process.

* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::installServiceWorker):

LayoutTests:

Fix test and make sure messages are exchanged for the test to succeed.

* http/tests/workers/service/resources/serviceworker-websocket-worker.js:
(async.doTest):

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

2 months ago[ContentChangeObserver] ChromeClient::observedContentChange() name is misleading
zalan@apple.com [Mon, 29 Jul 2019 21:32:16 +0000 (21:32 +0000)]
[ContentChangeObserver] ChromeClient::observedContentChange() name is misleading
https://bugs.webkit.org/show_bug.cgi?id=200238
<rdar://problem/53677038>

Reviewed by Simon Fraser.

Source/WebCore:

This function indicates that we've finished observing content changes.

* loader/EmptyClients.h:
* page/ChromeClient.h:
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::adjustObservedState):
* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::mouseMoved):

Source/WebKit:

* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
(WebKit::WebChromeClient::didFinishContentChangeObserving):
(WebKit::WebChromeClient::observedContentChange): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::didFinishContentChangeObserving):
(WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver): Deleted.

Source/WebKitLegacy/ios:

* WebCoreSupport/WebChromeClientIOS.h:
* WebCoreSupport/WebChromeClientIOS.mm:
(WebChromeClientIOS::didFinishContentChangeObserving):
(WebChromeClientIOS::observedContentChange): Deleted.

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

2 months agoShareableBitmap::createGraphicsContext() should return nullptr when CGBitmapContextCr...
rniwa@webkit.org [Mon, 29 Jul 2019 21:21:54 +0000 (21:21 +0000)]
ShareableBitmap::createGraphicsContext() should return nullptr when CGBitmapContextCreateWithData returns nil
https://bugs.webkit.org/show_bug.cgi?id=200185

Reviewed by Simon Fraser.

We should not be creating GraphicsContext with nil CGContextRef in ShareableBitmap::createGraphicsContext()
as such a GraphicsContext is only used for specific purposes.

This patch adds an early return to ShareableBitmap::createGraphicsContext() when CGBitmapContextCreateWithData
returns nil CGContextRef.

* PluginProcess/PluginControllerProxy.cpp:
(WebKit::PluginControllerProxy::paint):
* Shared/API/c/cg/WKImageCG.cpp:
(WKImageCreateFromCGImage):
* Shared/ContextMenuContextData.cpp:
(WebKit::ContextMenuContextData::ContextMenuContextData):
* Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::display):
* Shared/WebCoreArgumentCoders.cpp:
(IPC::encodeImage):
* Shared/cg/ShareableBitmapCG.cpp:
(WebKit::ShareableBitmap::createGraphicsContext):
(WebKit::ShareableBitmap::makeCGImageCopy):
* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
(WebKit::imageForRect):
* WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
(WebKit::InjectedBundleRangeHandle::renderedImage):
* WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
(WebKit::InjectedBundleHitTestResult::image const):
* WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
(WebKit::NetscapePlugin::snapshot):
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::snapshot):
* WebProcess/Plugins/PluginProxy.cpp:
(WebKit::PluginProxy::paint):
(WebKit::PluginProxy::update):
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::convertCGImageToBitmap):
* WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
(WebKit::DrawingAreaCoordinatedGraphics::display):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::createSelectionSnapshot const):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::snapshotAtSize):
(WebKit::WebPage::snapshotNode):
(WebKit::WebPage::drawRectToImage):

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

2 months agoContextual menu does not present when holding an embedded photo but works with link...
dino@apple.com [Mon, 29 Jul 2019 21:19:41 +0000 (21:19 +0000)]
Contextual menu does not present when holding an embedded photo but works with link and attachments
https://bugs.webkit.org/show_bug.cgi?id=200239
<rdar://problem/53318733>

Reviewed by Tim Horton.

If the user long-pressed on an image, and the client implemented the new API but did
not provide a configuration, we were not falling back to the default behaviour of
giving a menu allowing the user to copy/share/save the image.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView continueContextMenuInteraction:]): If we get through the delegates,
and the element is an image, return the default configuration.

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

2 months agoUnreviewed test gardening, update expectations for rdar://problem/48616298.
ryanhaddad@apple.com [Mon, 29 Jul 2019 20:30:41 +0000 (20:30 +0000)]
Unreviewed test gardening, update expectations for rdar://problem/48616298.

* platform/ios-wk2/TestExpectations:
The fast/viewport/ios directory is marked as passing in this file, which was overriding the entries in the 'ios' file.
* platform/ios/TestExpectations:

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

2 months agoRemove unnecessary null check under WebResourceLoadStatisticsStore::hasStorageAccess()
cdumez@apple.com [Mon, 29 Jul 2019 20:15:43 +0000 (20:15 +0000)]
Remove unnecessary null check under WebResourceLoadStatisticsStore::hasStorageAccess()
https://bugs.webkit.org/show_bug.cgi?id=200229

Reviewed by Alex Christensen.

Remove unnecessary null check under WebResourceLoadStatisticsStore::hasStorageAccess().
There is already a null check with an early return a few lines above.

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

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

2 months agoStringBuilder::append(makeString(...)) is inefficient
weinig@apple.com [Mon, 29 Jul 2019 20:12:25 +0000 (20:12 +0000)]
StringBuilder::append(makeString(...)) is inefficient
https://bugs.webkit.org/show_bug.cgi?id=200034

Reviewed by Saam Barati.

Replace uses of StringBuilder::append(makeString(...)) with StringBuilder::flexiblAppend(...).
Where possible, also merged consecutive calls to StringBuilder::append(...) into a single call
to StringBuilder::flexiblAppend(...) to avoid unnecessary additional overflow checks and resizes.
Also where possible, replaced StringBuilder with makeString() if no branching was used during
construction.

A lot more can be done to improve the efficiency of StringBuilder use in the WHLSL code including:
- Using StringView more prevelently, especially when passing a substring to the StringBuilder.
- Passing existing StringBuilders to functions for them to use rather than returning a String and
  then appending that to another StringBuilder.
- Using custom StringTypeAdapters for generated names, rather than storing them as Strings.

* Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
(WebCore::WHLSL::Metal::EntryPointScaffolding::resourceHelperTypes):
(WebCore::WHLSL::Metal::EntryPointScaffolding::resourceSignature):
(WebCore::WHLSL::Metal::EntryPointScaffolding::builtInsSignature):
(WebCore::WHLSL::Metal::EntryPointScaffolding::mangledInputPath):
(WebCore::WHLSL::Metal::EntryPointScaffolding::mangledOutputPath):
(WebCore::WHLSL::Metal::EntryPointScaffolding::unpackResourcesAndNamedBuiltIns):
(WebCore::WHLSL::Metal::VertexEntryPointScaffolding::helperTypes):
(WebCore::WHLSL::Metal::VertexEntryPointScaffolding::signature):
(WebCore::WHLSL::Metal::VertexEntryPointScaffolding::unpack):
(WebCore::WHLSL::Metal::VertexEntryPointScaffolding::pack):
(WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::helperTypes):
(WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::signature):
(WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::unpack):
(WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::pack):
(WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::signature):
* Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
(WebCore::WHLSL::Metal::FunctionDeclarationWriter::visit):
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::FunctionDefinitionWriter):
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::emitLoop):
* Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.cpp:
(WebCore::WHLSL::Metal::generateMetalCodeShared):
* Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
(WebCore::WHLSL::Metal::writeNativeFunction):
* Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
(WebCore::WHLSL::Metal::MetalTypeDeclarationWriter::visit):
(WebCore::WHLSL::Metal::TypeNamer::emitUnnamedTypeDefinition):
(WebCore::WHLSL::Metal::TypeNamer::emitNamedTypeDefinition):
(WebCore::WHLSL::Metal::TypeNamer::metalTypes):
* Modules/webgpu/WHLSL/WHLSLParser.cpp:
(WebCore::WHLSL::Types::appendNameTo):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::logLayerInfo):
* testing/Internals.cpp:
(WebCore::Internals::ongoingLoadsDescriptions const):

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

2 months agoREGRESSION (r247891): Layout Test accessibility/ios-simulator/video-elements-ios...
commit-queue@webkit.org [Mon, 29 Jul 2019 19:56:55 +0000 (19:56 +0000)]
REGRESSION (r247891): Layout Test accessibility/ios-simulator/video-elements-ios.html is failing
https://bugs.webkit.org/show_bug.cgi?id=200231
<rdar://problem/53666599>

Patch by Andres Gonzalez <andresg_22@apple.com> on 2019-07-29
Reviewed by Chris Fleizach.

We now expose <video> elements when they have controls.
* accessibility/ios-simulator/video-elements-ios-expected.txt:
* accessibility/ios-simulator/video-elements-ios.html:

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

2 months agoForce Reveal to always lookup from menu
megan_gardner@apple.com [Mon, 29 Jul 2019 19:20:17 +0000 (19:20 +0000)]
Force Reveal to always lookup from menu
https://bugs.webkit.org/show_bug.cgi?id=200186
<rdar://problem/52967940>

Reviewed by Tim Horton.

We currently only have the 'lookup' menu item, so we should always force the 'lookup' action from it.

Reveal is not currently testable.

* editing/cocoa/DictionaryLookup.mm:
(WebCore::showPopupOrCreateAnimationController):

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

2 months agoUI process occasionally hangs in -[UIKeyboardTaskQueue lockWhenReadyForMainThread]
wenson_hsieh@apple.com [Mon, 29 Jul 2019 19:12:40 +0000 (19:12 +0000)]
UI process occasionally hangs in -[UIKeyboardTaskQueue lockWhenReadyForMainThread]
https://bugs.webkit.org/show_bug.cgi?id=200215
<rdar://problem/52976965>

Reviewed by Tim Horton.

To implement autocorrection on iOS, UIKit sometimes needs to request contextual information from WebKit. This is
handled as a sync IPC message in WebKit, since UIKit would otherwise proceed to block the main thread after
sending the request, preventing WebKit from handling any IPC responses in the UI process (potentially resulting
in deadlock if any other sync IPC messages were to arrive in the UI process during this time).

The synchronous nature of this autocorrection request means that if any sync IPC message were to be
simultaneously dispatched in the opposite direction (i.e. web to UI process), we need to immediately handle the
incoming sync message in the UI process (otherwise, we'd end up deadlocking for 1 second until the
autocorrection context request hits a 1-second IPC timeout).

One such synchronous message from the web process to the UI process is WebPageProxy::CreateNewPage, triggered as
a result of synchronously opening a new window. Due to Safari changes in iOS 13 (<rdar://problem/51755088>),
this message now calls into code which then causes UIKit to call *back into* -[WKContentView
requestAutocorrectionContextWithCompletionHandler:] for the newly opened web view, under the scope of the call
to -requestAutocorrectionContextWithCompletionHandler: in the original web view.

This caused a crash, which was tracked in <rdar://problem/52590170>. There was an attempt to fix this in r247345
by invoking the existing handler well before storing the new one; while this avoided the crash, it didn't solve
the root problem, which was that keyboard task queues would get into a bad state after this scenario; this would
manifest in a UI process hang under -[UIKeyboardTaskQueue lockWhenReadyForMainThread] during the next user
gesture, which is tracked by this bug (<rdar://problem/52976965>).

As it turns out, the keyboard task queue gets into a bad state because it is architected in such a way that
tasks added to the queue under the scope of parent task must be finished executing before their parents;
otherwise, the call to -[UIKeyboardTaskExecutionContext returnExecutionToParentWithInfo:] never happens when
handling the child task. This has the effect of causing the keyboard task queue to end up with a
UIKeyboardTaskExecutionContext that can never return execution to its parent context, such that if the task
queue is then told to wait until any future task is finished executing, it will hang forever, waiting for these
stuck tasks to finish executing (which never happens, because they're all waiting to return execution to their
parents which are already done executing!)

To fix this hang and avoid ever getting into this bad state, we need to invoke the autocorrection request
handlers in this order:

(1) Receive outer autocorrection context request.
(2) Receive inner autocorrection context request.
(3) Invoke inner autocorrection context request completion handler.
(4) Invoke outer autocorrection context request completion handler.

...instead of swapping (3) and (4), like we do currently.

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

Remove the hack added in r247345 to try and avoid reentrant autocorrection context requests; we don't need this
anymore, since we should now be able to handle these reentrant requests in the way UIKit expects.

(-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):

Add an early return in the case where the request is synchronous and there's already a pending autocorrection
context to ensure that the completion handler for the nested request is invoked before the outer request is
finished.

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

2 months ago[X86] Emit BT instruction for shift + mask in B3
justin_michaud@apple.com [Mon, 29 Jul 2019 18:54:46 +0000 (18:54 +0000)]
[X86] Emit BT instruction for shift + mask in B3
https://bugs.webkit.org/show_bug.cgi?id=199891

Reviewed by Robin Morisset.

Lower the number of iterations to fix debug timeouts.

* microbenchmarks/bit-test-load.js:
(i):

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

2 months agoREGRESSION (r246899): Subtitles show twice when controls show/hide on hulu.com
simon.fraser@apple.com [Mon, 29 Jul 2019 18:37:50 +0000 (18:37 +0000)]
REGRESSION (r246899): Subtitles show twice when controls show/hide on hulu.com
https://bugs.webkit.org/show_bug.cgi?id=200187
rdar://problem/53511121

Reviewed by Zalan Bujtas.

Source/WebCore:

When a layer that painted into shared backing moved, we'd fail to repaint its old position
because the RenderLayer's repaint rects are cleared via BackingSharingState::updateBeforeDescendantTraversal().

Recomputing repaint rects is expensive, so we only want to do it when necessary, which is for
layers that start and stop sharing (going into and out of compositing already recomputes them).
So add logic to RenderLayerBacking::setBackingSharingLayers() that recomputes repaint rects
on layers that will no longer use shared backing, and those that are newly using shared
backing.

Test: compositing/shared-backing/backing-sharing-repaint.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::setBackingProviderLayer):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::setBackingSharingLayers):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::BackingSharingState::appendSharingLayer):
(WebCore::RenderLayerCompositor::updateBacking):

LayoutTests:

* compositing/shared-backing/backing-sharing-repaint-expected.html: Added.
* compositing/shared-backing/backing-sharing-repaint.html: Added.

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

2 months agoThe touch-action property was ignored on replaced elements (canvas, img etc)
simon.fraser@apple.com [Mon, 29 Jul 2019 18:31:04 +0000 (18:31 +0000)]
The touch-action property was ignored on replaced elements (canvas, img etc)
https://bugs.webkit.org/show_bug.cgi?id=200205
rdar://problem/53331224

Reviewed by Antti Koivisto.

Source/WebCore:

The event region painting code didn't handle replaced elements correctly,
causing touch-action to get ignored for <canvas>, <img> etc. Fix by handling
region painting in RenderReplaced.

This still doesn't fix <iframe> but I'm not sure what the correct behavior is there
(webkit.org/b/200204).

Test: pointerevents/ios/touch-action-region-replaced-elements.html

* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::paint):
(WebCore::RenderReplaced::shouldPaint):

LayoutTests:

* pointerevents/ios/touch-action-region-replaced-elements-expected.txt: Added.
* pointerevents/ios/touch-action-region-replaced-elements.html: Added.

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

2 months agoNetworkProcess clear and fetch of cache entries might move the callback aggregator...
youenn@apple.com [Mon, 29 Jul 2019 18:28:04 +0000 (18:28 +0000)]
NetworkProcess clear and fetch of cache entries might move the callback aggregator more than once
https://bugs.webkit.org/show_bug.cgi?id=200228

Reviewed by Alex Christensen.

copyRef the callback aggregator instead of moving it.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::fetchWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteDataForOrigins):

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

2 months agoREGRESSION (r247898): Multiple Layout Tests in http/tests/contentdispositionattachmen...
timothy_horton@apple.com [Mon, 29 Jul 2019 17:15:24 +0000 (17:15 +0000)]
REGRESSION (r247898): Multiple Layout Tests in http/tests/contentdispositionattachmentsandbox/* are timing out on iOS
<rdar://problem/53664817>

* http/tests/contentdispositionattachmentsandbox/resources/referer-header-stripped.js:
(onload):
iOS has eventSender, so this reorganizing didn't work (well, it worked for macOS...).
Instead, check which platform we're on and use touch vs. mouse events by
platform instead of by available API.

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

2 months agoPossible use-after-move under NetworkConnectionToWebProcess::resourceLoadStatisticsUp...
cdumez@apple.com [Mon, 29 Jul 2019 16:42:23 +0000 (16:42 +0000)]
Possible use-after-move under NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated()
https://bugs.webkit.org/show_bug.cgi?id=200225

Reviewed by Brent Fulgham.

The code was WTFMove()-ing the method parameter inside of a loop, which means that it could
move it several times. Instead of copying the parameters, I opted into sending the statistics
only to the network session that matches this WebProcess connection.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated):

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

2 months ago[Canvas Timeline] Compact canvas timeline
commit-queue@webkit.org [Mon, 29 Jul 2019 14:40:16 +0000 (14:40 +0000)]
[Canvas Timeline] Compact canvas timeline
https://bugs.webkit.org/show_bug.cgi?id=200177

Patch by Zhifei Fang <zhifei_fang@apple.com> on 2019-07-29
Reviewed by Jonathan Bedard.

* resultsdbpy/resultsdbpy/view/static/library/js/components/BaseComponents.js:
* resultsdbpy/resultsdbpy/view/static/library/js/components/TimelineComponents.js:
(Timeline.CanvasSeriesComponent):

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

2 months agoREGRESSION(r243058): [GStreamer] WebKitWebSrc's internal queue can exhaust the WebPro...
philn@webkit.org [Mon, 29 Jul 2019 14:33:57 +0000 (14:33 +0000)]
REGRESSION(r243058): [GStreamer] WebKitWebSrc's internal queue can exhaust the WebProcess memory
https://bugs.webkit.org/show_bug.cgi?id=199998

Reviewed by Xabier Rodriguez-Calvar.

With the webkitwebsrc rewrite the element lost its ability to tell
the resource loader when to pause and resume downloading because
we don't use appsrc and its enough-data/need-data signals anymore.
So new heuristics are introduced with this patch. Downloading of
resources bigger than 2MiB might pause when the internal adapter
has enough data (2% of the full resource) and resume when the
adapter size goes below 20% of those 2%.

No new tests, the media element spec doesn't clearly mandate how
the resource loading should behave when the element is paused or
how aggressively the resource should be downloaded during
playback.

This patch was functionally tested with a 1.3GiB resource loaded
over the local network, the resource was downloaded in ~30MiB
chunks, stopping and resuming every 20 seconds, approximately.

* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webkit_web_src_class_init):
(webKitWebSrcCreate):
(CachedResourceStreamingClient::responseReceived):
(CachedResourceStreamingClient::dataReceived):

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

2 months agoWebSockets: workers never use the platform WebSockets path
carlosgc@webkit.org [Mon, 29 Jul 2019 09:11:31 +0000 (09:11 +0000)]
WebSockets: workers never use the platform WebSockets path
https://bugs.webkit.org/show_bug.cgi?id=200161

Reviewed by Michael Catanzaro.

A WebCore::WebSocketChannel is created unconditionally in WorkerThreadableWebSocketChannel::Peer.

* Modules/websockets/ThreadableWebSocketChannel.cpp:
(WebCore::ThreadableWebSocketChannel::create): New create method that receives a Document& and creates the
WebSocket channel checking the runtime enabled features to decide.
* Modules/websockets/ThreadableWebSocketChannel.h:
* Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
(WebCore::WorkerThreadableWebSocketChannel::Peer::Peer): Use ThreadableWebSocketChannel::create().

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

2 months agoMultiple context menu actions broken for YouTube videos
carlosgc@webkit.org [Mon, 29 Jul 2019 09:07:26 +0000 (09:07 +0000)]
Multiple context menu actions broken for YouTube videos
https://bugs.webkit.org/show_bug.cgi?id=199999

Reviewed by Eric Carlson.

Source/WebCore:

Do not include CopyMediaLinkItem and OpenMediaInNewWindowItem to the context menu when media URL is not
downloadable or the request can't be handled.

* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::populate):

Tools:

Add a test case to check copy link address, open in new window and download options are not included in the
context menu for non-downloadable media.

* TestWebKitAPI/Tests/WebKitGtk/TestContextMenu.cpp:
(writeNextChunk):
(serverCallback):
(testContextMenuLiveStream):
(beforeAll):
(afterAll):

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

2 months agoUnreviewed, rolling out r247886.
commit-queue@webkit.org [Mon, 29 Jul 2019 04:31:04 +0000 (04:31 +0000)]
Unreviewed, rolling out r247886.
https://bugs.webkit.org/show_bug.cgi?id=200214

"Causes PLT5 regression on some machines" (Requested by mlam|a
on #webkit).

Reverted changeset:

"Add crash diagnostics for debugging unexpected zapped cells."
https://bugs.webkit.org/show_bug.cgi?id=200149
https://trac.webkit.org/changeset/247886

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

2 months agoFix the release build
timothy_horton@apple.com [Mon, 29 Jul 2019 02:27:28 +0000 (02:27 +0000)]
Fix the release build

* Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
(WebCore::WHLSL::Metal::TypeNamer::insert):

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

2 months agoReorganize UIScriptController into platform-specific subclasses
timothy_horton@apple.com [Mon, 29 Jul 2019 02:10:56 +0000 (02:10 +0000)]
Reorganize UIScriptController into platform-specific subclasses
https://bugs.webkit.org/show_bug.cgi?id=200027

Reviewed by Simon Fraser.

Instead of a mishmash of #ifdefs and extraneous empty functions,
reorganize UIScriptController so that we have a base class
with functions that assert if called (to make it harder to
accidentally write a test that depends on unimplemented
functionality), and override them in platform specific subclasses
as functionality is added.

* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
* DumpRenderTree/ios/UIScriptControllerIOS.h: Added.
* DumpRenderTree/ios/UIScriptControllerIOS.mm:
* DumpRenderTree/mac/UIScriptControllerMac.h: Added.
* DumpRenderTree/mac/UIScriptControllerMac.mm:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
* WebKitTestRunner/cocoa/UIScriptControllerCocoa.h: Added.
* WebKitTestRunner/cocoa/UIScriptControllerCocoa.mm: Added.
* WebKitTestRunner/gtk/UIScriptControllerGtk.cpp:
* WebKitTestRunner/gtk/UIScriptControllerGtk.h: Added.
* WebKitTestRunner/ios/UIScriptControllerIOS.h: Added.
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
* WebKitTestRunner/mac/UIScriptControllerMac.h: Added.
* WebKitTestRunner/mac/UIScriptControllerMac.mm:

* http/tests/contentdispositionattachmentsandbox/resources/referer-header-stripped.js:
(onload):
This test both uses event sender to click, and UIScriptController to "tap".
Since singleTapAtPoint is unimplemented on macOS, it really just ended
up doing nothing, but now it asserts. Only click or tap, but not both.

* platform/mac/TestExpectations:
* platform/win/TestExpectations:
Skip some tests for unimplemented or unsupported features.

* platform/mac/fast/events/autoscroll-when-input-is-offscreen-expected.txt: Removed.
* platform/mac/fast/events/autoscroll-with-software-keyboard-expected.txt: Removed.
Remove unneeded test results.

* swipe/resources/swipe-test.js:
(playEventStream):
playBackEventStream is unimplemented on iOS. Also, it's not necessary
for simulated swipe to send events at all on iOS, so just bail, which
is equivalent to what used to happen.

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

2 months ago[Win][WK1] Can't change Web Inspector frontend height in high DPI
Hironori.Fujii@sony.com [Mon, 29 Jul 2019 02:07:18 +0000 (02:07 +0000)]
[Win][WK1] Can't change Web Inspector frontend height in high DPI
https://bugs.webkit.org/show_bug.cgi?id=200153

Reviewed by Don Olmstead.

* WebCoreSupport/WebInspectorClient.cpp:
(WebInspectorFrontendClient::setAttachedWindowHeight):
Applied deviceScaleFactor to the argument height.

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

2 months ago[Win][MiniBrowser] Remove PageLoadTestClient
Hironori.Fujii@sony.com [Mon, 29 Jul 2019 02:03:32 +0000 (02:03 +0000)]
[Win][MiniBrowser] Remove PageLoadTestClient
https://bugs.webkit.org/show_bug.cgi?id=200155

Reviewed by Brent Fulgham.

It is not used nowadays.

* MiniBrowser/win/CMakeLists.txt:
* MiniBrowser/win/Common.cpp:
(parseCommandLine):
* MiniBrowser/win/Common.h:
* MiniBrowser/win/MainWindow.cpp:
(MainWindow::init):
* MiniBrowser/win/MainWindow.h:
* MiniBrowser/win/MiniBrowserWebHost.cpp:
(MiniBrowserWebHost::updateAddressBar):
(MiniBrowserWebHost::didFinishLoadForFrame):
(MiniBrowserWebHost::didStartProvisionalLoadForFrame):
(MiniBrowserWebHost::didFailLoadWithError):
(MiniBrowserWebHost::didHandleOnloadEventsForFrame):
(MiniBrowserWebHost::didFirstLayoutInFrame):
* MiniBrowser/win/PageLoadTestClient.cpp: Removed.
* MiniBrowser/win/PageLoadTestClient.h: Removed.
* MiniBrowser/win/ResourceLoadDelegate.cpp:
(ResourceLoadDelegate::identifierForInitialRequest):
(ResourceLoadDelegate::willSendRequest):
(ResourceLoadDelegate::didFinishLoadingFromDataSource):
(ResourceLoadDelegate::didFailLoadingWithError):
* MiniBrowser/win/WebKitBrowserWindow.cpp:
(WebKitBrowserWindow::create):
(WebKitBrowserWindow::createNewPage):
* MiniBrowser/win/WebKitBrowserWindow.h:
* MiniBrowser/win/WebKitLegacyBrowserWindow.cpp:
(WebKitLegacyBrowserWindow::create):
(WebKitLegacyBrowserWindow::WebKitLegacyBrowserWindow):
(WebKitLegacyBrowserWindow::exitProgram): Deleted.
* MiniBrowser/win/WebKitLegacyBrowserWindow.h:
(WebKitLegacyBrowserWindow::pageLoadTestClient): Deleted.
* MiniBrowser/win/WinMain.cpp:
(wWinMain):

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

2 months agoFix static analyzer build
ap@apple.com [Sun, 28 Jul 2019 21:28:24 +0000 (21:28 +0000)]
Fix static analyzer build
https://bugs.webkit.org/show_bug.cgi?id=200201

Reviewed by Anders Carlsson.

* Makefile: Add an analyze target, as this makefile is now used for full builds,
including static analyzer ones.

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

2 months ago[iOS] Touch regions overlay needs to show touch-action:none
simon.fraser@apple.com [Sun, 28 Jul 2019 21:23:51 +0000 (21:23 +0000)]
[iOS] Touch regions overlay needs to show touch-action:none
https://bugs.webkit.org/show_bug.cgi?id=200203

Reviewed by Wenson Hsieh.

When I added touch-action overlay painting, I didn't realize that touch-action:none
was an important value to display. But it is, so fix that.

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

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

2 months ago[WHLSL] Remove UnnamedType copy/move constructors and mark classes as final
sbarati@apple.com [Sun, 28 Jul 2019 01:31:48 +0000 (01:31 +0000)]
[WHLSL] Remove UnnamedType copy/move constructors and mark classes as final
https://bugs.webkit.org/show_bug.cgi?id=200188

Reviewed by Myles C. Maxfield.

Since they are ref counted, you should make taking a ref to them
instead of moving or copying them. This patch encodes that by deleting
the relevant copy/move constructors and assignment operators.

* Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h:
* Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
(WebCore::WHLSL::AST::ArrayType::ArrayType): Deleted.
(WebCore::WHLSL::AST::ArrayType::create): Deleted.
(WebCore::WHLSL::AST::ArrayType::type const): Deleted.
(WebCore::WHLSL::AST::ArrayType::type): Deleted.
(WebCore::WHLSL::AST::ArrayType::numElements const): Deleted.
* Modules/webgpu/WHLSL/AST/WHLSLPointerType.h:
(WebCore::WHLSL::AST::PointerType::PointerType): Deleted.
(WebCore::WHLSL::AST::PointerType::create): Deleted.
* Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
* Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
(WebCore::WHLSL::AST::TypeReference::TypeReference): Deleted.
(WebCore::WHLSL::AST::TypeReference::create): Deleted.
(WebCore::WHLSL::AST::TypeReference::name): Deleted.
(WebCore::WHLSL::AST::TypeReference::typeArguments): Deleted.
(WebCore::WHLSL::AST::TypeReference::maybeResolvedType const): Deleted.
(WebCore::WHLSL::AST::TypeReference::resolvedType const): Deleted.
(WebCore::WHLSL::AST::TypeReference::setResolvedType): Deleted.
* Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h:

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

2 months ago[WebGPU] Update GPUComputePipeline errors to match GPURenderPipeline implementation
justin_fan@apple.com [Sun, 28 Jul 2019 00:47:00 +0000 (00:47 +0000)]
[WebGPU] Update GPUComputePipeline errors to match GPURenderPipeline implementation
https://bugs.webkit.org/show_bug.cgi?id=200097

Reviewed by Myles C. Maxfield.

Remove passing around a functionName in GPUComputePipeline creation in favor of setting it on the GPUErrorScopes.
Also, WebGPU objects no longer create new Ref<>s unless object creation succeeds.

No new tests. Covered by existing tests.

* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createBuffer const):
(WebCore::WebGPUDevice::createBufferMapped const):
(WebCore::WebGPUDevice::createComputePipeline const):
* platform/graphics/gpu/GPUBuffer.h:
* platform/graphics/gpu/GPUComputePipeline.h:
* platform/graphics/gpu/GPUDevice.cpp:
(WebCore::GPUDevice::tryCreateBuffer):
(WebCore::GPUDevice::tryCreateComputePipeline const):
* platform/graphics/gpu/GPUDevice.h:
* platform/graphics/gpu/GPUErrorScopes.cpp:
(WebCore::GPUErrorScopes::generatePrefixedError): Only validaton errors have messages right now.
* platform/graphics/gpu/GPUErrorScopes.h:
* platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
(WebCore::GPUBuffer::validateBufferUsage):
(WebCore::GPUBuffer::tryCreate):
(WebCore::GPUBuffer::GPUBuffer):
* platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm:
(WebCore::trySetMetalFunctions):
(WebCore::trySetFunctions):
(WebCore::convertComputePipelineDescriptor):
(WebCore::tryCreateMTLComputePipelineState):
(WebCore::GPUComputePipeline::tryCreate):
(WebCore::GPUComputePipeline::GPUComputePipeline):
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::trySetMetalFunctions):
(WebCore::trySetFunctions):

These classes were made RefCounted in a previous patch; remove their move ctors to fix build.
* Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h:
* Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
* Modules/webgpu/WHLSL/AST/WHLSLPointerType.h:
* Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
* Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
* Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h:

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

2 months agoExpose the aria-label attribute for <video> elements.
commit-queue@webkit.org [Sun, 28 Jul 2019 00:42:36 +0000 (00:42 +0000)]
Expose the aria-label attribute for <video> elements.
https://bugs.webkit.org/show_bug.cgi?id=200169
<rdar://problem/51754558>

Patch by Andres Gonzalez <andresg_22@apple.com> on 2019-07-27
Reviewed by Chris Fleizach.

Source/WebCore:

Tests: accessibility/ios-simulator/media-with-aria-label.html
       accessibility/media-with-aria-label.html

We now expose the <video> element to accessibility clients as long as auto-play is not enabled.
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityIsWebInteractiveVideo]):

LayoutTests:

* accessibility/ios-simulator/media-with-aria-label-expected.txt: Added.
* accessibility/ios-simulator/media-with-aria-label.html: Added.
* accessibility/media-with-aria-label-expected.txt: Added.
* accessibility/media-with-aria-label.html: Added.
* platform/win/TestExpectations:

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

2 months agoAllow more syscalls in the WebContent process' sandbox profile
cdumez@apple.com [Sat, 27 Jul 2019 13:41:51 +0000 (13:41 +0000)]
Allow more syscalls in the WebContent process' sandbox profile
https://bugs.webkit.org/show_bug.cgi?id=200182
<rdar://problem/53594973>

Reviewed by Geoffrey Garen.

I reviewed all crash traces attached to the radar and found the following
syscalls that we not yet allowed by the WebContent process's sandbox
profile.

* WebProcess/com.apple.WebProcess.sb.in:

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

2 months ago[X86] Emit BT instruction for shift + mask in B3
justin_michaud@apple.com [Sat, 27 Jul 2019 07:08:01 +0000 (07:08 +0000)]
[X86] Emit BT instruction for shift + mask in B3
https://bugs.webkit.org/show_bug.cgi?id=199891

Reviewed by Keith Miller.

JSTests:

* microbenchmarks/bit-test-constant.js: Added.
(let.glob.0.doTest):
* microbenchmarks/bit-test-load.js: Added.
(let.glob.0.let.arr.new.Int32Array.8.doTest):
(i):
* microbenchmarks/bit-test-nonconstant.js: Added.
(let.glob.0.doTest):

Source/JavaScriptCore:

- Add a new BranchTestBit air opcode, matching the intel bt instruction
- Select this instruction for the following patterns:
  if (a & (1<<b))
  if ((a>>b)&1)
  if ((~a>>b)&1)
  if (~a & (1<<b))
- 15% perf progression on the nonconstant microbenchmark, neutral otherwise.
- Note: we cannot fuse loads when we have bitBase=Load, bitOffset=Tmp, since the X86 instruction has
  different behaviour in this mode. It will read past the current dword/qword instead of wrapping around.

* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::branchTestBit32):
* assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::branchTestBit64):
* assembler/X86Assembler.h:
(JSC::X86Assembler::bt_ir):
(JSC::X86Assembler::bt_im):
(JSC::X86Assembler::btw_ir):
(JSC::X86Assembler::btw_im):
* assembler/testmasm.cpp:
(JSC::int64Operands):
(JSC::testBranchTestBit32RegReg):
(JSC::testBranchTestBit32RegImm):
(JSC::testBranchTestBit32AddrImm):
(JSC::testBranchTestBit64RegReg):
(JSC::testBranchTestBit64RegImm):
(JSC::testBranchTestBit64AddrImm):
(JSC::run):
* b3/B3LowerToAir.cpp:
* b3/air/AirOpcode.opcodes:
* b3/testb3.cpp:
(JSC::B3::testBranchBitTest32TmpImm):
(JSC::B3::testBranchBitTest32AddrImm):
(JSC::B3::testBranchBitTest32TmpTmp):
(JSC::B3::testBranchBitTest64TmpTmp):
(JSC::B3::testBranchBitTest64AddrTmp):
(JSC::B3::run):

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

2 months ago[JSC] Potential GC fix for JSPropertyNameEnumerator
ysuzuki@apple.com [Sat, 27 Jul 2019 04:55:11 +0000 (04:55 +0000)]
[JSC] Potential GC fix for JSPropertyNameEnumerator
https://bugs.webkit.org/show_bug.cgi?id=200151

Reviewed by Mark Lam.

JSTests:

* stress/for-in-stress.js: Added.
(keys):

Source/JavaScriptCore:

We have been seeing some JSPropertyNameEnumerator::visitChildren crashes for a long time. The crash frequency itself is not high, but it has existed for a long time.
The crash happens when visiting m_propertyNames. It is also possible that this crash is caused by random corruption somewhere, but JSPropertyNameEnumerator
has some tricky (and potentially dangerous) implementations anyway.

1. JSPropertyNameEnumerator have Vector<WriteBarrier<JSString>> and it is extended in finishCreation with a lock.
   We should use Auxiliary memory for this use case. And we should set this memory in the constructor so that
   we do not extend it in finishCreation, and we do not need a lock.
2. JSPropertyNameEnumerator gets StructureID before allocating JSPropertyNameEnumerator. This is potentially dangerous because the conservative scan
   cannot find the Structure* since we could only have StructureID. Since allocation code happens after StructureID is retrieved, it is possible that
   the allocation causes GC and Structure* is collected.

In this patch, we align JSPropertyNameEnumerator implementation to the modern one to avoid using Vector<WriteBarrier<JSString>>. And we can make JSPropertyNameEnumerator
a non-destructible cell. Since JSCell's destructor is one of the cause of various issues, we should avoid it if we can.

No behavior change. This patch adds a test stressing JSPropertyNameEnumerator.

* dfg/DFGOperations.cpp:
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/JSPropertyNameEnumerator.cpp:
(JSC::JSPropertyNameEnumerator::create):
(JSC::JSPropertyNameEnumerator::JSPropertyNameEnumerator):
(JSC::JSPropertyNameEnumerator::finishCreation):
(JSC::JSPropertyNameEnumerator::visitChildren):
(JSC::JSPropertyNameEnumerator::destroy): Deleted.
* runtime/JSPropertyNameEnumerator.h:
* runtime/VM.cpp:
(JSC::VM::emptyPropertyNameEnumeratorSlow):
* runtime/VM.h:
(JSC::VM::emptyPropertyNameEnumerator):

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

2 months agoUnreviewed. Remove invalid assertion after r247878.
sbarati@apple.com [Sat, 27 Jul 2019 02:18:41 +0000 (02:18 +0000)]
Unreviewed. Remove invalid assertion after r247878.
We were essentially asserting all UnnamedType* were
unique. But my patch made this no longer the case by
design to make things faster.

* Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
(WebCore::WHLSL::Metal::TypeNamer::insert):

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

2 months agoAdd crash diagnostics for debugging unexpected zapped cells.
mark.lam@apple.com [Sat, 27 Jul 2019 00:43:54 +0000 (00:43 +0000)]
Add crash diagnostics for debugging unexpected zapped cells.
https://bugs.webkit.org/show_bug.cgi?id=200149
<rdar://problem/53570112>

Reviewed by Yusuke Suzuki, Saam Barati, and Michael Saboff.

Source/JavaScriptCore:

Add a check for zapped cells in SlotVisitor::appendToMarkStack() and
SlotVisitor::visitChildren().  If a zapped cell is detected, we will crash with
some diagnostic info.

To facilitate this, we've made the following changes:
1. Changed FreeCell to preserve the 1st 8 bytes.  This is fine to do because all
   cells are at least 16 bytes long.
2. Changed HeapCell::zap() to only zap the structureID.  Leave the rest of the
   cell header info intact (including the cell JSType).
3. Changed HeapCell::zap() to record the reason for zapping the cell.  We stash
   the reason immediately after the first 8 bytes.  This is the same location as
   FreeCell::scrambledNext.  However, since a cell is not expected to be zapped
   and on the free list at the same time, it is also fine to do this.
4. Added a few utility functions to MarkedBlock for checking if a cell points
   into the block.
5. Added VMInspector and JSDollarVM utilities to dump in-use subspace hashes.
6. Added some comments to document the hashes of known subspaces.

* heap/FreeList.h:
(JSC::FreeCell::offsetOfScrambledNext):
* heap/HeapCell.h:
(JSC::HeapCell::zap):
(JSC::HeapCell::isZapped const):
* heap/MarkedBlock.cpp:
(JSC::MarkedBlock::Handle::stopAllocating):
* heap/MarkedBlock.h:
(JSC::MarkedBlock::Handle::start const):
(JSC::MarkedBlock::Handle::end const):
(JSC::MarkedBlock::Handle::contains const):
* heap/MarkedBlockInlines.h:
(JSC::MarkedBlock::Handle::specializedSweep):
* heap/MarkedSpace.h:
(JSC::MarkedSpace::forEachSubspace):
* heap/SlotVisitor.cpp:
(JSC::SlotVisitor::appendToMarkStack):
(JSC::SlotVisitor::visitChildren):
(JSC::SlotVisitor::reportZappedCellAndCrash):
* heap/SlotVisitor.h:
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::emitAllocateWithNonNullAllocator):
* runtime/VM.cpp:
(JSC::VM::VM):
* tools/JSDollarVM.cpp:
(JSC::functionDumpSubspaceHashes):
(JSC::JSDollarVM::finishCreation):
* tools/VMInspector.cpp:
(JSC::VMInspector::dumpSubspaceHashes):
* tools/VMInspector.h:

Source/WebCore:

No new tests because this is a feature for debugging crashes.  It has been tested
manually by modifying the code to force a crash at the point of interest.

Added some comments to document the hashes of known subspaces.

* bindings/js/WebCoreJSClientData.cpp:
(WebCore::JSVMClientData::JSVMClientData):

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

2 months agoNavigationSOAuthorizationSession should check the active URL of the responding page...
jiewen_tan@apple.com [Sat, 27 Jul 2019 00:03:45 +0000 (00:03 +0000)]
NavigationSOAuthorizationSession should check the active URL of the responding page after waking up from waiting
https://bugs.webkit.org/show_bug.cgi?id=200150
<rdar://problem/53280170>

Reviewed by Brent Fulgham.

Source/WebKit:

NavigationSOAuthorizationSession should check the active URL of the responding page after waking up from waiting
as the page might have already changed the location.

* UIProcess/Cocoa/SOAuthorization/NavigationSOAuthorizationSession.h:
* UIProcess/Cocoa/SOAuthorization/NavigationSOAuthorizationSession.mm:
(WebKit::NavigationSOAuthorizationSession::shouldStartInternal):
(WebKit::NavigationSOAuthorizationSession::webViewDidMoveToWindow):
(WebKit::NavigationSOAuthorizationSession::pageActiveURLDidChangeDuringWaiting const):
* UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.mm:
(WebKit::SubFrameSOAuthorizationSession::abortInternal):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm:
(TestWebKitAPI::TEST):

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

2 months agoFollow-up fix: results.webkit.org: Suite results shouldn't be the landing page
jbedard@apple.com [Fri, 26 Jul 2019 23:58:59 +0000 (23:58 +0000)]
Follow-up fix: results.webkit.org: Suite results shouldn't be the landing page
https://bugs.webkit.org/show_bug.cgi?id=200090

Unreviewed follow-up fix.

* resultsdbpy/resultsdbpy/view/view_routes.py:
(ViewRoutes.__init__): Keep /search endpoint for existing links

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

2 months ago[Win] Remove unused methods from WebPluginInfoProvider
annulen@yandex.ru [Fri, 26 Jul 2019 23:48:33 +0000 (23:48 +0000)]
[Win] Remove unused methods from WebPluginInfoProvider
https://bugs.webkit.org/show_bug.cgi?id=200178

Reviewed by Brent Fulgham.

These methods are guarded with PLATFORM(MAC) and have no definitions.
Also remove unused friend declaration.

* WebCoreSupport/WebPluginInfoProvider.h:

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

2 months agoMoving right by word boundary right before an object element followed by a br element...
rniwa@webkit.org [Fri, 26 Jul 2019 23:38:16 +0000 (23:38 +0000)]
Moving right by word boundary right before an object element followed by a br element hangs
https://bugs.webkit.org/show_bug.cgi?id=200144

Reviewed by Simon Fraser.

Source/WebCore:

The bug was caused by an infinite loop inside wordBreakIteratorForMinOffsetBoundary when it's trying to
find the previous word boundary at the beginning of a word after the object element and the br element.
In this case, previousBox is at the br element after the object element in the preceding line, and
logicallyPreviousBox ends up returning the same inline box (that of the br element), causing a hang.

Here's how. In logicallyPreviousBox, previousRootInlineBoxCandidatePosition returns a legacy position
immediately after the object element. The root inline box for this position (previousRoot) is the one
that contains the object element and the br element. However, when previousTextOrLineBreakBox is called
on this root inline box, "box" argument of the function is set to nullptr, and as a result, the function
finds and returns the same inline box of the br element that was passed to logicallyPreviousBox.

Fixed the bug by passing the starting inline box to previousRootInlineBoxCandidatePosition when its
root inline box is the previous root inline box (previousRoot). Also applied the same fix to
logicallyNextBox even though we don't have a reproduction for that case for now (RTL test case is
unaffected by nextRootInlineBoxCandidatePosition).

Tests: editing/selection/move-by-word-visually-across-object-element-1.html
       editing/selection/move-by-word-visually-across-object-element-2.html
       editing/selection/move-by-word-visually-across-object-element-3.html

* editing/VisibleUnits.cpp:
(WebCore::logicallyPreviousBox): Fixed the bug.
(WebCore::logicallyNextBox): Ditto.

LayoutTests:

Added regression tests. The second test case involes non-word characters "%)" which are skipped like whitespaces
for the purposes of moving right or left by word granularity. The third test case involves RTL text.

* editing/selection/move-by-word-visually-across-object-element-1-expected.txt: Added.
* editing/selection/move-by-word-visually-across-object-element-1.html: Added.
* editing/selection/move-by-word-visually-across-object-element-2-expected.txt: Added.
* editing/selection/move-by-word-visually-across-object-element-2.html: Added.
* editing/selection/move-by-word-visually-across-object-element-3-expected.txt: Added.
* editing/selection/move-by-word-visually-across-object-element-3.html: Added.

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

2 months agoDo not fire readystatechange events at documents about to get replaced by javascript...
beidson@apple.com [Fri, 26 Jul 2019 22:53:47 +0000 (22:53 +0000)]
Do not fire readystatechange events at documents about to get replaced by javascript URLs.
<rdar://problem/51665406> and https://bugs.webkit.org/show_bug.cgi?id=198786

Reviewed by Ryosuke Niwa.

Source/WebCore:

Test: http/tests/dom/ready-state-on-javascript-replace.html

We were firing too many readystatechange events, more than other browsers.
Our behavior on this test with this patch now matches Chrome.

(There was even an ancient FIXME alluding to this referencing a spec issue, and that issues has long been resolvedv)

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::stopLoading):

LayoutTests:

* http/tests/dom/ready-state-on-javascript-replace-expected.txt: Added.
* http/tests/dom/ready-state-on-javascript-replace.html: Added.

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

2 months ago[iPadOS] wix.com cannot select a template to edit or view
zalan@apple.com [Fri, 26 Jul 2019 21:27:38 +0000 (21:27 +0000)]
[iPadOS] wix.com cannot select a template to edit or view
https://bugs.webkit.org/show_bug.cgi?id=200174
<rdar://problem/53281296>

Reviewed by Simon Fraser.

Opt out of simulated mouse event sending for template selection on wix.com.
When wix.com receives a simulated mouse event during the touch events, it calls preventDefault() which prevents us from running the hover heuristics -> no click.

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

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

2 months ago[WHLSL] UnnamedType should be reference counted
sbarati@apple.com [Fri, 26 Jul 2019 21:26:12 +0000 (21:26 +0000)]
[WHLSL] UnnamedType should be reference counted
https://bugs.webkit.org/show_bug.cgi?id=200098

Reviewed by Dean Jackson.

This patch makes UnnamedType reference counted. The motivation for doing this
is I measured how many times we were cloning UnnamedTypes, and I found we were
doing it ~433,000 times in some of Justin's demos. This is hugely wasteful,
given that an UnnamedType is immutable in the sense that once the type is
resolved, it will never change. So instead of repeatedly cloning the same
type, and having Expression point to a UniqueRef of UnnamedType, we should
instead make UnnamedType reference counted, and have expressions point to a
potentially shared UnnamedType.

Doing this is hugely beneficial to WHLSL compile times. On Justin's demos,
these are the results I'm getting:

hello-triangle: neutral
hello-cube: 55% faster
compute-blur: 35% faster
textured-cube: 49% faster

* Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h:
(WebCore::WHLSL::AST::ArrayReferenceType::ArrayReferenceType):
(WebCore::WHLSL::AST::ArrayReferenceType::create):
* Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
(WebCore::WHLSL::AST::ArrayType::ArrayType):
(WebCore::WHLSL::AST::ArrayType::create):
* Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h:
(WebCore::WHLSL::AST::EnumerationDefinition::EnumerationDefinition):
* Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
(WebCore::WHLSL::AST::Expression::setType):
(WebCore::WHLSL::AST::Expression::copyTypeTo const):
* Modules/webgpu/WHLSL/AST/WHLSLFloatLiteral.h:
(WebCore::WHLSL::AST::FloatLiteral::clone const):
* Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.cpp:
(WebCore::WHLSL::AST::FloatLiteralType::FloatLiteralType):
(WebCore::WHLSL::AST::FloatLiteralType::clone const):
* Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h:
* Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h:
(WebCore::WHLSL::AST::FunctionDeclaration::FunctionDeclaration):
* Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.h:
(WebCore::WHLSL::AST::IntegerLiteral::clone const):
* Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp:
(WebCore::WHLSL::AST::IntegerLiteralType::IntegerLiteralType):
(WebCore::WHLSL::AST::IntegerLiteralType::clone const):
* Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h:
* Modules/webgpu/WHLSL/AST/WHLSLNullLiteral.h:
(WebCore::WHLSL::AST::NullLiteral::clone const):
* Modules/webgpu/WHLSL/AST/WHLSLPointerType.h:
(WebCore::WHLSL::AST::PointerType::PointerType):
(WebCore::WHLSL::AST::PointerType::create):
* Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h:
(WebCore::WHLSL::AST::ReadModifyWriteExpression::ReadModifyWriteExpression):
* Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
(WebCore::WHLSL::AST::ReferenceType::ReferenceType):
* Modules/webgpu/WHLSL/AST/WHLSLResolvableType.h:
(WebCore::WHLSL::AST::ResolvableType::resolve):
* Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h:
(WebCore::WHLSL::AST::StructureElement::StructureElement):
* Modules/webgpu/WHLSL/AST/WHLSLTypeArgument.cpp:
(WebCore::WHLSL::AST::clone):
* Modules/webgpu/WHLSL/AST/WHLSLTypeArgument.h:
* Modules/webgpu/WHLSL/AST/WHLSLTypeDefinition.h:
(WebCore::WHLSL::AST::TypeDefinition::TypeDefinition):
* Modules/webgpu/WHLSL/AST/WHLSLTypeReference.cpp:
(WebCore::WHLSL::AST::TypeReference::wrap):
* Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
(WebCore::WHLSL::AST::TypeReference::create):
(WebCore::WHLSL::AST::TypeReference::cloneTypeReference const): Deleted.
* Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h:
* Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.h:
(WebCore::WHLSL::AST::UnsignedIntegerLiteral::clone const):
* Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp:
(WebCore::WHLSL::AST::UnsignedIntegerLiteralType::UnsignedIntegerLiteralType):
(WebCore::WHLSL::AST::UnsignedIntegerLiteralType::clone const):
* Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h:
* Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h:
* Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
(WebCore::WHLSL::Metal::vectorInnerType):
* Modules/webgpu/WHLSL/Metal/WHLSLNativeTypeWriter.cpp:
(WebCore::WHLSL::Metal::writeNativeType):
* Modules/webgpu/WHLSL/WHLSLAutoInitializeVariables.cpp:
(WebCore::WHLSL::AutoInitialize::visit):
* Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp:
(WebCore::WHLSL::DuplicateFunctionKey::hash const):
* Modules/webgpu/WHLSL/WHLSLChecker.cpp:
(WebCore::WHLSL::resolveWithOperatorAnderIndexer):
(WebCore::WHLSL::resolveWithOperatorLength):
(WebCore::WHLSL::resolveWithReferenceComparator):
(WebCore::WHLSL::resolveByInstantiation):
(WebCore::WHLSL::checkOperatorOverload):
(WebCore::WHLSL::Checker::assignTypes):
(WebCore::WHLSL::matchAndCommit):
(WebCore::WHLSL::commit):
(WebCore::WHLSL::Checker::assignConcreteType):
(WebCore::WHLSL::Checker::assignType):
(WebCore::WHLSL::Checker::forwardType):
(WebCore::WHLSL::Checker::visit):
(WebCore::WHLSL::getUnnamedType):
(WebCore::WHLSL::argumentTypeForAndOverload):
(WebCore::WHLSL::Checker::finishVisiting):
(WebCore::WHLSL::Checker::isBoolType):
* Modules/webgpu/WHLSL/WHLSLInferTypes.cpp:
(WebCore::WHLSL::matchAndCommit):
(WebCore::WHLSL::commit):
(WebCore::WHLSL::inferTypesForTypeArguments):
(WebCore::WHLSL::inferTypesForCallImpl):
* Modules/webgpu/WHLSL/WHLSLInferTypes.h:
* Modules/webgpu/WHLSL/WHLSLIntrinsics.cpp:
(WebCore::WHLSL::Intrinsics::addVector):
(WebCore::WHLSL::Intrinsics::addMatrix):
(WebCore::WHLSL::Intrinsics::addTexture):
* Modules/webgpu/WHLSL/WHLSLParser.cpp:
(WebCore::WHLSL::Parser::parseTypeArgument):
(WebCore::WHLSL::Parser::parseType):
(WebCore::WHLSL::Parser::parseEnumerationDefinition):
(WebCore::WHLSL::Parser::parseVariableDeclaration):
(WebCore::WHLSL::Parser::parseVariableDeclarations):
* Modules/webgpu/WHLSL/WHLSLParser.h:
* Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp:
(WebCore::WHLSL::PreserveLifetimes::PreserveLifetimes):
(WebCore::WHLSL::PreserveLifetimes::makeStructVariableReference):
(WebCore::WHLSL::PreserveLifetimes::assignVariableIntoStruct):
(WebCore::WHLSL::preserveVariableLifetimes):
* Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
(WebCore::WHLSL::wrapAnderCallArgument):
(WebCore::WHLSL::anderCallArgument):
(WebCore::WHLSL::setterCall):
(WebCore::WHLSL::getterCall):
(WebCore::WHLSL::modify):
(WebCore::WHLSL::PropertyResolver::visit):
(WebCore::WHLSL::PropertyResolver::simplifyRightValue):
(WebCore::WHLSL::LeftValueSimplifier::finishVisiting):
* Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.cpp:
(WebCore::WHLSL::conversionCost):
* Modules/webgpu/WHLSL/WHLSLResolvingType.h:
(WebCore::WHLSL::ResolvingType::ResolvingType):
(WebCore::WHLSL::ResolvingType::getUnnamedType):
(WebCore::WHLSL::ResolvingType::visit):
* Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp:
(WebCore::WHLSL::synthesizeArrayOperatorLength):
* Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
(WebCore::WHLSL::synthesizeConstructors):
* Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp:
(WebCore::WHLSL::synthesizeEnumerationFunctions):
* Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp:
(WebCore::WHLSL::synthesizeStructureAccessors):
* Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
(WebCore::WHLSL::Visitor::visit):

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

2 months agoresults.webkit.org: Add switch to filter results by expectation
jbedard@apple.com [Fri, 26 Jul 2019 21:23:32 +0000 (21:23 +0000)]
results.webkit.org: Add switch to filter results by expectation
https://bugs.webkit.org/show_bug.cgi?id=200134

Rubber-stamped by Aakash Jain.

Users of the results database should be able to easily differentiate tests which are expected
to fail verse tests which are unexpectedly failing.

* resultsdbpy/resultsdbpy/view/static/js/timeline.js:
(Timeline.render): Respect the willFilterExpected variable.
(LegendLabel): Generates html for label in the legend.
(Legend): Add switch for filter results.
* resultsdbpy/resultsdbpy/view/templates/search.html: GIve Legend callback to re-render timelines.
* resultsdbpy/resultsdbpy/view/templates/suite_results.html:

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

2 months agoCrashes under XPCServiceMain() / mach_msg_trap() due to sandboxing
cdumez@apple.com [Fri, 26 Jul 2019 21:08:46 +0000 (21:08 +0000)]
Crashes under XPCServiceMain() / mach_msg_trap() due to sandboxing
https://bugs.webkit.org/show_bug.cgi?id=200173
<rdar://problem/53594973>

Reviewed by Per Arne Vollan.

Allow a few more syscalls as they appear to be needed by mach_msg_trap().

* WebProcess/com.apple.WebProcess.sb.in:

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

2 months ago[iOS] REGRESSION: Keyboard dismisses and reappears when typing 2FA pin on appleid...
dbates@webkit.org [Fri, 26 Jul 2019 20:52:14 +0000 (20:52 +0000)]
[iOS] REGRESSION: Keyboard dismisses and reappears when typing 2FA pin on appleid.apple.com
https://bugs.webkit.org/show_bug.cgi?id=200171
<rdar://problem/50245251>

Reviewed by Wenson Hsieh.

Take out an InputViewUpdateDeferrer token (if we don't already have one) to temporarily defer
tearing down the input view (keyboard) before bluring the previously focused element as part
of switching between focused elements. This avoid a noticeable flash caused by UIKit animating
out and animating in the keyboard should the newly focused element require the keyboard. We
only take out the InputViewUpdateDeferrer until we fall off the end of _elementDidFocus: (or
bail early). Once we fall of the end UIKit will update input view UI.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]):

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

2 months ago[curl] Heap corruption in ~CurlResponse
commit-queue@webkit.org [Fri, 26 Jul 2019 20:46:48 +0000 (20:46 +0000)]
[curl] Heap corruption in ~CurlResponse
https://bugs.webkit.org/show_bug.cgi?id=198320

Patch by Takashi Komori <Takashi.Komori@sony.com> on 2019-07-26
Reviewed by Fujii Hironori.

Stop sharing object which was reffered by two threads to fix crash bug.

No tests needed, no functionality changes.

* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::start):
(WebCore::CurlRequest::invokeDidReceiveResponseForFile):
* platform/network/curl/CurlRequest.h:

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

2 months agoslides.google.com: opening speaker notes while presenting causes a fatal error in...
youenn@apple.com [Fri, 26 Jul 2019 20:34:28 +0000 (20:34 +0000)]
slides.google.com: opening speaker notes while presenting causes a fatal error in the web app on iPad
https://bugs.webkit.org/show_bug.cgi?id=199933
<rdar://problem/53034345>

Reviewed by Darin Adler.

docs.google.com might sometimes try to window.open an about URL that not about:blank or about:srcdoc.
In that case, WebKit is opening a window but is considering that the window is cross origin with its opener.
This breaks docs.google.com as they want to access the website.
Add a site-specific hack so as to treat all about URLs being opened through window.open as about:blank.

Manually tested on docs.google.com website.

* page/DOMWindow.cpp:
(WebCore::DOMWindow::createWindow):
(WebCore::DOMWindow::open):
* page/Quirks.cpp:
(WebCore::Quirks::needsYouTubeOverflowScrollQuirk const):
(WebCore::Quirks::shouldOpenAsAboutBlank const):
* page/Quirks.h:

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

2 months agoAvoid WebContent process SIGKILL when using kevent()
cdumez@apple.com [Fri, 26 Jul 2019 19:34:13 +0000 (19:34 +0000)]
Avoid WebContent process SIGKILL when using kevent()
https://bugs.webkit.org/show_bug.cgi?id=200170
<rdar://problem/51559921>

Reviewed by Per Arne Vollan.

Avoid WebContent process SIGKILL when using kevent() by updated its sandboxing profile.

* WebProcess/com.apple.WebProcess.sb.in:

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

2 months ago[ews-build] Use update-webkit script in Style EWS
aakash_jain@apple.com [Fri, 26 Jul 2019 19:22:02 +0000 (19:22 +0000)]
[ews-build] Use update-webkit script in Style EWS
https://bugs.webkit.org/show_bug.cgi?id=193196

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/factories.py:
(StyleFactory): Updated to use CheckOutSource step as well.
* BuildSlaveSupport/ews-build/steps.py: Added build-step to UpdateWorkingDirectory.
* BuildSlaveSupport/ews-build/steps_unittest.py: Added unit-tests.

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

2 months agoresults.webkit.org: Support buildbot 0.8 CI links
jbedard@apple.com [Fri, 26 Jul 2019 19:19:36 +0000 (19:19 +0000)]
results.webkit.org: Support buildbot 0.8 CI links
https://bugs.webkit.org/show_bug.cgi?id=200146

Reviewed by Aakash Jain.

* resultsdbpy/resultsdbpy/model/ci_context.py:
(BuildbotEightURLFactory): Buildbot 0.8 link factory.
(BuildbotEightURLFactory.__init__):
(BuildbotEightURLFactory.url):
* resultsdbpy/resultsdbpy/model/ci_context_unittest.py:
(URLFactoryTest.test_old_builder_url):
(URLFactoryTest):
(URLFactoryTest.test_old_worker_url):

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

2 months agoresults.webkit.org: Suite results shouldn't be the landing page
jbedard@apple.com [Fri, 26 Jul 2019 19:17:31 +0000 (19:17 +0000)]
results.webkit.org: Suite results shouldn't be the landing page
https://bugs.webkit.org/show_bug.cgi?id=200090

Reviewed by Aakash Jain.

* resultsdbpy/resultsdbpy/view/templates/suite_results.html: Remove search bar.
* resultsdbpy/resultsdbpy/view/view_routes.py:
(ViewRoutes.__init__): Make search the landing page instead of suite results.
* resultsdbpy/resultsdbpy/view/view_routes_unittest.py:
(WebSiteUnittest.test_main):

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

2 months ago[iOS] WebPage::TouchEventSync() & WebPage::GetPositionInformation() sync IPC causes...
cdumez@apple.com [Fri, 26 Jul 2019 18:27:28 +0000 (18:27 +0000)]
[iOS] WebPage::TouchEventSync() & WebPage::GetPositionInformation() sync IPC causes UIProcess hangs
https://bugs.webkit.org/show_bug.cgi?id=200138
<rdar://problem/52698157>

Reviewed by Geoffrey Garen.

Source/WebKit:

Revert most of r247822 and use an alternative approach to address hangs. In this patch, the proposal
is to add a SendSyncOption::ForceDispatchWhenDestinationIsWaitingForUnboundedSyncReply flag on the
WebPage::TouchEventSync() & WebPage::GetPositionInformation() sendSync() calls in the UIProcess.
Those will cause this IPCs to get dispatched right away in the WebContent process, even if the
WebContent process is itself currently stuck on unbounded (i.e. potentially slow) synchronous IPC
(JS alerts / prompts & sync XHR). Because re-entering WebCore on sync IPC is generally unsafe, this
patch also updates the WebPage::getPositionInformation() & WebPage::touchEventSync() to return early
(i.e. cancelled) if they get called while the WebContent process is stuck on a slow sendSync.

This approach should address the UIProcess hangs caused by the WebPage::TouchEventSync() and
WebPage::GetPositionInformation() sync IPC messages when the WebContent process is busy on a slow XHR
or a JS prompt / alert. It should be safe because we do not re-enter WebCore. The only drawback is that
those IPCs will be cancelled (early return with default value) when the WebContent process is busy.
However, I am being told that this is likely acceptable in practice.

* Platform/IPC/Connection.cpp:
(IPC::Connection::SyncMessageState::processIncomingMessage):
(IPC::Connection::sendMessage):
(IPC::Connection::sendSyncMessage):
(IPC::Connection::dispatchMessage):
* Platform/IPC/Connection.h:
(IPC::UnboundedSynchronousIPCScope::UnboundedSynchronousIPCScope):
(IPC::UnboundedSynchronousIPCScope::~UnboundedSynchronousIPCScope):
(IPC::UnboundedSynchronousIPCScope::hasOngoingUnboundedSyncIPC):
* Platform/IPC/Decoder.cpp:
(IPC::Decoder::shouldDispatchMessageWhenWaitingForSyncReply const):
* Platform/IPC/Decoder.h:
* Platform/IPC/Encoder.cpp:
(IPC::Encoder::shouldDispatchMessageWhenWaitingForSyncReply const):
(IPC::Encoder::setShouldDispatchMessageWhenWaitingForSyncReply):
(IPC::Encoder::wrapForTesting):
* Platform/IPC/Encoder.h:
* Platform/IPC/MessageFlags.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::handleTouchEventSynchronously):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView ensurePositionInformationIsUpToDate:]):
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::loadResourceSynchronously):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
(WebKit::WebChromeClient::runJavaScriptAlert):
(WebKit::WebChromeClient::runJavaScriptConfirm):
(WebKit::WebChromeClient::runJavaScriptPrompt):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::layerVolatilityTimerFired):
(WebKit::WebPage::markLayersVolatile):
(WebKit::WebPage::cancelMarkLayersVolatile):
(WebKit::WebPage::touchEventSync):
(WebKit::WebPage::didCompletePageTransition):
(WebKit::WebPage::updatePreferences):
(WebKit::WebPage::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::sendSyncWithDelayedReply):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getPositionInformation):

LayoutTests:

Update existing layout test accordingly.

* fast/misc/{testProcessIncomingSyncMessagesWhenWaitingForUnboundedReply-expected.txt: Renamed from LayoutTests/fast/misc/testProcessIncomingSyncMessagesWhenWaitingForSyncReply-expected.txt.
* fast/misc/{testProcessIncomingSyncMessagesWhenWaitingForUnboundedReply.html: Renamed from LayoutTests/fast/misc/testProcessIncomingSyncMessagesWhenWaitingForSyncReply.html.

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

2 months agoWeb Inspector: AXI: Audit: Typo of "some" as "somee"
commit-queue@webkit.org [Fri, 26 Jul 2019 18:25:00 +0000 (18:25 +0000)]
Web Inspector: AXI: Audit: Typo of "some" as "somee"
https://bugs.webkit.org/show_bug.cgi?id=200166

Patch by Greg Doolittle <gr3g@apple.com> on 2019-07-26
Reviewed by Devin Rousso.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Controllers/AuditManager.js:
(WI.AuditManager.prototype._addDefaultTests):
(WI.AuditManager):

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

2 months agoUnable to tap/double tap to open files/folders in Google Drive in Safari
zalan@apple.com [Fri, 26 Jul 2019 18:22:06 +0000 (18:22 +0000)]
Unable to tap/double tap to open files/folders in Google Drive in Safari
https://bugs.webkit.org/show_bug.cgi?id=200096
<rdar://problem/52748552>

Reviewed by Wenson Hsieh.

Source/WebKit:

This patch reverts to the original double-tap-for-double-click implementation (see r244775 and r246347 for more information).

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::doubleTapForDoubleClickDelay): Deleted.
(WebKit::PageClientImpl::doubleTapForDoubleClickRadius): Deleted.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView cleanupInteraction]):
(-[WKContentView _removeDefaultGestureRecognizers]):
(-[WKContentView _addDefaultGestureRecognizers]):
(-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]): Do not recognize the single and double gestures the same time.
(-[WKContentView gestureRecognizerShouldBegin:]):
(-[WKContentView _doubleTapRecognizedForDoubleClick:]):
(-[WKContentView _didStartProvisionalLoadForMainFrame]):
(-[WKContentView _ensureNonBlockingDoubleTapGestureRecognizer]): Deleted.
(-[WKContentView _doubleTapForDoubleClickDelay]): Deleted.
(-[WKContentView _doubleTapForDoubleClickRadius]): Deleted.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::handleDoubleTapForDoubleClickAtPoint):
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleDoubleTapForDoubleClickAtPoint):
(WebKit::WebPage::commitPotentialTap):
(WebKit::WebPage::handlePotentialDoubleTapForDoubleClickAtPoint): Deleted.

LayoutTests:

1. Rebaseline (progression).
2. Payment request tests activate elements by tapping on them at a high speed, triggering double clicks instead. Let's slow them down a bit.

* fast/events/touch/ios/double-tap-for-double-click3-expected.txt:
* http/tests/adClickAttribution/anchor-tag-attributes-validation.html:
* http/tests/resources/payment-request.js:
(activateThen):
* resources/ui-helper.js:
(window.UIHelper.activateElementAtHumanSpeed.return.new.Promise):
(window.UIHelper.activateElementAtHumanSpeed):
* tests-options.json:

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

2 months agoFix a bug that cannot update builder password on builders administrative page.
dewei_zhu@apple.com [Fri, 26 Jul 2019 17:58:21 +0000 (17:58 +0000)]
Fix a bug that cannot update builder password on builders administrative page.
https://bugs.webkit.org/show_bug.cgi?id=200154

Reviewed by Ryosuke Niwa.

'builders' administrative page should be able to update password for a builder.

* public/admin/builders.php: Should be able to update builder password.

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

2 months agoAX: web process should load correct bundle path for MACCATALYST
commit-queue@webkit.org [Fri, 26 Jul 2019 17:18:31 +0000 (17:18 +0000)]
AX: web process should load correct bundle path for MACCATALYST
https://bugs.webkit.org/show_bug.cgi?id=200122

Patch by Eric Liang <ericliang@apple.com> on 2019-07-26
Reviewed by Brent Fulgham.

Added the path to accessibility bundle for Mac Catalyst.
Added sandbox profile to read accessibility settings.

* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::registerWithAccessibility):
* WebProcess/com.apple.WebProcess.sb.in:

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

2 months agoFollow-up fix: results.webkit.org: Color should be the worst result, count should...
jbedard@apple.com [Fri, 26 Jul 2019 16:08:15 +0000 (16:08 +0000)]
Follow-up fix: results.webkit.org: Color should be the worst result, count should include all results
https://bugs.webkit.org/show_bug.cgi?id=200127

Unreviewed follow-up fix.

* resultsdbpy/resultsdbpy/view/static/js/timeline.js:
(Dot.toString): Use self instead of this in render callback.

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

2 months agoREGRESSION(r246496): [GTK] Tapping the web view scrolls up a bit
commit-queue@webkit.org [Fri, 26 Jul 2019 09:00:32 +0000 (09:00 +0000)]
REGRESSION(r246496): [GTK] Tapping the web view scrolls up a bit
https://bugs.webkit.org/show_bug.cgi?id=200084

Patch by Alexander Mikhaylenko <exalm7659@gmail.com> on 2019-07-26
Reviewed by Carlos Garcia Campos.

gdk_event_get_scroll_direction() returns false, but also sets direction to GDK_SCROLL_UP if
the direction was GDK_SCROLL_SMOOTH. Relying on zero deltas in this case is not correct, because
they can also be zero with GDK_SCROLL_SMOOTH. In this case, set the direction manually to avoid
that.

See https://gitlab.gnome.org/GNOME/gtk/issues/2048

Source/WebCore:

* platform/gtk/PlatformWheelEventGtk.cpp:
(WebCore::PlatformWheelEvent::PlatformWheelEvent):

Source/WebKit:

* Shared/gtk/WebEventFactory.cpp:
(WebKit::WebEventFactory::createWebWheelEvent):

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

2 months ago[WPE] Support disk cache dumping like GTK
commit-queue@webkit.org [Fri, 26 Jul 2019 08:52:01 +0000 (08:52 +0000)]
[WPE] Support disk cache dumping like GTK
https://bugs.webkit.org/show_bug.cgi?id=200157

Patch by Loïc Yhuel <loic.yhuel@softathome.com> on 2019-07-26
Reviewed by Carlos Garcia Campos.

Creating or touching "dump" would create the dump.json.

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::Cache):

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

2 months agoMake storing cross-origin top-level prefetches in HTTP cache optional
commit-queue@webkit.org [Fri, 26 Jul 2019 07:29:55 +0000 (07:29 +0000)]
Make storing cross-origin top-level prefetches in HTTP cache optional
https://bugs.webkit.org/show_bug.cgi?id=199499

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

Source/WebCore:

Add Internals API for adding an event listener to prefetch load.

Test: http/wpt/prefetch/link-prefetch-skip-disk-cache.html

* bindings/js/JSEventListener.h:
* dom/EventTarget.h:
(WebCore::EventTarget::addEventListener):
* dom/Node.h:
* html/HTMLLinkElement.h:
* testing/Internals.cpp:
(WebCore::Internals::addPrefetchLoadEventListener):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit:

Currently when we navigate we check if there is a cross-origin top-level
prefetch we can use for the navigation. The current solution uses the
HTTP cache as a way to store the prefetch and to immediately use it for
the navigation load. However this solution fails in case the prefetch is
not cacheable.

Instead of this, simulate a HTTP Cache entry to process the load and
afterwards try to store the navigation load into the HTTP cache, where
normal store decisions will be applied.

Test: http/wpt/prefetch/link-prefetch-skip-disk-cache.html

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::retrieveCacheEntry):
(WebKit::NetworkResourceLoader::retrieveCacheEntryInternal):
* NetworkProcess/NetworkResourceLoader.h:

LayoutTests:

Remove unneeded Cache-Control headers and verify that Cache-Control
effects whether the navigation gets stored in the disk cache or not.

* http/tests/cache/resources/prefetched-main-resource-iframe.php:
* http/tests/cache/resources/prefetched-main-resource.php:
* http/wpt/prefetch/link-prefetch-skip-disk-cache-expected.txt: Added.
* http/wpt/prefetch/link-prefetch-skip-disk-cache.html: Added.
* http/wpt/prefetch/resources/main-resource-skip-disk-cache.py: Added.
(main):
* http/wpt/prefetch/resources/navigate-skip-disk-cache.html: Added.
* platform/mac-wk1/TestExpectations:
* platform/win/TestExpectations:

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

2 months agoUnreviewed build fix in NetworkDataTaskSoup.
zandobersek@gmail.com [Fri, 26 Jul 2019 06:53:38 +0000 (06:53 +0000)]
Unreviewed build fix in NetworkDataTaskSoup.

* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::authenticateCallback):
Fix incorrect use of the dereferencing operator introduced in r247831.

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

2 months ago[Win][WK1] The inspected webview window is misplaced after changing Web Inspector...
Hironori.Fujii@sony.com [Fri, 26 Jul 2019 06:15:38 +0000 (06:15 +0000)]
[Win][WK1] The inspected webview window is misplaced after changing Web Inspector frontend window height
https://bugs.webkit.org/show_bug.cgi?id=200152

Reviewed by Brent Fulgham.

In WebInspectorFrontendClient::setAttachedWindowHeight, the size
of m_inspectedWebViewHwnd was changed to the whole host window
size. But, it's too tall because MiniBrowser's host window has a
toolbar. The toolbar height should be taken into account.

Change to the height of m_inspectedWebViewHwnd to the sum of
inspected WebView and inspector frontend WebView heights.

* WebCoreSupport/WebInspectorClient.cpp:
(WebInspectorFrontendClient::setAttachedWindowHeight):

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

2 months ago[JSC] Use unalignedLoad for JSRopeString fiber accesses
ysuzuki@apple.com [Fri, 26 Jul 2019 04:58:09 +0000 (04:58 +0000)]
[JSC] Use unalignedLoad for JSRopeString fiber accesses
https://bugs.webkit.org/show_bug.cgi?id=200148

Reviewed by Mark Lam.

JSRopeString always have some subsequent bytes that can be accessible because MarkedBlock has Footer.
We use WTF::unalignedLoad to get fibers. And it will be converted to one load CPU instruction.

* heap/MarkedBlock.h:
* runtime/JSString.h:

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

2 months agoUnreviewed, build fix after r247851
jiewen_tan@apple.com [Fri, 26 Jul 2019 02:38:39 +0000 (02:38 +0000)]
Unreviewed, build fix after r247851

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
Reverts an unnecessary change.

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

2 months ago[GTK] Indistinguishable overloaded callback function inspectorViewDestroyed if Remote...
Hironori.Fujii@sony.com [Fri, 26 Jul 2019 01:43:33 +0000 (01:43 +0000)]
[GTK] Indistinguishable overloaded callback function inspectorViewDestroyed if RemoteWebInspectorProxyGtk.cpp and WebInspectorProxyGtk.cpp are in a unified build bundle
https://bugs.webkit.org/show_bug.cgi?id=200123

Patch by Fujii Hironori <fujii.hironori@gmail.com> on 2019-07-25
Reviewed by Carlos Garcia Campos.

* UIProcess/gtk/RemoteWebInspectorProxyGtk.cpp:
(WebKit::remoteInspectorViewDestroyed): Added.
(WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
(WebKit::inspectorViewDestroyed): Deleted.
Renamed inspectorViewDestroyed to remoteInspectorViewDestroyed.

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

2 months agoWebPageProxy::receivedPolicyDecision should check navigation ID before clear pendingA...
jiewen_tan@apple.com [Fri, 26 Jul 2019 01:26:24 +0000 (01:26 +0000)]
WebPageProxy::receivedPolicyDecision should check navigation ID before clear pendingAPIRequest
https://bugs.webkit.org/show_bug.cgi?id=200108
<rdar://problem/53521238>

Reviewed by Chris Dumez.

Source/WebKit:

Assuming there are two loads happening one after another. There is an issue when clients save
the first decisionHandler and then call WKNavigationActionPolicyCancel for it right after the
second decisionHandler received, -[WKWebView URL] could return a null string even though it is
loading the second one.

To solve that, this patch pairs a navigationID with the pendingAPIRequestURL such that
WebPageProxy::receivedPolicyDecision could clear the pendingAPIRequestURL only if
the passed navigation ID matches the current one.

* UIProcess/PageLoadState.cpp:
(WebKit::PageLoadState::reset):
(WebKit::PageLoadState::activeURL):
(WebKit::PageLoadState::estimatedProgress):
(WebKit::PageLoadState::pendingAPIRequestURL const):
(WebKit::PageLoadState::pendingAPIRequest const):
(WebKit::PageLoadState::setPendingAPIRequest):
(WebKit::PageLoadState::clearPendingAPIRequest):
(WebKit::PageLoadState::isLoading):
(WebKit::PageLoadState::setPendingAPIRequestURL): Deleted.
(WebKit::PageLoadState::clearPendingAPIRequestURL): Deleted.
* UIProcess/PageLoadState.h:
(WebKit::PageLoadState::setPendingAPIRequest):
(WebKit::PageLoadState::setPendingAPIRequestURL): Deleted.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::launchProcessForReload):
(WebKit::WebPageProxy::loadRequestWithNavigationShared):
(WebKit::WebPageProxy::loadFile):
(WebKit::WebPageProxy::loadDataWithNavigationShared):
(WebKit::WebPageProxy::loadAlternateHTML):
(WebKit::WebPageProxy::loadWebArchiveData):
(WebKit::WebPageProxy::reload):
(WebKit::WebPageProxy::goToBackForwardItem):
(WebKit::WebPageProxy::receivedPolicyDecision):
(WebKit::WebPageProxy::continueNavigationInNewProcess):
(WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
(WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):

Tools:

Added an API test.

* TestWebKitAPI/Tests/WebKitCocoa/DecidePolicyForNavigationAction.mm:
(-[DecidePolicyForNavigationActionController webView:decidePolicyForNavigationAction:decisionHandler:]):
(TEST):

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

2 months agoresults.webkit.org: Color should be the worst result, count should include all results
jbedard@apple.com [Fri, 26 Jul 2019 01:03:40 +0000 (01:03 +0000)]
results.webkit.org: Color should be the worst result, count should include all results
https://bugs.webkit.org/show_bug.cgi?id=200127

Rubber-stamped by Aakash Jain.

* resultsdbpy/resultsdbpy/view/static/js/timeline.js:
(Dot.prototype.toString): Do not differentiate the count based on the prevailing failure type.

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

2 months agoSubpixel fringes around TextIndicator snapshots at non-integral scale factors
timothy_horton@apple.com [Fri, 26 Jul 2019 00:40:26 +0000 (00:40 +0000)]
Subpixel fringes around TextIndicator snapshots at non-integral scale factors
https://bugs.webkit.org/show_bug.cgi?id=200145

Reviewed by Simon Fraser.

* page/FrameSnapshotting.cpp:
(WebCore::snapshotFrameRectWithClip):
* page/FrameSnapshotting.h:
* page/TextIndicator.cpp:
(WebCore::snapshotOptionsForTextIndicatorOptions):
Round the scale factor up, and snappily enclose the clip rects.

TextIndicator doesn't require the use of the precise scale factor that
the page is painted at, but we want it to be sharp, so we overshoot!

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

2 months agoLegacy numeric literals should not permit separators or BigInt
ross.kirsling@sony.com [Thu, 25 Jul 2019 23:55:45 +0000 (23:55 +0000)]
Legacy numeric literals should not permit separators or BigInt
https://bugs.webkit.org/show_bug.cgi?id=199984

Reviewed by Keith Miller.

JSTests:

* stress/big-int-literals.js:
* stress/numeric-literal-separators.js:

Source/JavaScriptCore:

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

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

2 months agoUnreviewed, build fix due to C++17's std::invoke_result_t
ysuzuki@apple.com [Thu, 25 Jul 2019 23:15:57 +0000 (23:15 +0000)]
Unreviewed, build fix due to C++17's std::invoke_result_t
https://bugs.webkit.org/show_bug.cgi?id=200139

Use std::result_of for now until all the supported environments implement it.

* heap/IsoSubspace.h:

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

2 months ago[JSC] Ensure PackedCellPtr only takes non-large-allocation pointers
ysuzuki@apple.com [Thu, 25 Jul 2019 22:51:28 +0000 (22:51 +0000)]
[JSC] Ensure PackedCellPtr only takes non-large-allocation pointers
https://bugs.webkit.org/show_bug.cgi?id=200139

Reviewed by Mark Lam.

PackedCellPtr will compact a pointer by leveraging the fact that JSCell pointers are 16byte aligned.
But this fact only holds when the JSCell is not large allocation. Currently, we are using PackedCellPtr
only for the cell types which meets the above requirement. But we would like to ensure that statically.

In this patch, we add additional static/runtime assertions to ensure this invariant. We accept a cell
type of either (1) it is "final" annotated and sizeof(T) is <= MarkedSpace::largeCutoff or (2) it
is allocated from IsoSubspace.

This patch does not change any behaviors. It just adds extra static/runtime assertions.

* bytecode/CodeBlock.h:
(JSC::CodeBlock::subspaceFor):
* bytecode/CodeBlockJettisoningWatchpoint.h:
* bytecode/LLIntPrototypeLoadAdaptiveStructureWatchpoint.h:
* dfg/DFGAdaptiveStructureWatchpoint.h:
* heap/IsoSubspace.h:
* heap/PackedCellPtr.h:
(JSC::PackedCellPtr::PackedCellPtr):
* runtime/FunctionRareData.h:
(JSC::FunctionRareData::createAllocationProfileClearingWatchpoint):
* runtime/ObjectToStringAdaptiveStructureWatchpoint.h:

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

2 months agoUnreviewed, rolling out r247806.
commit-queue@webkit.org [Thu, 25 Jul 2019 22:25:15 +0000 (22:25 +0000)]
Unreviewed, rolling out r247806.
https://bugs.webkit.org/show_bug.cgi?id=200141

It is regressing PLT (Requested by youenn on #webkit).

Reverted changeset:

"Disable speculative loading if cache is not to be used for
the load"
https://bugs.webkit.org/show_bug.cgi?id=199644
https://trac.webkit.org/changeset/247806

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

2 months agoUse IWICBitmap (rather than ID2D1Bitmap) for NativeImagePtr on FTW
bfulgham@apple.com [Thu, 25 Jul 2019 22:02:00 +0000 (22:02 +0000)]
Use IWICBitmap (rather than ID2D1Bitmap) for NativeImagePtr on FTW
https://bugs.webkit.org/show_bug.cgi?id=200093

Reviewed by Dean Jackson.

Source/WebCore:

When I wrote the original Direct2D code, I did not realize that the backing memory for the
ID2D1Bitmap was inaccessible since it is effectively a representation of GPU memory. There
is no API to access or modify the pixels.

Instead, MSDN documentation indicates that we should be using IWICBitmap objects, which are
converted to ID2D1Bitmap objects when things are ready to be rendered.

This makes it possible to use the TextureMapper backend to do efficient compositing and tile
drawing, since the data backing the bitmap can now be accessed and manipulated, allowing us
to support filters and other effects.

* PlatformFTW.cmake:
* platform/MIMETypeRegistry.cpp:
(WebCore::supportedImageMIMETypesForEncoding):
* platform/graphics/ANGLEWebKitBridge.h:
* platform/graphics/GraphicsContext.h:
* platform/graphics/ImageBuffer.h:
* platform/graphics/NativeImage.h:
* platform/graphics/OpenGLShims.h:
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
* platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
(WebCore::GraphicsContext3D::GraphicsContext3D):
(WebCore::GraphicsContext3D::platformLayer const):
* platform/graphics/texmap/BitmapTexture.cpp:
(WebCore::BitmapTexture::updateContents):
* platform/graphics/texmap/BitmapTextureGL.cpp:
(WebCore::BitmapTextureGL::updateContents):
* platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp:
(WebCore::GraphicsContext3D::~GraphicsContext3D):
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContext::GraphicsContext):
(WebCore::GraphicsContext::platformInit):
(WebCore::GraphicsContextPlatformPrivate::setAlpha):
(WebCore::GraphicsContext::drawNativeImage):
(WebCore::GraphicsContext::drawDeviceBitmap):
(WebCore::GraphicsContext::releaseWindowsContext):
(WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
(WebCore::GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate):
(WebCore::GraphicsContextPlatformPrivate::beginDraw):
(WebCore::GraphicsContextPlatformPrivate::endDraw):
(WebCore::GraphicsContext::drawPattern):
(WebCore::GraphicsContext::clipPath):
* platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h:
* platform/graphics/win/ImageBufferDataDirect2D.cpp:
(WebCore::ImageBufferData::getData const):
(WebCore::ImageBufferData::putData):
* platform/graphics/win/ImageBufferDataDirect2D.h:
(): Deleted.
* platform/graphics/win/ImageBufferDirect2D.cpp:
(WebCore::ImageBuffer::createCompatibleBuffer):
(WebCore::ImageBuffer::ImageBuffer):
(WebCore::createCroppedImageIfNecessary):
(WebCore::createBitmapImageAfterScalingIfNeeded):
(WebCore::ImageBuffer::copyImage const):
(WebCore::ImageBuffer::sinkIntoNativeImage):
(WebCore::ImageBuffer::copyNativeImage const):
(WebCore::ImageBuffer::draw):
* platform/graphics/win/ImageDecoderDirect2D.cpp:
(WebCore::ImageDecoderDirect2D::createFrameImageAtIndex):
* platform/graphics/win/ImageDirect2D.cpp:
(WebCore::BitmapImage::drawFrameMatchingSourceSize):
* platform/graphics/win/NativeImageDirect2D.cpp:
(WebCore::imagingFactory):
(WebCore::nativeImageSize):
(WebCore::nativeImageHasAlpha):
(WebCore::nativeImageSinglePixelSolidColor):
(WebCore::drawNativeImage):
(WebCore::clearNativeImageSubimages):
* platform/graphics/win/PathDirect2D.cpp:
(WebCore::Path::strokeContains const):
* platform/graphics/win/PatternDirect2D.cpp:
(WebCore::Pattern::createPlatformPattern const):
* platform/win/PasteboardWin.cpp:
(WebCore::Pasteboard::read):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::shouldRespectImageOrientation const):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::adjustTiledBackingCoverage):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::nativeImage):

Source/WebCore/PAL:

* pal/PlatformFTW.cmake:

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

2 months agoREGRESSION (r243637): Some web fonts fail to load on Google docs
rniwa@webkit.org [Thu, 25 Jul 2019 21:18:04 +0000 (21:18 +0000)]
REGRESSION (r243637): Some web fonts fail to load on Google docs
https://bugs.webkit.org/show_bug.cgi?id=200106

Reviewed by Geoffrey Garen.

Prior to r243637, WebKit threw an exception if the font family name didn't parse as a CSS identifier in the setter
of `family` IDL attribute of FontFace interface because WebKit implemented the old spec faithfully unlike Chrome
and Firefox which basically treated it as a string and didn't throw any exception. [1]

To account for this browser behavior difference, Google docs implemented a workaround for Safari which is to wrap
some identifiers in font family names with quotation marks: `docs-Amatic SC` as `'docs-Amatic SC'` and
`docs-Playfair Display` as `docs-'Playfair Display'`. Unfortunately, this in turn causes the latest Safari to
not match these font face family with those that appear in stylesheet since we no longer parse it as a CSS identifier.

This patch adds a site specific quirk for Google docs to undo this workaround by stripping away single quotation marks.

[1] See https://github.com/w3c/csswg-drafts/issues/3776 for the context.

* css/FontFace.cpp:
(WebCore::FontFace::create):
(WebCore::FontFace::setFamily):
* css/FontFace.h:
* css/FontFace.idl:
* page/Quirks.cpp:
(WebCore::Quirks::shouldStripQuotationMarkInFontFaceSetFamily const):
* page/Quirks.h:

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

2 months ago[iOS WK2] A top fixed bar can flicker when scrolling with the keyboard up
simon.fraser@apple.com [Thu, 25 Jul 2019 21:12:01 +0000 (21:12 +0000)]
[iOS WK2] A top fixed bar can flicker when scrolling with the keyboard up
https://bugs.webkit.org/show_bug.cgi?id=200105
rdar://problem/52871975

Reviewed by Wenson Hsieh.

Source/WebCore:

ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition() computes a visual viewport
from the current scroll position and scrollableAreaSize(). This doesn't know anything about
the impact of keyboards on the visual viewport, so it computes a too-large visual viewport
when the keyboard is up, triggering incorrect manipulations of the layout viewport. This
leads to the top bar flashing to position 0 when it should be hidden off the top.

Fix by feeding into the scrolling tree the height of the visual viewport which takes
FrameView::visualViewportOverrideRect() into account. This is stored on ScrollingStateFrameScrollingNode/
ScrollingTreeFrameScrollingNode.

Test: scrollingcoordinator/ios/fixed-scrolling-with-keyboard.html

* page/FrameView.h:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::setFrameScrollingNodeState):
* page/scrolling/ScrollingStateFrameScrollingNode.cpp:
(WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
(WebCore::ScrollingStateFrameScrollingNode::setPropertyChangedBitsAfterReattach):
(WebCore::ScrollingStateFrameScrollingNode::setOverrideVisualViewportSize):
(WebCore::ScrollingStateFrameScrollingNode::dumpProperties const):
* page/scrolling/ScrollingStateFrameScrollingNode.h:
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::commitTreeState): LOG_WITH_STREAM() doesn't evaluate scrollingTreeAsText()
every time.
* page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
(WebCore::ScrollingTreeFrameScrollingNode::commitStateBeforeChildren):
(WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition const):
(WebCore::ScrollingTreeFrameScrollingNode::dumpProperties const):
* page/scrolling/ScrollingTreeFrameScrollingNode.h:

Source/WebKit:

ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition() computes a visual viewport
from the current scroll position and scrollableAreaSize(). This doesn't know anything about
the impact of keyboards on the visual viewport, so it computes a too-large visual viewport
when the keyboard is up, triggering incorrect manipulations of the layout viewport. This
leads to the top bar flashing to position 0 when it should be hidden off the top.

Fix by feeding into the scrolling tree the height of the visual viewport which takes
FrameView::visualViewportOverrideRect() into account. This is stored on ScrollingStateFrameScrollingNode/
ScrollingTreeFrameScrollingNode.

* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
(ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
(ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):

LayoutTests:

* resources/ui-helper.js:
(window.UIHelper.ensureStablePresentationUpdate.return.new.Promise):
(window.UIHelper.ensureStablePresentationUpdate):
* scrollingcoordinator/ios/fixed-scrolling-with-keyboard-expected.txt: Added.
* scrollingcoordinator/ios/fixed-scrolling-with-keyboard.html: Added.

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

2 months agoWebKit/UIProcess/ios/WKContentViewInteraction.mm: error: implementing deprecated...
dino@apple.com [Thu, 25 Jul 2019 20:55:06 +0000 (20:55 +0000)]
WebKit/UIProcess/ios/WKContentViewInteraction.mm: error: implementing deprecated method contextMenuInteractionWillPresent
https://bugs.webkit.org/show_bug.cgi?id=200136
<rdar://problem/53547698>

Reviewed by Wenson Hsieh.

Ignore deprecation warnings for these UIContextMenuInteraction delegates.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView contextMenuInteractionWillPresent:]):
(-[WKContentView contextMenuInteraction:willCommitWithAnimator:]):
(-[WKContentView contextMenuInteractionDidEnd:]):

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

2 months agoAdd helper for ignoring deprecated implementation warnings
dino@apple.com [Thu, 25 Jul 2019 20:53:57 +0000 (20:53 +0000)]
Add helper for ignoring deprecated implementation warnings
https://bugs.webkit.org/show_bug.cgi?id=200135

Reviewed by Wenson Hsieh.

Add ALLOW_DEPRECATED_IMPLEMENTATIONS_BEGIN/END macro which
is IGNORE_WARNINGS_BEGIN("deprecated-implementations")

Source/WebCore:

* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
(-[WebAccessibilityObjectWrapper accessibilityIsAttributeSettable:]):
(-[WebAccessibilityObjectWrapper accessibilityPerformAction:]):
(-[WebAccessibilityObjectWrapper accessibilitySetValue:forAttribute:]):
(-[WebAccessibilityObjectWrapper accessibilityActionDescription:]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
(-[WebAccessibilityObjectWrapper IGNORE_WARNINGS_END]): Deleted.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(-[WebAVStreamDataParserListener streamDataParserWillProvideContentKeyRequestInitializationData:forTrackID:]):
(-[WebAVStreamDataParserListener streamDataParser:didProvideContentKeyRequestInitializationData:forTrackID:]):
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveAuthenticationChallenge:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):

Source/WebKit:

* UIProcess/API/Cocoa/LegacyBundleForClass.mm:
* UIProcess/API/Cocoa/WKBrowsingContextController.mm:
(IGNORE_WARNINGS_BEGIN): Deleted.
* UIProcess/API/Cocoa/WKBrowsingContextGroup.mm:
(IGNORE_WARNINGS_BEGIN): Deleted.
* UIProcess/API/Cocoa/WKConnection.mm:
(IGNORE_WARNINGS_BEGIN): Deleted.
* UIProcess/API/Cocoa/WKPreviewElementInfo.mm:
* UIProcess/API/Cocoa/WKProcessGroup.mm:
(IGNORE_WARNINGS_BEGIN): Deleted.
* UIProcess/API/Cocoa/WKTypeRefWrapper.mm:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
(-[WKWebView draggedImage:endedAt:operation:]):
(-[WKWebView accessibilityAttributeValue:]):
(-[WKWebView accessibilityAttributeValue:forParameter:]):
(-[WKWebView namesOfPromisedFilesDroppedAtDestination:]):
(-[WKWebView IGNORE_WARNINGS_END]): Deleted.
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
(-[WKWebViewConfiguration _setWebsiteDataStore:]):
(-[WKWebViewConfiguration IGNORE_WARNINGS_END]): Deleted.
* UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
* UIProcess/API/mac/WKView.mm:
(-[WKView ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
(-[WKView draggedImage:endedAt:operation:]):
(-[WKView accessibilityAttributeValue:]):
(-[WKView accessibilityAttributeValue:forParameter:]):
(-[WKView namesOfPromisedFilesDroppedAtDestination:]):
(-[WKView IGNORE_WARNINGS_END]): Deleted.
* UIProcess/WKImagePreviewViewController.mm:
(-[WKImagePreviewViewController ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
(-[WKImagePreviewViewController IGNORE_WARNINGS_END]): Deleted.
* UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
(-[WKAirPlayRoutePicker popoverControllerDidDismissPopover:]):
* UIProcess/ios/forms/WKFileUploadPanel.mm:
(-[WKFileUploadPanel popoverControllerDidDismissPopover:]):
* UIProcess/ios/forms/WKFormPopover.mm:
(-[WKRotatingPopover popoverControllerDidDismissPopover:]):
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(-[WKPDFPluginAccessibilityObject ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
(-[WKPDFPluginAccessibilityObject accessibilityAttributeValue:]):
(-[WKPDFPluginAccessibilityObject accessibilityAttributeValue:forParameter:]):
(-[WKPDFPluginAccessibilityObject accessibilityPerformAction:]):
(-[WKPDFPluginAccessibilityObject accessibilityIsAttributeSettable:]):
(-[WKPDFPluginAccessibilityObject accessibilitySetValue:forAttribute:]):
(-[WKPDFPluginAccessibilityObject IGNORE_WARNINGS_END]): Deleted.
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
(-[WKAccessibilityWebPageObject accessibilityIsAttributeSettable:]):
(-[WKAccessibilityWebPageObject accessibilitySetValue:forAttribute:]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
(-[WKAccessibilityWebPageObject IGNORE_WARNINGS_END]): Deleted.

Source/WebKitLegacy/mac:

* Misc/WebDownload.mm:
(-[WebDownload initWithRequest:delegate:]):
* Misc/WebIconDatabase.mm:
* Plugins/WebBaseNetscapePluginView.mm:
(-[WebBaseNetscapePluginView ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
(-[WebBaseNetscapePluginView IGNORE_WARNINGS_END]): Deleted.
* WebView/WebDynamicScrollBarsView.mm:
(-[WebDynamicScrollBarsView ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
(-[WebDynamicScrollBarsView IGNORE_WARNINGS_END]): Deleted.
* WebView/WebHTMLView.mm:
(-[WebHTMLView draggingSourceOperationMaskForLocal:]):
(-[WebHTMLView draggedImage:endedAt:operation:]):
(-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]):
(-[WebHTMLView accessibilityAttributeValue:]):
(-[WebHTMLView ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
(-[WebHTMLView characterIndexForPoint:]):
(-[WebHTMLView firstRectForCharacterRange:]):
(-[WebHTMLView attributedSubstringFromRange:]):
(-[WebHTMLView setMarkedText:selectedRange:]):
(-[WebHTMLView doCommandBySelector:]):
(-[WebHTMLView insertText:]):
(-[WebHTMLView IGNORE_WARNINGS_END]): Deleted.

Source/WTF:

* wtf/Compiler.h:

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

2 months agoUnreviewed. Speculative build fix for tvOS of missing include.
sbarati@apple.com [Thu, 25 Jul 2019 20:21:59 +0000 (20:21 +0000)]
Unreviewed. Speculative build fix for tvOS of missing include.

* Modules/webgpu/WHLSL/WHLSLLexer.h:

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

2 months agoUnreviewed, fix -Wunused-parameter warning
mcatanzaro@igalia.com [Thu, 25 Jul 2019 19:52:15 +0000 (19:52 +0000)]
Unreviewed, fix -Wunused-parameter warning

* testing/Internals.cpp:
(WebCore::Internals::privatePlayerVolume):

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

2 months ago[WHLSL] Add descriptive error messages
sbarati@apple.com [Thu, 25 Jul 2019 19:42:42 +0000 (19:42 +0000)]
[WHLSL] Add descriptive error messages
https://bugs.webkit.org/show_bug.cgi?id=195682
<rdar://problem/50746322>

Reviewed by Myles C. Maxfield.

This patch adds error messages to the WHLSL compiler. I'm taking a first pass
at having decent error messages everywhere we set an error. However, we will
probably refine these messages to be more accurate and descriptive over time.

Passes that can fail no longer return a boolean. Instead, they return Expected<void, Error>.
From Error, we can generate a descriptive error message. Visitor::setError now
requires an Error as an argument. So anywhere in Visitor that might fail is
now required to provide an error message.

In a follow-up to this, we should actually make our checkFail tests test that
they get the expected error message: https://bugs.webkit.org/show_bug.cgi?id=200049

* Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h:
* Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
* Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h:
* Modules/webgpu/WHLSL/AST/WHLSLBaseFunctionAttribute.h:
* Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h:
* Modules/webgpu/WHLSL/AST/WHLSLBlock.h:
* Modules/webgpu/WHLSL/AST/WHLSLBooleanLiteral.h:
* Modules/webgpu/WHLSL/AST/WHLSLBreak.h:
* Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h:
* Modules/webgpu/WHLSL/AST/WHLSLCallExpression.h:
* Modules/webgpu/WHLSL/AST/WHLSLCommaExpression.h:
* Modules/webgpu/WHLSL/AST/WHLSLContinue.h:
* Modules/webgpu/WHLSL/AST/WHLSLDereferenceExpression.h:
* Modules/webgpu/WHLSL/AST/WHLSLDoWhileLoop.h:
* Modules/webgpu/WHLSL/AST/WHLSLDotExpression.h:
* Modules/webgpu/WHLSL/AST/WHLSLEffectfulExpressionStatement.h:
* Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h:
* Modules/webgpu/WHLSL/AST/WHLSLEnumerationMember.h:
* Modules/webgpu/WHLSL/AST/WHLSLEnumerationMemberLiteral.h:
* Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
* Modules/webgpu/WHLSL/AST/WHLSLFallthrough.h:
* Modules/webgpu/WHLSL/AST/WHLSLFloatLiteral.h:
* Modules/webgpu/WHLSL/AST/WHLSLForLoop.h:
* Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h:
* Modules/webgpu/WHLSL/AST/WHLSLGlobalVariableReference.h:
* Modules/webgpu/WHLSL/AST/WHLSLIfStatement.h:
* Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h:
* Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.h:
* Modules/webgpu/WHLSL/AST/WHLSLLogicalExpression.h:
* Modules/webgpu/WHLSL/AST/WHLSLLogicalNotExpression.h:
* Modules/webgpu/WHLSL/AST/WHLSLMakeArrayReferenceExpression.h:
* Modules/webgpu/WHLSL/AST/WHLSLMakePointerExpression.h:
* Modules/webgpu/WHLSL/AST/WHLSLNamedType.h:
* Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h:
* Modules/webgpu/WHLSL/AST/WHLSLNullLiteral.h:
* Modules/webgpu/WHLSL/AST/WHLSLPointerType.h:
* Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h:
* Modules/webgpu/WHLSL/AST/WHLSLQualifier.h:
* Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h:
* Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
* Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.h:
* Modules/webgpu/WHLSL/AST/WHLSLReturn.h:
* Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.h:
* Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.h:
* Modules/webgpu/WHLSL/AST/WHLSLStatement.h:
* Modules/webgpu/WHLSL/AST/WHLSLStatementList.h:
* Modules/webgpu/WHLSL/AST/WHLSLStructureDefinition.h:
* Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h:
* Modules/webgpu/WHLSL/AST/WHLSLSwitchCase.h:
* Modules/webgpu/WHLSL/AST/WHLSLSwitchStatement.h:
* Modules/webgpu/WHLSL/AST/WHLSLTernaryExpression.h:
* Modules/webgpu/WHLSL/AST/WHLSLTypeArgument.h:
* Modules/webgpu/WHLSL/AST/WHLSLTypeDefinition.h:
* Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
* Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h:
* Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.h:
* Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h:
* Modules/webgpu/WHLSL/AST/WHLSLVariableDeclarationsStatement.h:
* Modules/webgpu/WHLSL/AST/WHLSLVariableReference.h:
* Modules/webgpu/WHLSL/AST/WHLSLWhileLoop.h:
* Modules/webgpu/WHLSL/WHLSLAutoInitializeVariables.cpp:
(WebCore::WHLSL::AutoInitialize::visit):
(WebCore::WHLSL::autoInitializeVariables):
* Modules/webgpu/WHLSL/WHLSLAutoInitializeVariables.h:
* Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp:
(WebCore::WHLSL::checkDuplicateFunctions):
* Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.h:
* Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.cpp:
(WebCore::WHLSL::TextureReferencesChecker::visit):
(WebCore::WHLSL::checkTextureReferences):
* Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.h:
* Modules/webgpu/WHLSL/WHLSLChecker.cpp:
(WebCore::WHLSL::resolveWithOperatorAnderIndexer):
(WebCore::WHLSL::resolveWithOperatorLength):
(WebCore::WHLSL::resolveWithReferenceComparator):
(WebCore::WHLSL::resolveByInstantiation):
(WebCore::WHLSL::resolveFunction):
(WebCore::WHLSL::checkSemantics):
(WebCore::WHLSL::Checker::assignTypes):
(WebCore::WHLSL::Checker::visit):
(WebCore::WHLSL::Checker::recurseAndGetInfo):
(WebCore::WHLSL::Checker::getInfo):
(WebCore::WHLSL::Checker::finishVisiting):
(WebCore::WHLSL::Checker::recurseAndRequireBoolType):
(WebCore::WHLSL::check):
* Modules/webgpu/WHLSL/WHLSLChecker.h:
* Modules/webgpu/WHLSL/WHLSLCodeLocation.h: Added.
(WebCore::WHLSL::CodeLocation::CodeLocation):
(WebCore::WHLSL::CodeLocation::startOffset const):
(WebCore::WHLSL::CodeLocation::endOffset const):
(WebCore::WHLSL::CodeLocation::operator== const):
(WebCore::WHLSL::CodeLocation::operator!= const):
(WebCore::WHLSL::CodeLocation::operator bool const):
* Modules/webgpu/WHLSL/WHLSLComputeDimensions.cpp:
(WebCore::WHLSL::computeDimensions):
* Modules/webgpu/WHLSL/WHLSLError.h: Added.
(WebCore::WHLSL::Error::Error):
(WebCore::WHLSL::Error::codeLocation const):
(WebCore::WHLSL::Error::message const):
* Modules/webgpu/WHLSL/WHLSLFunctionStageChecker.cpp:
(WebCore::WHLSL::checkFunctionStages):
* Modules/webgpu/WHLSL/WHLSLFunctionStageChecker.h:
* Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp:
(WebCore::WHLSL::Gatherer::reset):
(WebCore::WHLSL::Gatherer::visit):
(WebCore::WHLSL::gatherEntryPointItems):
* Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.h:
* Modules/webgpu/WHLSL/WHLSLLexer.cpp:
(WebCore::WHLSL::Lexer::lineAndColumnNumberFromOffset):
(WebCore::WHLSL::Lexer::errorString):
(WebCore::WHLSL::Lexer::lineNumberFromOffset): Deleted.
* Modules/webgpu/WHLSL/WHLSLLexer.h:
(WebCore::WHLSL::CodeLocation::CodeLocation):
(WebCore::WHLSL::Lexer::errorString):
(WebCore::WHLSL::AST::CodeLocation::CodeLocation): Deleted.
(WebCore::WHLSL::AST::CodeLocation::startOffset const): Deleted.
(WebCore::WHLSL::AST::CodeLocation::endOffset const): Deleted.
* Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
(WebCore::WHLSL::NameResolver::~NameResolver):
(WebCore::WHLSL::NameResolver::visit):
(WebCore::WHLSL::resolveNamesInTypes):
(WebCore::WHLSL::resolveTypeNamesInFunctions):
* Modules/webgpu/WHLSL/WHLSLNameResolver.h:
* Modules/webgpu/WHLSL/WHLSLParser.cpp:
(WebCore::WHLSL::Parser::parse):
(WebCore::WHLSL::intLiteralToInt):
(WebCore::WHLSL::uintLiteralToUint):
(WebCore::WHLSL::floatLiteralToFloat):
(WebCore::WHLSL::recognizeSimpleUnsignedInteger):
(WebCore::WHLSL::Parser::parseTypeArgument):
(WebCore::WHLSL::Parser::parseType):
(WebCore::WHLSL::Parser::parseForLoop):
(WebCore::WHLSL::Parser::parseWhileLoop):
(WebCore::WHLSL::Parser::parseEffectfulExpression):
(WebCore::WHLSL::Parser::parseLimitedSuffixOperator):
(WebCore::WHLSL::Parser::parseSuffixOperator):
(WebCore::WHLSL::Parser::parseExpression):
(WebCore::WHLSL::Parser::completeTernaryConditional):
(WebCore::WHLSL::Parser::completeAssignment):
(WebCore::WHLSL::Parser::completePossibleLogicalBinaryOperation):
(WebCore::WHLSL::Parser::completePossibleRelationalBinaryOperation):
(WebCore::WHLSL::Parser::completePossibleShift):
(WebCore::WHLSL::Parser::completePossibleAdd):
(WebCore::WHLSL::Parser::completePossibleMultiply):
(WebCore::WHLSL::Parser::parsePossiblePrefix):
(WebCore::WHLSL::Parser::parseCallExpression):
* Modules/webgpu/WHLSL/WHLSLParser.h:
(WebCore::WHLSL::Parser::Error::Error): Deleted.
(WebCore::WHLSL::Parser::Error::dump const): Deleted.
* Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
(WebCore::WHLSL::prepareShared):
(WebCore::WHLSL::prepare):
* Modules/webgpu/WHLSL/WHLSLPrepare.h:
* Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
(WebCore::WHLSL::setterCall):
(WebCore::WHLSL::getterCall):
(WebCore::WHLSL::modify):
(WebCore::WHLSL::PropertyResolver::visit):
* Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp:
(WebCore::WHLSL::checkRecursion):
* Modules/webgpu/WHLSL/WHLSLRecursionChecker.h:
* Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp:
(WebCore::WHLSL::checkRecursiveTypes):
* Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.h:
* Modules/webgpu/WHLSL/WHLSLStandardLibraryUtilities.cpp:
(WebCore::WHLSL::includeStandardLibrary):
* Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.cpp:
(WebCore::WHLSL::checkStatementBehavior):
* Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.h:
* Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp:
(WebCore::WHLSL::synthesizeArrayOperatorLength):
* Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.h:
* Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
(WebCore::WHLSL::synthesizeConstructors):
* Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.h:
* Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp:
(WebCore::WHLSL::synthesizeEnumerationFunctions):
* Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.h:
* Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp:
(WebCore::WHLSL::synthesizeStructureAccessors):
* Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.h:
* Modules/webgpu/WHLSL/WHLSLVisitor.h:
(WebCore::WHLSL::Visitor::hasError const):
(WebCore::WHLSL::Visitor::expectedError):
(WebCore::WHLSL::Visitor::checkErrorAndVisit):
(WebCore::WHLSL::Visitor::setError):
(WebCore::WHLSL::Visitor::error const): Deleted.
(): Deleted.
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm:
(WebCore::trySetFunctions):

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

2 months agordar://53551736 (Layout Test editing/pasteboard/paste-and-sanitize.html is a Flaky...
russell_e@apple.com [Thu, 25 Jul 2019 18:52:19 +0000 (18:52 +0000)]
rdar://53551736 (Layout Test editing/pasteboard/paste-and-sanitize.html is a Flaky Failure on iOS 13).

Unreviewed Test Gardening.

* platform/ios-12/TestExpectations: Test is passing on iOS 12
* platform/ios/TestExpectations: Marking test as flaky on iOS 13

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

2 months ago[JSC] Make visitChildren implementation more idiomatic
ysuzuki@apple.com [Thu, 25 Jul 2019 18:28:53 +0000 (18:28 +0000)]
[JSC] Make visitChildren implementation more idiomatic
https://bugs.webkit.org/show_bug.cgi?id=200121

Reviewed by Mark Lam.

This patch makes visitChildren implementations more idiomatic: cast, assert, and calling Base::visitChildren.
While this does not find interesting issues, it is still nice to have consistent implementations.
StructureChain::visitChildren missed Base::visitChildren, but it does not have much effect since StructureChain
is immortal cell.

* bytecode/ExecutableToCodeBlockEdge.cpp:
(JSC::ExecutableToCodeBlockEdge::visitChildren):
* runtime/AbstractModuleRecord.cpp:
(JSC::AbstractModuleRecord::visitChildren):
* runtime/FunctionRareData.cpp:
(JSC::FunctionRareData::visitChildren):
* runtime/JSArrayBufferView.cpp:
(JSC::JSArrayBufferView::visitChildren):
* runtime/JSGenericTypedArrayViewInlines.h:
(JSC::JSGenericTypedArrayView<Adaptor>::visitChildren):
* runtime/JSImmutableButterfly.cpp:
(JSC::JSImmutableButterfly::visitChildren):
* runtime/JSModuleEnvironment.cpp:
(JSC::JSModuleEnvironment::visitChildren):
* runtime/JSModuleRecord.cpp:
(JSC::JSModuleRecord::visitChildren):
* runtime/JSPropertyNameEnumerator.cpp:
(JSC::JSPropertyNameEnumerator::visitChildren):
* runtime/JSString.cpp:
(JSC::JSString::visitChildren):
* runtime/SparseArrayValueMap.cpp:
(JSC::SparseArrayValueMap::visitChildren):
* runtime/StructureChain.cpp:
(JSC::StructureChain::visitChildren):
* runtime/SymbolTable.cpp:
(JSC::SymbolTable::visitChildren):
* tools/JSDollarVM.cpp:
(JSC::Root::visitChildren):
(JSC::ImpureGetter::visitChildren):
* wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::visitChildren):

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

2 months agoMake NetworkSession no longer RefCounted
youenn@apple.com [Thu, 25 Jul 2019 18:17:20 +0000 (18:17 +0000)]
Make NetworkSession no longer RefCounted
https://bugs.webkit.org/show_bug.cgi?id=200020

This allows to have a simpler memory management model where
NetworkSession cannot live once removed from the network process session map.
This requires some additional null checks, especially in NetworkDataTask.

Reviewed by Carlos Garcia Campos.

* NetworkProcess/curl/NetworkSessionCurl.h:
* NetworkProcess/soup/NetworkSessionSoup.h:
* NetworkProcess/NetworkDataTask.cpp:
(WebKit::NetworkDataTask::NetworkDataTask):
* NetworkProcess/NetworkDataTask.h:
* NetworkProcess/NetworkDataTaskBlob.cpp:
(WebKit::NetworkDataTaskBlob::~NetworkDataTaskBlob):
(WebKit::NetworkDataTaskBlob::download):
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::lowMemoryHandler):
(WebKit::NetworkProcess::setSession):
(WebKit::NetworkProcess::destroySession):
(WebKit::NetworkProcess::setResourceLoadStatisticsEnabled):
(WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
* NetworkProcess/NetworkProcess.h:
(WebKit::NetworkProcess::networkSessions):
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::create):
* NetworkProcess/NetworkSession.h:
* NetworkProcess/NetworkSocketChannel.cpp:
(WebKit::NetworkSocketChannel::NetworkSocketChannel):
(WebKit::NetworkSocketChannel::~NetworkSocketChannel):
* NetworkProcess/NetworkSocketChannel.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded):
(WebKit::computeIsAlwaysOnLoggingAllowed):
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
(WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa):
(WebKit::NetworkDataTaskCocoa::resume):
(WebKit::NetworkDataTaskCocoa::isAlwaysOnLoggingAllowed const):
* NetworkProcess/cocoa/NetworkSessionCocoa.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate initWithNetworkSession:withCredentials:]):
(WebKit::NetworkSessionCocoa::create):
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::createRequest):
(WebKit::NetworkDataTaskSoup::clearRequest):
(WebKit::NetworkDataTaskSoup::cancel):
(WebKit::NetworkDataTaskSoup::authenticateCallback):
(WebKit::NetworkDataTaskSoup::authenticate):
(WebKit::NetworkDataTaskSoup::continueAuthenticate):

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

2 months ago[Timeline]: Make timeline header width automatic, instead of fixed width
commit-queue@webkit.org [Thu, 25 Jul 2019 18:16:34 +0000 (18:16 +0000)]
[Timeline]: Make timeline header width automatic, instead of fixed width
https://bugs.webkit.org/show_bug.cgi?id=200059

Patch by Zhifei Fang <zhifei_fang@apple.com> on 2019-07-25
Reviewed by Jonathan Bedard.

* resultsdbpy/resultsdbpy/view/static/css/timeline.css:
(.dot.crash):
(.timeline>.header): Deleted.
* resultsdbpy/resultsdbpy/view/static/library/css/webkit.css:
(.timeline>.content):
(.timeline>.header):

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

2 months ago[WHLSL] Add optional logging for phase timings
sbarati@apple.com [Thu, 25 Jul 2019 18:14:15 +0000 (18:14 +0000)]
[WHLSL] Add optional logging for phase timings
https://bugs.webkit.org/show_bug.cgi?id=200099

Reviewed by Dean Jackson.

As we're doing WHLSL compiler speedup work, it helps to be able to
log phase times. I think a few of us have written such patches locally.
In this patch, I'm adding a way to easily switch this logging on and
off by flipping a "constexpr bool" and rebuilding.

* Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
(WebCore::WHLSL::logPhaseTimes):
(WebCore::WHLSL::PhaseTimer::PhaseTimer):
(WebCore::WHLSL::PhaseTimer::~PhaseTimer):
(WebCore::WHLSL::prepareShared):
(WebCore::WHLSL::prepare):

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

2 months agoAvoid some unnecessary HashMap copies
cdumez@apple.com [Thu, 25 Jul 2019 18:09:59 +0000 (18:09 +0000)]
Avoid some unnecessary HashMap copies
https://bugs.webkit.org/show_bug.cgi?id=200129

Reviewed by Youenn Fablet.

Source/WebCore:

* workers/service/server/SWServer.cpp:
(WebCore::SWServer::addRegistrationFromStore):

Source/WebKit:

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::didClose):
* UIProcess/AuxiliaryProcessProxy.cpp:
(WebKit::AuxiliaryProcessProxy::connect):
* UIProcess/Launcher/ProcessLauncher.cpp:
(WebKit::ProcessLauncher::ProcessLauncher):
* UIProcess/Launcher/ProcessLauncher.h:
(WebKit::ProcessLauncher::create):
* WebProcess/Plugins/WebPluginInfoProvider.cpp:
(WebKit::WebPluginInfoProvider::setPluginLoadClientPolicy):

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

2 months ago[WPE] Draw other button types
commit-queue@webkit.org [Thu, 25 Jul 2019 18:04:15 +0000 (18:04 +0000)]
[WPE] Draw other button types
https://bugs.webkit.org/show_bug.cgi?id=199377

Patch by Joshua Watt <JPEW.hacker@gmail.com> on 2019-07-25
Reviewed by Michael Catanzaro.

There are other button types that should be drawn with the default style
besides just push buttons.

* platform/wpe/ThemeWPE.cpp:
(WebCore::ThemeWPE::paint):
(WebCore::ThemeWPE::paintButton):
* platform/wpe/ThemeWPE.h:

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

2 months agoREGRESSION (r244995): Assertion failure when addEventListener to an SVGElement which...
commit-queue@webkit.org [Thu, 25 Jul 2019 17:56:45 +0000 (17:56 +0000)]
REGRESSION (r244995): Assertion failure when addEventListener to an SVGElement which has an. instance in shadow tree
https://bugs.webkit.org/show_bug.cgi?id=200083

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-07-25
Reviewed by Ryosuke Niwa.

Source/WebCore:

When adding an event listener to an SVGElement, the same event listener
has to be add to all the instances of SVGElement in the shadow tree. See
SVGElement::addEventListener().

In r244995, an assertion was added to ensure if the event listener is
attached to an event target, the new event target has be the same as the
attached one. This assertion isn't correct for the event targets which
were copied from the targetElement sub tree of an SVGUseElement to the
shadow tree.

Test: svg/custom/add-event-listener-shadow-tree-element.html

* bindings/js/JSLazyEventListener.cpp:
(WebCore::isCloneInShadowTreeOfSVGUseElement):
(WebCore::JSLazyEventListener::checkValidityForEventTarget):

LayoutTests:

* svg/custom/add-event-listener-shadow-tree-element-expected.txt: Added.
* svg/custom/add-event-listener-shadow-tree-element.html: Added.

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

2 months agoUnreviewed, rolling out r247821.
tsavell@apple.com [Thu, 25 Jul 2019 17:55:30 +0000 (17:55 +0000)]
Unreviewed, rolling out r247821.

Caused two crashing Layout Tests

Reverted changeset:

"Make storing cross-origin top-level prefetches in HTTP cache
optional"
https://bugs.webkit.org/show_bug.cgi?id=199499
https://trac.webkit.org/changeset/247821

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

2 months agoAdding iOS-specific expectations for fast/text-indicator/text-indicator-with-low...
russell_e@apple.com [Thu, 25 Jul 2019 17:23:22 +0000 (17:23 +0000)]
Adding iOS-specific expectations for fast/text-indicator/text-indicator-with-low-contrast-text.html.
https://bugs.webkit.org/show_bug.cgi?id=200064

Unreviewed Test Gardening.

* platform/ios/fast/text-indicator/text-indicator-with-low-contrast-text-expected.txt: Added.

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

2 months agoUnreviewed, fix -Wredundant-move warning spam after r247672
mcatanzaro@igalia.com [Thu, 25 Jul 2019 16:07:09 +0000 (16:07 +0000)]
Unreviewed, fix -Wredundant-move warning spam after r247672
https://bugs.webkit.org/show_bug.cgi?id=199967
<rdar://problem/53351435>

* Platform/IPC/ArgumentCoders.cpp:
(IPC::decodeStringText):
* Platform/IPC/ArgumentCoders.h:

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

2 months agoAvoid UI Process hangs when the WebContent process is showing JS prompts / alerts
cdumez@apple.com [Thu, 25 Jul 2019 15:42:11 +0000 (15:42 +0000)]
Avoid UI Process hangs when the WebContent process is showing JS prompts / alerts
https://bugs.webkit.org/show_bug.cgi?id=200107
<rdar://problem/53034592>

Reviewed by Geoffrey Garen.

Source/WebCore:

Add testing infrastructure for SendSyncOption::ProcessIncomingSyncMessagesWhenWaitingForSyncReply.

Test: fast/misc/testProcessIncomingSyncMessagesWhenWaitingForSyncReply.html

* page/ChromeClient.h:
* testing/Internals.cpp:
(WebCore::Internals::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit:

* Platform/IPC/Connection.cpp:
(IPC::Connection::SyncMessageState::incrementProcessIncomingSyncMessagesWhenWaitingForSyncReplyCount):
(IPC::Connection::SyncMessageState::decrementProcessIncomingSyncMessagesWhenWaitingForSyncReplyCount):
(IPC::Connection::SyncMessageState::processIncomingMessage):
(IPC::Connection::sendSyncMessage):
* Platform/IPC/Connection.h:
Add support for new SendSyncOption::ProcessIncomingSyncMessagesWhenWaitingForSyncReply flag
to allow processing incoming sync messages while sending a particular sync IPC. This is the
default behavior in all processes except in the WebContent process, where we try to avoid
re-entering to prevent bugs. This flag allows the WebContent process to change its default
behavior for some specific IPCs, where we know it is safe to re-enter and where it benefits
performance to re-renter.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::didReceiveSyncMessage):
(WebKit::NetworkProcessProxy::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::sendSyncWithDelayedReply):
* WebProcess/WebPage/WebPage.messages.in:
SendSyncOption::ProcessIncomingSyncMessagesWhenWaitingForSyncReply
Add testing infrastructure for SendSyncOption::ProcessIncomingSyncMessagesWhenWaitingForSyncReply
flag.

* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::runJavaScriptAlert):
(WebKit::WebChromeClient::runJavaScriptConfirm):
(WebKit::WebChromeClient::runJavaScriptPrompt):
Use new SendSyncOption::ProcessIncomingSyncMessagesWhenWaitingForSyncReply flag when sending
the synchronous IPC for JS alerts / prompt / confirm. This allows the WebProcess to process
incoming synchronous IPC for other processes (in particular the UIProcess) while it is blocked
on those synchronous IPCs. It is safe to re-enter the WebContent process on these sync IPCs
since they are triggered by JS and we return to JS right after. This should avoid UIProcess
hangs when the UIProcess is sending a sync IPC to the WebContent process, which is itself
stuck on the sync IPC to show a JS alert.

LayoutTests:

Add layout test coverage for SendSyncOption::ProcessIncomingSyncMessagesWhenWaitingForSyncReply.
Without the flag on the sendSync from the WebContent process of the
NetworkConnectionToWebProcess::TestProcessIncomingSyncMessagesWhenWaitingForSyncReply IPC, the
test would hang. This is because the WebContent process sends a sync IPC to the network process,
which in turns sends one to the UIProcess, which itself sends one back to the WebContent process.
This would attempt to re-enter the WebContent process which is currently sending a sync IPC, which
is not allowed by default.

* fast/misc/testProcessIncomingSyncMessagesWhenWaitingForSyncReply-expected.txt: Added.
* fast/misc/testProcessIncomingSyncMessagesWhenWaitingForSyncReply.html: Added.

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

2 months agoMake storing cross-origin top-level prefetches in HTTP cache optional
commit-queue@webkit.org [Thu, 25 Jul 2019 15:37:09 +0000 (15:37 +0000)]
Make storing cross-origin top-level prefetches in HTTP cache optional
https://bugs.webkit.org/show_bug.cgi?id=199499

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

Source/WebCore:

Add Internals API for adding an event listener to prefetch load.

Test: http/wpt/prefetch/link-prefetch-skip-disk-cache.html

* bindings/js/JSEventListener.h:
* dom/EventTarget.h:
(WebCore::EventTarget::addEventListener):
* dom/Node.h:
* html/HTMLLinkElement.h:
* testing/Internals.cpp:
(WebCore::Internals::addPrefetchLoadEventListener):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit:

Currently when we navigate we check if there is a cross-origin top-level
prefetch we can use for the navigation. The current solution uses the
HTTP cache as a way to store the prefetch and to immediately use it for
the navigation load. However this solution fails in case the prefetch is
not cacheable.

Instead of this, simulate a HTTP Cache entry to process the load and
afterwards try to store the navigation load into the HTTP cache, where
normal store decisions will be applied.

Test: http/wpt/prefetch/link-prefetch-skip-disk-cache.html

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::retrieveCacheEntry):
(WebKit::NetworkResourceLoader::retrieveCacheEntryInternal):
* NetworkProcess/NetworkResourceLoader.h:

LayoutTests:

Remove unneeded Cache-Control headers and verify that Cache-Control
effects whether the navigation gets stored in the disk cache or not.

* http/tests/cache/resources/prefetched-main-resource-iframe.php:
* http/tests/cache/resources/prefetched-main-resource.php:
* http/wpt/prefetch/link-prefetch-skip-disk-cache-expected.txt: Added.
* http/wpt/prefetch/link-prefetch-skip-disk-cache.html: Added.
* http/wpt/prefetch/resources/main-resource-skip-disk-cache.py: Added.
(main):
* http/wpt/prefetch/resources/navigate-skip-disk-cache.html: Added.
* platform/mac-wk1/TestExpectations:
* platform/win/TestExpectations:

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

2 months agoUnreviewed, rolling out r247817.
tsavell@apple.com [Thu, 25 Jul 2019 15:35:17 +0000 (15:35 +0000)]
Unreviewed, rolling out r247817.

Broke 14 http/tests/paymentrequest/ tests. on iOS

Reverted changeset:

"Unable to tap/double tap to open files/folders in Google
Drive in Safari"
https://bugs.webkit.org/show_bug.cgi?id=200096
https://trac.webkit.org/changeset/247817

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

2 months ago[ESNext] Implement nullish coalescing
ross.kirsling@sony.com [Thu, 25 Jul 2019 07:50:46 +0000 (07:50 +0000)]
[ESNext] Implement nullish coalescing
https://bugs.webkit.org/show_bug.cgi?id=200072

Reviewed by Darin Adler.

JSTests:

* stress/nullish-coalescing.js: Added.

Source/JavaScriptCore:

Implement the nullish coalescing proposal, which has now reached Stage 3 at TC39.

This introduces a ?? operator which:
  - acts like || but checks for nullishness instead of truthiness
  - has a precedence lower than || (or any other binary operator)
  - must be disambiguated with parentheses when combined with || or &&

* bytecompiler/NodesCodegen.cpp:
(JSC::CoalesceNode::emitBytecode): Added.
Bytecode must use OpIsUndefinedOrNull and not OpNeqNull because of document.all.

* parser/ASTBuilder.h:
(JSC::ASTBuilder::makeBinaryNode):
* parser/Lexer.cpp:
(JSC::Lexer<T>::lexWithoutClearingLineTerminator):
* parser/NodeConstructors.h:
(JSC::CoalesceNode::CoalesceNode): Added.
* parser/Nodes.h:
Introduce new token and AST node.

* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseBinaryExpression):
Implement early error.

* parser/ParserTokens.h:
Since this patch needs to shift the value of every binary operator token anyway,
let's only bother to increment their LSBs when we actually have a precedence conflict.

* parser/ResultType.h:
(JSC::ResultType::definitelyIsNull const): Added.
(JSC::ResultType::mightBeUndefinedOrNull const): Added.
(JSC::ResultType::forCoalesce): Added.
We can do better than forLogicalOp here; let's be as accurate as possible.

* runtime/Options.h:
Add runtime feature flag.

Tools:

* Scripts/run-jsc-stress-tests:

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

2 months agoAdd Takashi Komori and Tomoki Imai as contributors
Hironori.Fujii@sony.com [Thu, 25 Jul 2019 05:35:15 +0000 (05:35 +0000)]
Add Takashi Komori and Tomoki Imai as contributors

Unreviewed.

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

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

2 months agoUnable to tap/double tap to open files/folders in Google Drive in Safari
zalan@apple.com [Thu, 25 Jul 2019 04:50:10 +0000 (04:50 +0000)]
Unable to tap/double tap to open files/folders in Google Drive in Safari
https://bugs.webkit.org/show_bug.cgi?id=200096
<rdar://problem/52748552>

Reviewed by Wenson Hsieh.

Source/WebKit:

This patch reverts to the original double-tap-for-double-click implementation (see r244775 and r246347 for more information).

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::doubleTapForDoubleClickDelay): Deleted.
(WebKit::PageClientImpl::doubleTapForDoubleClickRadius): Deleted.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView cleanupInteraction]):
(-[WKContentView _removeDefaultGestureRecognizers]):
(-[WKContentView _addDefaultGestureRecognizers]):
(-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]): Do not recognize the single and double gestures the same time.
(-[WKContentView gestureRecognizerShouldBegin:]):
(-[WKContentView _doubleTapRecognizedForDoubleClick:]):
(-[WKContentView _didStartProvisionalLoadForMainFrame]):
(-[WKContentView _ensureNonBlockingDoubleTapGestureRecognizer]): Deleted.
(-[WKContentView _doubleTapForDoubleClickDelay]): Deleted.
(-[WKContentView _doubleTapForDoubleClickRadius]): Deleted.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::handleDoubleTapForDoubleClickAtPoint):
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleDoubleTapForDoubleClickAtPoint):
(WebKit::WebPage::commitPotentialTap):
(WebKit::WebPage::handlePotentialDoubleTapForDoubleClickAtPoint): Deleted.

LayoutTests:

Rebaseline.

* fast/events/touch/ios/double-tap-for-double-click3-expected.txt:

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

2 months ago[bmalloc] Add IsoHeap test to ensure that IsoHeap pages are not allocating too large VA
ysuzuki@apple.com [Thu, 25 Jul 2019 03:42:09 +0000 (03:42 +0000)]
[bmalloc] Add IsoHeap test to ensure that IsoHeap pages are not allocating too large VA
https://bugs.webkit.org/show_bug.cgi?id=200103

Reviewed by Mark Lam.

Source/bmalloc:

* bmalloc/IsoPage.cpp:

Source/WebCore:

No behavior change in WebCore.

* page/MemoryRelease.cpp:
* page/ResourceUsageThread.h:
(WebCore::TagInfo::TagInfo): Deleted.
* page/cocoa/ResourceUsageThreadCocoa.mm:
(WebCore::vmPageSize): Deleted.
(WebCore::logFootprintComparison): Deleted.
(WebCore::displayNameForVMTag): Deleted.
(WebCore::pagesPerVMTag): Deleted.

Source/WebCore/PAL:

Move VMTag page memory investigation code from PAL to WTF to reuse it in TestWTF.

* PAL.xcodeproj/project.pbxproj:
* pal/PlatformMac.cmake:

Source/WebKit:

Move MachVMSPI.h from PAL to WTF.

* Platform/cocoa/SharedMemoryCocoa.cpp:

Source/WTF:

We move VMTag page investigation code from PAL to WTF to use it in TestWTF.
And we also accumulate allocated VA size in `reserved` field of `TagInfo`.

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/PlatformMac.cmake:
* wtf/ResourceUsage.h: Added.
* wtf/cocoa/MemoryPressureHandlerCocoa.mm:
* wtf/cocoa/ResourceUsageCocoa.cpp: Added.
(WTF::vmPageSize):
(WTF::logFootprintComparison):
(WTF::displayNameForVMTag):
(WTF::pagesPerVMTag):
* wtf/spi/cocoa/MachVMSPI.h: Added.

Tools:

This patch adds tests to TestWTF IsoHeap tests to ensure that IsoHeap's component is not leaking pages or not allocating too large VAs for memory allocation.
We use VMTag to get the system view of the allocated VAs and check whether it is not incredibly large.

While the tests are white-box tests (it means that this is a bit flaky to the implementation changes of IsoHeap), I adjusted some threshold to make this less-flaky
to the future implementation changes while it catches the severe issues we had.

* TestWebKitAPI/Tests/WTF/bmalloc/IsoHeap.cpp:
(assertEmptyPointerSet):
(assertHasOnlyObjects):
(assertClean):
(TEST):
(allocateAndDeallocate):

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

2 months agoWeb Inspector: support `console.screenshot` with detached Nodes that are graphical
drousso@apple.com [Thu, 25 Jul 2019 03:35:03 +0000 (03:35 +0000)]
Web Inspector: support `console.screenshot` with detached Nodes that are graphical
https://bugs.webkit.org/show_bug.cgi?id=199309

Reviewed by Joseph Pecoraro.

Source/WebCore:

Test: inspector/console/console-screenshot.html

* page/PageConsoleClient.cpp:
(WebCore::PageConsoleClient::screenshot):

LayoutTests:

* inspector/console/console-screenshot.html:
* inspector/console/console-screenshot-expected.txt:

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