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

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

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

No new tests, not changing behavior.

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

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

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

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

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

No new tests, not changing behavior.

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

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

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

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

Support non-interleaved YUV color for gstreamer-gl

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

No new tests, not changing behavior.

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

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

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

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

Source/WebCore:

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

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

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

LayoutTests:

Adjust beforeload tests to also test load/error events.

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

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

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

Reviewed by Carlos Garcia Campos.

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

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

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

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

Reviewed by Carlos Garcia Campos.

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

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

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

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

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

Reviewed by Žan Doberšek.

Source/WebKit:

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

Tools:

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

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

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

Reviewed by Saam Barati.

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

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

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

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

Reviewed by Andreas Kling.

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

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

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

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

Reviewed by Said Abou-Hallawa.

Source/WebCore:

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

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

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

LayoutTests:

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

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

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

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

Reviewed by Don Olmstead.

No behavior change.

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

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

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

Reviewed by Don Olmstead.

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

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

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

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

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

Reviewed by Alex Christensen.

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

No observable change of behavior.

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

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

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

Reviewed by Alex Christensen.

Source/WebCore:

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

Covered by existing tests.

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

Source/WebKit:

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

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

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

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

Reviewed by Carlos Garcia Campos.

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

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

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

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

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

Reviewed by Alex Christensen.

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

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

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

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

Reviewed by Brent Fulgham.

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

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

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

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

Reviewed by Dean Jackson.

Source/WebCore:

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

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

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

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

LayoutTests:

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

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

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

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

Reverted changeset:

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

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

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

Reviewed by Mark Lam.

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

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

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

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

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

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

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

Reverted changeset:

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

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

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

Reviewed by Mark Lam.

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

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

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

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

Reviewed by Dean Jackson.

Source/WebCore:

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

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

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

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

LayoutTests:

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

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

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

Reviewed by Dean Jackson.

Source/WebKit:

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

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

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

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

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

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

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

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

(-[WKContentView gestureRecognizerShouldBegin:]):

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

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

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

(-[WKHighlightLongPressGestureRecognizer reset]):

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

(-[WKHighlightLongPressGestureRecognizer touchesBegan:withEvent:]):

Remember the last touched UIScrollView here.

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

Tools:

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

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

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

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

LayoutTests:

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

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

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

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

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

LayoutTests/imported/w3c:

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

Source/WebCore:

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

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

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

LayoutTests:

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

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

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

Reviewed by Don Olmstead.

Source/WebCore:

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

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

Source/WebKit:

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

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

Tools:

Reset zoom to 1.0; device scale is handled elsewhere.

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

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

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

Not reviewed.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reviewed by Dean Jackson.

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

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

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

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

Reviewed by Mark Lam.

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

* llint/LowLevelInterpreter.asm:

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

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

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

LayoutTests/imported/w3c:

Updated expected result.

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

Source/WebCore:

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

Behavior matches Firefox.

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

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

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

LayoutTests:

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

Behavior matches Firefox.

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

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

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

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

LayoutTests/imported/w3c:

Update tests and support files for fractions/stacks parameters.

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

Source/WebCore:

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

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

No new tests, existing tests updated.

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

LayoutTests:

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

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

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

Reviewed by John Wilander.

Source/WebCore:

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

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

Source/WebKit:

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

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

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

Reviewed by Jonathan Bedard.

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

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

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

Reviewed by Antti Koivisto.

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

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

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

Reviewed by Antti Koivisto.

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

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

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

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

Reviewed by Jonathan Bedard.

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

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

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

Reviewed by Antti Koivisto.

Source/WebCore:

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

Source/WebKit:

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

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

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

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Rebaseline WPT test that is now passing.

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

Source/WebCore:

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

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

No new tests, rebaselined existing test.

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

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

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

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

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

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

* workers/service/ServiceWorkerContainer.h:

LayoutTests:

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

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

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

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

Reviewed by Antti Koivisto.

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

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

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

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

Reviewed by Robin Morisset.

Source/WebCore:

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

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

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

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

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

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

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

LayoutTests:

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

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

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

Reviewed by Antti Koivisto.

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

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

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

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

Reviewed by Antti Koivisto.

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

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

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

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

Reviewed by Aakash Jain.

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

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

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

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

Reviewed by Saam Barati.

This patch removes 3 statements that look like this:

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

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

* dfg/DFGOperations.cpp:

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

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

Reviewed by Tim Horton.

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

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

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

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

Reviewed by Yusuke Suzuki.

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

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

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

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

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

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

Caused 500+ layout test failures on WK1

Reverted changeset:

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

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

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

Reviewed by Youenn Fablet.

Source/WebCore/PAL:

* pal/spi/cf/CFNetworkSPI.h:

Source/WebKit:

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

Source/WTF:

* wtf/Platform.h:

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

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

Reviewed by Darin Adler.

Source/WebCore:

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

Source/WebKit:

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

Source/WTF:

* wtf/Platform.h:

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

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

Reviewed by Chris Dumez.

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

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

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

8 months agoFix non-iOS iOS-family and catalyst builds after r249019
achristensen@apple.com [Fri, 30 Aug 2019 20:18:48 +0000 (20:18 +0000)]
Fix non-iOS iOS-family and catalyst builds after r249019
https://bugs.webkit.org/show_bug.cgi?id=200945

* wtf/Platform.h:
State that they have tls_protocol_version_t

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

8 months agoCaret does not appear in text field inside a transformed, overflow: hidden container
wenson_hsieh@apple.com [Fri, 30 Aug 2019 19:28:57 +0000 (19:28 +0000)]
Caret does not appear in text field inside a transformed, overflow: hidden container
https://bugs.webkit.org/show_bug.cgi?id=201317
<rdar://problem/54859264>

Reviewed by Simon Fraser.

Source/WebCore:

This patch refactors the heuristic for determining whether to suppress selection gestures and UI in a way that
fixes the corner case encountered in this bug. To understand why this test case fails with our existing
heuristic, consider the below test case.

Let's say we have an input field inside an "overflow: hidden;" container, which is positioned in such a way that
it is completely clipped by its enclosing container which is also "overflow: hidden". Our existing logic would
appropriately identify this as a hidden editable element.

However, let's now apply a transform to the input field's closest "overflow: hidden" ancestor, such that the
field is now visible. Since RenderLayer::offsetFromAncestor doesn't take transforms into account when we try to
find the offset of the "overflow: hidden" layer relative to the root view, we end up passing an offsetFromRoot
of (0, 100vw) to RenderLayer::calculateClipRects, which computes a background clip rect of (0, 0, 100vw, 100vh).

This means that at the end of RenderLayer::calculateClipRects, we end up intersecting the background clip rect
(0, 0, 100vw, 100vh) against (100vw, 0, 100vw, 100vh), which results in the empty rect, and subsequently makes
us believe we're editing a hidden editable element.

Instead of tacking on more logic to isTransparentOrFullyClippedRespectingParentFrames, we can fix this by using
RenderObject::computeVisibleRectInContainer instead, performing a similar walk up the render tree to compute the
visible rect of each focused element or subframe relative to its root. This is capable of taking transforms into
account. See comments below for more details.

Test: editing/selection/ios/show-selection-in-transformed-container-2.html

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

Split out isTransparentOrFullyClippedRespectingParentFrames into two methods: RenderLayer's
isTransparentRespectingParentFrames, and RenderObject's hasNonEmptyVisibleRectRespectingParentFrames. The
transparency check starts at the enclosing layer and walks up the layer tree, while the non-empty visible rect
check looks for renderers that are completely empty relative to their root views.

* rendering/RenderLayer.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::hasNonEmptyVisibleRectRespectingParentFrames const):

Rewrite logic for detecting completely clipped editable areas (that formerly lived in
isTransparentOrFullyClippedRespectingParentFrames) to use computeVisibleRectInContainer instead.

* rendering/RenderObject.h:

Source/WebKit:

Adjust isTransparentOrFullyClipped to use the new methods in RenderLayer and RenderObject. See WebCore ChangeLog
for more details.

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

LayoutTests:

Add a new layout test that covers this scenario. See WebCore ChangeLog for additional detail.

* editing/selection/ios/show-selection-in-transformed-container-2-expected.txt: Added.
* editing/selection/ios/show-selection-in-transformed-container-2.html: Added.

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

8 months agoAdd support for postMessage buffering between the service worker and window
cdumez@apple.com [Fri, 30 Aug 2019 19:03:35 +0000 (19:03 +0000)]
Add support for postMessage buffering between the service worker and window
https://bugs.webkit.org/show_bug.cgi?id=201169

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Rebaseline WPT test that is now passing.

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

Source/WebCore:

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

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

No new tests, rebaselined existing test.

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

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

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

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

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

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

* workers/service/ServiceWorkerContainer.h:

LayoutTests:

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

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

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

8 months ago[JSC] Generate new.target register only when it is used
ysuzuki@apple.com [Fri, 30 Aug 2019 18:53:26 +0000 (18:53 +0000)]
[JSC] Generate new.target register only when it is used
https://bugs.webkit.org/show_bug.cgi?id=201335

Reviewed by Mark Lam.

JSTests:

* stress/ensure-new-register-allocated.js: Added.
(shouldBe):
(basic):
(arrow):
(Base):
(Derived):
(evaluate):

Source/JavaScriptCore:

Since bytecode generator knows whether new.target register can be used, we should emit and use new.target register
only when it is actually required.

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::BytecodeGenerator):
* bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::newTarget):
* parser/Nodes.h:
(JSC::ScopeNode::needsNewTargetRegisterForThisScope const):

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

8 months agoAdd system tracing points for compositing updates, and touch-event dispatching
simon.fraser@apple.com [Fri, 30 Aug 2019 18:23:29 +0000 (18:23 +0000)]
Add system tracing points for compositing updates, and touch-event dispatching
https://bugs.webkit.org/show_bug.cgi?id=201327

Reviewed by Alex Christensen.
Source/WebCore:

TraceScope in RenderLayerCompositor::updateCompositingLayers().

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingLayers):

Source/WebKit:

TraceScope in EventDispatcher::dispatchTouchEvents().

* WebProcess/WebPage/EventDispatcher.cpp:
(WebKit::EventDispatcher::dispatchTouchEvents):

Source/WTF:

* wtf/SystemTracing.h:

Tools:

* Tracing/SystemTracePoints.plist:

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

8 months ago[FTW] Use DirectX SharedResource as basis for SharedBitmap
bfulgham@apple.com [Fri, 30 Aug 2019 18:20:22 +0000 (18:20 +0000)]
[FTW] Use DirectX SharedResource as basis for SharedBitmap
https://bugs.webkit.org/show_bug.cgi?id=201157

Reviewed by Alex Christensen.

Source/WebCore:

Currently an ID2D1Bitmap is used as the backing store for the SharedBitmap that is the
base type for sharing data between the WebContent Process and the UIProcess. However, this
involves moving GPU memory to local memory, copying that memory into the SharedMemory member
of the SharedBitmap, then building a new GPU bitmap on the UIProcess side from that SharedMemory.

Profiling indicates that this is the single largest place FTW WebKit spends its time.

Instead, we should use Direct2D's ability to render to an IDXGISurface, which can be shared
between multiple processes. This should avoid the GPU->CPU copy, the Direct2D-allocated
CPU->Shared Memory copy, and the shared memory to GPU copy.

* platform/graphics/win/BackingStoreBackendDirect2D.h:
(WebCore::BackingStoreBackendDirect2D::renderTarget const): Change type.
(WebCore::BackingStoreBackendDirect2D::dxSurface const): Added.
(WebCore::BackingStoreBackendDirect2D::BackingStoreBackendDirect2D): Require a DXD11 device.
* platform/graphics/win/BackingStoreBackendDirect2DImpl.cpp:
(WebCore::BackingStoreBackendDirect2DImpl::BackingStoreBackendDirect2DImpl): Use Direct2D's
IDXGISurface to make a render target we can use to support our fast cross-process sharing.
(WebCore::BackingStoreBackendDirect2DImpl::scroll):
* platform/graphics/win/BackingStoreBackendDirect2DImpl.h:
* platform/graphics/win/Direct2DOperations.cpp:
(WebCore::Direct2D::fillRect): Remove unneeded PlatformContextStateSaver.
(WebCore::Direct2D::fillRoundedRect): Ditto.
(WebCore::Direct2D::fillRectWithGradient): Ditto.
(WebCore::Direct2D::fillPath): Ditto.
(WebCore::Direct2D::strokePath): Ditto.
* platform/graphics/win/Direct2DUtilities.cpp:
(WebCore::Direct2D::pixelFormat): Switch to constants for bitmap format.
(WebCore::Direct2D::createDXGISurfaceOfSize): Added.
(WebCore::Direct2D::createSurfaceRenderTarget): Added.
(WebCore::Direct2D::writeDiagnosticPNGToPath):
(WebCore::Direct2D::dxgiImmediateContext): Added.
(WebCore::Direct2D::defaultDirectXDevice): Added.
(WebCore::Direct2D::createDeviceAndContext): Added.
(WebCore::Direct2D::toDXGIDevice): Added.
(WebCore::Direct2D::factoryForDXGIDevice): Added.
* platform/graphics/win/Direct2DUtilities.h:

Source/WebKit:

Currently an ID2D1Bitmap is used as the backing store for the SharedBitmap that is the
base type for sharing data between the WebContent Process and the UIProcess. However, this
involves moving GPU memory to local memory, copying that memory into the SharedMemory member
of the SharedBitmap, then building a new GPU bitmap on the UIProcess side from that SharedMemory.

Profiling indicates that this is the single largest place FTW WebKit spends its time.

Instead, we should use Direct2D's ability to render to an IDXGISurface, which can be shared
between multiple processes. This should avoid the GPU->CPU copy, the Direct2D-allocated
CPU->Shared Memory copy, and the shared memory to GPU copy.

Reviewed by Alex Christensen.

* Platform/SharedMemory.h:
* Platform/win/SharedMemoryWin.cpp:
(WebKit::SharedMemory::Handle::encodeHandle): Added.
(WebKit::SharedMemory::Handle::encode const): Use new helper function.
(WebKit::SharedMemory::Handle::decodeHandle): Added.
(WebKit::SharedMemory::Handle::decode): Use new helper function.
* PlatformFTW.cmake: Add D3X11 libraries.
* Shared/ShareableBitmap.cpp:
(WebKit::ShareableBitmap::Configuration::encode const): Encode shared resource handle for DX texture.
(WebKit::ShareableBitmap::Configuration::decode): Ditto (but decode).
(WebKit::ShareableBitmap::ShareableBitmap): Create SharedResource (if needed).
(WebKit::ShareableBitmap::~ShareableBitmap): Add cleanup code for SharedResoure.
(WebKit::ShareableBitmap::numBytesForSize): Only allocate a small memory store when using GPU textures.
* Shared/ShareableBitmap.h:
(WebKit::ShareableBitmap::dxSurface):
* Shared/win/ShareableBitmapDirect2D.cpp:
(WebKit::ShareableBitmap::createSharedResource): Added.
(WebKit::ShareableBitmap::disposeSharedResource): Added.
(WebKit::ShareableBitmap::leakSharedResource): Added.
(WebKit::ShareableBitmap::createGraphicsContext): Update for new data types.
(WebKit::ShareableBitmap::paint): Ditto.
(WebKit::ShareableBitmap::createDirect2DSurface): Update for new data types.
(WebKit::ShareableBitmap::createImage): Ditto.
(WebKit::createSurfaceFromData): Deleted.
(WebKit::ShareableBitmap::sync): Deleted.
* UIProcess/BackingStore.cpp:
* UIProcess/BackingStore.h:
* UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
* UIProcess/WebPageProxy.cpp:
* UIProcess/WebPageProxy.h:
* UIProcess/win/BackingStoreDirect2D.cpp:
(WebKit::BackingStore::createBackend):
(WebKit::BackingStore::paint):
(WebKit::BackingStore::incorporateUpdate):
* UIProcess/win/PageClientImpl.cpp:
* UIProcess/win/WebPageProxyWin.cpp:
(WebKit::WebPageProxy::device const):
(WebKit::WebPageProxy::setDevice):
* UIProcess/win/WebView.cpp:
(WebKit::WebView::WebView): Initialize DirectX stuff.
(WebKit::WebView::paint): Use new DiretX drawing logic.
(WebKit::WebView::onSizeEvent): Update SwapChain's buffer sizes when resizing.
(WebKit::WebView::setupSwapChain): Added.
(WebKit::WebView::configureBackingStore): Added.
* UIProcess/win/WebView.h:
(WebKit::WebView::d3dDevice):
* WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
(WebKit::DrawingAreaCoordinatedGraphics::display):

Source/WebKitLegacy:

* PlatformFTW.cmake: Link to DirectX to avoid build failure.

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

8 months agoBind WPT server hostname
youenn@apple.com [Fri, 30 Aug 2019 18:02:52 +0000 (18:02 +0000)]
Bind WPT server hostname
https://bugs.webkit.org/show_bug.cgi?id=201334

Reviewed by Alex Christensen.

Make WPT server bind to localhost/127.0.0.1 only.
* resources/config.json:

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

8 months agoIndexedDB: update size of database when database operation is completed
sihui_liu@apple.com [Fri, 30 Aug 2019 17:19:38 +0000 (17:19 +0000)]
IndexedDB: update size of database when database operation is completed
https://bugs.webkit.org/show_bug.cgi?id=201057

Reviewed by Youenn Fablet.

Currently when a database operation was completed, we re-computed the disk usage of the origin. This computation
listed all databases in the origin directory and read the size of each database file, which was very inefficient
because the completed operation should only affect one database.

This patch makes UniqueIDBDatabase keep track of database size and reports size change to QuotaUser.

Tested PerformanceTests/IndexedDB/basic/objectstore-add.html on release build minibrowser. This change makes
the test over 50% faster.

* Modules/indexeddb/server/IDBBackingStore.h:
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::QuotaUser::increaseSpaceUsed):
(WebCore::IDBServer::IDBServer::QuotaUser::decreaseSpaceUsed):
(WebCore::IDBServer::IDBServer::computeSpaceUsedForOrigin):
(WebCore::IDBServer::IDBServer::increaseSpaceUsed):
(WebCore::IDBServer::IDBServer::decreaseSpaceUsed):
(WebCore::IDBServer::IDBServer::setSpaceUsed): Deleted.
* Modules/indexeddb/server/IDBServer.h:
* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::databaseSize const):
(WebCore::IDBServer::MemoryIDBBackingStore::close):
(WebCore::IDBServer::MemoryIDBBackingStore::databasesSizeForOrigin const): Deleted.
* Modules/indexeddb/server/MemoryIDBBackingStore.h:
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::databasesSizeForDirectory):
(WebCore::IDBServer::SQLiteIDBBackingStore::databaseSize const):
(WebCore::IDBServer::SQLiteIDBBackingStore::close):
(WebCore::IDBServer::SQLiteIDBBackingStore::databasesSizeForFolder): Deleted.
(WebCore::IDBServer::SQLiteIDBBackingStore::databasesSizeForOrigin const): Deleted.
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::deleteBackingStore):
(WebCore::IDBServer::UniqueIDBDatabase::shutdownForClose):
(WebCore::IDBServer::UniqueIDBDatabase::didShutdownForClose):
(WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
(WebCore::IDBServer::UniqueIDBDatabase::openBackingStore):
(WebCore::IDBServer::UniqueIDBDatabase::didOpenBackingStore):
(WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTaskReply):
(WebCore::IDBServer::UniqueIDBDatabase::updateSpaceUsedIfNeeded):
* Modules/indexeddb/server/UniqueIDBDatabase.h:

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

8 months ago[MSE][GStreamer] Replaying the video should update currentTime
aboya@igalia.com [Fri, 30 Aug 2019 17:17:20 +0000 (17:17 +0000)]
[MSE][GStreamer] Replaying the video should update currentTime
https://bugs.webkit.org/show_bug.cgi?id=201307

Reviewed by Xabier Rodriguez-Calvar.

LayoutTests/imported/w3c:

* web-platform-tests/media-source/mediasource-replay-expected.txt: Added.
* web-platform-tests/media-source/mediasource-replay.html: Added.

Source/WebCore:

While writing a test to confirm that https://bugs.webkit.org/show_bug.cgi?id=190050
has indeed been fixed I noticed a non-conformity: when the video has
ended, right after calling .play() for a second playback currentTime
did not return zero, but the video duration.

This turned to be due to the m_isEndReached flag not being reseted on
seeks (replaying a video incurs in a seek done from multi-platform
code).

Test: imported/w3c/web-platform-tests/media-source/mediasource-replay.html

* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::seek):

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

8 months ago[LFC] Make Geometry/Quirk/MarginCollapse subclasses stateful.
zalan@apple.com [Fri, 30 Aug 2019 17:02:31 +0000 (17:02 +0000)]
[LFC] Make Geometry/Quirk/MarginCollapse subclasses stateful.
https://bugs.webkit.org/show_bug.cgi?id=201343
<rdar://problem/54883787>

Reviewed by Antti Koivisto.

This is in preparation for enforcing LFC to not call outside of the formatting context.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry):
(WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry):
(WebCore::Layout::FormattingContext::computeBorderAndPadding):
(WebCore::Layout::FormattingContext::layoutOutOfFlowContent):
(WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const): Deleted.
(WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const): Deleted.
(WebCore::Layout::FormattingContext::computeBorderAndPadding const): Deleted.
(WebCore::Layout::FormattingContext::layoutOutOfFlowContent const): Deleted.
* layout/FormattingContext.h:
(WebCore::Layout::FormattingContext::Geometry::layoutState const):
(WebCore::Layout::FormattingContext::Geometry::layoutState):
(WebCore::Layout::FormattingContext::geometry const):
(WebCore::Layout::FormattingContext::Quirks::layoutState const):
(WebCore::Layout::FormattingContext::Quirks::layoutState):
(WebCore::Layout::FormattingContext::quirks const):
(WebCore::Layout::FormattingContext::Geometry::Geometry):
(WebCore::Layout::FormattingContext::Quirks::Quirks):
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::computedHeightValue const):
(WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const):
(WebCore::Layout::FormattingContext::Geometry::computedValueIfNotAuto const):
(WebCore::Layout::FormattingContext::Geometry::fixedValue const):
(WebCore::Layout::FormattingContext::Geometry::computedMaxHeight const):
(WebCore::Layout::FormattingContext::Geometry::computedMinHeight const):
(WebCore::Layout::FormattingContext::Geometry::staticVerticalPositionForOutOfFlowPositioned const):
(WebCore::Layout::FormattingContext::Geometry::staticHorizontalPositionForOutOfFlowPositioned const):
(WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry const):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry const):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry const):
(WebCore::Layout::FormattingContext::Geometry::complicatedCases const):
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin const):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin const):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry const):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin const):
(WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin const):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin const):
(WebCore::Layout::FormattingContext::Geometry::inFlowPositionedPositionOffset const):
(WebCore::Layout::FormattingContext::Geometry::computedBorder const):
(WebCore::Layout::FormattingContext::Geometry::computedPadding const):
(WebCore::Layout::FormattingContext::Geometry::computedHorizontalMargin const):
(WebCore::Layout::FormattingContext::Geometry::computedVerticalMargin const):
(WebCore::Layout::FormattingContext::Geometry::constrainByMinMaxWidth const):
(WebCore::Layout::FormattingContext::Geometry::computedHeightValue): Deleted.
(WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot): Deleted.
(WebCore::Layout::FormattingContext::Geometry::computedValueIfNotAuto): Deleted.
(WebCore::Layout::FormattingContext::Geometry::fixedValue): Deleted.
(WebCore::Layout::FormattingContext::Geometry::computedMaxHeight): Deleted.
(WebCore::Layout::FormattingContext::Geometry::computedMinHeight): Deleted.
(WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned): Deleted.
(WebCore::Layout::staticHorizontalPositionForOutOfFlowPositioned): Deleted.
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry): Deleted.
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry): Deleted.
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry): Deleted.
(WebCore::Layout::FormattingContext::Geometry::complicatedCases): Deleted.
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin): Deleted.
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin): Deleted.
(WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry): Deleted.
(WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin): Deleted.
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin): Deleted.
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin): Deleted.
(WebCore::Layout::FormattingContext::Geometry::inFlowPositionedPositionOffset): Deleted.
(WebCore::Layout::FormattingContext::Geometry::computedBorder): Deleted.
(WebCore::Layout::FormattingContext::Geometry::computedPadding): Deleted.
(WebCore::Layout::FormattingContext::Geometry::computedHorizontalMargin): Deleted.
(WebCore::Layout::FormattingContext::Geometry::computedVerticalMargin): Deleted.
(WebCore::Layout::FormattingContext::Geometry::constrainByMinMaxWidth): Deleted.
* layout/FormattingContextQuirks.cpp:
(WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout):
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot):
(WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren):
(WebCore::Layout::BlockFormattingContext::computeStaticVerticalPosition):
(WebCore::Layout::BlockFormattingContext::computeStaticHorizontalPosition):
(WebCore::Layout::BlockFormattingContext::computeStaticPosition):
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition):
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForAncestors):
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFormattingRoot):
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFloatClear):
(WebCore::Layout::BlockFormattingContext::computeFloatingPosition):
(WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats):
(WebCore::Layout::BlockFormattingContext::computeWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::computedIntrinsicWidthConstraints):
(WebCore::Layout::BlockFormattingContext::verticalPositionWithMargin const):
(WebCore::Layout::BlockFormattingContext::setEstimatedMarginBefore):
(WebCore::Layout::BlockFormattingContext::layout const): Deleted.
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const): Deleted.
(WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren const): Deleted.
(WebCore::Layout::BlockFormattingContext::computeStaticVerticalPosition const): Deleted.
(WebCore::Layout::BlockFormattingContext::computeStaticHorizontalPosition const): Deleted.
(WebCore::Layout::BlockFormattingContext::computeStaticPosition const): Deleted.
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition const): Deleted.
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForAncestors const): Deleted.
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFormattingRoot const): Deleted.
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFloatClear const): Deleted.
(WebCore::Layout::BlockFormattingContext::computeFloatingPosition const): Deleted.
(WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const): Deleted.
(WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const): Deleted.
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const): Deleted.
(WebCore::Layout::BlockFormattingContext::computedIntrinsicWidthConstraints const): Deleted.
(WebCore::Layout::BlockFormattingContext::setEstimatedMarginBefore const): Deleted.
* layout/blockformatting/BlockFormattingContext.h:
(WebCore::Layout::BlockFormattingContext::computeWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::geometry const):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::layoutState):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::layoutState const):
(WebCore::Layout::BlockFormattingContext::marginCollapse const):
(WebCore::Layout::BlockFormattingContext::quirks const):
(WebCore::Layout::BlockFormattingContext::removeEstimatedMarginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::Geometry):
(WebCore::Layout::BlockFormattingContext::Quirks::Quirks):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::MarginCollapse):
(WebCore::Layout::BlockFormattingContext::removeEstimatedMarginBefore const): Deleted.
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin const):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin const):
(WebCore::Layout::BlockFormattingContext::Geometry::staticVerticalPosition const):
(WebCore::Layout::BlockFormattingContext::Geometry::staticHorizontalPosition const):
(WebCore::Layout::BlockFormattingContext::Geometry::staticPosition const):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::staticVerticalPosition): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::staticHorizontalPosition): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::staticPosition): Deleted.
* layout/blockformatting/BlockFormattingContextQuirks.cpp:
(WebCore::Layout::BlockFormattingContext::Quirks::needsStretching const):
(WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
(WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreCollapsedQuirkMargin const):
(WebCore::Layout::BlockFormattingContext::Quirks::needsStretching): Deleted.
(WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreCollapsedQuirkMargin): Deleted.
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter const):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore const):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter const):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore const):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance const):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithParentMarginBefore const):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithParentMarginAfter const):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter const):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithNextSiblingMarginBefore const):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough const):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::updateMarginAfterForPreviousSibling const):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginAfter):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeIgnoringCollapsingThrough):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::updatePositiveNegativeMarginValues):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedVerticalValues):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter): Deleted.
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore): Deleted.
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter): Deleted.
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore): Deleted.
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance): Deleted.
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithParentMarginBefore): Deleted.
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithParentMarginAfter): Deleted.
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter): Deleted.
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithNextSiblingMarginBefore): Deleted.
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough): Deleted.
(WebCore::Layout::BlockFormattingContext::MarginCollapse::updateMarginAfterForPreviousSibling): Deleted.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout):
(WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
(WebCore::Layout::InlineFormattingContext::initializeMarginBorderAndPaddingForGenericInlineBox):
(WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPaddingForInlineContainer):
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot):
(WebCore::Layout::InlineFormattingContext::computeHorizontalMargin):
(WebCore::Layout::InlineFormattingContext::computeWidthAndMargin):
(WebCore::Layout::InlineFormattingContext::computeHeightAndMargin):
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot):
(WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForReplacedInlineBox):
(WebCore::Layout::InlineFormattingContext::layout const): Deleted.
(WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints const): Deleted.
(WebCore::Layout::InlineFormattingContext::initializeMarginBorderAndPaddingForGenericInlineBox const): Deleted.
(WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPaddingForInlineContainer const): Deleted.
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot const): Deleted.
(WebCore::Layout::InlineFormattingContext::computeHorizontalMargin const): Deleted.
(WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const): Deleted.
(WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const): Deleted.
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const): Deleted.
(WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForReplacedInlineBox const): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:
(WebCore::Layout::InlineFormattingContext::quirks const):
(WebCore::Layout::InlineFormattingContext::geometry const):
(WebCore::Layout::InlineFormattingContext::Geometry::Geometry):
(WebCore::Layout::InlineFormattingContext::Quirks::Quirks):
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
(WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin const):
(WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin): Deleted.
* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::LineLayout::LineLayout):
(WebCore::Layout::InlineFormattingContext::InlineLayout::layout const):
(WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
(WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const):
* layout/inlineformatting/InlineFormattingContextQuirks.cpp:
(WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
(WebCore::Layout::InlineFormattingContext::Quirks::lineHeightConstraints const):
(WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing): Deleted.
(WebCore::Layout::InlineFormattingContext::Quirks::lineHeightConstraints): Deleted.
* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::Line):
(WebCore::Layout::Line::close):
* layout/inlineformatting/InlineLine.h:
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::layout):
(WebCore::Layout::TableFormattingContext::computedIntrinsicWidthConstraints):
(WebCore::Layout::TableFormattingContext::ensureTableGrid):
(WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns):
(WebCore::Layout::TableFormattingContext::computedTableWidth):
(WebCore::Layout::TableFormattingContext::distributeAvailableWidth):
(WebCore::Layout::TableFormattingContext::layout const): Deleted.
(WebCore::Layout::TableFormattingContext::computedIntrinsicWidthConstraints const): Deleted.
(WebCore::Layout::TableFormattingContext::ensureTableGrid const): Deleted.
(WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns const): Deleted.
(WebCore::Layout::TableFormattingContext::computedTableWidth const): Deleted.
(WebCore::Layout::TableFormattingContext::distributeAvailableWidth const): Deleted.
* layout/tableformatting/TableFormattingContext.h:
(WebCore::Layout::TableFormattingContext::geometry const):
(WebCore::Layout::TableFormattingContext::Geometry::Geometry):
* layout/tableformatting/TableFormattingContextGeometry.cpp:
(WebCore::Layout::TableFormattingContext::Geometry::tableCellHeightAndMargin const):
(WebCore::Layout::TableFormattingContext::Geometry::tableCellHeightAndMargin): Deleted.

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

8 months agoUnreviewed, fix test failure after r249305
drousso@apple.com [Fri, 30 Aug 2019 17:01:11 +0000 (17:01 +0000)]
Unreviewed, fix test failure after r249305

* inspector/dom-debugger/dom-breakpoints-expected.txt:

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

8 months ago[PSON] Bump the WebPage's identifier every time we process-swap
cdumez@apple.com [Fri, 30 Aug 2019 16:34:40 +0000 (16:34 +0000)]
[PSON] Bump the WebPage's identifier every time we process-swap
https://bugs.webkit.org/show_bug.cgi?id=201225

Reviewed by Alex Christensen.

Every time we create a new WebPage object in a provisional process, we now assign it a new
identifier, instead of using the identifier of the WebPage in the committed process. This
will address issues with IPC when navigating back and forth between processes since we will
no longer be confused as to which WebPage the IPC is coming from. Also, this will allow
suspended WebPages to keep living in the process, even if we use the process for a new load
(will be done in a follow-up patch) since we will no longer have an identifier conflict.

* Scripts/webkit/messages.py:
* Shared/API/APIPageHandle.cpp:
(API::PageHandle::create):
(API::PageHandle::createAutoconverting):
(API::PageHandle::PageHandle):
(API::PageHandle::encode const):
(API::PageHandle::decode):
* Shared/API/APIPageHandle.h:
(API::PageHandle::pageProxyID const):
(API::PageHandle::webPageID const):
* Shared/API/Cocoa/WKBrowsingContextHandle.mm:
(-[WKBrowsingContextHandle _initWithPageProxy:]):
(-[WKBrowsingContextHandle _initWithPage:]):
(-[WKBrowsingContextHandle _initWithPageProxyID:andWebPageID:]):
(-[WKBrowsingContextHandle hash]):
(-[WKBrowsingContextHandle isEqual:]):
(-[WKBrowsingContextHandle encodeWithCoder:]):
(-[WKBrowsingContextHandle initWithCoder:]):
* Shared/API/Cocoa/WKBrowsingContextHandleInternal.h:
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* Shared/mac/ObjCObjectGraph.mm:
(WebKit::ObjCObjectGraph::encode):
(WebKit::ObjCObjectGraph::decode):
* UIProcess/API/Cocoa/WKBrowsingContextController.mm:
(-[WKBrowsingContextController handle]):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView dealloc]):
(-[WKWebView _remoteObjectRegistry]):
(-[WKWebView _handle]):
* UIProcess/API/glib/WebKitURISchemeRequest.cpp:
(webkitURISchemeRequestCreate):
* UIProcess/Cocoa/WebProcessProxyCocoa.mm:
(WebKit::WebProcessProxy::transformHandlesToObjects):
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::~WebViewImpl):
(WebKit::WebViewImpl::remoteObjectRegistry):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
(WebKit::NetworkProcessProxy::logDiagnosticMessage):
(WebKit::NetworkProcessProxy::logDiagnosticMessageWithResult):
(WebKit::NetworkProcessProxy::logDiagnosticMessageWithValue):
(WebKit::NetworkProcessProxy::requestStorageAccessConfirm):
(WebKit::NetworkProcessProxy::didCommitCrossSiteLoadWithDataTransferFromPrevalentResource):
(WebKit::NetworkProcessProxy::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
(WebKit::ProvisionalPageProxy::loadData):
(WebKit::ProvisionalPageProxy::loadRequest):
(WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync):
(WebKit::ProvisionalPageProxy::decidePolicyForResponse):
(WebKit::ProvisionalPageProxy::startURLSchemeTask):
(WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionSync):
* UIProcess/ProvisionalPageProxy.h:
(WebKit::ProvisionalPageProxy::webPageID const):
* UIProcess/SuspendedPageProxy.h:
* UIProcess/UserContent/WebUserContentControllerProxy.cpp:
(WebKit::WebUserContentControllerProxy::didPostMessage):
* UIProcess/UserContent/WebUserContentControllerProxy.h:
* UIProcess/UserContent/WebUserContentControllerProxy.messages.in:
* UIProcess/VisitedLinkStore.cpp:
(WebKit::VisitedLinkStore::addVisitedLinkHashFromPage):
* UIProcess/VisitedLinkStore.h:
* UIProcess/VisitedLinkStore.messages.in:
* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::createFrontendPage):
(WebKit::WebInspectorProxy::openLocalInspectorFrontend):
(WebKit::WebInspectorProxy::closeFrontendPageAndWindow):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::swapToWebProcess):
(WebKit::WebPageProxy::loadRequest):
(WebKit::WebPageProxy::loadRequestWithNavigationShared):
(WebKit::WebPageProxy::loadData):
(WebKit::WebPageProxy::loadDataWithNavigationShared):
(WebKit::WebPageProxy::commitProvisionalPage):
(WebKit::WebPageProxy::continueNavigationInNewProcess):
(WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
(WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
(WebKit::WebPageProxy::decidePolicyForNavigationActionSyncShared):
(WebKit::WebPageProxy::decidePolicyForResponse):
(WebKit::WebPageProxy::decidePolicyForResponseShared):
(WebKit::WebPageProxy::createNewPage):
(WebKit::WebPageProxy::creationParameters):
(WebKit::WebPageProxy::startURLSchemeTask):
(WebKit::WebPageProxy::startURLSchemeTaskShared):
(WebKit::WebPageProxy::loadSynchronousURLSchemeTask):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::webPageFromCorePageIdentifier):
(WebKit::WebProcessProxy::didReceiveMessage):
(WebKit::WebProcessProxy::transformHandlesToObjects):
(WebKit::WebProcessProxy::transformObjectsToHandles):
* UIProcess/WebProcessProxy.h:
* UIProcess/WebURLSchemeHandler.cpp:
(WebKit::WebURLSchemeHandler::startTask):
(WebKit::WebURLSchemeHandler::taskCompleted):
* UIProcess/WebURLSchemeHandler.h:
* UIProcess/WebURLSchemeTask.cpp:
(WebKit::WebURLSchemeTask::create):
(WebKit::WebURLSchemeTask::WebURLSchemeTask):
(WebKit::WebURLSchemeTask::didPerformRedirection):
(WebKit::WebURLSchemeTask::didReceiveResponse):
(WebKit::WebURLSchemeTask::didReceiveData):
(WebKit::WebURLSchemeTask::didComplete):
(WebKit::WebURLSchemeTask::pageDestroyed):
* UIProcess/WebURLSchemeTask.h:
(WebKit::WebURLSchemeTask::pageProxyID const):
(WebKit::WebURLSchemeTask::webPageID const):
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(-[WKWebProcessPlugInBrowserContextController handle]):
(+[WKWebProcessPlugInBrowserContextController lookUpBrowsingContextFromHandle:]):
* WebProcess/UserContent/WebUserContentController.cpp:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::createWindow):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
* WebProcess/WebPage/Cocoa/WebRemoteObjectRegistry.cpp:
(WebKit::WebRemoteObjectRegistry::WebRemoteObjectRegistry):
(WebKit::WebRemoteObjectRegistry::close):
* WebProcess/WebPage/VisitedLinkTableController.cpp:
(WebKit::VisitedLinkTableController::addVisitedLink):
* WebProcess/WebPage/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::establishConnection):
* WebProcess/WebPage/WebInspectorUI.h:
* WebProcess/WebPage/WebInspectorUI.messages.in:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::sessionStorageNamespaceIdentifier const):
(WebKit::WebPage::webPageProxyIdentifier const):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::didReceiveMessage):
(WebKit::WebProcess::transformHandlesToObjects):
(WebKit::WebProcess::transformObjectsToHandles):
* WebProcess/WebStorage/StorageNamespaceImpl.cpp:
(WebKit::StorageNamespaceImpl::createSessionStorageNamespace):
(WebKit::StorageNamespaceImpl::createLocalStorageNamespace):
(WebKit::StorageNamespaceImpl::createTransientLocalStorageNamespace):
(WebKit::StorageNamespaceImpl::StorageNamespaceImpl):
(WebKit::StorageNamespaceImpl::copy):
(WebKit::StorageNamespaceImpl::sessionStoragePageID const):
* WebProcess/WebStorage/StorageNamespaceImpl.h:
* WebProcess/WebStorage/WebStorageNamespaceProvider.cpp:
(WebKit::WebStorageNamespaceProvider::createSessionStorageNamespace):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::transformHandlesToObjects):

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

8 months agoSimplify PLATFORM expression
krollin@apple.com [Fri, 30 Aug 2019 15:44:40 +0000 (15:44 +0000)]
Simplify PLATFORM expression
https://bugs.webkit.org/show_bug.cgi?id=201286
<rdar://problem/54822347>

Reviewed by Alexey Proskuryakov.

The preprocessor expression conditionalizing the inclusion of the body
of ExitFullscreenOnEnterPiP.mm evolved into:

    #if PLATFORM(MAC) || (PLATFORM(IOS_FAMILY) && !PLATFORM(IOS_FAMILY_SIMULATOR))

Simplify this to just:

    #if !PLATFORM(IOS_FAMILY_SIMULATOR)

* TestWebKitAPI/Tests/WebKitCocoa/ExitFullscreenOnEnterPiP.mm:

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

8 months agoRemove AppKitCompatibilityDeclarations.h
krollin@apple.com [Fri, 30 Aug 2019 15:37:26 +0000 (15:37 +0000)]
Remove AppKitCompatibilityDeclarations.h
https://bugs.webkit.org/show_bug.cgi?id=201283
<rdar://problem/54822042>

Reviewed by Alexey Proskuryakov.

The two copies of these files -- on in WTF, one in MiniBrowser -- are
empty and can be removed.

Source/WebCore:

No new tests -- no new or changed functionality.

* WebCorePrefix.h:

Source/WebKit:

* WebKit2Prefix.h:

Source/WebKitLegacy/mac:

* Misc/WebNSEventExtras.m:
* Misc/WebNSViewExtras.m:
* WebKitPrefix.h:

Source/WTF:

* WTF.xcodeproj/project.pbxproj:
* wtf/PlatformMac.cmake:
* wtf/mac/AppKitCompatibilityDeclarations.h: Removed.

Tools:

* DumpRenderTree/mac/EventSendingController.mm:
* DumpRenderTree/mac/TextInputControllerMac.m:
* MiniBrowser/AppKitCompatibilityDeclarations.h: Removed.
* MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj:
* MiniBrowser/mac/SettingsController.m:
* MiniBrowser/mac/WK1BrowserWindowController.m:
* MiniBrowser/mac/WK2BrowserWindowController.m:
* TestWebKitAPI/Tests/WebKit/mac/ContextMenuImgWithVideo.mm:
* TestWebKitAPI/Tests/WebKitCocoa/CommandBackForward.mm:
* TestWebKitAPI/Tests/WebKitCocoa/DecidePolicyForNavigationAction.mm:
* TestWebKitAPI/Tests/WebKitCocoa/FullscreenDelegate.mm:
* TestWebKitAPI/Tests/WebKitCocoa/FullscreenLayoutConstraints.mm:
* TestWebKitAPI/Tests/WebKitCocoa/FullscreenTopContentInset.mm:
* TestWebKitAPI/Tests/WebKitCocoa/PictureInPictureDelegate.mm:
* TestWebKitAPI/Tests/WebKitCocoa/ShouldOpenExternalURLsInNewWindowActions.mm:
* TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm:
* TestWebKitAPI/Tests/WebKitCocoa/UserInitiatedActionInNavigationAction.mm:
* TestWebKitAPI/Tests/mac/AcceptsFirstMouse.mm:
* TestWebKitAPI/Tests/mac/ContextMenuCanCopyURL.mm:
* TestWebKitAPI/Tests/mac/ContextMenuDefaultItemsHaveTags.mm:
* TestWebKitAPI/Tests/mac/FullscreenZoomInitialFrame.mm:
* TestWebKitAPI/Tests/mac/MediaPlaybackSleepAssertion.mm:
* TestWebKitAPI/Tests/mac/MenuTypesForMouseEvents.mm:
* TestWebKitAPI/cocoa/TestWKWebView.mm:
* TestWebKitAPI/mac/PlatformUtilitiesMac.mm:
* TestWebKitAPI/mac/PlatformWebViewMac.mm:
* WebKitTestRunner/mac/EventSenderProxy.mm:
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
* WebKitTestRunner/mac/TestControllerMac.mm:

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

8 months agoRemove extra braces
krollin@apple.com [Fri, 30 Aug 2019 15:29:36 +0000 (15:29 +0000)]
Remove extra braces
https://bugs.webkit.org/show_bug.cgi?id=201285

Reviewed by Alexey Proskuryakov.

Some code evolved such that there was only a single statement under an
'if' statement. The braces surrounding the single-line block can now
be removed.

* WebView/WebView.mm:
(-[WebView updateMediaTouchBar]):

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

8 months ago[MSE][GStreamer] Gracefully fail on invalid non-first initialization segment
aboya@igalia.com [Fri, 30 Aug 2019 15:14:54 +0000 (15:14 +0000)]
[MSE][GStreamer] Gracefully fail on invalid non-first initialization segment
https://bugs.webkit.org/show_bug.cgi?id=201322

Reviewed by Xabier Rodriguez-Calvar.

Source/WebCore:

In normal operation of AppendPipeline, except during tear down,
qtdemux never removes a pad. Even if a new initialization segment is
appended, the pad is reused.

There is an exception though: when the new initialization segment has
an incompatible set of tracks. This is invalid under the MSE spec and
should produce an error, but in this case this was making an assertion
fail -- in particular by sending an EOS to the to-be-removed pad, which
AppendPipeline doesn't expect.

This patch changes the assertion with graceful error handling for that
error.

Fixes media/media-source/media-source-seek-detach-crash.html

* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::AppendPipeline):
(WebCore::AppendPipeline::handleErrorConditionFromStreamingThread):
(WebCore::AppendPipeline::handleErrorSyncMessage):
* platform/graphics/gstreamer/mse/AppendPipeline.h:

LayoutTests:

* platform/gtk/TestExpectations:
* platform/wpe/TestExpectations:

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

8 months ago[WPE][GTK] New API to remove a filter from an user content manager given its identifier
aperez@igalia.com [Fri, 30 Aug 2019 13:18:53 +0000 (13:18 +0000)]
[WPE][GTK] New API to remove a filter from an user content manager given its identifier
https://bugs.webkit.org/show_bug.cgi?id=200479

Reviewed by Carlos Garcia Campos.

Source/WebKit:

* UIProcess/API/glib/WebKitUserContentManager.cpp:
(webkit_user_content_manager_remove_filter_by_id): Add new public API function.
* UIProcess/API/gtk/WebKitUserContentManager.h: Add declaration for
webkit_user_content_manager_remove_filter_by_id().
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: List new function.
* UIProcess/API/wpe/WebKitUserContentManager.h: Add declaration for
webkit_user_content_manager_remove_filter_by_id().
* UIProcess/API/wpe/docs/wpe-1.0-sections.txt: List new function.

Tools:

* TestWebKitAPI/Tests/WebKitGLib/TestWebKitUserContentManager.cpp:
(testUserContentManagerContentFilter): Test also the new
webkit_user_content_manager_remove_filter_by_id() public API function.

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

8 months ago[GTK] Build failure in Debian Stable and Ubuntu LTS bots
psaavedra@igalia.com [Fri, 30 Aug 2019 12:52:54 +0000 (12:52 +0000)]
[GTK] Build failure in Debian Stable and Ubuntu LTS bots
https://bugs.webkit.org/show_bug.cgi?id=201337

Reviewed by Carlos Garcia Campos.

* UIProcess/gtk/WaylandCompositor.cpp:
(WebKit::WaylandCompositor::bindSurfaceToWebPage):

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

8 months ago[GStreamer] Do not ref the player count from background threads.
cturner@igalia.com [Fri, 30 Aug 2019 11:02:18 +0000 (11:02 +0000)]
[GStreamer] Do not ref the player count from background threads.
https://bugs.webkit.org/show_bug.cgi?id=201222

Reviewed by Xabier Rodriguez-Calvar.

Test: imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-retrieve-persistent-license.https.html

In the sync-message handler, a ref() was being taken waiting for a
CDM instance to be attached. This hits asserts since you are not
allowed to ref() an object created on the main thread
(BasePlayer) on a background thread.

The protection condition was overly scoped, tidied up the locking
and made it more granular. To avoid needing to hold a ref() in the
background thread, use instead a semaphore to signal when a CDM
instance is attached, or the player has been destroyed.

Also remove an erroneous safe-guard, the operator= in
isCDMInstanceAvailable will ref() the CDMInstance for us. This use
of holding a reference to CDMInstance in the decryptors is not
thread-safe, and now we have a problem since there's no clean way
to communicate with CDMInstance from background threads without
being thread unsafe. For ClearKey and Widevine, a thread safe
ProxyCDM needs to be designed and passed to background
threads (upcoming patch).

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
(WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
(WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceAttached):
(WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceDetached):
(WebCore::MediaPlayerPrivateGStreamerBase::handleProtectionEvent):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(isCDMInstanceAvailable):

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

8 months agoImport css/css-text/tab-size/tab-size.html wpt test
jh718.park@samsung.com [Fri, 30 Aug 2019 10:28:54 +0000 (10:28 +0000)]
Import css/css-text/tab-size/tab-size.html wpt test
https://bugs.webkit.org/show_bug.cgi?id=201328

Unreviewed. No behavioral changes.

The css/css-text/tab-size/tab-size.html wpt test was ported from
the original test LayoutTests/css3/tab-size.html.

So we import that wpt test and remove the original test from LayoutTests.

LayoutTests/imported/w3c:

* web-platform-tests/css/css-text/tab-size/tab-size-expected.txt: Renamed from LayoutTests/css3/tab-size-expected.txt.
* web-platform-tests/css/css-text/tab-size/tab-size.html: Added.

LayoutTests:

* css3/tab-size.html: Removed.

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

8 months ago[JSC] DFG ByteCodeParser should not copy JIT-related part of SimpleJumpTable
ysuzuki@apple.com [Fri, 30 Aug 2019 10:00:31 +0000 (10:00 +0000)]
[JSC] DFG ByteCodeParser should not copy JIT-related part of SimpleJumpTable
https://bugs.webkit.org/show_bug.cgi?id=201331

Reviewed by Mark Lam.

JSTests:

* stress/simple-jump-table-copy.js: Added.
(let.code):
(g2):

Source/JavaScriptCore:

SimpleJumpTable's non-JIT part is not changed after CodeBlock is finalized well. On the other hand, JIT related part is allocated on-demand.
For example, ctiOffsets can be grown by Baseline JIT compiler. There is race condition as follows.

    1. DFG ByteCodeParser is inlining and copying SimpleJumpTable
    2. Baseline JIT compiler is expanding JIT-related part of SimpleJumpTable

Then, (1) reads the broken Vector, and crashes. Since JIT-related part is unnecessary in (1), we should not clone that.
This patch adds CodeBlock::addSwitchJumpTableFromProfiledCodeBlock, which only copies non JIT-related part of the given SimpleJumpTable offered
by profiled CodeBlock.

* bytecode/CodeBlock.h:
(JSC::CodeBlock::addSwitchJumpTableFromProfiledCodeBlock):
* bytecode/JumpTable.h:
(JSC::SimpleJumpTable::cloneNonJITPart const):
(JSC::SimpleJumpTable::clear):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):

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

9 months ago[WPE][Qt] loadingChanged signal parameter is unusable
philn@webkit.org [Fri, 30 Aug 2019 08:29:41 +0000 (08:29 +0000)]
[WPE][Qt] loadingChanged signal parameter is unusable
https://bugs.webkit.org/show_bug.cgi?id=201301

Reviewed by Carlos Garcia Campos.

Source/WebKit:

* UIProcess/API/wpe/qt/WPEQtView.h: Explicitely name signal
parameter. It is a runtime requirement for QML.

Tools:

* MiniBrowser/wpe/qt/main.qml: Add a basic loadingChange signal handler.
* Scripts/webkitpy/style/checker.py: White-list WPEQtView.h for
readablity/parameter_name code styl checker rule.

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

9 months ago[JSC] DFG inlining CheckBadCell slow path does not assume result VirtualRegister...
ysuzuki@apple.com [Fri, 30 Aug 2019 08:13:15 +0000 (08:13 +0000)]
[JSC] DFG inlining CheckBadCell slow path does not assume result VirtualRegister can be invalid
https://bugs.webkit.org/show_bug.cgi?id=201332

Reviewed by Mark Lam.

JSTests:

This test is very flaky, it is hard to reproduce.

* stress/setter-inlining-resulting-bad-cell-result-virtual-register-should-be-invalid.js: Added.
(code):

Source/JavaScriptCore:

When inlining setter calls in DFG, result VirtualRegister becomes invalid one. While other call-related DFG code correctly assumes
that `result` may be invalid, only CheckBadCell slow path missed this case. Since this is OSR exit path and VirtualRegister result
does not exist, set BottomValue only when "result" is valid as the other DFG code is doing.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleInlining):

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

9 months ago[wk2] LayoutTest imported/w3c/web-platform-tests/IndexedDB/fire-error-event-exception...
sihui_liu@apple.com [Fri, 30 Aug 2019 07:50:14 +0000 (07:50 +0000)]
[wk2] LayoutTest imported/w3c/web-platform-tests/IndexedDB/fire-error-event-exception.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=169621

Reviewed by Alex Christensen.

Source/WebCore:

Event handlers of IDB objects were called in unexpected order because of race, which made the console messages
in the tests come out of order.
Usually, an operation/request result is handled as follows:
1. IDBServer sends IDBResultData to IDBClient.
2. IDBClient receives IDBResultData and finishes a IDBTransaction operation with that result.
3. IDBTransaction schedules operation completed timer.
4. (Some time later) Timer fires, and IDBTransaction completes a request with the result and dispatches event.
5. (Some time later) IDBTransaction is notified that event is dispatched. If there are other results received,
IDBTransaction schedules operation completed timer.

In previous implementation, if the IDBClient received a second IDBResultData for the same IDBTransaction between
step 3 and step 4, it would not schedule timer because timer was still active; if it received the result between
step 4 and step 5, it would schedule timer again.

Consider a flow like this:
result1 of transaction1 received, timer of transaction1 scheduled
result2 of transaction2 received, timer of transaction2 scheduled
result3 of transaction1 is received, timer of transaction1 active so no scheduling
timer of transaction1 fired, event1 to be dispatched to request1
timer of transaction2 fired, event2 to be dispatched to request2
result4 of transaction2 received, timer of transaction2 scheduled
event1 dispatched, timer of transaction1 scheduled (for handling result3)
event2 dispatched, timer of transaction2 active so no scheduling
timer of transaction2 fired, event3 to dispatch to request4
timer of transaction1 fired, event4 to dispatch to request3

request4 would get event before request3, though result3 was received before result4. We should stop scheduling
event if an IDBTransaction is in between step 4 and 5, which means its m_currentlyCompletingRequest is not null.

* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::operationCompletedOnServer):

LayoutTests:

Update test expectations to PASS.

* platform/gtk/TestExpectations:
* platform/ios-wk2/TestExpectations:
* platform/mac-wk2/TestExpectations:

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

9 months agoWeb Inspector: Debugger: async event listener stack traces should be available in...
drousso@apple.com [Fri, 30 Aug 2019 06:56:06 +0000 (06:56 +0000)]
Web Inspector: Debugger: async event listener stack traces should be available in Workers
https://bugs.webkit.org/show_bug.cgi?id=200903

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/agents/InspectorDebuggerAgent.h:
(Inspector::InspectorDebuggerAgent::enabled): Added.
* inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::InspectorDebuggerAgent::willDestroyFrontendAndBackend):
(Inspector::InspectorDebuggerAgent::enable):
(Inspector::InspectorDebuggerAgent::disable):
Allow subclasses to extend what it means for the `InspectorDebuggerAgent` to be `enabled`.

Source/WebCore:

Tests: inspector/worker/dom-debugger-event-interval-breakpoints.html
       inspector/worker/dom-debugger-event-listener-breakpoints.html
       inspector/worker/dom-debugger-event-timeout-breakpoints.html
       inspector/worker/dom-debugger-url-breakpoints.html

* inspector/agents/WebDebuggerAgent.h:
* inspector/agents/WebDebuggerAgent.cpp:
(WebCore::WebDebuggerAgent::enabled const): Added.
(WebCore::WebDebuggerAgent::enable):
(WebCore::WebDebuggerAgent::disable):
(WebCore::WebDebuggerAgent::didAddEventListener): Added.
(WebCore::WebDebuggerAgent::willRemoveEventListener): Added.
(WebCore::WebDebuggerAgent::willHandleEvent): Added.
(WebCore::WebDebuggerAgent::didPostMessage): Added.
(WebCore::WebDebuggerAgent::didFailPostMessage): Added.
(WebCore::WebDebuggerAgent::willDispatchPostMessage): Added.
(WebCore::WebDebuggerAgent::didDispatchPostMessage): Added.
(WebCore::WebDebuggerAgent::didClearAsyncStackTraceData): Added.
* inspector/agents/page/PageDebuggerAgent.h:
* inspector/agents/page/PageDebuggerAgent.cpp:
(WebCore::PageDebuggerAgent::enabled const): Added.
(WebCore::PageDebuggerAgent::enable):
(WebCore::PageDebuggerAgent::disable):
(WebCore::PageDebuggerAgent::didClearAsyncStackTraceData): Deleted.
(WebCore::PageDebuggerAgent::didAddEventListener): Deleted.
(WebCore::PageDebuggerAgent::willRemoveEventListener): Deleted.
(WebCore::PageDebuggerAgent::willHandleEvent): Deleted.
(WebCore::PageDebuggerAgent::didPostMessage): Deleted.
(WebCore::PageDebuggerAgent::didFailPostMessage): Deleted.
(WebCore::PageDebuggerAgent::willDispatchPostMessage): Deleted.
(WebCore::PageDebuggerAgent::didDispatchPostMessage): Deleted.
Move various `InspectorInstrumentation` calls from `PageDebuggerAgent` to `WebDebuggerAgent`
so that `WorkerDebuggerAgent` also inherits them.

* inspector/InstrumentingAgents.h:
(WebCore::InstrumentingAgents::webDebuggerAgent const): Added.
(WebCore::InstrumentingAgents::setWebDebuggerAgent): Added.
(WebCore::InstrumentingAgents::inspectorDebuggerAgent const): Deleted.
(WebCore::InstrumentingAgents::setInspectorDebuggerAgent): Deleted.
* inspector/InstrumentingAgents.cpp:
(WebCore::InstrumentingAgents::reset):
* inspector/agents/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::mainFrameStartedLoading):
(WebCore::InspectorTimelineAgent::startProgrammaticCapture):
(WebCore::InspectorTimelineAgent::stopProgrammaticCapture):
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didClearWindowObjectInWorldImpl):
(WebCore::InspectorInstrumentation::isDebuggerPausedImpl):
(WebCore::InspectorInstrumentation::didInstallTimerImpl):
(WebCore::InspectorInstrumentation::didRemoveTimerImpl):
(WebCore::InspectorInstrumentation::didAddEventListenerImpl):
(WebCore::InspectorInstrumentation::willRemoveEventListenerImpl):
(WebCore::InspectorInstrumentation::didPostMessageImpl):
(WebCore::InspectorInstrumentation::didFailPostMessageImpl):
(WebCore::InspectorInstrumentation::willDispatchPostMessageImpl):
(WebCore::InspectorInstrumentation::didDispatchPostMessageImpl):
(WebCore::InspectorInstrumentation::willHandleEventImpl):
(WebCore::InspectorInstrumentation::didHandleEventImpl):
(WebCore::InspectorInstrumentation::willFireTimerImpl):
(WebCore::InspectorInstrumentation::didFireTimerImpl):
(WebCore::InspectorInstrumentation::scriptExecutionBlockedByCSPImpl):
(WebCore::InspectorInstrumentation::didCommitLoadImpl):
(WebCore::InspectorInstrumentation::frameStartedLoadingImpl):
(WebCore::InspectorInstrumentation::frameStoppedLoadingImpl):
(WebCore::InspectorInstrumentation::addMessageToConsoleImpl):
(WebCore::InspectorInstrumentation::didRequestAnimationFrameImpl):
(WebCore::InspectorInstrumentation::didCancelAnimationFrameImpl):
(WebCore::InspectorInstrumentation::willFireAnimationFrameImpl):
(WebCore::InspectorInstrumentation::didFireAnimationFrameImpl):
Replace `inspectorDebuggerAgent` with `webDebuggerAgent` so the right instrumentation hooks
are available.

LayoutTests:

* inspector/worker/dom-debugger-event-interval-breakpoints-expected.txt:
* inspector/worker/dom-debugger-event-listener-breakpoints-expected.txt:
* inspector/worker/dom-debugger-event-timeout-breakpoints-expected.txt:
* inspector/worker/dom-debugger-url-breakpoints-expected.txt:
* inspector/worker/resources/worker-dom-debugger.js:

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

9 months agoRemove HAVE_PASSKIT_GRANULAR_ERRORS conditional
krollin@apple.com [Fri, 30 Aug 2019 05:00:15 +0000 (05:00 +0000)]
Remove HAVE_PASSKIT_GRANULAR_ERRORS conditional
https://bugs.webkit.org/show_bug.cgi?id=201278
<rdar://problem/54821052>

Reviewed by Alex Christensen.

HAVE_PASSKIT_GRANULAR_ERRORS is always True, so remove the conditional
tests, keeping the True branches and removing the False branches.

Source/WebCore/PAL:

* pal/cocoa/PassKitSoftLink.h:
* pal/cocoa/PassKitSoftLink.mm:

Source/WebKit:

* Platform/cocoa/PaymentAuthorizationPresenter.mm:
(WebKit::PaymentAuthorizationPresenter::completePaymentSession):
(WebKit::PaymentAuthorizationPresenter::completeShippingContactSelection):
* Platform/cocoa/PaymentAuthorizationViewController.mm:
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didAuthorizePayment:completion:]): Deleted.
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:completion:]): Deleted.
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:completion:]): Deleted.
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:completion:]): Deleted.
* Platform/cocoa/WKPaymentAuthorizationDelegate.h:
* Platform/cocoa/WKPaymentAuthorizationDelegate.mm:
(-[WKPaymentAuthorizationDelegate completePaymentMethodSelection:]):
(-[WKPaymentAuthorizationDelegate completePaymentSession:errors:didReachFinalState:]):
(-[WKPaymentAuthorizationDelegate completeShippingContactSelection:summaryItems:shippingMethods:errors:]):
(-[WKPaymentAuthorizationDelegate completeShippingMethodSelection:]):
* Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
(WebKit::toPKContactFields):
(WebKit::toNSSet):
(WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest):
(WebKit::toPKAddressField): Deleted.

Source/WTF:

* wtf/FeatureDefines.h:

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

9 months agoAdd "IsolatedCopy" in the name of String getters that call isolatedCopy() on the...
cdumez@apple.com [Fri, 30 Aug 2019 04:35:58 +0000 (04:35 +0000)]
Add "IsolatedCopy" in the name of String getters that call isolatedCopy() on the string
https://bugs.webkit.org/show_bug.cgi?id=201318

Reviewed by Alex Christensen.

Add "IsolatedCopy" in the name of String getters that call isolatedCopy() on the string, for clarity.

Source/WebCore:

* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::createBackingStore):
(WebCore::IDBServer::IDBServer::performGetAllDatabaseNames):
(WebCore::IDBServer::IDBServer::removeDatabasesModifiedSinceForVersion):
(WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesModifiedSince):
(WebCore::IDBServer::IDBServer::removeDatabasesWithOriginsForVersion):
(WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesForOrigins):
(WebCore::IDBServer::IDBServer::computeSpaceUsedForOrigin):
(WebCore::IDBServer::IDBServer::upgradeFilesIfNecessary):
* Modules/indexeddb/server/IDBServer.h:
(WebCore::IDBServer::IDBServer::databaseDirectoryPathIsolatedCopy const):
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabaseDirectoryWithUpgrade):
(WebCore::IDBServer::SQLiteIDBBackingStore::databasesSizeForOrigin const):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:
(WebCore::IDBServer::SQLiteIDBBackingStore::databaseRootDirectoryIsolatedCopy const):
* Modules/webdatabase/Database.cpp:
(WebCore::Database::markAsDeletedAndClose):
(WebCore::Database::stringIdentifierIsolatedCopy const):
(WebCore::Database::displayNameIsolatedCopy const):
(WebCore::Database::expectedVersionIsolatedCopy const):
(WebCore::Database::fileNameIsolatedCopy const):
(WebCore::Database::details const):
(WebCore::Database::didCommitWriteTransaction):
(WebCore::Database::didExceedQuota):
* Modules/webdatabase/Database.h:
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::maximumSize):
(WebCore::DatabaseTracker::doneCreatingDatabase):
(WebCore::DatabaseTracker::addOpenDatabase):
(WebCore::DatabaseTracker::removeOpenDatabase):
* Modules/webdatabase/SQLError.h:
(WebCore::SQLError::messageIsolatedCopy const):
* Modules/webdatabase/SQLError.idl:
* Modules/webdatabase/SQLTransaction.cpp:
(WebCore::SQLTransaction::openTransactionAndPreflight):
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::RegistrationDatabase::openSQLiteDatabase):
(WebCore::RegistrationDatabase::clearAll):
* workers/service/server/RegistrationDatabase.h:
(WebCore::RegistrationDatabase::databaseDirectoryIsolatedCopy const):

Source/WebKit:

* NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp:
(WebKit::ResourceLoadStatisticsPersistentStorage::storageDirectoryPathIsolatedCopy const):
(WebKit::ResourceLoadStatisticsPersistentStorage::resourceLogFilePath const):
(WebKit::ResourceLoadStatisticsPersistentStorage::monitorDirectoryForNewStatistics):
* NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.h:
* NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
(WebKit::NetworkCache::BlobStorage::blobDirectoryPathIsolatedCopy const):
(WebKit::NetworkCache::BlobStorage::synchronize):
(WebKit::NetworkCache::BlobStorage::blobPathForHash const):
* NetworkProcess/cache/NetworkCacheBlobStorage.h:
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::basePathIsolatedCopy const):
(WebKit::NetworkCache::Storage::versionPath const):
(WebKit::NetworkCache::Storage::recordsPathIsolatedCopy const):
(WebKit::NetworkCache::Storage::synchronize):
(WebKit::NetworkCache::Storage::recordDirectoryPathForKey const):
(WebKit::NetworkCache::Storage::traverse):
(WebKit::NetworkCache::Storage::clear):
(WebKit::NetworkCache::Storage::shrink):
(WebKit::NetworkCache::Storage::deleteOldVersions):
* NetworkProcess/cache/NetworkCacheStorage.h:

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

9 months agoUpdate .xcconfig symbols to reflect the current set of past and future product versions.
krollin@apple.com [Fri, 30 Aug 2019 04:18:29 +0000 (04:18 +0000)]
Update .xcconfig symbols to reflect the current set of past and future product versions.
https://bugs.webkit.org/show_bug.cgi?id=200720
<rdar://problem/54305032>

Reviewed by Alex Christensen.

Remove version symbols related to old OS's we no longer support,
ensure that version symbols are defined for OS's we do support.

PerformanceTests:

* MediaTime/Configurations/Base.xcconfig:
* MediaTime/Configurations/DebugRelease.xcconfig:

Source/bmalloc:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:

Source/JavaScriptCore:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* Configurations/Version.xcconfig:

Source/ThirdParty:

* gtest/xcode/Config/DebugProject.xcconfig:
* gtest/xcode/Config/ReleaseProject.xcconfig:

Source/ThirdParty/ANGLE:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:

Source/ThirdParty/libwebrtc:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* Configurations/Version.xcconfig:

Source/WebCore:

No new tests -- no new or changed functionality.

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* Configurations/Version.xcconfig:

Source/WebCore/PAL:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* Configurations/Version.xcconfig:

Source/WebInspectorUI:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* Configurations/Version.xcconfig:

Source/WebKit:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* Configurations/Version.xcconfig:

Source/WebKitLegacy/mac:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* Configurations/Version.xcconfig:

Source/WTF:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:

Tools:

* ContentExtensionTester/Configurations/Base.xcconfig:
* ContentExtensionTester/Configurations/DebugRelease.xcconfig:
* DumpRenderTree/mac/Configurations/Base.xcconfig:
* DumpRenderTree/mac/Configurations/DebugRelease.xcconfig:
* ImageDiff/cg/Configurations/Base.xcconfig:
* ImageDiff/cg/Configurations/DebugRelease.xcconfig:
* MiniBrowser/Configurations/Base.xcconfig:
* MiniBrowser/Configurations/DebugRelease.xcconfig:
* TestWebKitAPI/Configurations/Base.xcconfig:
* TestWebKitAPI/Configurations/DebugRelease.xcconfig:
* WebEditingTester/Configurations/Base.xcconfig:
* WebEditingTester/Configurations/DebugRelease.xcconfig:
* WebKitTestRunner/Configurations/Base.xcconfig:
* WebKitTestRunner/Configurations/DebugRelease.xcconfig:
* lldb/lldbWebKitTester/Configurations/Base.xcconfig:
* lldb/lldbWebKitTester/Configurations/DebugRelease.xcconfig:

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

9 months agoRemove empty FontCache.cpp file in TestWebKitAPI
krollin@apple.com [Fri, 30 Aug 2019 04:16:22 +0000 (04:16 +0000)]
Remove empty FontCache.cpp file in TestWebKitAPI
https://bugs.webkit.org/show_bug.cgi?id=201277
<rdar://problem/54820726>

Reviewed by Alex Christensen.

Bug 200694 emptied out the contents of FontCache.cpp. This patch
removes the file from the project.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebCore/FontCache.cpp: Removed.

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

9 months ago[JSC] Repatch should construct CallCases and CasesValue at the same time
ysuzuki@apple.com [Fri, 30 Aug 2019 03:28:20 +0000 (03:28 +0000)]
[JSC] Repatch should construct CallCases and CasesValue at the same time
https://bugs.webkit.org/show_bug.cgi?id=201325

Reviewed by Saam Barati.

JSTests:

* stress/repatch-switch.js: Added.
(main.f2.f0):
(main.f2.f3):
(main.f2.f1):
(main.f2):
(main):

Source/JavaScriptCore:

In linkPolymorphicCall, we should create callCases and casesValue at the same time to assert `callCases.size() == casesValue.size()`.
If the call variant is isClosureCall and InternalFunction, we skip adding it to casesValue. So we should not add this variant to callCases too.

* jit/Repatch.cpp:
(JSC::linkPolymorphicCall):

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

9 months agoAvoid running the outline painting phase if no renderers have outlines
simon.fraser@apple.com [Fri, 30 Aug 2019 02:35:34 +0000 (02:35 +0000)]
Avoid running the outline painting phase if no renderers have outlines
https://bugs.webkit.org/show_bug.cgi?id=201284

Reviewed by Said Abou-Hallawa.

The outline painting phase (paintOutlineForFragments()) can take up to 20% of the painting time
even when there are no outlines. Keep track of which renderers have outlines, and only run the phase
when printing (for hasOutlineAnnotation()) or if there are any renderers with outlines.

* rendering/RenderElement.cpp:
(WebCore::RenderElement::styleWillChange):
(WebCore::RenderElement::styleDidChange):
(WebCore::RenderElement::willBeDestroyed):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintLayerContents):
* rendering/RenderView.h:

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

9 months agoInvalid XPCServices symlinks are being created
krollin@apple.com [Fri, 30 Aug 2019 01:57:01 +0000 (01:57 +0000)]
Invalid XPCServices symlinks are being created
https://bugs.webkit.org/show_bug.cgi?id=201320
<rdar://problem/54719612>

Reviewed by Dan Bernstein.

When performing incremental builds, errant XPCServices symlinks can be
created. For example, in the following, the second symlink is the
correct one. The first symlink gets created when the build process
tries to create the symlink and it already exists. When it already
exists, the command to create the symlink actually follows the
existing symlink and creates the (second) symlink at the location
where the first symlink points.

    WebKit.framework/Versions/A/XPCServices/XPCServices@ -> Versions/Current/XPCServices
    WebKit.framework/XPCServices@ -> Versions/Current/XPCServices

Address this by specifying -h to the `ln` command, which will cause it
to not follow symlinks if they already exist at the target.

Also, fix a benign issue where the Xcode build variable WRAPPER_NAME
was being referenced in a context where it wasn't defined.

* WebKit.xcodeproj/project.pbxproj:

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

9 months agoCopying and pasting two paragraphs with a newline between them results in stray parag...
timothy@apple.com [Fri, 30 Aug 2019 01:40:58 +0000 (01:40 +0000)]
Copying and pasting two paragraphs with a newline between them results in stray paragraph with newline inside.
https://bugs.webkit.org/show_bug.cgi?id=201306

Reviewed by Wenson Hsieh.

Source/WebCore:

Test: editing/pasteboard/paste-without-nesting.html

* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::moveNodeOutOfAncestor): Consider the ancestor node safe to remove
if there is no rendered text inside, not just if there are any child nodes.

LayoutTests:

* editing/pasteboard/paste-without-nesting-expected.txt: Updated results.
* editing/pasteboard/paste-without-nesting.html: Added new test case.

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

9 months ago[JSC] ObjectAllocationSinkingPhase wrongly deals with always-taken branches during...
ysuzuki@apple.com [Fri, 30 Aug 2019 01:30:29 +0000 (01:30 +0000)]
[JSC] ObjectAllocationSinkingPhase wrongly deals with always-taken branches during interpretation
https://bugs.webkit.org/show_bug.cgi?id=198650

Reviewed by Saam Barati.

JSTests:

* stress/object-allocation-sinking-interpretation-can-interpret-edges-that-can-be-proven-unreachable-in-ai.js:
(main.v0):
(main):

Source/JavaScriptCore:

Object Allocation Sinking phase has a lightweight abstract interpreter which interprets DFG nodes related to allocations and properties.
This interpreter is lightweight since it does not track abstract values and conditions as deeply as AI does. It can happen that this
interpreter interpret the control-flow edge that AI proved that is never taken.
AI already knows some control-flow edges are never taken, and based on this information, AI can remove CheckStructure nodes. But
ObjectAllocationSinking phase can trace this never-taken edges and propagate structure information that contradicts to the analysis
done in ObjectAllocationSinking.

Let's see the example.

    BB#0
        35: NewObject([%AM:Object])
        ...
        47: Branch(ConstantTrue, T:#1, F:#2)

    BB#1 // This basic block is never taken due to @47's jump.
        ...
        71: PutByOffset(@35, @66, id2{a}, 0, W:NamedProperties(2))
        72: PutStructure(@35, %AM:Object -> %Dx:Object, ID:60066)
        ...
        XX: Jump(#2)

    BB#2
        ...
        92: CheckStructure(@35, [%Dx:Object])
        93: PutByOffset(@35, @35, id2{a}, 0, W:NamedProperties(2))
        ...

AI removes @92 because AI knows BB#0 only takes BB#1 branch. @35's Structure is always %Dx so @92 is redundant.
AI proved that @71 and @72 are always executed while BB#0 -> BB#2 edge is never taken so that @35 object's structure is proven at @92.
After AI removes @92, ObjectAllocationSinking starts looking into this graph.

    BB#0
        35: NewObject([%AM:Object])
        ...
        47: Branch(ConstantTrue, T:#1, F:#2)

    BB#1 // This basic block is never taken due to @47's jump.
        ...
        71: PutByOffset(@35, @66, id2{a}, 0, W:NamedProperties(2))
        72: PutStructure(@35, %AM:Object -> %Dx:Object, ID:60066)
        ...
        XX: Jump(#2)

    BB#2
        ...
        93: PutByOffset(@35, @35, id2{a}, 0, W:NamedProperties(2))
        ...
        YY: Jump(#3)

    BB#3
        ...
        ZZ: <HERE> want to materialize @35's sunk object.

Since AI does not change the @47 Branch to Jump (it is OK anyway), BB#0 -> BB#2 edge remains and ObjectAllocationSinking phase propagates information in
BB#0's %AM structure information to BB#2. ObjectAllocationSinking phase converts @35 to PhantomNewObject, removes PutByOffset and PutStructure, and
insert MaterializeNewObject in @ZZ. At this point, ObjectAllocationSinking lightweight interpreter gets two structures while AI gets one: @35's original
one (%AM) and @72's replaced one (%Dx). Since AI already proved @ZZ only gets %Dx, AI removed @92 CheckStructure. But this is not known to ObjectAllocationSinking
phase's interpretation. So when creating recovery data, MultiPutByOffset includes two structures, %AM and %Dx. This is OK since MultiPutByOffset takes
conservative set of structures and performs switching. But the problem here is that %AM's id2{a} offset is -1 since %AM does not have such a property.
So when creating MultiPutByOffset in ObjectAllocationSinking, we accidentally create MultiPutByOffset with -1 offset data, and lowering phase hits the debug
assertion.

    187: MultiPutByOffset(@138, @138, id2{a}, <Replace: [%AM:Object], offset = -1, >, <Replace: [%Dx:Object], offset = 0, >)

This bug is harmless since %AM structure comparison never meets at runtime. But we are not considering the case including `-1` offset property in MultiPutByOffset data.
In this patch, we just filter out apparently wrong structures when creating MultiPutByOffset in ObjectAllocationSinking. This is OK since it never comes at runtime.

* dfg/DFGObjectAllocationSinkingPhase.cpp:

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

9 months agoWeb Inspector: DOMDebugger: support event breakpoints in Worker contexts
drousso@apple.com [Fri, 30 Aug 2019 01:08:03 +0000 (01:08 +0000)]
Web Inspector: DOMDebugger: support event breakpoints in Worker contexts
https://bugs.webkit.org/show_bug.cgi?id=200651

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/protocol/DOMDebugger.json:
Make the domain available in "worker" contexts as well.

Source/WebCore:

Tests: inspector/worker/dom-debugger-dom-breakpoints.html
       inspector/worker/dom-debugger-event-animation-frame-breakpoints.html
       inspector/worker/dom-debugger-event-interval-breakpoints.html
       inspector/worker/dom-debugger-event-listener-breakpoints.html
       inspector/worker/dom-debugger-event-timeout-breakpoints.html
       inspector/worker/dom-debugger-url-breakpoints.html

* inspector/agents/InspectorDOMDebuggerAgent.h:
* inspector/agents/InspectorDOMDebuggerAgent.cpp:
(WebCore::InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent):
(WebCore::InspectorDOMDebuggerAgent::enabled const):
(WebCore::InspectorDOMDebuggerAgent::enable):
(WebCore::InspectorDOMDebuggerAgent::disable):
(WebCore::InspectorDOMDebuggerAgent::debuggerWasEnabled):
(WebCore::InspectorDOMDebuggerAgent::debuggerWasDisabled):
(WebCore::InspectorDOMDebuggerAgent::setEventBreakpoint):
(WebCore::InspectorDOMDebuggerAgent::removeEventBreakpoint):
(WebCore::InspectorDOMDebuggerAgent::~InspectorDOMDebuggerAgent): Deleted.
(WebCore::InspectorDOMDebuggerAgent::frameDocumentUpdated): Deleted.
(WebCore::InspectorDOMDebuggerAgent::willInvalidateStyleAttr): Deleted.
(WebCore::InspectorDOMDebuggerAgent::didInsertDOMNode): Deleted.
(WebCore::InspectorDOMDebuggerAgent::didRemoveDOMNode): Deleted.
(WebCore::domTypeForName): Deleted.
(WebCore::domTypeName): Deleted.
(WebCore::InspectorDOMDebuggerAgent::setDOMBreakpoint): Deleted.
(WebCore::InspectorDOMDebuggerAgent::removeDOMBreakpoint): Deleted.
(WebCore::InspectorDOMDebuggerAgent::willInsertDOMNode): Deleted.
(WebCore::InspectorDOMDebuggerAgent::willRemoveDOMNode): Deleted.
(WebCore::InspectorDOMDebuggerAgent::willModifyDOMAttr): Deleted.
(WebCore::InspectorDOMDebuggerAgent::descriptionForDOMEvent): Deleted.
(WebCore::InspectorDOMDebuggerAgent::hasBreakpoint): Deleted.
(WebCore::InspectorDOMDebuggerAgent::updateSubtreeBreakpoints): Deleted.
(WebCore::InspectorDOMDebuggerAgent::willFireAnimationFrame): Deleted.
* inspector/agents/page/PageDOMDebuggerAgent.h: Added.
* inspector/agents/page/PageDOMDebuggerAgent.cpp: Added.
(WebCore::domTypeForName):
(WebCore::domTypeName):
(WebCore::PageDOMDebuggerAgent::PageDOMDebuggerAgent):
(WebCore::PageDOMDebuggerAgent::enabled const):
(WebCore::PageDOMDebuggerAgent::enable):
(WebCore::PageDOMDebuggerAgent::disable):
(WebCore::PageDOMDebuggerAgent::setDOMBreakpoint):
(WebCore::PageDOMDebuggerAgent::removeDOMBreakpoint):
(WebCore::PageDOMDebuggerAgent::frameDocumentUpdated):
(WebCore::PageDOMDebuggerAgent::willInsertDOMNode):
(WebCore::PageDOMDebuggerAgent::didInsertDOMNode):
(WebCore::PageDOMDebuggerAgent::willRemoveDOMNode):
(WebCore::PageDOMDebuggerAgent::didRemoveDOMNode):
(WebCore::PageDOMDebuggerAgent::willModifyDOMAttr):
(WebCore::PageDOMDebuggerAgent::willFireAnimationFrame):
(WebCore::PageDOMDebuggerAgent::willInvalidateStyleAttr):
(WebCore::PageDOMDebuggerAgent::setAnimationFrameBreakpoint):
(WebCore::PageDOMDebuggerAgent::descriptionForDOMEvent):
(WebCore::PageDOMDebuggerAgent::updateSubtreeBreakpoints):
(WebCore::PageDOMDebuggerAgent::hasBreakpoint):
* inspector/agents/worker/WorkerDOMDebuggerAgent.h: Added.
* inspector/agents/worker/WorkerDOMDebuggerAgent.cpp: Added.
(WebCore::WorkerDOMDebuggerAgent::WorkerDOMDebuggerAgent):
(WebCore::WorkerDOMDebuggerAgent::setDOMBreakpoint):
(WebCore::WorkerDOMDebuggerAgent::removeDOMBreakpoint):
(WebCore::WorkerDOMDebuggerAgent::setAnimationFrameBreakpoint):
Split the `InspectorDOMDebuggerAgent` into two subclasses depending on the inspected target
type, as certain `DOMDebugger` commands don't make sense for a `Worker` context:
 - DOM breakpoints, as there is no DOM in a `Worker` context
 - animation frame event breakpoints, as there is no `requestAnimationFrame` function

* inspector/InspectorController.cpp:
(WebCore::InspectorController::createLazyAgents):
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::createLazyAgents):

* inspector/InstrumentingAgents.h:
(WebCore::InstrumentingAgents::pageDOMDebuggerAgent const): Added.
(WebCore::InstrumentingAgents::setPageDOMDebuggerAgent): Added.
* inspector/InstrumentingAgents.cpp:
(WebCore::InstrumentingAgents::reset):

* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::willInsertDOMNodeImpl):
(WebCore::InspectorInstrumentation::didInsertDOMNodeImpl):
(WebCore::InspectorInstrumentation::willRemoveDOMNodeImpl):
(WebCore::InspectorInstrumentation::didRemoveDOMNodeImpl):
(WebCore::InspectorInstrumentation::willModifyDOMAttrImpl):
(WebCore::InspectorInstrumentation::willInvalidateStyleAttrImpl):
(WebCore::InspectorInstrumentation::frameDocumentUpdatedImpl):
(WebCore::InspectorInstrumentation::willFireAnimationFrameImpl):

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

Source/WebInspectorUI:

* UserInterface/Controllers/DOMDebuggerManager.js:
(WI.DOMDebuggerManager.prototype._updateDOMBreakpoint):
(WI.DOMDebuggerManager.prototype._updateEventBreakpoint):
Add assertions when adding/removing DOM breakpoints or animation frame event breakpoints if
the target is a `WI.WorkerTarget`, as neither are supported by `Worker`s.

LayoutTests:

* inspector/worker/dom-debugger-dom-breakpoints.html: Added.
* inspector/worker/dom-debugger-dom-breakpoints-expected.txt: Added.
* inspector/worker/dom-debugger-event-animation-frame-breakpoints.html: Added.
* inspector/worker/dom-debugger-event-animation-frame-breakpoints-expected.txt: Added.
* inspector/worker/dom-debugger-event-interval-breakpoints.html: Added.
* inspector/worker/dom-debugger-event-interval-breakpoints-expected.txt: Added.
* inspector/worker/dom-debugger-event-listener-breakpoints.html: Added.
* inspector/worker/dom-debugger-event-listener-breakpoints-expected.txt: Added.
* inspector/worker/dom-debugger-event-timeout-breakpoints.html: Added.
* inspector/worker/dom-debugger-event-timeout-breakpoints-expected.txt: Added.
* inspector/worker/dom-debugger-url-breakpoints.html: Added.
* inspector/worker/dom-debugger-url-breakpoints-expected.txt: Added.

* inspector/debugger/resources/log-active-stack-trace.js: Added.
(TestPage.registerInitializer.window.logStackTrace): Added.
(TestPage.registerInitializer.window.logActiveStackTrace):

* inspector/worker/resources/dom-debugger-utilities.js: Added.
(TestPage.registerInitializer.InspectorTest.Worker.DOMDebugger.createWorkerTarget):
* inspector/worker/resources/worker-dom-debugger.js: Added.

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

9 months agoRemove 32-bit macOS support
krollin@apple.com [Fri, 30 Aug 2019 00:39:31 +0000 (00:39 +0000)]
Remove 32-bit macOS support
https://bugs.webkit.org/show_bug.cgi?id=201282
<rdar://problem/54821667>

Reviewed by Anders Carlsson.

WebKit doesn’t support 32-bit Mac any more, so remove checks and code
for that platform.

Source/JavaScriptCore:

* API/JSBase.h:
* runtime/VM.h:

Source/WTF:

* wtf/Platform.h:

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

9 months agoSpeculative loads should use the NetworkSession owning their Cache
commit-queue@webkit.org [Fri, 30 Aug 2019 00:17:41 +0000 (00:17 +0000)]
Speculative loads should use the NetworkSession owning their Cache
https://bugs.webkit.org/show_bug.cgi?id=201314

Patch by Alex Christensen <achristensen@webkit.org> on 2019-08-29
Reviewed by Chris Dumez.

This provides a performance improvement when using non-default persistent WKWebsiteDataStores.

* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::NetworkSession):
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::open):
(WebKit::NetworkCache::Cache::Cache):
* NetworkProcess/cache/NetworkCache.h:
(WebKit::NetworkCache::Cache::sessionID const):
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):

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

9 months agoRemove CCBigNum fallback code
krollin@apple.com [Fri, 30 Aug 2019 00:02:11 +0000 (00:02 +0000)]
Remove CCBigNum fallback code
https://bugs.webkit.org/show_bug.cgi?id=201250
<rdar://problem/54814330>

Reviewed by Jiewen Tan.

Bug 184637 added support for CCRSAGetCRTComponents, falling back to
the older CCBigNum code if CCRSAGetCRTComponents was not available. We
now only support OS's that have CCRSAGetCRTComponents so remove the
fallback code.

Source/WebCore:

No new tests -- no new or changed functionality.

* crypto/CommonCryptoUtilities.cpp:
(WebCore::CCBigNum::CCBigNum): Deleted.
(WebCore::CCBigNum::~CCBigNum): Deleted.
(WebCore::CCBigNum::operator=): Deleted.
(WebCore::CCBigNum::data const): Deleted.
(WebCore::CCBigNum::operator- const): Deleted.
(WebCore::CCBigNum::operator% const): Deleted.
(WebCore::CCBigNum::inverse const): Deleted.
* crypto/CommonCryptoUtilities.h:
* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::getPrivateKeyComponents):

Source/WebCore/PAL:

* pal/spi/cocoa/CommonCryptoSPI.h:

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

9 months agoWeb Inspector: replace uses of `Array.prototype.concat` with `Array.prototype.push`
drousso@apple.com [Thu, 29 Aug 2019 23:56:12 +0000 (23:56 +0000)]
Web Inspector: replace uses of `Array.prototype.concat` with `Array.prototype.push`
https://bugs.webkit.org/show_bug.cgi?id=201082

Reviewed by Joseph Pecoraro.

Source/WebInspectorUI:

`x = x.concat(y)` is very slow, as `x` has to be fully copied in order to add `y` to it.
Introduce `Array.prototype.pushIterable`, which iterates the given `iterable` and adds each
item to the `this` array.

* UserInterface/Controllers/DOMDebuggerManager.js:
(WI.DOMDebuggerManager.prototype.get domBreakpoints):
(WI.DOMDebuggerManager.prototype.domBreakpointsInSubtree):
* UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
(WI.JavaScriptRuntimeCompletionProvider.completionControllerCompletionsNeeded.receivedPropertyNames):
* UserInterface/Models/CSSCompletions.js:
(WI.CSSCompletions):
* UserInterface/Models/CSSKeywordCompletions.js:
(WI.CSSKeywordCompletions.forProperty):
(WI.CSSKeywordCompletions.forProperty.addKeywordsForName):
(WI.CSSKeywordCompletions.forFunction):
* UserInterface/Models/Canvas.js:
(WI.Canvas.prototype.recordingProgress):
* UserInterface/Models/DOMNodeStyles.js:
(WI.DOMNodeStyles.prototype._updateStyleCascade):
(WI.DOMNodeStyles.prototype._collectStylesInCascadeOrder):
* UserInterface/Models/TimelineRecording.js:
(WI.TimelineRecording.prototype.get sourceCodeTimelines):
(WI.TimelineRecording.prototype.initializeCallingContextTrees):
* UserInterface/Protocol/RemoteObject.js:
(WI.RemoteObject.prototype._getPropertyDescriptorsResolver):
* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype._appendMessageTextAndArguments):
* UserInterface/Views/ContentBrowser.js:
(WI.ContentBrowser.prototype.get currentRepresentedObjects):
* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype._visibleChildren):
* UserInterface/Views/DataGridNode.js:
(WI.DataGridNode.prototype.get filterableData):
* UserInterface/Views/HeapAllocationsTimelineView.js:
(WI.HeapAllocationsTimelineView.prototype.get selectionPathComponents):
* UserInterface/Views/IndexedDatabaseObjectStoreContentView.js:
(WI.IndexedDatabaseObjectStoreContentView.prototype._fetchMoreData.processEntries):
* UserInterface/Views/NavigationItem.js:
(WI.NavigationItem.prototype.get _classNames):
* UserInterface/Views/ObjectTreeView.js:
(WI.ObjectTreeView.prototype._updateProperties):
* UserInterface/Views/OpenResourceDialog.js:
(WI.OpenResourceDialog.prototype._addResourcesForFrame):
* UserInterface/Views/OverviewTimelineView.js:
(WI.OverviewTimelineView.prototype._loadExistingRecords):
* UserInterface/Views/ResourceCollectionContentView.js:
(WI.ResourceCollectionContentView.prototype.get navigationItems):
* UserInterface/Views/ResourceHeadersContentView.js:
(WI.ResourceHeadersContentView.prototype._perfomSearchOnKeyValuePairs):
* UserInterface/Views/ResourceSecurityContentView.js:
(WI.ResourceSecurityContentView.prototype._perfomSearchOnKeyValuePairs):
* UserInterface/Views/ScriptClusterTimelineView.js:
(WI.ScriptClusterTimelineView.prototype.get selectionPathComponents):
* UserInterface/Views/ScrubberNavigationItem.js:
(WI.ScrubberNavigationItem.prototype.get additionalClassNames):
* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype._addGradientTokens):
(WI.SpreadsheetStyleProperty.prototype._addColorTokens.pushPossibleColorToken):
(WI.SpreadsheetStyleProperty.prototype._addTimingFunctionTokens):
(WI.SpreadsheetStyleProperty.prototype._addVariableTokens):
* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline.prototype.selfOrDescendant):
* UserInterface/Views/View.js:
(WI.View._visitViewTreeForLayout):

LayoutTests:

* inspector/unit-tests/array-utilities.html:
* inspector/unit-tests/array-utilities-expected.txt:
Add tests for added utility `Array.prototype.pushIterable`.

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

9 months ago[EWS] Increase status-bubble iframe width on bugzilla comment review page
aakash_jain@apple.com [Thu, 29 Aug 2019 22:35:17 +0000 (22:35 +0000)]
[EWS] Increase status-bubble iframe width on bugzilla comment review page
https://bugs.webkit.org/show_bug.cgi?id=201304

Reviewed by Jonathan Bedard.

* template/en/default/attachment/reviewform.html.tmpl: Increased the width from 400 to 700 pixels.

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

9 months ago[LFC][TFC] Initialize <tr> display boxes.
zalan@apple.com [Thu, 29 Aug 2019 22:32:43 +0000 (22:32 +0000)]
[LFC][TFC] Initialize <tr> display boxes.
https://bugs.webkit.org/show_bug.cgi?id=201232
<rdar://problem/54806789>

Reviewed by Antti Koivisto.

Set them as blank for now.

* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::initializeDisplayBoxToBlank const):
(WebCore::Layout::TableFormattingContext::layout const):
* layout/tableformatting/TableFormattingContext.h:
* layout/tableformatting/TableGrid.cpp:
(WebCore::Layout::TableGrid::Row::Row):
(WebCore::Layout::TableGrid::appendCell):
* layout/tableformatting/TableGrid.h:
(WebCore::Layout::TableGrid::Row::box const):

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

9 months ago[iOS 13] Caret does not appear in text field if the body element is translated comple...
wenson_hsieh@apple.com [Thu, 29 Aug 2019 22:17:46 +0000 (22:17 +0000)]
[iOS 13] Caret does not appear in text field if the body element is translated completely out of the viewport
https://bugs.webkit.org/show_bug.cgi?id=201287
<rdar://problem/54780864>

Reviewed by Tim Horton.

Source/WebKit:

During EditorState computation, we use the hidden editable element heuristic to determine whether we should
begin suppressing selection gestures and UI. Currently, we use the editable root of the selection range to
determine where in the layer tree we should start our ascent, in search of a completely transparent or
completely clipped container.

However, in the case where the selection is inside a focused text field, this causes us to walk up the layer
tree starting at the RenderLayer corresponding to the text field's inner contenteditable div, which is different
than the text field's enclosing RenderLayer in the case where the containing block is transformed, such that no
part of it is within the visible viewport. This scenario is exercised by the below test case, in which the caret
after transforming the body horizontally by -100vw is hidden due to a false positive in the hidden editable area
heuristic.

Fix this by starting the layer tree ascent from the enclosing layer of the text form control if applicable,
instead of the inner editable area under the shadow root of the form control.

Test: editing/selection/ios/show-selection-in-transformed-container.html

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

LayoutTests:

Add a new layout test that covers this scenario. See WebKit ChangeLog for additional detail.

* editing/selection/ios/show-selection-in-transformed-container-expected.txt: Added.
* editing/selection/ios/show-selection-in-transformed-container.html: Added.

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

9 months agodocument.fonts.ready is resolved too quickly
youenn@apple.com [Thu, 29 Aug 2019 22:01:53 +0000 (22:01 +0000)]
document.fonts.ready is resolved too quickly
https://bugs.webkit.org/show_bug.cgi?id=174030
<rdar://problem/33083550>

Reviewed by Frédéric Wang.

LayoutTests/imported/w3c:

Test from https://github.com/web-platform-tests/wpt/pull/18489.

* web-platform-tests/fonts/ahem.css: Added.
(@font-face):
* web-platform-tests/infrastructure/assumptions/document-fonts-ready-expected.txt: Added.
* web-platform-tests/infrastructure/assumptions/document-fonts-ready.html: Added.

Source/WebCore:

As described in https://drafts.csswg.org/css-font-loading/#font-face-set-ready, the ready promise
is only fulfilled after layout operations complete and no additional font loads are necessary.

This patch implements this by notifying the FontFaceSet created for the document when the document
is finished loading. At that time, the promise will be resolved as soon as fonts are finished loading if any.

Test: imported/w3c/web-platform-tests/infrastructure/assumptions/document-fonts-ready.html

* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::optionalFontFaceSet):
* css/CSSFontSelector.h:
* css/FontFaceSet.cpp:
(WebCore::FontFaceSet::FontFaceSet):
(WebCore::FontFaceSet::startedLoading):
(WebCore::FontFaceSet::didFirstLayout):
(WebCore::FontFaceSet::completedLoading):
* css/FontFaceSet.h:
* dom/Document.cpp:
(WebCore::Document::implicitClose):

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

9 months ago[ews-app] Status bubble should only display important messages in pop-over
aakash_jain@apple.com [Thu, 29 Aug 2019 21:55:11 +0000 (21:55 +0000)]
[ews-app] Status bubble should only display important messages in pop-over
https://bugs.webkit.org/show_bug.cgi?id=201308

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-app/ews/views/statusbubble.py: Added various build-steps which are of low interest
to end-users in STEPS_TO_HIDE. If any of these steps fail, it will not be hidden.

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

9 months agoFlaky Test: svg/custom/tabindex-order.html
rniwa@webkit.org [Thu, 29 Aug 2019 21:51:22 +0000 (21:51 +0000)]
Flaky Test: svg/custom/tabindex-order.html
https://bugs.webkit.org/show_bug.cgi?id=201294

Reviewed by Chris Dumez.

Make the backward sequential navigation case more robust against platform differences.

* svg/custom/tabindex-order.html:

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

9 months ago[LFC][BFC] BlockFormattingContext::usedAvailableWidthForFloatAvoider should only...
zalan@apple.com [Thu, 29 Aug 2019 21:26:23 +0000 (21:26 +0000)]
[LFC][BFC] BlockFormattingContext::usedAvailableWidthForFloatAvoider should only be called on float avoiders.
https://bugs.webkit.org/show_bug.cgi?id=201238
<rdar://problem/54807663>

Reviewed by Antti Koivisto.

Make the horizontal available space logic for float avoiders more explicit/readable.

* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::usedAvailableWidthForFloatAvoider const):
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):

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

9 months agoWeb Inspector: REGRESSION (r248873): Debugger: pressing delete on a breakpoint will...
drousso@apple.com [Thu, 29 Aug 2019 20:50:24 +0000 (20:50 +0000)]
Web Inspector: REGRESSION (r248873): Debugger: pressing delete on a breakpoint will also delete any resource/element parent immediately before it in the list
https://bugs.webkit.org/show_bug.cgi?id=200939

Reviewed by Joseph Pecoraro.

* UserInterface/Views/DebuggerSidebarPanel.js:
(WI.DebuggerSidebarPanel.prototype._breakpointTreeOutlineDeleteTreeElement):
(WI.DebuggerSidebarPanel.prototype._handleBreakpointElementAddedOrRemoved):
(WI.DebuggerSidebarPanel.prototype._breakpointTreeOutlineDeleteTreeElement.checkIfSelectionAdjustmentNeeded): Deleted.
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel):
(WI.SourcesNavigationSidebarPanel.prototype._handleBreakpointElementAddedOrRemoved):
(WI.SourcesNavigationSidebarPanel.this._breakpointsTreeOutline.ondelete.checkIfSelectionAdjustmentNeeded): Deleted.
When the `WI.TreeOutline`'s own `ondelete` is called, that means we must be handling a
delete that was _not_ handled by a `WI.TreeElement`. This means that the `selectedTreeElement`
has to be a resource/script, the `window` object, or one of the non-deletable breakpoints.

In the case of a non-deletable breakpoint, since they're never removed from their parent
`WI.TreeOutline`, we just shift the selection to the next selectable `WI.TreeElement`.

Otherwise, wait for the `WI.TreeOutline.Event.ElementRemoved` event to be fired, and adjust
the selection then based on whether the new `selectedTreeElement` is one of the "top" items,
namely the "All Exceptions", "Uncaught Exceptions", and "Assertion Failures" breakpoints.

* UserInterface/Views/BreakpointTreeElement.js:
(WI.BreakpointTreeElement.prototype.ondelete):
* UserInterface/Views/DOMBreakpointTreeElement.js:
(WI.DOMBreakpointTreeElement.prototype.ondelete):
* UserInterface/Views/DOMNodeTreeElement.js:
(WI.DOMNodeTreeElement.prototype.ondelete):
* UserInterface/Views/EventBreakpointTreeElement.js:
(WI.EventBreakpointTreeElement.prototype.ondelete):
* UserInterface/Views/URLBreakpointTreeElement.js:
(WI.URLBreakpointTreeElement.prototype.ondelete):
Add `return true;` to let the parent `WI.TreeOutline` know that the delete event was handled.
This prevents the parent `WI.TreeOutline`'s own `ondelete` from being called, which would
cause a double-delete as there would be a different `selectedTreeElement`.

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

9 months ago[LFC] Inline content logging should have some extra space for better readability
zalan@apple.com [Thu, 29 Aug 2019 20:48:02 +0000 (20:48 +0000)]
[LFC] Inline content logging should have some extra space for better readability
https://bugs.webkit.org/show_bug.cgi?id=201236
<rdar://problem/54807336>

Reviewed by Antti Koivisto.

* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::outputInlineRuns):

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

9 months ago[LFC][TFC] Use the "complicated-cases" category for computing the TFC root's height
zalan@apple.com [Thu, 29 Aug 2019 20:07:36 +0000 (20:07 +0000)]
[LFC][TFC] Use the "complicated-cases" category for computing the TFC root's height
https://bugs.webkit.org/show_bug.cgi?id=201230
<rdar://problem/54806131>

Reviewed by Antti Koivisto.

This might change in the future but for now let's use the "complicated cases" when we need to compute the TFC's height and vertical margin.
This is very BFC specific since (block)TFC is always parented in a BFC.

* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):

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