WebKit-https.git
17 months agoRemove LayoutTests/platform/big-sur
tsavell@apple.com [Fri, 11 Dec 2020 22:28:51 +0000 (22:28 +0000)]
Remove LayoutTests/platform/big-sur
https://bugs.webkit.org/show_bug.cgi?id=218359

Unreviewed test gardening.

* platform/mac-bigsur/http/tests/navigation/javascriptlink-frames-expected.txt: Removed.
* platform/mac-bigsur/media/controls-after-reload-expected.txt: Removed.
* platform/mac-bigsur/media/video-no-audio-expected.txt: Removed.
* platform/mac-bigsur/svg/W3C-I18N/tspan-direction-rtl-expected.txt: Removed.
* platform/mac-bigsur/svg/custom/svg-fonts-without-missing-glyph-expected.txt: Removed.
* platform/mac-bigsur/svg/text/bidi-tspans-expected.txt: Removed.
* platform/mac-bigsur/tables/mozilla/bugs/bug18359-expected.txt: Removed.
* platform/mac-bigsur/tables/mozilla/bugs/bug60749-expected.txt: Removed.
* platform/mac-bigsur/tables/mozilla/bugs/bug7342-expected.txt: Removed.
* platform/mac-bigsur/transforms/2d/zoom-menulist-expected.txt: Removed.
* platform/mac-catalina/http/tests/navigation/javascriptlink-frames-expected.txt: Copied from LayoutTests/platform/mac/http/tests/navigation/javascriptlink-frames-expected.txt.
* platform/mac-catalina/http/tests/xmlhttprequest/methods-async-expected.txt: Copied from LayoutTests/platform/mac-bigsur/http/tests/xmlhttprequest/methods-async-expected.txt.
* platform/mac-catalina/http/tests/xmlhttprequest/methods-expected.txt: Copied from LayoutTests/platform/mac-bigsur/http/tests/xmlhttprequest/methods-expected.txt.
* platform/mac-catalina/http/tests/xmlhttprequest/workers/methods-async-expected.txt: Copied from LayoutTests/platform/mac-bigsur/http/tests/xmlhttprequest/workers/methods-async-expected.txt.
* platform/mac-catalina/http/tests/xmlhttprequest/workers/methods-expected.txt: Copied from LayoutTests/platform/mac-bigsur/http/tests/xmlhttprequest/workers/methods-expected.txt.
* platform/mac-catalina/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method.any-expected.txt: Added.
* platform/mac-catalina/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method.any.worker-expected.txt: Added.
* platform/mac-catalina/imported/w3c/web-platform-tests/fetch/redirect-navigate/preserve-fragment-expected.txt: Copied from LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/fetch/redirect-navigate/preserve-fragment-expected.txt.
* platform/mac-catalina/imported/w3c/web-platform-tests/mathml/relations/css-styling/ignored-properties-001-expected.txt: Copied from LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/mathml/relations/css-styling/ignored-properties-001-expected.txt.
* platform/mac-catalina/imported/w3c/web-platform-tests/mathml/relations/css-styling/padding-border-margin/border-002-expected.txt: Copied from LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/mathml/relations/css-styling/padding-border-margin/border-002-expected.txt.
* platform/mac-catalina/imported/w3c/web-platform-tests/mathml/relations/css-styling/padding-border-margin/padding-002-expected.txt: Copied from LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/mathml/relations/css-styling/padding-border-margin/padding-002-expected.txt.
* platform/mac-catalina/imported/w3c/web-platform-tests/xhr/send-entity-body-empty-expected.txt: Copied from LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/xhr/send-entity-body-empty-expected.txt.
* platform/mac-catalina/imported/w3c/web-platform-tests/xhr/send-entity-body-get-head-async-expected.txt: Added.
* platform/mac-catalina/imported/w3c/web-platform-tests/xhr/send-entity-body-get-head-expected.txt: Added.
* platform/mac-catalina/imported/w3c/web-platform-tests/xhr/send-entity-body-none-expected.txt: Added.
* platform/mac-catalina/media/controls-after-reload-expected.txt: Copied from LayoutTests/platform/mac/media/controls-after-reload-expected.txt.
* platform/mac-catalina/media/video-no-audio-expected.txt: Copied from LayoutTests/platform/mac/media/video-no-audio-expected.txt.
* platform/mac-catalina/platform/mac/fast/text/bidi-fallback-font-weight-expected.txt: Copied from LayoutTests/platform/mac-bigsur/platform/mac/fast/text/international/bidi-fallback-font-weight-expected.txt.
* platform/mac-catalina/svg/W3C-I18N/tspan-direction-rtl-expected.txt: Copied from LayoutTests/platform/mac/svg/W3C-I18N/tspan-direction-rtl-expected.txt.
* platform/mac-catalina/svg/custom/svg-fonts-without-missing-glyph-expected.txt: Copied from LayoutTests/platform/mac/svg/custom/svg-fonts-without-missing-glyph-expected.txt.
* platform/mac-catalina/svg/text/bidi-tspans-expected.txt: Copied from LayoutTests/platform/mac/svg/text/bidi-tspans-expected.txt.
* platform/mac-catalina/tables/mozilla/bugs/bug18359-expected.txt: Copied from LayoutTests/platform/mac/tables/mozilla/bugs/bug18359-expected.txt.
* platform/mac-catalina/tables/mozilla/bugs/bug60749-expected.txt: Copied from LayoutTests/platform/mac/tables/mozilla/bugs/bug60749-expected.txt.
* platform/mac-catalina/tables/mozilla/bugs/bug7342-expected.txt: Copied from LayoutTests/platform/mac/tables/mozilla/bugs/bug7342-expected.txt.
* platform/mac-catalina/transforms/2d/zoom-menulist-expected.txt: Copied from LayoutTests/platform/mac/transforms/2d/zoom-menulist-expected.txt.
* platform/mac/http/tests/navigation/javascriptlink-frames-expected.txt:
* platform/mac/http/tests/xmlhttprequest/methods-async-expected.txt: Renamed from LayoutTests/platform/mac-bigsur/http/tests/xmlhttprequest/methods-async-expected.txt.
* platform/mac/http/tests/xmlhttprequest/methods-expected.txt: Renamed from LayoutTests/platform/mac-bigsur/http/tests/xmlhttprequest/methods-expected.txt.
* platform/mac/http/tests/xmlhttprequest/workers/methods-async-expected.txt: Renamed from LayoutTests/platform/mac-bigsur/http/tests/xmlhttprequest/workers/methods-async-expected.txt.
* platform/mac/http/tests/xmlhttprequest/workers/methods-expected.txt: Renamed from LayoutTests/platform/mac-bigsur/http/tests/xmlhttprequest/workers/methods-expected.txt.
* platform/mac/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method.any-expected.txt: Renamed from LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method.any-expected.txt.
* platform/mac/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method.any.worker-expected.txt: Renamed from LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method.any.worker-expected.txt.
* platform/mac/imported/w3c/web-platform-tests/fetch/redirect-navigate/preserve-fragment-expected.txt: Renamed from LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/fetch/redirect-navigate/preserve-fragment-expected.txt.
* platform/mac/imported/w3c/web-platform-tests/mathml/relations/css-styling/ignored-properties-001-expected.txt: Renamed from LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/mathml/relations/css-styling/ignored-properties-001-expected.txt.
* platform/mac/imported/w3c/web-platform-tests/mathml/relations/css-styling/padding-border-margin/border-002-expected.txt: Renamed from LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/mathml/relations/css-styling/padding-border-margin/border-002-expected.txt.
* platform/mac/imported/w3c/web-platform-tests/mathml/relations/css-styling/padding-border-margin/padding-002-expected.txt: Renamed from LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/mathml/relations/css-styling/padding-border-margin/padding-002-expected.txt.
* platform/mac/imported/w3c/web-platform-tests/xhr/send-entity-body-empty-expected.txt: Renamed from LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/xhr/send-entity-body-empty-expected.txt.
* platform/mac/imported/w3c/web-platform-tests/xhr/send-entity-body-get-head-async-expected.txt: Renamed from LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/xhr/send-entity-body-get-head-async-expected.txt.
* platform/mac/imported/w3c/web-platform-tests/xhr/send-entity-body-get-head-expected.txt: Renamed from LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/xhr/send-entity-body-get-head-expected.txt.
* platform/mac/imported/w3c/web-platform-tests/xhr/send-entity-body-none-expected.txt: Renamed from LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/xhr/send-entity-body-none-expected.txt.
* platform/mac/media/controls-after-reload-expected.txt:
* platform/mac/media/video-no-audio-expected.txt:
* platform/mac/platform/mac/fast/loader/international/bidi-fallback-font-weight-expected.txt: Renamed from LayoutTests/platform/mac-bigsur/platform/mac/fast/text/international/bidi-fallback-font-weight-expected.txt.
* platform/mac/svg/W3C-I18N/tspan-direction-rtl-expected.txt:
* platform/mac/svg/custom/svg-fonts-without-missing-glyph-expected.txt:
* platform/mac/svg/text/bidi-tspans-expected.txt:
* platform/mac/tables/mozilla/bugs/bug18359-expected.txt:
* platform/mac/tables/mozilla/bugs/bug60749-expected.txt:
* platform/mac/tables/mozilla/bugs/bug7342-expected.txt:
* platform/mac/transforms/2d/zoom-menulist-expected.txt:

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

17 months ago[Media in GPU Process][MSE] Implement some required functions with new IPC messages...
peng.liu6@apple.com [Fri, 11 Dec 2020 21:47:46 +0000 (21:47 +0000)]
[Media in GPU Process][MSE] Implement some required functions with new IPC messages and remove some unneeded functions
https://bugs.webkit.org/show_bug.cgi?id=219788

Reviewed by Eric Carlson.

Source/WebCore:

Change the argument type of sourceBufferPrivateDidReceiveRenderingError() from int to int64_t
so that we can pass it in an IPC message.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveRenderingError):
* Modules/mediasource/SourceBuffer.h:
* platform/graphics/SourceBufferPrivateClient.h:

Source/WebKit:

Implement unimplemented functions and remove unneeded ones.
This patch also cleans up `RemoteSourceBufferProxy`.

* GPUProcess/media/RemoteSourceBufferProxy.cpp:
(WebKit::RemoteSourceBufferProxy::sourceBufferPrivateStreamEndedWithDecodeError):
(WebKit::RemoteSourceBufferProxy::sourceBufferPrivateAppendError):
(WebKit::RemoteSourceBufferProxy::sourceBufferPrivateDidDropSample):
(WebKit::RemoteSourceBufferProxy::sourceBufferPrivateDidReceiveRenderingError):
* GPUProcess/media/RemoteSourceBufferProxy.h:
* WebProcess/GPU/media/SourceBufferPrivateRemote.cpp:
(WebKit::SourceBufferPrivateRemote::sourceBufferPrivateStreamEndedWithDecodeError):
(WebKit::SourceBufferPrivateRemote::sourceBufferPrivateAppendError):
(WebKit::SourceBufferPrivateRemote::sourceBufferPrivateDidDropSample):
(WebKit::SourceBufferPrivateRemote::sourceBufferPrivateDidReceiveRenderingError):
(WebKit::SourceBufferPrivateRemote::flush): Deleted.
(WebKit::SourceBufferPrivateRemote::isReadyForMoreSamples): Deleted.
(WebKit::SourceBufferPrivateRemote::notifyClientWhenReadyForMoreSamples): Deleted.
(WebKit::SourceBufferPrivateRemote::canSetMinimumUpcomingPresentationTime const): Deleted.
(WebKit::SourceBufferPrivateRemote::setMinimumUpcomingPresentationTime): Deleted.
(WebKit::SourceBufferPrivateRemote::clearMinimumUpcomingPresentationTime): Deleted.
* WebProcess/GPU/media/SourceBufferPrivateRemote.h:
* WebProcess/GPU/media/SourceBufferPrivateRemote.messages.in:

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

17 months ago[LFC][IFC] InlineTextItem::isCollapsible might be misleading
zalan@apple.com [Fri, 11 Dec 2020 21:36:48 +0000 (21:36 +0000)]
[LFC][IFC] InlineTextItem::isCollapsible might be misleading
https://bugs.webkit.org/show_bug.cgi?id=219796

Reviewed by Antti Koivisto.

This change makes the code more aligned with the spec language.
::isCollapsed (which maps to RenderStyle::collapseWhiteSpace) is not always about collapsing subsequent
whitespace content but also about preserving tab stops.

* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::appendTextContent):
* layout/inlineformatting/InlineLine.h:
(WebCore::Layout::Line::Run::trailingWhitespaceType const):
* layout/inlineformatting/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::inlineItemWidth const):
* layout/inlineformatting/InlineTextItem.cpp:
(WebCore::Layout::InlineTextItem::shouldPreserveSpacesAndTabs):
* layout/inlineformatting/InlineTextItem.h:
(WebCore::Layout::InlineTextItem::isWhitespace const):
(WebCore::Layout::InlineTextItem::InlineTextItem):
(WebCore::Layout::InlineTextItem::isCollapsible const): Deleted.
* layout/inlineformatting/text/TextUtil.cpp:
(WebCore::Layout::TextUtil::width):

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

17 months agoUnreviewed test gardening for Windows.
ryanhaddad@apple.com [Fri, 11 Dec 2020 21:05:39 +0000 (21:05 +0000)]
Unreviewed test gardening for Windows.

* platform/win/fast/url/data-url-mediatype-expected.txt: Correct the baseline.

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

17 months ago[GPUProcess] WebAudio rendering quantum is 15 instead of 128 when the GPU Process...
cdumez@apple.com [Fri, 11 Dec 2020 21:04:23 +0000 (21:04 +0000)]
[GPUProcess] WebAudio rendering quantum is 15 instead of 128 when the GPU Process is enabled
https://bugs.webkit.org/show_bug.cgi?id=219797

Reviewed by Eric Carlson.

WebAudio rendering quantum is 15 instead of 128 when the GPU Process is enabled. This generates a lot more
IPC unnecessarily, not to mention how WebAudio code expects a rendering quantum of 128 and could potentially
do bad things with a lower value.

The issue was that RemoteAudioSessionProxyManager::setPreferredBufferSizeForProcess() was iterating over
all RemoteAudioSessionProxy objects to find out the lowest rendering quantum. If there is a proxy with
a preferred buffer size that is not set, the value ends up being 0. When then ask core audio for a rendering
quantum of 0, and they end up using 15 (likely the minimum).

* GPUProcess/media/RemoteAudioSessionProxyManager.cpp:
(WebKit::RemoteAudioSessionProxyManager::setPreferredBufferSizeForProcess):

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

17 months agoUnreviewed. Address post-review comments after r270678.
akeerthi@apple.com [Fri, 11 Dec 2020 20:53:08 +0000 (20:53 +0000)]
Unreviewed. Address post-review comments after r270678.

* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::paintColorWellDecorations):

Use std::size to determine the size of the color stops array.

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

17 months ago[LFC][IFC] Line should report the correct value for "content logical right"
zalan@apple.com [Fri, 11 Dec 2020 20:41:35 +0000 (20:41 +0000)]
[LFC][IFC] Line should report the correct value for "content logical right"
https://bugs.webkit.org/show_bug.cgi?id=219779

Reviewed by Antti Koivisto.

Adjust the run's horizontal geometry when negative margin-start is present.

* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::appendNonReplacedInlineBox):
(WebCore::Layout::Line::appendReplacedInlineBox):
* layout/inlineformatting/InlineLine.h:
(WebCore::Layout::Line::contentLogicalRight const):

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

17 months agoReflect.preventExtensions should not throw if called on WindowProxy or Location
shvaikalesh@gmail.com [Fri, 11 Dec 2020 20:39:38 +0000 (20:39 +0000)]
Reflect.preventExtensions should not throw if called on WindowProxy or Location
https://bugs.webkit.org/show_bug.cgi?id=219270

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

* web-platform-tests/html/browsers/history/the-location-interface/location-prevent-extensions-expected.txt: Added.
* web-platform-tests/html/browsers/history/the-location-interface/location-prevent-extensions.html: Added.
* web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt:
* web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects.html:
* web-platform-tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prevent-extensions-expected.txt: Added.
* web-platform-tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prevent-extensions.html: Added.

Source/WebCore:

Since r254626 fixed Object.preventExtensions to throw a TypeError on
`false` result, this patch makes [[PreventExtensions]] overrides pure,
aligning Reflect.preventExtensions behavior with the spec [1], Gecko,
and (only for WindowProxy [2]) Blink.

[1]: https://html.spec.whatwg.org/multipage/history.html#location-preventextensions
[2]: https://html.spec.whatwg.org/multipage/window-object.html#windowproxy-preventextensions

Tests: imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-prevent-extensions.html
       imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects.html
       imported/w3c/web-platform-tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prevent-extensions.html

* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::preventExtensions):
* bindings/js/JSLocationCustom.cpp:
(WebCore::JSLocation::preventExtensions):
* bindings/js/JSRemoteDOMWindowCustom.cpp:
(WebCore::JSRemoteDOMWindow::preventExtensions):

LayoutTests:

* http/tests/security/preventExtensions-window-location-expected.txt:

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

17 months ago[PlayStation] Link additional libraries into processes after r270690
don.olmstead@sony.com [Fri, 11 Dec 2020 20:21:52 +0000 (20:21 +0000)]
[PlayStation] Link additional libraries into processes after r270690
https://bugs.webkit.org/show_bug.cgi?id=219795

Unreviewed build fix after r270690.

Some libraries were being propagated from WebKit before the change so just add
them to the Process_PRIVATE_LIBRARIES.

* PlatformPlayStation.cmake:

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

17 months agoREGRESSION (r270665): testapi failing on CLoop bot
tzagallo@apple.com [Fri, 11 Dec 2020 20:10:12 +0000 (20:10 +0000)]
REGRESSION (r270665): testapi failing on CLoop bot
https://bugs.webkit.org/show_bug.cgi?id=219787

Reviewed by Mark Lam.

The API has to special case the empty JSValue as null.

* API/JSValueRef.cpp:
(JSValueGetType):
(JSValueIsNull):

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

17 months ago[WinCairo] Enable accelerated WebGL canvas
Hironori.Fujii@sony.com [Fri, 11 Dec 2020 20:09:38 +0000 (20:09 +0000)]
[WinCairo] Enable accelerated WebGL canvas
https://bugs.webkit.org/show_bug.cgi?id=219768

Reviewed by Don Olmstead.

Source/WebCore:

TextureMapper has TextureMapperGCGLPlatformLayer that is a
PlatformLayer for WebGL.

* html/canvas/GPUBasedCanvasRenderingContext.h (isAccelerated):
Return true for WinCairo port.

Source/WebKit:

prepareForRendering should be called before calling
flushPendingLayerChanges to make the GL context current because it
uses OpenGL API.

* WebProcess/WebPage/CoordinatedGraphics/LayerTreeHostTextureMapper.cpp:
(WebKit::LayerTreeHost::compositeLayersToContext):
(WebKit::LayerTreeHost::flushAndRenderLayers):

LayoutTests:

* platform/wincairo/TestExpectations: Skip some WebGL tests
because WinCairo DRT and WTR don't support pixel dump yet.

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

17 months ago[TextureMapper] REGRESION(r269570): mask layer doesn't clip descendent layers
Hironori.Fujii@sony.com [Fri, 11 Dec 2020 20:06:50 +0000 (20:06 +0000)]
[TextureMapper] REGRESION(r269570): mask layer doesn't clip descendent layers
https://bugs.webkit.org/show_bug.cgi?id=219136
<rdar://problem/71742605>

Reviewed by Carlos Garcia Campos.

Source/WebCore:

computeOverlapRegions shouldn't include the descendent layer
region for layers with a mask layer. Add a new mode Mask to
ComputeOverlapRegionMode which is like Union mode but doesn't
include descendent layers.

Test: compositing/masks/clip-path-composited-descendent-2.html

* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::computeOverlapRegions): Skip
children for the Mask mode.
(WebCore::TextureMapperLayer::paintUsingOverlapRegions): Use
ComputeOverlapRegionMode::Mask for a layer with mask layer.
* platform/graphics/texmap/TextureMapperLayer.h (ComputeOverlapRegionMode): Added Mask.

LayoutTests:

* compositing/masks/clip-path-composited-descendent-2-expected.html: Added.
* compositing/masks/clip-path-composited-descendent-2.html: Added.

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

17 months ago[webkitscmpy] Do not use actual URLs in testing
jbedard@apple.com [Fri, 11 Dec 2020 20:00:37 +0000 (20:00 +0000)]
[webkitscmpy] Do not use actual URLs in testing
https://bugs.webkit.org/show_bug.cgi?id=219790
<rdar://problem/72228983>

Reviewed by Stephanie Lewis.

* Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py: Bump version.
* Scripts/libraries/webkitscmpy/webkitscmpy/mocks/local/git.py:
(Git): Use example.org instead of webkit.org.
* Scripts/libraries/webkitscmpy/webkitscmpy/mocks/remote/svn.py:
(Svn.__init__): Use example.org instead of webkit.org.
* Scripts/libraries/webkitscmpy/webkitscmpy/test/find_unittest.py:
(TestFind.test_basic_svn_remote): Use example.org instead of webkit.org.
* Scripts/libraries/webkitscmpy/webkitscmpy/test/git_unittest.py:
(TestGit.test_info): Use example.org instead of webkit.org.
* Scripts/libraries/webkitscmpy/webkitscmpy/test/svn_unittest.py:
(TestRemoteSvn): Use example.org instead of webkit.org.
(TestRemoteSvn.test_detection):

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

17 months ago[GPU process] Update TestExpectations to skip Layout tests crashes
commit-queue@webkit.org [Fri, 11 Dec 2020 19:54:38 +0000 (19:54 +0000)]
[GPU process] Update TestExpectations to skip Layout tests crashes
https://bugs.webkit.org/show_bug.cgi?id=219792

Patch by Rini Patel <rini_patel@apple.com> on 2020-12-11
Reviewed by Simon Fraser.

* gpu-process/TestExpectations:

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

17 months ago[JSC] Update test262
ysuzuki@apple.com [Fri, 11 Dec 2020 19:50:47 +0000 (19:50 +0000)]
[JSC] Update test262
https://bugs.webkit.org/show_bug.cgi?id=219794

Reviewed by Mark Lam.

* test262/expectations.yaml:
* test262/latest-changes-summary.txt:
* test262/test/built-ins/Array/prototype/reverse/array-has-one-entry.js: Added.
* test262/test/built-ins/Array/prototype/sort/bug_596_1.js:
* test262/test/built-ins/Math/max/Math.max_each-element-coerced.js: Added.
(const.n.valueOf):
* test262/test/built-ins/Math/min/Math.min_each-element-coerced.js: Added.
(const.n.valueOf):
* test262/test/built-ins/String/prototype/at/prop-desc.js:
* test262/test/built-ins/TypedArray/prototype/at/prop-desc.js:
* test262/test/built-ins/TypedArray/prototype/fill/BigInt/fill-values-non-numeric-throw.js:
* test262/test/built-ins/TypedArray/prototype/fill/BigInt/fill-values-non-numeric.js:
* test262/test/built-ins/TypedArray/prototype/fill/BigInt/fill-values-symbol-throws.js:
* test262/test/built-ins/TypedArray/prototype/fill/BigInt/return-abrupt-from-set-value.js:
* test262/test/built-ins/TypedArray/prototype/fill/fill-values-non-numeric.js:
* test262/test/built-ins/TypedArray/prototype/fill/fill-values-symbol-throws.js:
* test262/test/built-ins/TypedArray/prototype/fill/return-abrupt-from-set-value.js:
* test262/test/built-ins/TypedArray/prototype/includes/detached-buffer-tointeger.js:
(testWithTypedArrayConstructors.valueOf):
(testWithTypedArrayConstructors):
(testWithTypedArrayConstructors.detachAndReturnIndex): Deleted.
* test262/test/built-ins/TypedArray/prototype/map/return-new-typedarray-conversion-operation-consistent-nan.js:
* test262/test/built-ins/TypedArray/prototype/map/return-new-typedarray-conversion-operation.js:
* test262/test/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/bigint-tobigint64.js:
* test262/test/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/bigint-tobiguint64.js:
* test262/test/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/boolean-tobigint.js:
* test262/test/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/null-tobigint.js:
* test262/test/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/number-tobigint.js:
* test262/test/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/string-nan-tobigint.js:
* test262/test/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/string-tobigint.js:
* test262/test/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/symbol-tobigint.js:
* test262/test/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/throws-setting-obj-to-primitive-typeerror.js:
* test262/test/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/throws-setting-obj-to-primitive.js:
* test262/test/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/throws-setting-obj-tostring.js:
* test262/test/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/throws-setting-obj-valueof-typeerror.js:
* test262/test/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/throws-setting-obj-valueof.js:
* test262/test/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/undefined-tobigint.js:
* test262/test/built-ins/TypedArrayConstructors/ctors/object-arg/conversion-operation-consistent-nan.js:
* test262/test/built-ins/TypedArrayConstructors/ctors/object-arg/conversion-operation.js:
* test262/test/built-ins/TypedArrayConstructors/ctors/object-arg/throws-setting-obj-to-primitive-typeerror.js:
* test262/test/built-ins/TypedArrayConstructors/ctors/object-arg/throws-setting-obj-to-primitive.js:
* test262/test/built-ins/TypedArrayConstructors/ctors/object-arg/throws-setting-obj-tostring.js:
* test262/test/built-ins/TypedArrayConstructors/ctors/object-arg/throws-setting-obj-valueof-typeerror.js:
* test262/test/built-ins/TypedArrayConstructors/ctors/object-arg/throws-setting-obj-valueof.js:
* test262/test/built-ins/TypedArrayConstructors/from/BigInt/source-value-is-symbol-throws.js:
* test262/test/built-ins/TypedArrayConstructors/from/nan-conversion.js:
* test262/test/built-ins/TypedArrayConstructors/from/source-value-is-symbol-throws.js:
* test262/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/desc-value-throws.js:
* test262/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/detached-buffer-realm.js:
* test262/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/detached-buffer.js:
* test262/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/set-value.js:
* test262/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/BigInt/tonumber-value-detached-buffer.js:
* test262/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/conversion-operation.js:
* test262/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/desc-value-throws.js:
* test262/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/detached-buffer-realm.js:
* test262/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/detached-buffer.js:
* test262/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/set-value.js:
* test262/test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/tonumber-value-detached-buffer.js:
* test262/test/built-ins/TypedArrayConstructors/internals/Set/BigInt/detached-buffer-realm.js:
* test262/test/built-ins/TypedArrayConstructors/internals/Set/BigInt/indexed-value.js:
* test262/test/built-ins/TypedArrayConstructors/internals/Set/BigInt/key-is-minus-zero.js:
(testWithBigIntTypedArrayConstructors):
* test262/test/built-ins/TypedArrayConstructors/internals/Set/BigInt/key-is-not-integer.js:
(testWithBigIntTypedArrayConstructors):
* test262/test/built-ins/TypedArrayConstructors/internals/Set/BigInt/key-is-out-of-bounds.js:
(testWithBigIntTypedArrayConstructors):
* test262/test/built-ins/TypedArrayConstructors/internals/Set/BigInt/tonumber-value-detached-buffer.js:
(testWithBigIntTypedArrayConstructors):
* test262/test/built-ins/TypedArrayConstructors/internals/Set/BigInt/tonumber-value-throws.js:
* test262/test/built-ins/TypedArrayConstructors/internals/Set/conversion-operation-consistent-nan.js:
* test262/test/built-ins/TypedArrayConstructors/internals/Set/conversion-operation.js:
* test262/test/built-ins/TypedArrayConstructors/internals/Set/detached-buffer-realm.js:
* test262/test/built-ins/TypedArrayConstructors/internals/Set/indexed-value.js:
* test262/test/built-ins/TypedArrayConstructors/internals/Set/key-is-minus-zero.js:
(testWithTypedArrayConstructors):
* test262/test/built-ins/TypedArrayConstructors/internals/Set/key-is-not-integer.js:
(testWithTypedArrayConstructors):
* test262/test/built-ins/TypedArrayConstructors/internals/Set/key-is-out-of-bounds.js:
(testWithTypedArrayConstructors):
* test262/test/built-ins/TypedArrayConstructors/internals/Set/tonumber-value-detached-buffer.js:
(testWithTypedArrayConstructors):
* test262/test/built-ins/TypedArrayConstructors/internals/Set/tonumber-value-throws.js:
* test262/test/built-ins/TypedArrayConstructors/of/BigInt/argument-is-symbol-throws.js:
* test262/test/built-ins/TypedArrayConstructors/of/BigInt/new-instance.js:
* test262/test/built-ins/TypedArrayConstructors/of/argument-is-symbol-throws.js:
* test262/test/built-ins/TypedArrayConstructors/of/nan-conversion.js:
* test262/test/built-ins/TypedArrayConstructors/of/new-instance.js:
* test262/test/built-ins/parseInt/S15.1.2.2_A2_T2.js:
* test262/test/intl402/DateTimeFormat/prototype/formatRange/date-x-greater-than-y-throws.js:
* test262/test/intl402/DateTimeFormat/prototype/formatRangeToParts/date-x-greater-than-y-throws.js:
* test262/test/language/arguments-object/mapped/enumerable-configurable-accessor-descriptor.js: Added.
(set _v):
* test262/test/language/arguments-object/mapped/nonconfigurable-descriptors-define-failure.js: Added.
(get 3):
* test262/test/language/arguments-object/mapped/writable-enumerable-configurable-descriptor.js: Added.
* test262/test/language/destructuring/binding/syntax/destructuring-array-parameters-function-arguments-length.js: Added.
(assert.sameValue):
(assert.sameValue.async a):
* test262/test/language/destructuring/binding/syntax/destructuring-object-parameters-function-arguments-length.js: Added.
(assert.sameValue):
* test262/test/language/expressions/async-function/named-reassign-fn-name-in-body-in-arrow.js: Added.
(let.ref.async BindingIdentifier):
(let.ref):
* test262/test/language/expressions/async-function/named-reassign-fn-name-in-body-in-eval.js: Added.
(let.ref.async BindingIdentifier):
(let.ref):
* test262/test/language/expressions/async-function/named-reassign-fn-name-in-body.js: Added.
(let.ref.async BindingIdentifier):
(let.ref):
* test262/test/language/expressions/async-function/named-strict-error-reassign-fn-name-in-body-in-arrow.js: Added.
(let.ref.async BindingIdentifier):
(let.ref):
* test262/test/language/expressions/async-function/named-strict-error-reassign-fn-name-in-body-in-eval.js: Added.
(let.ref.async BindingIdentifier):
(let.ref):
* test262/test/language/expressions/async-function/named-strict-error-reassign-fn-name-in-body.js: Added.
(let.ref.async BindingIdentifier):
(let.ref):
* test262/test/language/expressions/async-generator/named-no-strict-reassign-fn-name-in-body-in-arrow.js: Added.
(let.ref.async BindingIdentifier):
(let.ref):
* test262/test/language/expressions/async-generator/named-no-strict-reassign-fn-name-in-body-in-eval.js: Added.
(let.ref.async BindingIdentifier):
(let.ref):
* test262/test/language/expressions/async-generator/named-no-strict-reassign-fn-name-in-body.js: Added.
(let.ref.async BindingIdentifier):
(let.ref):
* test262/test/language/expressions/async-generator/named-strict-error-reassign-fn-name-in-body-in-arrow.js: Added.
(let.ref.async BindingIdentifier):
(let.ref):
* test262/test/language/expressions/async-generator/named-strict-error-reassign-fn-name-in-body-in-eval.js: Added.
(let.ref.async BindingIdentifier):
(let.ref):
* test262/test/language/expressions/async-generator/named-strict-error-reassign-fn-name-in-body.js: Added.
(let.ref.async BindingIdentifier):
(let.ref):
* test262/test/language/expressions/function/named-no-strict-reassign-fn-name-in-body-in-arrow.js: Added.
(let.ref):
* test262/test/language/expressions/function/named-no-strict-reassign-fn-name-in-body-in-eval.js: Added.
(let.ref):
* test262/test/language/expressions/function/named-no-strict-reassign-fn-name-in-body.js: Added.
(let.ref):
* test262/test/language/expressions/function/named-strict-error-reassign-fn-name-in-body-in-arrow.js: Added.
(let.ref):
* test262/test/language/expressions/function/named-strict-error-reassign-fn-name-in-body-in-eval.js: Added.
(let.ref):
* test262/test/language/expressions/function/named-strict-error-reassign-fn-name-in-body.js: Added.
(let.ref):
* test262/test/language/expressions/generators/named-no-strict-reassign-fn-name-in-body-in-arrow.js: Added.
(let.ref):
* test262/test/language/expressions/generators/named-no-strict-reassign-fn-name-in-body-in-eval.js: Added.
(let.ref):
* test262/test/language/expressions/generators/named-no-strict-reassign-fn-name-in-body.js: Added.
(let.ref):
* test262/test/language/expressions/generators/named-strict-error-reassign-fn-name-in-body-in-arrow.js: Added.
(let.ref):
* test262/test/language/expressions/generators/named-strict-error-reassign-fn-name-in-body-in-eval.js: Added.
(let.ref):
* test262/test/language/expressions/generators/named-strict-error-reassign-fn-name-in-body.js: Added.
(let.ref):
* test262/test262-Revision.txt:

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

17 months ago[WebAuthn] Adopt new UI for the Platform Authenticator makeCredential flow
jiewen_tan@apple.com [Fri, 11 Dec 2020 19:46:49 +0000 (19:46 +0000)]
[WebAuthn] Adopt new UI for the Platform Authenticator makeCredential flow
https://bugs.webkit.org/show_bug.cgi?id=219709
<rdar://problem/72154774>

Reviewed by Brent Fulgham.

This patch adopts the new UI for the platform authenticator makeCredential flow. In this new design,
the UI will be responsible for creating the LAContext and get it verified by the user. Therefore, WebKit
just needs to reverify the LAContext in non-UI mode against the SecAccessControlRef without handling any
LA UI anymore.

Covered by manual tests.

* Platform/spi/Cocoa/AuthenticationServicesCoreSPI.h:
Adds a new class which represents a successful operation.

* Resources/SandboxProfiles/ios/com.apple.WebKit.WebAuthn.sb:
Adds rule to allow the WebAuthn process to access Keychain and SEP.

* UIProcess/WebAuthentication/Authenticator.h:
(WebKit::Authenticator::setWebAuthenticationModernEnabled):
(WebKit::Authenticator::webAuthenticationModernEnabled const):
Adds a flag to know which UI to call.

* UIProcess/WebAuthentication/AuthenticatorManager.cpp:
(WebKit::AuthenticatorManager::handleRequest):
(WebKit::AuthenticatorManager::enableModernWebAuthentication):
(WebKit::AuthenticatorManager::authenticatorAdded):
(WebKit::AuthenticatorManager::requestLAContextForUserVerification):
(WebKit::AuthenticatorManager::invokePendingCompletionHandler):
* UIProcess/WebAuthentication/AuthenticatorManager.h:
Adds plumbing to the new UI method.

* UIProcess/WebAuthentication/Cocoa/AuthenticationServicesCoreSoftLink.h:
* UIProcess/WebAuthentication/Cocoa/AuthenticationServicesCoreSoftLink.mm:
Paperwork.

* UIProcess/WebAuthentication/Cocoa/AuthenticatorPresenterCoordinator.h:
(WebKit::AuthenticatorPresenterCoordinator::setCredentialRequestHandler):
This handler is from the UI delegate which is supposed to call if the operation succeeds.
* UIProcess/WebAuthentication/Cocoa/AuthenticatorPresenterCoordinator.mm:
(WebKit::AuthenticatorPresenterCoordinator::AuthenticatorPresenterCoordinator):
(WebKit::AuthenticatorPresenterCoordinator::requestLAContextForUserVerification):
(WebKit::AuthenticatorPresenterCoordinator::dimissPresenter):
(WebKit::AuthenticatorPresenterCoordinator::setLAContext):
* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.h:
* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
(WebKit::LocalAuthenticator::makeCredential):
(WebKit::LocalAuthenticator::continueMakeCredentialAfterReceivingLAContext):
* UIProcess/WebAuthentication/Cocoa/LocalConnection.h:
* UIProcess/WebAuthentication/Cocoa/LocalConnection.mm:
(WebKit::LocalConnection::verifyUser):
* UIProcess/WebAuthentication/Cocoa/WKASCAuthorizationPresenterDelegate.mm:
(-[WKASCAuthorizationPresenterDelegate authorizationPresenter:credentialRequestedForLoginChoice:authenticatedContext:completionHandler:]):
(-[WKASCAuthorizationPresenterDelegate dispatchCoordinatorCallback:]):
Implements the new UI logic.

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

17 months ago[Cocoa] REGRESSION (r270315): WebKitLegacy builds fail with "unifdef" error message
darin@apple.com [Fri, 11 Dec 2020 19:37:51 +0000 (19:37 +0000)]
[Cocoa] REGRESSION (r270315): WebKitLegacy builds fail with "unifdef" error message
https://bugs.webkit.org/show_bug.cgi?id=219756

Reviewed by Sam Weinig.

Was seeing this error: Unifdef: can't open Debug/WebKitLegacy.framework/Versions/A/Headers/*.h.tmp: No such file or directory.
Keith figured out it was because there are no public headers in the WebKitLegacy framework.

* postprocess-headers.sh: Remove the line that post-processes public headers.

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

17 months ago[macOS] Remove access to com.apple.MTLCompilerService in the WebContent process
pvollan@apple.com [Fri, 11 Dec 2020 19:29:33 +0000 (19:29 +0000)]
[macOS] Remove access to com.apple.MTLCompilerService in the WebContent process
https://bugs.webkit.org/show_bug.cgi?id=219774
<rdar://problem/70497100>

Reviewed by Brent Fulgham.

Remove access to com.apple.MTLCompilerService in the WebContent process on macOS, since there are no reports of this being used.

No new tests, since the result will depend on macOS version.

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

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

17 months ago[macOS] Remove Mobile Asset access from the WebContent process
pvollan@apple.com [Fri, 11 Dec 2020 19:26:42 +0000 (19:26 +0000)]
[macOS] Remove Mobile Asset access from the WebContent process
https://bugs.webkit.org/show_bug.cgi?id=219738
<rdar://problem/60650074>

Reviewed by Brent Fulgham.

Remove Mobile Asset access from the WebContent process on macOS, since there are no reports of this being used.

No new tests, since the result will depend on macOS version.

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

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

17 months ago[CMake] Determine correct visibility for linked frameworks
don.olmstead@sony.com [Fri, 11 Dec 2020 19:15:43 +0000 (19:15 +0000)]
[CMake] Determine correct visibility for linked frameworks
https://bugs.webkit.org/show_bug.cgi?id=210366

Reviewed by Michael Catanzaro.

.:

WebKit has some frameworks that are compiled statically into a larger shared library. For
example Apple compiles bmalloc and WTF into JavaScriptCore. This means the JavaScriptCore
framework also exposes the symbols for those two libraries and that targets depending
on WTF or bmalloc should link to JavaScriptCore and never to WTF or bmalloc directly.

The CMake code allows each port to decide the type of library for a WEBKIT_FRAMEWORK.
This means there are many different combinations that it needs to support. To ensure that
everything links properly some bookkeeping is required.

WEBKIT_FRAMEWORK now uses ${target}_FRAMEWORKS to determine how to link the frameworks
it depends on. First the macro determines if the framework is a SHARED library or is linked
into a shared library, and if so it is linked as PUBLIC. If the framework itself is not a
SHARED library, then it links other STATIC/OBJECT framework as PUBLIC. If the framework
itself is SHARED then any framework that is a STATIC/OBJECT library is linked as PRIVATE
to stop propagation. The linked framework's header directories are added to the
WebKit::${framework} target to allow the framework to present as that framework. A global
property is set to inform consumers that they should link to this different framework
to get the requested framework.

This ensures that all ports can ship with hidden visibility turned on which is a precursor
to a port turning on link time optimization (LTO).

* Source/cmake/WebKitMacros.cmake:

Source/JavaScriptCore:

Set JavaScriptCore_FRAMEWORKS to determine correct linkage for the library. Remove
explicit setting of STATICALLY_LINKED_WITH_${framework} and $<TARGET_OBJECTS:${framework}>
by ports.

Move the add_subdirectory of shell to the end of the CMakeLists.txt so its after the
WEBKIT_FRAMEWORK call. This ensures that the frameworks linked into JavaScriptCore are
known when creating the executables in that directory.

* CMakeLists.txt:
* PlatformGTK.cmake:
* PlatformJSCOnly.cmake:
* PlatformMac.cmake:
* PlatformPlayStation.cmake:
* shell/CMakeLists.txt:

Source/WebCore:

Set WebCore_FRAMEWORKS and WebCoreTestSupport_FRAMEWORKS to determine correct linkage
for the libraries. Remove explicit setting of STATICALLY_LINKED_WITH_PAL.

For the GTK port JavaScriptCore is compiled as a SHARED library with WTF and bmalloc
compiled into it. WEBKIT_FRAMEWORK now correctly prevents WTF and bmalloc being linked
into targets that also link JavaScriptCore. However GTK port can't be compiled with
hidden visibility turned on currently to properly export symbols so the libraries are
added back to the list for WebCore to keep the old, albiet wrong, behavior.

* CMakeLists.txt:
* PlatformGTK.cmake:

Source/WebCore/PAL:

Set PAL_FRAMEWORKS to determine correct linkage for the library.

* pal/CMakeLists.txt:

Source/WebDriver:

Conditionally add bmalloc to the list of WebDriver_FRAMEWORKS.

* CMakeLists.txt:

Source/WebKit:

Set WebKit_FRAMEWORKS to determine correct linkage for the library. Remove
explicit setting of STATICALLY_LINKED_WITH_${framework} and $<TARGET_OBJECTS:${framework}>
by ports.

* CMakeLists.txt:
* PlatformFTW.cmake:
* PlatformPlayStation.cmake:
* PlatformWPE.cmake:
* PlatformWin.cmake:

Source/WebKitLegacy:

Remove explicit setting of STATICALLY_LINKED_WITH_${framework}.

* PlatformFTW.cmake:
* PlatformWin.cmake:

Source/WTF:

Set WTF_FRAMEWORKS to determine correct linkage for the library. Remove
explicit setting of STATICALLY_LINKED_WITH_${framework} by ports.

* wtf/CMakeLists.txt:
* wtf/PlatformPlayStation.cmake:

Tools:

Remove explicit setting of STATICALLY_LINKED_WITH_${framework}.

* TestWebKitAPI/PlatformWin.cmake:

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

17 months ago[WASM-References] Add table.init
commit-queue@webkit.org [Fri, 11 Dec 2020 19:04:22 +0000 (19:04 +0000)]
[WASM-References] Add table.init
https://bugs.webkit.org/show_bug.cgi?id=219297

Patch by Dmitry Bezhetskov <dbezhetskov@igalia.com> on 2020-12-11
Reviewed by Yusuke Suzuki.

JSTests:

Added reference types spec tests for element section, table.init
and elem.drop:
https://github.com/WebAssembly/reference-types/blob/master/test/core/elem.wast,
https://github.com/WebAssembly/reference-types/blob/master/test/core/table_init.wast.
Added tests for checking table instructions immediates when they are unreachable.

* wasm.yaml:
* wasm/references-spec-tests/elem.wast.js: Added.
* wasm/references-spec-tests/ref_is_null.js: Removed.
* wasm/references-spec-tests/ref_is_null.wast.js: Added.
* wasm/references-spec-tests/ref_null.js: Removed.
* wasm/references-spec-tests/ref_null.wast.js: Added.
* wasm/references-spec-tests/table_copy.wast.js: Renamed from JSTests/wasm/references-spec-tests/table_copy.js.
* wasm/references-spec-tests/table_init.wast.js: Added.
* wasm/spec-harness/wasm-constants.js:
(hostref):
* wasm/wasm.json:

Source/JavaScriptCore:

Add support for table.init, elem.drop and new element section
from reference-type proposal:
https://webassembly.github.io/reference-types/core/syntax/instructions.html#table-instructions,
https://webassembly.github.io/reference-types/core/syntax/modules.html#element-segments.
All in one patch because all this stuff are very coupled and ref-types
spec tests require each other to run the its tests, so not to write
hand-crafted tests this is in one PR.

* bytecode/BytecodeList.rb:
* llint/WebAssembly.asm:
* wasm/WasmAirIRGenerator.cpp:
(JSC::Wasm::AirIRGenerator::addTableInit):
(JSC::Wasm::AirIRGenerator::addElemDrop):
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::addTableInit):
(JSC::Wasm::B3IRGenerator::addElemDrop):
* wasm/WasmFormat.h:
(JSC::Wasm::Element::Element):
(JSC::Wasm::Element::length const):
(JSC::Wasm::Element::isPassive const):
* wasm/WasmFunctionParser.h:
(JSC::Wasm::FunctionParser<Context>::parseExpression):
* wasm/WasmInstance.cpp:
(JSC::Wasm::Instance::Instance):
(JSC::Wasm::Instance::elemDrop):
(JSC::Wasm::Instance::elem const):
(JSC::Wasm::Instance::initElementSegment):
(JSC::Wasm::Instance::tableInit):
* wasm/WasmInstance.h:
(JSC::Wasm::Instance::isImportFunction const):
* wasm/WasmLLIntGenerator.cpp:
(JSC::Wasm::LLIntGenerator::addTableInit):
(JSC::Wasm::LLIntGenerator::addElemDrop):
* wasm/WasmModuleInformation.h:
(JSC::Wasm::ModuleInformation::elementCount const):
* wasm/WasmOperations.cpp:
(JSC::Wasm::JSC_DEFINE_JIT_OPERATION):
* wasm/WasmOperations.h:
* wasm/WasmSectionParser.cpp:
(JSC::Wasm::SectionParser::parseElement):
(JSC::Wasm::SectionParser::parseElementSegmentVectorOfExpressions):
(JSC::Wasm::SectionParser::parseElementSegmentVectorOfIndexes):
(JSC::Wasm::SectionParser::parseFuncIndexFromRefExpForElementSection): Deleted.
(JSC::Wasm::SectionParser::parseFuncIndexForElementSection): Deleted.
* wasm/WasmSectionParser.h:
* wasm/WasmSlowPaths.cpp:
(JSC::LLInt::WASM_SLOW_PATH_DECL):
* wasm/WasmSlowPaths.h:
* wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::evaluate):
* wasm/wasm.json:

Tools:

Support ref-types spec tests.

* Scripts/run-jsc-stress-tests:

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

17 months agoUnreviewed, reverting r270654.
commit-queue@webkit.org [Fri, 11 Dec 2020 19:00:50 +0000 (19:00 +0000)]
Unreviewed, reverting r270654.
https://bugs.webkit.org/show_bug.cgi?id=219793

Introduced crash

Reverted changeset:

"[macOS] The development WebContent XPC service is missing a
required entitlement"
https://bugs.webkit.org/show_bug.cgi?id=219730
https://trac.webkit.org/changeset/270654

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

17 months agoAdd Big Sur to WebKit Build Archives page
ryanhaddad@apple.com [Fri, 11 Dec 2020 18:50:30 +0000 (18:50 +0000)]
Add Big Sur to WebKit Build Archives page
https://bugs.webkit.org/show_bug.cgi?id=219789

Reviewed by Alexey Proskuryakov.

* wp-content/themes/webkit/build-archives.php:
Add Big Sur, remove High Sierra since we aren't producing new archives for it.

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

17 months agoAdd extra validation after untagging code pointers.
mark.lam@apple.com [Fri, 11 Dec 2020 18:49:31 +0000 (18:49 +0000)]
Add extra validation after untagging code pointers.
https://bugs.webkit.org/show_bug.cgi?id=219765
rdar://72069920

Reviewed by Robin Morisset.

* assembler/AbstractMacroAssembler.h:
(JSC::AbstractMacroAssembler::untagReturnAddress):
(JSC::AbstractMacroAssembler::validateUntaggedPtr):
* assembler/MacroAssemblerARM64E.h:
(JSC::MacroAssemblerARM64E::untagReturnAddress):
(JSC::MacroAssemblerARM64E::validateUntaggedPtr):
* dfg/DFGOSRExitCompilerCommon.cpp:
(JSC::DFG::reifyInlinedCallFrames):
* ftl/FTLThunks.cpp:
(JSC::FTL::genericGenerationThunkGenerator):
* jit/CCallHelpers.h:
(JSC::CCallHelpers::prepareForTailCallSlow):
* jit/CallFrameShuffler.cpp:
(JSC::CallFrameShuffler::prepareForTailCall):
* jit/ThunkGenerators.cpp:
(JSC::emitPointerValidation):
(JSC::arityFixupGenerator):
* llint/LLIntThunks.cpp:
(JSC::LLInt::createTailCallGate):
(JSC::LLInt::untagGateThunk):
* wasm/js/WebAssemblyFunction.cpp:
(JSC::WebAssemblyFunction::jsCallEntrypointSlow):

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

17 months agoProtect the WebProcessPool earlier in WebProcessCache::addProcessIfPossible
commit-queue@webkit.org [Fri, 11 Dec 2020 18:31:05 +0000 (18:31 +0000)]
Protect the WebProcessPool earlier in WebProcessCache::addProcessIfPossible
https://bugs.webkit.org/show_bug.cgi?id=219777

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2020-12-11
Reviewed by Adrian Perez de Castro.

We are taking a reference of the WebProcessPool in the isResponsive() completion handler lambda, but the
WebProcessPool can be destroyed earlier when CachedProcess is created if the WebProcessProxy contains the last
strong reference.

* UIProcess/WebProcessCache.cpp:
(WebKit::WebProcessCache::addProcessIfPossible):

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

17 months agoEliminate 'async time' in StyleBench
ggaren@apple.com [Fri, 11 Dec 2020 18:23:51 +0000 (18:23 +0000)]
Eliminate 'async time' in StyleBench
https://bugs.webkit.org/show_bug.cgi?id=219785

Reviewed by Antti Koivisto.

r270132 (a RunLoop change) measured as a 13% regression on the
StyleBench bot. But I don't think the measured regression was user-real.
Instead, I think the baseline score was artificially high because 'async
time' sometimes did not measure painting.

I decided just to eliminate 'async time' (and force style resolution +
layout during 'sync time') because this benchmark intends to measure
style resolution + layout, and not painting or frame rate.

With this change, there is no measured regression anymore.

Explanation of 'did not measure painting':

        StyleBench synchronously modifies DOM + style, and then sets a
        zero-delay timer to measure 'async time'. If layout has not
        happened by the time the timer fires, StyleBench forces layout
        and then computes 'async time'. The flaw here is painting.
        StyleBench accepts both of these orders of operations as valid:

        (A) { modify DOM + style }, { measure 'sync time' }, { style resolution + layout }, { paint }, { measure 'async time' }

        (B) { modify DOM + style }, { measure 'sync time' }, { style resolution + layout }, { measure 'async time' }, { paint }

        ^ (B) includes more stuff than (A). Not cool!

Evidence for the theory that the baseline was sometimes doing (B):

        * Forcing style resolution + layout during sync time reduces the
        baseline score and eliminates the difference in async time
        between baseline and patch.

        * Starting the benchmark from a requestAnimationFrame() instead
        of a timer reduces the baseline score and eliminates the
        difference in async time between baseline and patch.

        * The regression only reproduced on machines with fewer cores.

        * The new benchmark method reduces sttdev by ~3X - ~5X.

* StyleBench/resources/benchmark-runner.js:
(BenchmarkRunner.prototype._runTest): Call getBoundingClientRect()
during sync time to force style resolution + layout consistently.

Always report async time as 1, since this benchmark doesn't have an
async time component anymore. (The harness doesn't like zeroes.)

Just store height in a global because that is sufficient to prevent
dead code elimination (which was probably impossible anyway, since
getBoundingClientRect() has side effects).

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

17 months ago[GTK][WPE] Async overflow scrolling is disabled by default due to brokenness
clord@igalia.com [Fri, 11 Dec 2020 17:50:08 +0000 (17:50 +0000)]
[GTK][WPE] Async overflow scrolling is disabled by default due to brokenness
https://bugs.webkit.org/show_bug.cgi?id=219776

Reviewed by Žan Doberšek.

Source/WebCore:

Make sure to respect GraphicsLayer::boundsOrigin when calculating
transforms, coverage and clipping in CoordinatedGraphicsLayer. Also,
when scrolling overflow areas, change the boundsOrigin on the
container layer and not the contents area, to match behaviour on Mac.

* page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.cpp:
(WebCore::ScrollingTreeOverflowScrollingNodeNicosia::repositionScrollingLayers):
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::paintSelfAndChildren):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
(WebCore::CoordinatedGraphicsLayer::computeTransformedVisibleRect):

Source/WTF:

Enable async overflow scrolling with Nicosia.

* Scripts/Preferences/WebPreferencesInternal.yaml:

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

17 months ago[macOS] Only extend access to the RootDomainUserClient IOKit class if the GPU Process...
bfulgham@apple.com [Fri, 11 Dec 2020 17:32:56 +0000 (17:32 +0000)]
[macOS] Only extend access to the RootDomainUserClient IOKit class if the GPU Process is not used
https://bugs.webkit.org/show_bug.cgi?id=219758
<rdar://problem/70464431>

Reviewed by Per Arne Vollan.

The RootDomainUserClient IOKit class appears to only be used by media on Apple Silicon. Dynamically extend access to this
class for Apple Silicon builds if the GPU process is not being used.

This patch also includes telemetry to confirm that it is not needed on Intel, or for any other purposes. It does not
block access to the IOKit class yet.

* UIProcess/WebPageProxy.cpp:
(WebKit::mediaRelatedIOKitClasses):
* WebProcess/com.apple.WebProcess.sb.in:

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

17 months ago[iOS] Adopt AVSystemController_SubscribeToNotificationsAttribute
jer.noble@apple.com [Fri, 11 Dec 2020 17:28:56 +0000 (17:28 +0000)]
[iOS] Adopt AVSystemController_SubscribeToNotificationsAttribute
https://bugs.webkit.org/show_bug.cgi?id=219754
<rdar://problem/71352731>

Reviewed by Eric Carlson.

Ask AVSystemController to send us the notifications we are interested in,
making sure to ask again if the server dies.

* platform/audio/ios/MediaSessionHelperIOS.mm:
(MediaSessionHelperiOS::mediaServerConnectionDied):
(-[WebMediaSessionHelper initWithCallback:]):

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

17 months agoEnable WebRTCPlatformSocketsEnabled by default
youenn@apple.com [Fri, 11 Dec 2020 17:05:54 +0000 (17:05 +0000)]
Enable WebRTCPlatformSocketsEnabled by default
https://bugs.webkit.org/show_bug.cgi?id=219778

Reviewed by Eric Carlson.

* Scripts/Preferences/WebPreferencesExperimental.yaml:

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

17 months agoIntroduce a way to update additional settings than the one handled by policies
youenn@apple.com [Fri, 11 Dec 2020 16:46:52 +0000 (16:46 +0000)]
Introduce a way to update additional settings than the one handled by policies
https://bugs.webkit.org/show_bug.cgi?id=219681

Reviewed by Eric Carlson.

Add a way for WebKit additions to update page settings at the time settings are changed by policies.
Manually tested.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::applyPoliciesToSettings):
* loader/DocumentLoader.h:

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

17 months ago[iOS][FCR] Add new look for color inputs
akeerthi@apple.com [Fri, 11 Dec 2020 16:42:17 +0000 (16:42 +0000)]
[iOS][FCR] Add new look for color inputs
https://bugs.webkit.org/show_bug.cgi?id=219654
<rdar://problem/72107493>

Reviewed by Wenson Hsieh.

Source/WebCore:

The new appearance matches the appearance of UIKit's UIColorWell.

Tests: fast/forms/ios/form-control-refresh/color/background-color.html
       fast/forms/ios/form-control-refresh/color/border-radius.html
       fast/forms/ios/form-control-refresh/color/border.html
       fast/forms/ios/form-control-refresh/color/width-height.html

* css/formControlsIOS.css:
(input[type="color"]::-webkit-color-swatch-wrapper, input[type="color"]::-webkit-color-swatch):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::adjustStyle):
(WebCore::RenderTheme::paint):
(WebCore::RenderTheme::paintDecorations):
(WebCore::RenderTheme::adjustColorWellStyle const):

Call adjustButtonStyle to preserve existing behavior in cases where
the form control refresh does not apply (setting disabled,
non-iOS ports).

(WebCore::RenderTheme::paintColorWell):

Call paintButton to preserve existing behavior in cases where
the form control refresh does not apply (setting disabled,
non-iOS ports).

(WebCore::RenderTheme::paintColorWellDecorations):

Call paintButtonDecorations to preserve existing behavior in
cases where the form control refresh does not apply (setting
disabled, non-iOS ports).

(WebCore::RenderTheme::colorInputStyleSheet const):
* rendering/RenderTheme.h:

Previously, color inputs always had the same appearance as buttons.
However, with the new appearance on iOS this is no longer always
the case. Consequently, it is necessary to introduce adjustColorWellStyle,
paintColorWell and paintColorWellDecorations.

Updated colorInputStyleSheet to take an additional parameter, so that
the style can change depending on whether or not the form control refresh
setting is enabled. It is not possible to simply add the new style to
formControlsiOS.css, since <input type=color> is another runtime
enabled feature.

* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::colorInputStyleSheet const):
(WebCore::RenderThemeIOS::adjustColorWellStyle const):
(WebCore::RenderThemeIOS::paintColorWell):
(WebCore::RenderThemeIOS::paintColorWellDecorations):

Use a conic gradient to achieve the new appearance.

* style/UserAgentStyle.cpp:
(WebCore::Style::UserAgentStyle::ensureDefaultStyleSheetsForElement):

LayoutTests:

Added tests to verify the stylability of color inputs with the new appearance.

* fast/forms/ios/form-control-refresh/color/background-color-expected-mismatch.html: Added.
* fast/forms/ios/form-control-refresh/color/background-color.html: Added.
* fast/forms/ios/form-control-refresh/color/border-expected-mismatch.html: Added.
* fast/forms/ios/form-control-refresh/color/border-radius-expected-mismatch.html: Added.
* fast/forms/ios/form-control-refresh/color/border-radius.html: Added.
* fast/forms/ios/form-control-refresh/color/border.html: Added.
* fast/forms/ios/form-control-refresh/color/width-height-expected-mismatch.html: Added.
* fast/forms/ios/form-control-refresh/color/width-height.html: Added.

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

17 months ago[GLib] Move GCrypt initialization to platformInitialize
don.olmstead@sony.com [Fri, 11 Dec 2020 16:38:16 +0000 (16:38 +0000)]
[GLib] Move GCrypt initialization to platformInitialize
https://bugs.webkit.org/show_bug.cgi?id=219749

Reviewed by Adrian Perez de Castro.

It makes more sense for initialization of GCrypt to occur in platformInitialize
than in the main method of the process. This means that the process does not have
to link gcrypt libraries and can just link WebKit only.

* NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp:
(main):
* NetworkProcess/soup/NetworkProcessMainSoup.cpp:
* WebProcess/EntryPoint/unix/WebProcessMain.cpp:
(main):
* WebProcess/gtk/WebProcessMainGtk.cpp:
(WebKit::WebProcessMain):
* WebProcess/wpe/WebProcessMainWPE.cpp:

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

17 months agoREGRESSION (r270458): Canvas painting is broken when enabling GPU process for DOM
wenson_hsieh@apple.com [Fri, 11 Dec 2020 16:06:22 +0000 (16:06 +0000)]
REGRESSION (r270458): Canvas painting is broken when enabling GPU process for DOM
https://bugs.webkit.org/show_bug.cgi?id=219760

Reviewed by Tim Horton.

Use `ImageBuffer::logicalSize` instead of `ImageBuffer::backendSize` when overriding the CanvasBase's size, upon
changing image buffers. When enabling GPU process for DOM, `ImageBufferShareableIOSurfaceBackend::backendSize`
is empty because the actual IOSurface backend exists in the GPU process; using the backendSize instead of the
logical size here would otherwise cause us to always set CanvasBase's size to `(0, 0)`.

* html/CanvasBase.cpp:
(WebCore::CanvasBase::setImageBuffer const):

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

17 months agoREGRESSION(r268923): [WPE] Nothing renders on the rpi3 using the proprietary video...
magomez@igalia.com [Fri, 11 Dec 2020 12:46:26 +0000 (12:46 +0000)]
REGRESSION(r268923): [WPE] Nothing renders on the rpi3 using the proprietary video driver
https://bugs.webkit.org/show_bug.cgi?id=219739

Reviewed by Carlos Garcia Campos.

Rewrite the GLSL code to perform rounded rectangle clipping so it works with the limitations
of the raspberrypi3 proprietary video driver.

* platform/graphics/texmap/TextureMapperShaderProgram.cpp:

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

17 months ago[iOS] Remove access to the IOKIt class AGXDeviceUserClient in the WebContent process
pvollan@apple.com [Fri, 11 Dec 2020 11:39:54 +0000 (11:39 +0000)]
[iOS] Remove access to the IOKIt class AGXDeviceUserClient in the WebContent process
https://bugs.webkit.org/show_bug.cgi?id=219733
<rdar://problem/70628137>

Reviewed by Brent Fulgham.

Remove access to the IOKIt class AGXDeviceUserClient in the WebContent process on iOS, since this is not needed when allowing access to IOGPU.
The IOGPU class is the superclass of AGXDeviceUserClient, and is the preferred IOKit reference to use according to the Sandbox team.

* Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb:
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
* UIProcess/WebPageProxy.cpp:
(WebKit::gpuIOKitClasses):

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

17 months agoREGRESSION(r270186): [GTK] MiniBrowser: do not exit after load when no arguments...
carlosgc@webkit.org [Fri, 11 Dec 2020 10:50:28 +0000 (10:50 +0000)]
REGRESSION(r270186): [GTK] MiniBrowser: do not exit after load when no arguments given
https://bugs.webkit.org/show_bug.cgi?id=219737

Reviewed by Adrian Perez de Castro.

Only exit after load when --exit-after-load is passed.

* MiniBrowser/gtk/main.c:
(activate):

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

17 months agoUnreviewed. Remove temporary workaround added to fix the build with GCC 10
carlosgc@webkit.org [Fri, 11 Dec 2020 10:45:34 +0000 (10:45 +0000)]
Unreviewed. Remove temporary workaround added to fix the build with GCC 10

Revert r269948. The bug has already been fixed in GCC.

* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::sanitizeHTTPHeaderFieldsAccordingToTainting):

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

17 months ago[macOS] Add telemetry for notification message filtering in sandbox
pvollan@apple.com [Fri, 11 Dec 2020 10:11:19 +0000 (10:11 +0000)]
[macOS] Add telemetry for notification message filtering in sandbox
https://bugs.webkit.org/show_bug.cgi?id=219684
<rdar://problem/69819260>

Reviewed by Brent Fulgham.

Add telemetry for notification message filtering in sandbox in the WebContent process on macOS.

No new tests, since this just adds telemetry.

* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

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

17 months agoUnreviewed, reverting r270655.
commit-queue@webkit.org [Fri, 11 Dec 2020 09:29:58 +0000 (09:29 +0000)]
Unreviewed, reverting r270655.
https://bugs.webkit.org/show_bug.cgi?id=219772

Introduced sandbox compile error

Reverted changeset:

"[iOS] Add missing endpoint in sandbox message filter"
https://bugs.webkit.org/show_bug.cgi?id=219731
https://trac.webkit.org/changeset/270655

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

17 months agoAccept click measurement data from hosting application
commit-queue@webkit.org [Fri, 11 Dec 2020 07:41:15 +0000 (07:41 +0000)]
Accept click measurement data from hosting application
https://bugs.webkit.org/show_bug.cgi?id=219763
<rdar://problem/72121094>

Patch by Alex Christensen <achristensen@webkit.org> on 2020-12-10
Reviewed by John Wilander.

Source/WebCore:

Covered by an API test.

* loader/PrivateClickMeasurement.h:
(WebCore::PrivateClickMeasurement::PrivateClickMeasurement):
(WebCore::PrivateClickMeasurement::sourceID const):
(WebCore::PrivateClickMeasurement::sourceDescription const):
(WebCore::PrivateClickMeasurement::purchaser const):
(WebCore::PrivateClickMeasurement::encode const):
(WebCore::PrivateClickMeasurement::decode):
(WebCore::PrivateClickMeasurement::sourceID): Deleted.

Source/WebKit:

* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
(WebKit::ResourceLoadStatisticsDatabaseStore::buildPrivateClickMeasurementFromDatabase):
* Platform/ios/UIKitSoftLink.h: Added.
* Platform/ios/UIKitSoftLink.mm: Added.
* Platform/spi/ios/UIKitSPI.h:
* SourcesCocoa.txt:
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h:
* UIProcess/API/Cocoa/WKWebViewTesting.mm:
(-[WKWebView _setPrivateClickMeasurementOverrideTimerForTesting:completionHandler:]):
(-[WKWebView _setPrivateClickMeasurementConversionURLForTesting:completionHandler:]):
* UIProcess/API/ios/WKWebViewIOS.mm:
(-[WKWebView _setEventAttribution:]):
(-[WKWebView _eventAttribution]):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::createNewPage):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::setPrivateClickMeasurement):
(WebKit::WebPageProxy::privateClickMeasurement const):
* WebKit.xcodeproj/project.pbxproj:

Tools:

* TestWebKitAPI/SourcesCocoa.txt:
* TestWebKitAPI/Tests/WebKitCocoa/Challenge.mm:
(testCertificate):
* TestWebKitAPI/Tests/WebKitCocoa/EventAttribution.mm: Added.
(-[MockEventAttribution initWithReportEndpoint:attributeOn:]):
(TestWebKitAPI::TEST):
* TestWebKitAPI/cocoa/HTTPServer.h:

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

17 months ago[Media in GPU Process][MSE] Implement several methods in SourceBufferPrivateRemote...
peng.liu6@apple.com [Fri, 11 Dec 2020 07:11:01 +0000 (07:11 +0000)]
[Media in GPU Process][MSE] Implement several methods in SourceBufferPrivateRemote to make seeking more reliable
https://bugs.webkit.org/show_bug.cgi?id=219757

Reviewed by Eric Carlson.

Source/WebCore:

Clean up the code regarding flush audio and video.

* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::flush):

Source/WebKit:

Add the required IPC messages and implement three functions of `SourceBufferPrivateRemote`.

* GPUProcess/media/RemoteSourceBufferProxy.cpp:
(WebKit::RemoteSourceBufferProxy::abort):
(WebKit::RemoteSourceBufferProxy::resetParserState):
(WebKit::RemoteSourceBufferProxy::removedFromMediaSource):
* GPUProcess/media/RemoteSourceBufferProxy.h:
* GPUProcess/media/RemoteSourceBufferProxy.messages.in:
* WebProcess/GPU/media/SourceBufferPrivateRemote.cpp:
(WebKit::SourceBufferPrivateRemote::abort):
(WebKit::SourceBufferPrivateRemote::resetParserState):
(WebKit::SourceBufferPrivateRemote::removedFromMediaSource):

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

17 months agoPCM: Turn feature on by default
wilander@apple.com [Fri, 11 Dec 2020 05:32:04 +0000 (05:32 +0000)]
PCM: Turn feature on by default
https://bugs.webkit.org/show_bug.cgi?id=219762
<rdar://problem/56118178>

Reviewed by Brent Fulgham.

This patch turns on Private Click Measurement (PCM) by default.
Source/WTF:

* Scripts/Preferences/WebPreferencesExperimental.yaml:

LayoutTests:

Test cases no longer need to enable it.

* http/tests/privateClickMeasurement/anchor-tag-attributes-reflect.html:
* http/tests/privateClickMeasurement/attribution-conversion-through-cross-site-image-redirect.html:
* http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-in-new-window.html:
* http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-with-priority.html:
* http/tests/privateClickMeasurement/clear-through-website-data-removal.html:

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

17 months ago[Mac] Create a format reader plug-in for WebM
aestes@apple.com [Fri, 11 Dec 2020 05:21:26 +0000 (05:21 +0000)]
[Mac] Create a format reader plug-in for WebM
https://bugs.webkit.org/show_bug.cgi?id=218908
<rdar://problem/71373264>

Reviewed by Eric Carlson.

Source/WebCore/PAL:

* pal/spi/cocoa/MediaToolboxSPI.h: Defined SPI for MTPluginFormatReader.

Source/WebKit:

Added a new bundle target that builds a MediaToolbox format reader
plug-in and installs it in the WebContent and GPU XPC service bundles.
The plug-in does nothing for now, but in follow-up patches will learn
how to read WebM containers.

* Configurations/MediaFormatReader.xcconfig: Added.
* MediaFormatReaderPlugIn/Info.plist: Added. Defines a CMClassImplementations array
specifying the plug-in factory function and the supported media types / extensions.
* MediaFormatReaderPlugIn/MediaFormatReaderPlugIn.cpp: Added.
* WebKit.xcodeproj/project.pbxproj:

Source/WTF:

* wtf/PlatformHave.h: Defined HAVE_MT_PLUGIN_FORMAT_READER.

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

17 months agoRemoving unnecessary locking from JSValue API functions
tzagallo@apple.com [Fri, 11 Dec 2020 04:20:19 +0000 (04:20 +0000)]
Removing unnecessary locking from JSValue API functions
https://bugs.webkit.org/show_bug.cgi?id=219723

Reviewed by Filip Pizlo.

PerformanceTests:

Print an error message when benchmarks fail to run and add option to change
the configuration used to build the benchmarks.

* APIBench/api-bench:

Source/JavaScriptCore:

Remove the unnecessary locking from the JSValueIs* and JSValueMake* API functions
that only work on primitives. Also remove the unnecessary method dispatching and
call from the -[JSValue is*] methods.

This improves the APIBench score by another ~8% since these are such common operations.
Here are the results: (Baseline includes https://bugs.webkit.org/show_bug.cgi?id=219663)

CURRENT_API:        Baseline   Change
----------------------------------------
RichardsMostlyC:      74ms      60ms
RichardsMostlyObjC:  304ms     300ms
RichardsMostlySwift: 305ms     293ms
RichardsSomeC:        97ms      77ms
RichardsSomeObjC:    158ms     159ms
RichardsSomeSwift:   202ms     198ms

UPCOMING_API:       Baseline   Change
----------------------------------------
RichardsMostlyC:      23ms      19ms
RichardsMostlyObjC:  282ms     282ms
RichardsMostlySwift: 280ms     282ms
RichardsSomeC:        95ms      76ms
RichardsSomeObjC:    157ms     156ms
RichardsSomeSwift:   202ms     197ms
----------------------------------------
Score:             33.6404   36.4006

* API/APICast.h:
(toRef):
* API/JSValue.mm:
(-[JSValue isUndefined]):
(-[JSValue isNull]):
(-[JSValue isBoolean]):
(-[JSValue isNumber]):
(-[JSValue isString]):
(-[JSValue isObject]):
(-[JSValue isSymbol]):
* API/JSValueRef.cpp:
(JSValueGetType):
(JSValueIsUndefined):
(JSValueIsNull):
(JSValueIsBoolean):
(JSValueIsNumber):
(JSValueIsString):
(JSValueIsObject):
(JSValueIsSymbol):
(JSValueMakeUndefined):
(JSValueMakeNull):
(JSValueMakeBoolean):
(JSValueMakeNumber):

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

17 months agoAlign [[DefineOwnProperty]] method of mapped arguments object with the spec
shvaikalesh@gmail.com [Fri, 11 Dec 2020 04:14:18 +0000 (04:14 +0000)]
Align [[DefineOwnProperty]] method of mapped arguments object with the spec
https://bugs.webkit.org/show_bug.cgi?id=219750

Reviewed by Yusuke Suzuki.

JSTests:

* test262/expectations.yaml: Mark 5 test cases as passing.

Source/JavaScriptCore:

This patch reimplements [[DefineOwnProperty]] method to resemble the spec [1] as
closely as possible, aligning JSC with V8 and SpiderMonkey on remaining test262 cases.

Unlike the spec [2], JSC doesn't materialize mapped indices with initial values,
so putDirectIndex() is performed on the first call to handle incomplete descriptors.

Even though there is a possibility to avoid JSObject storage puts for a handful of
super rare descriptors, it's not worth the increased complexity.

[1]: https://tc39.es/ecma262/#sec-arguments-exotic-objects-defineownproperty-p-desc
[2]: https://tc39.es/ecma262/#sec-createmappedargumentsobject (step 15.b)

* runtime/GenericArgumentsInlines.h:
(JSC::GenericArguments<Type>::defineOwnProperty):

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

17 months ago[GPUProcess] Cut in half amount of IPC needed to do WebAudio
cdumez@apple.com [Fri, 11 Dec 2020 02:14:41 +0000 (02:14 +0000)]
[GPUProcess] Cut in half amount of IPC needed to do WebAudio
https://bugs.webkit.org/show_bug.cgi?id=219715

Reviewed by Geoff Garen.

Source/WebCore:

Cut in half amount of IPC needed to do WebAudio. Previously, we would send 2
IPCs per rendering quantum:
1. RemoteAudioDestinationProxy::RequestBuffer from GPUProcess to WebProcess
2. The response to RemoteAudioDestinationProxy::RequestBuffer which contained
   the frame bounds for the RingBuffer.

This patch gets rid of IPC 2 by having the CARingBuffer class store its bounds
in its memory backing. As a result, when the CARingBuffer is using a shared
memory backing, the bounds get shared between processes, without any need for
IPC to sync them.

This is still too much IPC but this is a step in the right direction. We
can hopefully get rid of (or greatly reduce) IPC 1 in a follow-up patch.

* platform/audio/cocoa/AudioSampleBufferList.cpp:
(WebCore::AudioSampleBufferList::copyFrom):
* platform/audio/cocoa/AudioSampleDataSource.mm:
(WebCore::AudioSampleDataSource::pullAvalaibleSamplesAsChunks):
* platform/audio/cocoa/CARingBuffer.cpp:
(WebCore::CARingBufferStorageVector::CARingBufferStorageVector):
(WebCore::CARingBuffer::CARingBuffer):
(WebCore::CARingBuffer::flush):
(WebCore::CARingBufferStorageVector::flush):
(WebCore::CARingBuffer::setCurrentFrameBounds):
(WebCore::CARingBufferStorageVector::setCurrentFrameBounds):
(WebCore::CARingBuffer::getCurrentFrameBounds):
(WebCore::CARingBuffer::getCurrentFrameBoundsWithoutUpdate):
(WebCore::CARingBufferStorageVector::getCurrentFrameBounds):
(WebCore::CARingBuffer::clipTimeBounds):
(WebCore::CARingBuffer::currentStartFrame const):
(WebCore::CARingBufferStorageVector::currentStartFrame const):
(WebCore::CARingBuffer::currentEndFrame const):
(WebCore::CARingBufferStorageVector::currentEndFrame const):
(WebCore::CARingBuffer::updateFrameBounds):
(WebCore::CARingBuffer::fetchIfHasEnoughData):
(WebCore::CARingBuffer::fetch):
(WebCore::CARingBuffer::fetchInternal):
* platform/audio/cocoa/CARingBuffer.h:
(WebCore::CARingBufferStorage::updateFrameBounds):

Source/WebKit:

Cut in half amount of IPC needed to do WebAudio. Previously, we would send 2
IPCs per rendering quantum:
1. RemoteAudioDestinationProxy::RequestBuffer from GPUProcess to WebProcess
2. The response to RemoteAudioDestinationProxy::RequestBuffer which contained
   the frame bounds for the RingBuffer.

This patch gets rid of IPC 2 by having the CARingBuffer class store its bounds
in its memory backing. As a result, when the CARingBuffer is using a shared
memory backing, the bounds get shared between processes, without any need for
IPC to sync them.

This is still too much IPC but this is a step in the right direction. We
can hopefully get rid of (or greatly reduce) IPC 1 in a follow-up patch.

* GPUProcess/media/RemoteAudioDestinationManager.cpp:
(WebKit::RemoteAudioDestination::audioSamplesStorageChanged):
(WebKit::RemoteAudioDestination::render):
* GPUProcess/media/RemoteAudioSourceProviderProxy.cpp:
(WebKit::RemoteAudioSourceProviderProxy::storageChanged):
* GPUProcess/webrtc/RemoteAudioMediaStreamTrackRenderer.cpp:
(WebKit::RemoteAudioMediaStreamTrackRenderer::audioSamplesStorageChanged):
(WebKit::RemoteAudioMediaStreamTrackRenderer::audioSamplesAvailable):
* GPUProcess/webrtc/RemoteAudioMediaStreamTrackRenderer.h:
* GPUProcess/webrtc/RemoteAudioMediaStreamTrackRenderer.messages.in:
* GPUProcess/webrtc/RemoteMediaRecorder.cpp:
(WebKit::RemoteMediaRecorder::audioSamplesStorageChanged):
(WebKit::RemoteMediaRecorder::audioSamplesAvailable):
* GPUProcess/webrtc/RemoteMediaRecorder.h:
* GPUProcess/webrtc/RemoteMediaRecorder.messages.in:
* Shared/Cocoa/SharedRingBufferStorage.cpp:
(WebKit::SharedRingBufferStorage::allocate):
(WebKit::SharedRingBufferStorage::sharedFrameBounds):
(WebKit::SharedRingBufferStorage::data):
(WebKit::SharedRingBufferStorage::getCurrentFrameBounds):
(WebKit::SharedRingBufferStorage::setCurrentFrameBounds):
(WebKit::SharedRingBufferStorage::updateFrameBounds):
(WebKit::SharedRingBufferStorage::flush):
* Shared/Cocoa/SharedRingBufferStorage.h:
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
* UIProcess/SpeechRecognitionRemoteRealtimeMediaSource.cpp:
(WebKit::SpeechRecognitionRemoteRealtimeMediaSource::remoteAudioSamplesAvailable):
* UIProcess/SpeechRecognitionRemoteRealtimeMediaSource.h:
* UIProcess/SpeechRecognitionRemoteRealtimeMediaSourceManager.cpp:
(WebKit::SpeechRecognitionRemoteRealtimeMediaSourceManager::remoteAudioSamplesAvailable):
* UIProcess/SpeechRecognitionRemoteRealtimeMediaSourceManager.h:
* UIProcess/SpeechRecognitionRemoteRealtimeMediaSourceManager.messages.in:
* WebProcess/GPU/media/RemoteAudioDestinationProxy.cpp:
(WebKit::RemoteAudioDestinationProxy::requestBuffer):
(WebKit::RemoteAudioDestinationProxy::storageChanged):
* WebProcess/GPU/media/RemoteAudioDestinationProxy.h:
* WebProcess/GPU/media/RemoteAudioDestinationProxy.messages.in:
* WebProcess/GPU/media/RemoteAudioSourceProviderManager.cpp:
(WebKit::RemoteAudioSourceProviderManager::RemoteAudio::setStorage):
(WebKit::RemoteAudioSourceProviderManager::RemoteAudio::audioSamplesAvailable):
* WebProcess/GPU/webrtc/AudioMediaStreamTrackRenderer.cpp:
(WebKit::AudioMediaStreamTrackRenderer::pushSamples):
(WebKit::AudioMediaStreamTrackRenderer::storageChanged):
* WebProcess/GPU/webrtc/MediaRecorderPrivate.cpp:
(WebKit::MediaRecorderPrivate::audioSamplesAvailable):
(WebKit::MediaRecorderPrivate::storageChanged):
* WebProcess/Speech/SpeechRecognitionRealtimeMediaSourceManager.cpp:
* WebProcess/cocoa/RemoteCaptureSampleManager.cpp:
(WebKit::RemoteCaptureSampleManager::audioSamplesAvailable):
(WebKit::RemoteCaptureSampleManager::RemoteAudio::audioSamplesAvailable):
* WebProcess/cocoa/RemoteCaptureSampleManager.h:
* WebProcess/cocoa/RemoteCaptureSampleManager.messages.in:

Tools:

Minor API test changes due to CARingBuffer API change. fetch() always returned Ok
so I dropped the return value.

* TestWebKitAPI/Tests/WebCore/CARingBuffer.cpp:
(TestWebKitAPI::TEST_F):
(TestWebKitAPI::MixingTest::run):

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

17 months ago[MSE] Refactor SourceBufferParserWebM in preparation for supporting audio
eric.carlson@apple.com [Fri, 11 Dec 2020 00:45:46 +0000 (00:45 +0000)]
[MSE] Refactor SourceBufferParserWebM in preparation for supporting audio
https://bugs.webkit.org/show_bug.cgi?id=219755
<rdar://problem/72192625>

Reviewed by Jer Noble.

Refactor the WebM parser in preparation for supporting audio: move VP9-specific code
into VP9UtilitiesCocoa, convert TrackData from a struct to a class and made derived
classes for audio and video, add stub function to create format descriptions for
Vorbis and Opus audio.

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

* platform/cocoa/MediaUtilities.cpp:
(WebCore::createAudioFormatDescription): Add optional parameters for magic cookie.
* platform/cocoa/MediaUtilities.h:

* platform/graphics/cocoa/SourceBufferParserWebM.cpp:
(WebCore::SourceBufferParserWebM::isContentTypeSupported):
(WebCore::SourceBufferParserWebM::create):
(WebCore::SourceBufferParserWebM::resetParserState):
(WebCore::SourceBufferParserWebM::trackDataForTrackNumber):
(WebCore::SourceBufferParserWebM::OnTrackEntry):
(WebCore::SourceBufferParserWebM::OnFrame):
(WebCore::SourceBufferParserWebM::provideMediaData):
(WebCore::SourceBufferParserWebM::VideoTrackData::consumeFrameData):
(WebCore::SourceBufferParserWebM::VideoTrackData::createSampleBuffer):
(WebCore::SourceBufferParserWebM::AudioTrackData::consumeFrameData):
(WebCore::SourceBufferParserWebM::AudioTrackData::createSampleBuffer):
(WebCore::SourceBufferParserWebM::flushPendingAudioBuffers):
(WebCore::SourceBufferParserWebM::setMinimumAudioSampleDuration):
(WebCore::convertToColorPrimaries): Deleted.
(WebCore::convertToCMColorPrimaries): Deleted.
(WebCore::convertToTransferCharacteristics): Deleted.
(WebCore::convertToCMTransferFunction): Deleted.
(WebCore::convertToMatrixCoefficients): Deleted.
(WebCore::convertToCMYCbCRMatrix): Deleted.
(WebCore::convertSubsamplingXYToChromaSubsampling): Deleted.
(WebCore::createFormatDescriptionFromVP9HeaderParser): Deleted.
* platform/graphics/cocoa/SourceBufferParserWebM.h:
(isType):

* platform/graphics/cocoa/VP9UtilitiesCocoa.h:
* platform/graphics/cocoa/VP9UtilitiesCocoa.mm:
(WebCore::convertToColorPrimaries):
(WebCore::convertToCMColorPrimaries):
(WebCore::convertToTransferCharacteristics):
(WebCore::convertToCMTransferFunction):
(WebCore::convertToMatrixCoefficients):
(WebCore::convertToCMYCbCRMatrix):
(WebCore::convertSubsamplingXYToChromaSubsampling):
(WebCore::createFormatDescriptionFromVP9HeaderParser):

* platform/graphics/cocoa/WebMAudioUtilitiesCocoa.h: Added.
* platform/graphics/cocoa/WebMAudioUtilitiesCocoa.mm: Added.
(WebCore::registerDecoderFactory):
(WebCore::createAudioFormatDescriptionForFormat):
(WebCore::cookieFromOpusCodecPrivate):
(WebCore::isOpusDecoderAvailable):
(WebCore::createOpusAudioFormatDescription):
(WebCore::cookieFromVorbisCodecPrivate):
(WebCore::isVorbisDecoderAvailable):
(WebCore::createVorbisAudioFormatDescription):

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

17 months agoUnreviewed, re-landing r270132.
ggaren@apple.com [Fri, 11 Dec 2020 00:17:23 +0000 (00:17 +0000)]
Unreviewed, re-landing r270132.

Regression test failures have been resolved.

Re-landed changeset:

"Use a Version 1 CFRunLoopSource for faster task dispatch"
https://bugs.webkit.org/show_bug.cgi?id=202874
https://trac.webkit.org/changeset/270132

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

17 months agoAdd a JSC API to allow acquiring the JSLock
tzagallo@apple.com [Thu, 10 Dec 2020 23:10:36 +0000 (23:10 +0000)]
Add a JSC API to allow acquiring the JSLock
https://bugs.webkit.org/show_bug.cgi?id=219663

Reviewed by Filip Pizlo.

PerformanceTests:

This patch does 3 things:
- Change how the geomean is calculated in api-bench to avoid overflowing
- Allow linking against the local build we're benchmarking
- Adopt the new JSLock API in the UpcomingAPI subtests

Using the new API the score improves by ~13.5%. Here are the results for each
of the "UpcomingAPI" subtests plus the total score:

                        Before       After
RichardsMostlyC:          77ms        23ms
RichardsMostlyObjC:      309ms       282ms
RichardsMostlySwift      305ms       280ms
RichardsSomeC:           101ms        95ms
RichardsSomeObjC:        160ms       157ms
RichardsSomeSwift:       201ms       202ms
------------------------------------------
Score:                 29.5974     33.6404

* APIBench/UpcomingAPI/RichardsMostlyC/RichardsMostlyC/richards.c:
(workfn):
* APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlyObjC.xcscheme: Renamed from PerformanceTests/APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC.xcodeproj/xcshareddata/xcschemes/RichardsMostlySwift.xcscheme.
* APIBench/UpcomingAPI/RichardsMostlyObjC/RichardsMostlyObjC/WorkerTask.m:
(+[WorkerTask context]):
* APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift.xcodeproj/project.pbxproj:
* APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/BridgingHeader.h: Copied from PerformanceTests/APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift.
* APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift:
* APIBench/UpcomingAPI/RichardsSomeC/RichardsSomeC/main.m:
(main):
* APIBench/UpcomingAPI/RichardsSomeObjC/RichardsSomeObjC/main.m:
(main):
* APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift.xcodeproj/project.pbxproj:
* APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/BridgingHeader.h: Copied from PerformanceTests/APIBench/UpcomingAPI/RichardsMostlySwift/RichardsMostlySwift/WorkerTask.swift.
* APIBench/UpcomingAPI/RichardsSomeSwift/RichardsSomeSwift/main.swift:
* APIBench/api-bench:

Source/JavaScriptCore:

Introduce two new functions to the C API: JSLock and JSUnlock. These
functions allow users to take control of the JSContext's lock, which
can greatly reduce the overhead of bridging between JS and native.

* API/JSLockRef.cpp: Added.
(JSLock):
(JSUnlock):
* API/JSLockRefPrivate.h: Added.
* API/JSValueRef.cpp:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:

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

17 months ago[macOS] Deny mach-lookup to the service 'com.apple.SystemConfiguration.configd' in...
pvollan@apple.com [Thu, 10 Dec 2020 22:56:33 +0000 (22:56 +0000)]
[macOS] Deny mach-lookup to the service 'com.apple.SystemConfiguration.configd' in the WebContent process
https://bugs.webkit.org/show_bug.cgi?id=219680
<rdar://problem/69019138>

Reviewed by Brent Fulgham.

Deny mach-lookup to the service 'com.apple.SystemConfiguration.configd' in the WebContent process on macOS,
since there are no reports of this being used.

No new tests, since the result will depend on macOS version.

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

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

17 months ago[macOS] Create sandbox extension for AppleAVDUserClient when Media in GPU process...
pvollan@apple.com [Thu, 10 Dec 2020 22:31:28 +0000 (22:31 +0000)]
[macOS] Create sandbox extension for AppleAVDUserClient when Media in GPU process is not enabled
https://bugs.webkit.org/show_bug.cgi?id=219740
<rdar://problem/70496905>

Reviewed by Brent Fulgham.

Create sandbox extension for AppleAVDUserClient for WebContent process when Media in GPU process is not enabled on macOS,
since this IOKit class is only used for Media purposes.

* GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in:
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::mediaRelatedIOKitClasses):
(WebKit::WebPageProxy::creationParameters):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_limitsNavigationsToAppBoundDomains):
* WebProcess/com.apple.WebProcess.sb.in:

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

17 months ago[macOS] Add telemetry for notification message filtering in sandbox
pvollan@apple.com [Thu, 10 Dec 2020 22:29:17 +0000 (22:29 +0000)]
[macOS] Add telemetry for notification message filtering in sandbox
https://bugs.webkit.org/show_bug.cgi?id=219684
<rdar://problem/69819260>

Reviewed by Brent Fulgham.

Add telemetry for notification message filtering in sandbox in the WebContent process on macOS.

No new tests, since this just adds telemetry.

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

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

17 months ago[iOS] Add missing endpoint in sandbox message filter
pvollan@apple.com [Thu, 10 Dec 2020 22:13:52 +0000 (22:13 +0000)]
[iOS] Add missing endpoint in sandbox message filter
https://bugs.webkit.org/show_bug.cgi?id=219731
<rdar://problem/71566760>

Reviewed by Brent Fulgham.

Add missing endpoint in the WebContent process' sandbox message filter on iOS.

* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

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

17 months ago[macOS] The development WebContent XPC service is missing a required entitlement
pvollan@apple.com [Thu, 10 Dec 2020 22:01:35 +0000 (22:01 +0000)]
[macOS] The development WebContent XPC service is missing a required entitlement
https://bugs.webkit.org/show_bug.cgi?id=219730
<rdar://problem/72145560>

Reviewed by Brent Fulgham.

The message filtering entitlement is missing in com.apple.WebKit.WebContent.Development.xpc on macOS.

* Scripts/process-entitlements.sh:

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

17 months ago[GPU Process] Crash when loading drinktrade.com
wenson_hsieh@apple.com [Thu, 10 Dec 2020 22:01:33 +0000 (22:01 +0000)]
[GPU Process] Crash when loading drinktrade.com
https://bugs.webkit.org/show_bug.cgi?id=219752

Reviewed by Tim Horton.

Fix an overrelease when rendering color emoji fonts by removing an extraneous `adoptCF` around a `CGImageRef`.
This `CGImageRef` is not a retained (+1) object, so we need to make sure that it is retained when tracking it in
the display list's native image cache.

Layout test: fast/text/emoji.html

* platform/graphics/displaylists/DisplayListDrawGlyphsRecorderCoreText.cpp:
(WebCore::DisplayList::DrawGlyphsRecorder::recordDrawImage):

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

17 months ago[CMake] Determine when to use $<TARGET_OBJECTS> for executables
don.olmstead@sony.com [Thu, 10 Dec 2020 21:28:18 +0000 (21:28 +0000)]
[CMake] Determine when to use $<TARGET_OBJECTS> for executables
https://bugs.webkit.org/show_bug.cgi?id=219648

Reviewed by Michael Catanzaro.

.:

When a WebKit framework is declared as an OBJECT library the WebKit::${framework} ALIAS
does not propagate the objects to the executable being built. As a workaround ports will
explicitly add $<TARGET_OBJECTS> to the list of libraries being linked. There is already
enough information to determine when $<TARGET_OBJECTS> is needed so this decision is moved
into the WEBKIT_EXECUTABLE macros.

An additional ${taget_name}_FRAMEWORKS variable is added which specifies the WebKit
frameworks being used. This will link the WebKit::${framework} alias and if necessary the
associated $<TARGET_OBJECTS>.

This functionality will be expanded upon when support for ${target_name}_FRAMEWORKS is
added to WebKit frameworks to support hidden visibility across ports.

* Source/cmake/WebKitMacros.cmake:

Source/JavaScriptCore:

Use ${taget_name}_FRAMEWORKS to specify WebKit frameworks when linking executables.

* CMakeLists.txt:
* shell/CMakeLists.txt:

Source/WebDriver:

Use ${taget_name}_FRAMEWORKS to specify WebKit frameworks when linking executables.
Remove use of $<TARGET_OBJECTS>.

* CMakeLists.txt:
* PlatformPlayStation.cmake:
* PlatformWin.cmake:

Tools:

Use ${taget_name}_FRAMEWORKS to specify WebKit frameworks when linking executables.
Remove use of $<TARGET_OBJECTS>.

* TestWebKitAPI/CMakeLists.txt:
* TestWebKitAPI/PlatformPlayStation.cmake:
* TestWebKitAPI/PlatformWin.cmake:
* WebKitTestRunner/CMakeLists.txt:

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

17 months agomacOS Production WebKitLegacy build is broken on Xcode 10
commit-queue@webkit.org [Thu, 10 Dec 2020 21:16:11 +0000 (21:16 +0000)]
macOS Production WebKitLegacy build is broken on Xcode 10
https://bugs.webkit.org/show_bug.cgi?id=219753

Patch by Adam Roben <aroben@apple.com> on 2020-12-10
Reviewed by Tim Horton.

* Configurations/WebKitLegacy.xcconfig: Replaced :default= syntax that
is only supported in Xcode 11.4 and newer with the equivalent
WK_DEFAULT_PLATFORM_NAME variable.

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

17 months agoRework of AXObjectCache::isIsolatedTreeEnabled.
andresg_22@apple.com [Thu, 10 Dec 2020 20:53:31 +0000 (20:53 +0000)]
Rework of AXObjectCache::isIsolatedTreeEnabled.
https://bugs.webkit.org/show_bug.cgi?id=219722

Reviewed by Chris Fleizach.

Source/WebCore:

Covered by existing tests.

- AXObjectCache::isIsolatedTreeEnabled now returns true if it is called
off the main thread, no matter the rest of the conditions. This is
necessary since any call off of the main thread must be handled by the
isolated tree.
- It caches a true value to optimize the case where a client that
supports isolated tree mode makes a request. All subsequent request by
any client will be served by the isolated tree.
- Moved the check for the WebKit test client to clientSupportsIsolatedTree
where it belongs.
- Renamed canUseSecondaryAXThread to UsedOnAXThread, which is a more
accurate name.

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::clientSupportsIsolatedTree):
(WebCore::AXObjectCache::isIsolatedTreeEnabled):
(WebCore::AXObjectCache::isolatedTreeRootObject):
(WebCore::AXObjectCache::usedOnAXThread):
(WebCore::AXObjectCache::canUseSecondaryAXThread): Renamed usedOnAXThread.
* accessibility/AXObjectCache.h:
* accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::AXIsolatedTree):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):

Source/WebKit:

- Renamed AXObjecCache::canUseSecondaryAXThread as usedOnAXThread.
- No need for the additional thread check since isIsolatedTreeEnabled
will return true for any call off of the main thread.

* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKAccessibilityCanUseSecondaryAXThread):
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityHitTest:]):

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

17 months agoREGRESSION (r270574): [iOS] ASSERTION FAILED: !m_messageReceiverMapCount under WebKit...
sihui_liu@apple.com [Thu, 10 Dec 2020 20:46:49 +0000 (20:46 +0000)]
REGRESSION (r270574): [iOS] ASSERTION FAILED: !m_messageReceiverMapCount under WebKit::SpeechRecognitionRemoteRealtimeMediaSourceManager::~SpeechRecognitionRemoteRealtimeMediaSourceManager
https://bugs.webkit.org/show_bug.cgi?id=219745
<rdar://problem/72184764>

Reviewed by Youenn Fablet.

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::~WebProcessProxy): Remove SpeechRecognitionRemoteRealtimeMediaSourceManager from
MessageReceiverMap before destroying it.

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

17 months agoDisplayList::Recorder::drawImageBuffer should flush the given image buffer before...
wenson_hsieh@apple.com [Thu, 10 Dec 2020 20:20:01 +0000 (20:20 +0000)]
DisplayList::Recorder::drawImageBuffer should flush the given image buffer before recording
https://bugs.webkit.org/show_bug.cgi?id=219748

Reviewed by Darin Adler.

Make sure that the source image buffer has been flushed, so that the platform context in the GPU process is
flushed along with any outstanding display list items. This codepath is exercised when painting GPU-process-
backed canvases into other GPU-process-backed canvases.

* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::drawImageBuffer):

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

17 months ago[LFC][IFC] Cleanup TextUtil::width/split functions
zalan@apple.com [Thu, 10 Dec 2020 20:17:04 +0000 (20:17 +0000)]
[LFC][IFC] Cleanup TextUtil::width/split functions
https://bugs.webkit.org/show_bug.cgi?id=219697

Reviewed by Antti Koivisto.

General cleanup and tightening.

* layout/inlineformatting/InlineContentBreaker.cpp:
(WebCore::Layout::InlineContentBreaker::processOverflowingContent const):
(WebCore::Layout::InlineContentBreaker::tryBreakingTextRun const):
* layout/inlineformatting/InlineTextItem.cpp:
(WebCore::Layout::InlineTextItem::createAndAppendTextItems):
* layout/inlineformatting/InlineTextItem.h:
(WebCore::Layout::InlineTextItem::createEmptyItem):
* layout/inlineformatting/text/TextUtil.cpp:
(WebCore::Layout::TextUtil::width):
(WebCore::Layout::TextUtil::split):
* layout/inlineformatting/text/TextUtil.h:

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

17 months agoAdd willInjectUserScriptForFrame to WKWebProcessPlugInLoadDelegate.
timothy@apple.com [Thu, 10 Dec 2020 20:10:04 +0000 (20:10 +0000)]
Add willInjectUserScriptForFrame to WKWebProcessPlugInLoadDelegate.
https://bugs.webkit.org/show_bug.cgi?id=219727
rdar://71987073

Reviewed by Brady Eidson.

* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(willInjectUserScriptForFrame): Added.
(setUpPageLoaderClient): Set client.willInjectUserScriptForFrame.

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

17 months ago[CMake] Use WEBKIT_EXECUTABLE macro for LLInt executables
don.olmstead@sony.com [Thu, 10 Dec 2020 19:54:02 +0000 (19:54 +0000)]
[CMake] Use WEBKIT_EXECUTABLE macro for LLInt executables
https://bugs.webkit.org/show_bug.cgi?id=219746

Reviewed by Michael Catanzaro.

The LLInt executables were the only ones within Source that were being created
without the WEBKIT_EXECUTABLE macros.

* CMakeLists.txt:

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

17 months agoAdd a SFrame VP8 experimental compatibility mode
youenn@apple.com [Thu, 10 Dec 2020 19:48:38 +0000 (19:48 +0000)]
Add a SFrame VP8 experimental compatibility mode
https://bugs.webkit.org/show_bug.cgi?id=219674

Reviewed by Eric Carlson.

Source/WebCore:

Similarly to H264, prefix the SFrame content with some data to ensure key frames or resolution can be detected
without revealing the actual content.

Covered by updated test.

* Modules/mediastream/RTCRtpSFrameTransform.idl:
* Modules/mediastream/RTCRtpSFrameTransformer.cpp:
(WebCore::RTCRtpSFrameTransformer::decryptFrame):
(WebCore::RTCRtpSFrameTransformer::encryptFrame):
* Modules/mediastream/RTCRtpSFrameTransformer.h:
* Modules/mediastream/SFrameUtils.cpp: Renamed from Source/WebCore/Modules/mediastream/H264Utils.cpp.
(WebCore::computeH264PrefixOffset):
(WebCore::computeH264PrefixBuffer):
(WebCore::isVP8KeyFrame):
(WebCore::computeVP8PrefixOffset):
(WebCore::computeVP8PrefixBuffer):
* Modules/mediastream/SFrameUtils.h: Renamed from Source/WebCore/Modules/mediastream/H264Utils.h.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

LayoutTests:

* webrtc/video-sframe-expected.txt:
* webrtc/video-sframe.html:

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

17 months ago[GTK] Add even more exports to support hidden visibility
don.olmstead@sony.com [Thu, 10 Dec 2020 19:38:11 +0000 (19:38 +0000)]
[GTK] Add even more exports to support hidden visibility
https://bugs.webkit.org/show_bug.cgi?id=219747

Reviewed by Michael Catanzaro.

Source/WebCore:

Add WEBCORE_EXPORT to additional declarations.

* platform/graphics/SourceBufferPrivate.h:
* platform/graphics/gstreamer/GRefPtrGStreamer.h:

Source/WebKit:

Add WK_EXPORT to additional declarations.

* UIProcess/API/glib/WebKitSettingsPrivate.h:
* UIProcess/API/glib/WebKitWebViewInternal.h:
* UIProcess/API/gtk/WebKitWebViewBaseInternal.h:

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

17 months ago[Media in GPU Process][MSE] Implement seeking support
peng.liu6@apple.com [Thu, 10 Dec 2020 19:31:22 +0000 (19:31 +0000)]
[Media in GPU Process][MSE] Implement seeking support
https://bugs.webkit.org/show_bug.cgi?id=219658

Reviewed by Jer Noble.

Source/WebCore:

Covered by existing tests.

* platform/graphics/SourceBufferPrivate.h:
Change function `seekToTime()` to virtual because `SourceBufferPrivateRemote`
needs to override it.

Source/WebKit:

Implement the required functions with IPC to support seeking.

* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* GPUProcess/media/RemoteMediaSourceProxy.cpp:
(WebKit::RemoteMediaSourceProxy::seekToTime):
(WebKit::RemoteMediaSourceProxy::waitForSeekCompleted):
(WebKit::RemoteMediaSourceProxy::seekCompleted):
* GPUProcess/media/RemoteMediaSourceProxy.h:
* GPUProcess/media/RemoteMediaSourceProxy.messages.in:
* GPUProcess/media/RemoteSourceBufferProxy.cpp:
(WebKit::RemoteSourceBufferProxy::seekToTime):
* GPUProcess/media/RemoteSourceBufferProxy.h:
* GPUProcess/media/RemoteSourceBufferProxy.messages.in:
* Sources.txt:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/GPU/media/MediaSourcePrivateRemote.cpp:
(WebKit::MediaSourcePrivateRemote::MediaSourcePrivateRemote):
(WebKit::MediaSourcePrivateRemote::~MediaSourcePrivateRemote):
(WebKit::MediaSourcePrivateRemote::waitForSeekCompleted):
(WebKit::MediaSourcePrivateRemote::seekCompleted):
(WebKit::MediaSourcePrivateRemote::seekToTime):
* WebProcess/GPU/media/MediaSourcePrivateRemote.h:
* WebProcess/GPU/media/MediaSourcePrivateRemote.messages.in: Added.
* WebProcess/GPU/media/SourceBufferPrivateRemote.cpp:
(WebKit::SourceBufferPrivateRemote::seekToTime):
* WebProcess/GPU/media/SourceBufferPrivateRemote.h:

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

17 months agoSource/WebKit:
commit-queue@webkit.org [Thu, 10 Dec 2020 19:27:49 +0000 (19:27 +0000)]
Source/WebKit:
Introduce new download API
https://bugs.webkit.org/show_bug.cgi?id=217747

Patch by Alex Christensen <achristensen@webkit.org> on 2020-12-10
Reviewed by Brady Eidson.

Safari currently uses _WKDownload, which has evolved strangely over the last decade.
In order to make a nicer interface, we need to learn from those lessons and take a step back.
I did that, and here's what I came up with: WKDownload and WKDownloadDelegate!

Notable changes include:
1.  The delegate now lives on the download object instead of the process pool.
2.  WKDownload does not conform to NSCopying because we have NSMapTable instead of NSDictionary.
3.  publishProgressAtURL is gone.  That will be reimplemented in the UI process of the client that used it.
4.  cancel has a completion handler to get the resume data instead of waiting for didCancel then getting it from the download object.
5.  didFailWithError also gives you the resume data, so there is no way to get it from the download object.  That's more about a fail/cancel
    event than a property of the download.
6.  wasUserInitiated is gone.  Instead, WKNavigationDelegate has a callback that links a navigation action (where _isUserInitiated is exposed) to the download.
7.  redirectChain is also gone.  That can also be gotten from the link to the navigation and the download delegate's redirect callback.
8.  _downloadDidStart is gone.  Instead, we have completion handlers that expose a WKDownload once it's started.  There's no need to
    reference the download object before then anyways.  Note: that's when the download "starts" which is before it receives the response,
    so there will be no server delay in the difference between download object availabilities.
9.  didReceiveServerRedirectToURL now gives you the option of continuing or cancelling.  This reflects the amount of control the
    WKNavigationDelegate has.
10. decideDestinationWithSuggestedFilename and didReceiveResponse have been merged, since they actually happen at the same time and
    NSURLResponse has suggestedFilename API.  allowOverwrite is also gone.  It wasn't used, and not really needed.
11. didCreateDestination is gone.  That callback time wasn't really necessary.  If you need to know when it's created, wait until the first
    didWriteData callback.  The destination has definitely been created by then.
12. shouldDecodeSourceDataOfMIMEType is gone.  It's actually not called since we adopted NSURLSession, and we should remove the related dead code.
13. originatingFrame is gone.  On _WKDownload it was actually a non-null WKFrameInfo that often contained no information.  When information was there,
    the information access has been replaced by didBecomeDownload which links the WKNavigationResponse which has frame info on it.

I wrote API tests for everything I could think of.

* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::resumeDownload):
* NetworkProcess/Downloads/DownloadManager.h:
* NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
(WebKit::Download::resume):
(WebKit::Download::platformCancelNetworkLoad):
* NetworkProcess/NetworkDataTaskBlob.cpp:
(WebKit::NetworkDataTaskBlob::suggestedFilename const):
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::resumeDownload):
(WebKit::NetworkProcess::findPendingDownloadLocation):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
* Scripts/webkit/messages.py:
* Shared/API/Cocoa/WebKit.h:
* Shared/API/c/WKSharedAPICast.h:
(WebKit::toAPI):
* Shared/Cocoa/APIObject.mm:
(API::Object::newObject):
* Sources.txt:
* SourcesCocoa.txt:
* UIProcess/API/APIDownloadClient.h:
(API::DownloadClient::legacyDidStart):
(API::DownloadClient::didFail):
(API::DownloadClient::didStart): Deleted.
* UIProcess/API/APINavigationAction.h:
* UIProcess/API/APINavigationClient.h:
(API::NavigationClient::navigationResponseDidBecomeDownload):
(API::NavigationClient::navigationActionDidBecomeDownload):
(API::NavigationClient::contextMenuDidCreateDownload):
* UIProcess/API/APIPolicyClient.h:
(API::PolicyClient::decidePolicyForNavigationAction):
(API::PolicyClient::decidePolicyForNewWindowAction):
* UIProcess/API/C/WKContext.cpp:
(WKContextSetDownloadClient): Deleted.
* UIProcess/API/C/WKContext.h:
* UIProcess/API/C/WKContextDownloadClient.h: Removed.
* UIProcess/API/C/WKDownload.cpp: Removed.
* UIProcess/API/C/WKDownloadClient.h: Added.
* UIProcess/API/C/WKDownloadRef.cpp: Added.
(WKDownloadGetTypeID):
(WKDownloadCopyRequest):
(WKDownloadCancel):
(WKDownloadGetOriginatingPage):
(WKDownloadGetWasUserInitiated):
(WKDownloadSetClient):
* UIProcess/API/C/WKDownloadRef.h: Renamed from Source/WebKit/UIProcess/API/C/WKDownload.h.
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPagePolicyClient):
(WKPageSetPageNavigationClient):
* UIProcess/API/C/WKPageNavigationClient.h:
* UIProcess/API/Cocoa/WKDownload.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKDownload.h.
* UIProcess/API/Cocoa/WKDownload.mm: Added.
(-[WKDownload cancel:]):
(-[WKDownload originalRequest]):
(-[WKDownload delegate]):
(-[WKDownload setDelegate:]):
(-[WKDownload dealloc]):
(-[WKDownload _apiObject]):
* UIProcess/API/Cocoa/WKDownloadDelegate.h: Added.
* UIProcess/API/Cocoa/WKDownloadInternal.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKDownloadInternal.h.
* UIProcess/API/Cocoa/WKNavigationAction.h:
* UIProcess/API/Cocoa/WKNavigationAction.mm:
(-[WKNavigationAction downloadAttribute]):
(-[WKNavigationAction _shouldPerformDownload]):
* UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
* UIProcess/API/Cocoa/WKNavigationDelegate.h:
* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _downloadURLRequest:websiteDataStore:originatingWebView:]):
(-[WKProcessPool _resumeDownloadFromData:websiteDataStore:path:originatingWebView:]):
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/API/Cocoa/WKWebView.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView downloadRequest:completionHandler:]):
(-[WKWebView resumeDownloadWithData:completionHandler:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/_WKDownload.h:
* UIProcess/API/Cocoa/_WKDownload.mm:
(-[_WKDownload initWithDownload2:]):
(+[_WKDownload downloadWithDownload:]):
(-[_WKDownload cancel]):
(-[_WKDownload publishProgressAtURL:]):
(-[_WKDownload request]):
(-[_WKDownload originatingWebView]):
(-[_WKDownload redirectChain]):
(-[_WKDownload wasUserInitiated]):
(-[_WKDownload resumeData]):
(-[_WKDownload originatingFrame]):
(-[_WKDownload _apiObject]):
(-[_WKDownload dealloc]): Deleted.
* UIProcess/API/Cocoa/_WKDownloadDelegate.h:
* UIProcess/API/Cocoa/_WKDownloadInternal.h:
* UIProcess/API/glib/WebKitDownloadClient.cpp:
* UIProcess/Cocoa/LegacyDownloadClient.h:
* UIProcess/Cocoa/LegacyDownloadClient.mm:
(WebKit::LegacyDownloadClient::legacyDidStart):
(WebKit::LegacyDownloadClient::didReceiveResponse):
(WebKit::LegacyDownloadClient::didReceiveData):
(WebKit::LegacyDownloadClient::didReceiveAuthenticationChallenge):
(WebKit::LegacyDownloadClient::didCreateDestination):
(WebKit::LegacyDownloadClient::processDidCrash):
(WebKit::LegacyDownloadClient::decideDestinationWithSuggestedFilename):
(WebKit::LegacyDownloadClient::didFinish):
(WebKit::LegacyDownloadClient::didFail):
(WebKit::LegacyDownloadClient::legacyDidCancel):
(WebKit::LegacyDownloadClient::willSendRequest):
(WebKit::LegacyDownloadClient::didStart): Deleted.
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::setNavigationDelegate):
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
(WebKit::NavigationState::NavigationClient::navigationActionDidBecomeDownload):
(WebKit::NavigationState::NavigationClient::navigationResponseDidBecomeDownload):
(WebKit::NavigationState::NavigationClient::contextMenuDidCreateDownload):
* UIProcess/Cocoa/WebProcessProxyCocoa.mm:
* UIProcess/Downloads/DownloadProxy.cpp:
(WebKit::DownloadProxy::~DownloadProxy):
(WebKit::DownloadProxy::didStart):
(WebKit::DownloadProxy::decideDestinationWithSuggestedFilename):
(WebKit::DownloadProxy::didFail):
(WebKit::DownloadProxy::setClient):
* UIProcess/Downloads/DownloadProxy.h:
(WebKit::DownloadProxy::setDidStartCallback):
(WebKit::DownloadProxy::setSuggestedFilename):
* UIProcess/Network/NetworkProcessProxy.cpp:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
(WebKit::WebPageProxy::receivedPolicyDecision):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForNewWindowAction):
(WebKit::WebPageProxy::decidePolicyForResponseShared):
(WebKit::WebPageProxy::resumeDownload):
(WebKit::WebPageProxy::downloadRequest):
(WebKit::WebPageProxy::contextMenuItemSelected):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::receivedPolicyDecision):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::resumeDownload):
* UIProcess/WebProcessPool.h:
* WebKit.xcodeproj/project.pbxproj:

Tools:
Introduce new download SPI
https://bugs.webkit.org/show_bug.cgi?id=217747

Patch by Alex Christensen <achristensen@webkit.org> on 2020-12-10
Reviewed by Brady Eidson.

* TestWebKitAPI/SourcesCocoa.txt:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit/DownloadDecideDestinationCrash.cpp:
(TestWebKitAPI::decidePolicyForNavigationResponse):
(TestWebKitAPI::decideDestinationWithSuggestedFilename):
(TestWebKitAPI::navigationResponseDidBecomeDownload):
(TestWebKitAPI::setPagePolicyClient):
(TestWebKitAPI::TEST):
(TestWebKitAPI::decidePolicyForNavigationAction): Deleted.
(TestWebKitAPI::setContextDownloadClient): Deleted.
* TestWebKitAPI/Tests/WebKit/mac/ContextMenuDownload.mm:
(TestWebKitAPI::decideDestinationWithSuggestedFilename):
(TestWebKitAPI::contextMenuDidCreateDownload):
(TestWebKitAPI::TEST):
(TestWebKitAPI::decideDestinationWithSuggestedFilenameContainingSlashes):
(TestWebKitAPI::contextMenuDidCreateDownloadWithSuggestedFilenameContainingSlashes):
* TestWebKitAPI/Tests/WebKitCocoa/ContentFiltering.mm:
(-[BecomeDownloadDelegate webView:decidePolicyForNavigationResponse:decisionHandler:]):
* TestWebKitAPI/Tests/WebKitCocoa/Download.mm:
(-[ConvertResponseToDownloadNavigationDelegate webView:decidePolicyForNavigationResponse:decisionHandler:]):
(-[TestDownloadNavigationResponseFromMemoryCacheDelegate webView:didFailProvisionalNavigation:withError:]):
(-[TestDownloadNavigationResponseFromMemoryCacheDelegate webView:didFinishNavigation:]):
(TEST):
(downloadTestServer):
(checkResumedDownloadContents):
(simpleDownloadTestServer):
(checkFileContents):
(tempFileThatDoesNotExist):
(-[DownloadTestSchemeDelegate webView:decidePolicyForNavigationResponse:decisionHandler:]):
(TestWebKitAPI::mutateFile):
* TestWebKitAPI/Tests/WebKitCocoa/DownloadProgress.mm:
(-[DownloadProgressTestRunner webView:decidePolicyForNavigationResponse:decisionHandler:]):
* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
(-[PSONNavigationDelegate webView:decidePolicyForNavigationResponse:decisionHandler:]):
* TestWebKitAPI/Tests/WebKitCocoa/QuickLook.mm:
(TEST):
* TestWebKitAPI/cocoa/TestDownloadDelegate.h:
* TestWebKitAPI/cocoa/TestDownloadDelegate.mm:
(-[TestDownloadDelegate download:willPerformHTTPRedirection:newRequest:decisionHandler:]):
(-[TestDownloadDelegate download:decideDestinationWithResponse:suggestedFilename:completionHandler:]):
(-[TestDownloadDelegate download:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]):
(-[TestDownloadDelegate download:didReceiveAuthenticationChallenge:completionHandler:]):
(-[TestDownloadDelegate downloadDidFinish:]):
(-[TestDownloadDelegate download:didFailWithError:resumeData:]):
(-[TestDownloadDelegate webView:navigationResponse:didBecomeDownload:]):
(-[TestDownloadDelegate webView:decidePolicyForNavigationResponse:decisionHandler:]):
(-[TestDownloadDelegate waitForDownloadDidFinish]):
(-[TestDownloadDelegate takeCallbackRecord]):
(-[TestDownloadDelegate _downloadDidStart:]): Deleted.
(-[TestDownloadDelegate _download:didReceiveServerRedirectToURL:]): Deleted.
(-[TestDownloadDelegate _download:didReceiveResponse:]): Deleted.
(-[TestDownloadDelegate _download:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]): Deleted.
(-[TestDownloadDelegate _download:decideDestinationWithSuggestedFilename:completionHandler:]): Deleted.
(-[TestDownloadDelegate _downloadDidFinish:]): Deleted.
(-[TestDownloadDelegate _download:didFailWithError:]): Deleted.
(-[TestDownloadDelegate _downloadDidCancel:]): Deleted.
(-[TestDownloadDelegate _download:didReceiveAuthenticationChallenge:completionHandler:]): Deleted.
(-[TestDownloadDelegate _download:didCreateDestination:]): Deleted.
* TestWebKitAPI/cocoa/TestLegacyDownloadDelegate.h: Copied from Tools/TestWebKitAPI/cocoa/TestDownloadDelegate.h.
* TestWebKitAPI/cocoa/TestLegacyDownloadDelegate.mm: Copied from Tools/TestWebKitAPI/cocoa/TestDownloadDelegate.mm.
(-[TestLegacyDownloadDelegate _downloadDidStart:]):
(-[TestLegacyDownloadDelegate _download:didReceiveServerRedirectToURL:]):
(-[TestLegacyDownloadDelegate _download:didReceiveResponse:]):
(-[TestLegacyDownloadDelegate _download:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]):
(-[TestLegacyDownloadDelegate _download:decideDestinationWithSuggestedFilename:completionHandler:]):
(-[TestLegacyDownloadDelegate _downloadDidFinish:]):
(-[TestLegacyDownloadDelegate _download:didFailWithError:]):
(-[TestLegacyDownloadDelegate _downloadDidCancel:]):
(-[TestLegacyDownloadDelegate _download:didReceiveAuthenticationChallenge:completionHandler:]):
(-[TestLegacyDownloadDelegate _download:didCreateDestination:]):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::navigationDidBecomeDownloadShared):
(WTR::TestController::navigationActionDidBecomeDownload):
(WTR::TestController::navigationResponseDidBecomeDownload):
(WTR::TestController::createOtherPage):
(WTR::TestController::createWebViewWithOptions):
(WTR::TestController::decideDestinationWithSuggestedFilename):
(WTR::TestController::downloadDidFinish):
(WTR::TestController::downloadDidFail):
(WTR::TestController::downloadDidReceiveServerRedirectToURL):
(WTR::TestController::downloadDidStart):
(WTR::TestController::decidePolicyForNavigationAction):
(WTR::TestController::downloadDidCancel): Deleted.
* WebKitTestRunner/TestController.h:

LayoutTests:
Introduce new download API
https://bugs.webkit.org/show_bug.cgi?id=217747

Patch by Alex Christensen <achristensen@webkit.org> on 2020-12-10
Reviewed by Brady Eidson.

* fast/dom/HTMLAnchorElement/anchor-download-expected.txt:
* fast/dom/HTMLAnchorElement/anchor-download-user-triggered-synthetic-click-expected.txt:
* fast/dom/HTMLAnchorElement/anchor-file-blob-convert-to-download-async-delegate-expected.txt:
* fast/dom/HTMLAnchorElement/anchor-file-blob-convert-to-download-expected.txt:
* fast/dom/HTMLAnchorElement/anchor-nodownload-set-expected.txt:
Now that NetworkDataTaskBlob::suggestedFilename doesn't suggest "unknown"
the capitalization has changed to "Unknown" from NSURLResponse's suggestedFilename.

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

17 months agoWeb Inspector: Show current properties for font in new Elements sidebar Font panel
pangle@apple.com [Thu, 10 Dec 2020 19:09:00 +0000 (19:09 +0000)]
Web Inspector: Show current properties for font in new Elements sidebar Font panel
https://bugs.webkit.org/show_bug.cgi?id=218964

Reviewed by Devin Rousso.

Source/JavaScriptCore:

Adds objects and method for getting font data for a node to the `CSS` domain. A `CSS.Font` is meant to represent
a `WebCore::Font` and contain information about the underlying font as the system sees it. The source for this
information can be a system font or a web font. Each `CSS.Font` in turn can have some number of
`CSS.FontVariationAxis` for its available open-type variation axes. Fonts that don't support these features will
have an empty set of axes.

* inspector/protocol/CSS.json:
- Added objects and method for getting font data for a node.

Source/WebCore:

Test: inspector/css/getComputedPrimaryFontForNode.html

Adds support for retrieving the primary font computed for a node including the available variation axes of the
underlying Font.

* inspector/agents/InspectorCSSAgent.cpp:
(WebCore::buildObjectForFont):
(WebCore::InspectorCSSAgent::getFontDataForNode):
(WebCore::InspectorCSSAgent::nodeForId):
* inspector/agents/InspectorCSSAgent.h:
- Added method for retrieving font data for a node.
* platform/graphics/FontPlatformData.cpp:
(WebCore::FontPlatformData::variationAxes const):
- Empty implementation for non-Cocoa platforms.
* platform/graphics/FontPlatformData.h:
(WebCore::FontPlatformData::FontVariationAxis::FontVariationAxis):
(WebCore::FontPlatformData::FontVariationAxis::name const):
(WebCore::FontPlatformData::FontVariationAxis::tag const):
(WebCore::FontPlatformData::FontVariationAxis::defaultValue const):
(WebCore::FontPlatformData::FontVariationAxis::minimumValue const):
(WebCore::FontPlatformData::FontVariationAxis::maximumValue const):
- Added struct type for font variation axis information.
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::defaultVariationValues):
* platform/graphics/cocoa/FontCacheCoreText.h:
- Support getting the name of variation axes.
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::FontPlatformData::variationAxes const):
- Retrieve font variation axes from the underlying font.

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Base/Setting.js:
- Added experimental setting for Font panel.
* UserInterface/Main.html:
* UserInterface/Models/DOMNodeStyles.js:
(WI.DOMNodeStyles):
(WI.DOMNodeStyles.prototype.get computedPrimaryFont):
(WI.DOMNodeStyles.prototype.refresh.fetchedComputedStyle):
(WI.DOMNodeStyles.prototype.refresh.fetchedFontData):
(WI.DOMNodeStyles.prototype.refresh):
- Support getting the computed primary font.
* UserInterface/Models/Font.js: Added.
(WI.Font):
(WI.Font.fromPayload):
(WI.Font.prototype.get name):
(WI.Font.prototype.get variationAxes):
(WI.Font.prototype.variationAxis):
- Model object for `CSS.Font`.
(WI.Font.prototype.calculateFontProperties):
- Build maps of font properties from the `DOMNodeStyle` and this Font.
(WI.Font.prototype._calculateProperties):
(WI.Font.prototype._calculateFontFeatureAxes):
(WI.Font.prototype._calculateFontVariationAxes):
(WI.Font.prototype._parseFontFeatureOrVariationSettings):
* UserInterface/Models/FontVariationAxis.js: Added.
(WI.FontVariationAxis):
(WI.FontVariationAxis.fromPayload):
(WI.FontVariationAxis.prototype.get name):
(WI.FontVariationAxis.prototype.get tag):
(WI.FontVariationAxis.prototype.get minimumValue):
(WI.FontVariationAxis.prototype.get maximumValue):
(WI.FontVariationAxis.prototype.get defaultValue):
- Model object for `CSS.FontVariationAxis`.
* UserInterface/Test.html:
* UserInterface/Views/ComputedStyleDetailsPanel.css:
(.sidebar > .panel.details.css-style > .content > .computed .property:not(:hover) .go-to-arrow):
(.multi-sidebar.showing-multiple > .sidebar > .panel.details.style-computed > .content > .pseudo-classes,): Deleted.
- Move multi-sidebar support to GeneralStyleDetailsSidebarPanel.css
* UserInterface/Views/ElementsTabContentView.js:
(WI.ElementsTabContentView):
- Add Font panel to detail panel set if enabled and supported.
* UserInterface/Views/FontDetailsPanel.js: Added.
(WI.FontDetailsPanel):
(WI.FontDetailsPanel.prototype.get supportsToggleCSSClass):
(WI.FontDetailsPanel.prototype.refresh):
(WI.FontDetailsPanel.prototype.initialLayout):
(WI.FontDetailsPanel.prototype._formatSizeValue):
(WI.FontDetailsPanel.prototype._formatStyleValue):
(WI.FontDetailsPanel.prototype._formatSimpleSingleValue):
- Format basic font properties.
(WI.FontDetailsPanel.prototype._formatVariationValue):
- Format non-standard variation axes.
(WI.FontDetailsPanel.prototype._formatSimpleFeatureValues):
- Common formatting for `font-variant-xxx` properties that map to font feature values.
(WI.FontDetailsPanel.prototype._formatLigatureValue):
(WI.FontDetailsPanel.prototype._formatPositionValue):
(WI.FontDetailsPanel.prototype._formatCapitalsValue):
(WI.FontDetailsPanel.prototype._formatNumericValue):
(WI.FontDetailsPanel.prototype._formatAlternatesValue):
(WI.FontDetailsPanel.prototype._formatEastAsianValue):
(WI.FontDetailsPanel.prototype._featureIsEnabled):
(WI.FontDetailsPanel.prototype._hasVariationValue):
* UserInterface/Views/FontDetailsSidebarPanel.js: Added.
(WI.FontDetailsSidebarPanel):
* UserInterface/Views/GeneralStyleDetailsSidebarPanel.css:
(.sidebar > .panel.details.css-style > .content:not(.supports-new-rule) ~ .options-container > .new-rule,):
(.multi-sidebar.showing-multiple > .sidebar > .panel.details:not(.style-rules) > .content > .pseudo-classes,):
- When showing the Styles panel alongside another style-based panel, hide the pseudo-class and filter options.
* UserInterface/Views/GeneralStyleDetailsSidebarPanel.js:
(WI.GeneralStyleDetailsSidebarPanel.prototype.styleDetailsPanelFocusFilterBar):
(WI.GeneralStyleDetailsSidebarPanel.prototype.initialLayout):
(WI.GeneralStyleDetailsSidebarPanel.prototype._showPanel):
(WI.GeneralStyleDetailsSidebarPanel.prototype._handleNodeChanged):
(WI.GeneralStyleDetailsSidebarPanel.prototype._filterDidChange):
- Support not showing the filter bar for style panels where filtering is not applicable.
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createExperimentalSettingsView):
* UserInterface/Views/StyleDetailsPanel.js:
(WI.StyleDetailsPanel.prototype.get supportsToggleCSSClass):
(WI.StyleDetailsPanel.prototype.filterDidChange): Deleted.
- Remove empty implementation of `filterDidChange` as `WI.GeneralStyleDetailsSidebarPanel.prototype.initialLayout`
checks for an implmentation of this function to determine if a filter bar should be shown.

LayoutTests:

* inspector/css/getComputedPrimaryFontForNode-expected.txt: Added.
* inspector/css/getComputedPrimaryFontForNode.html: Added.
* inspector/model/font-calculate-properties-expected.txt: Added.
* inspector/model/font-calculate-properties.html: Added.

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

17 months agoAdd runtime flag for ANGLE on Metal
dino@apple.com [Thu, 10 Dec 2020 18:58:00 +0000 (18:58 +0000)]
Add runtime flag for ANGLE on Metal
https://bugs.webkit.org/show_bug.cgi?id=219661
Source/WebCore:

<rdar://problem/69061894>

Reviewed by Sam Weinig.

Add a new RuntimeEnabledFeature for "WebGL on Metal". Check that
value when creating the GraphicsContextGL inside WebGL and
then pass a new attribute into EGL_GetPlatformDisplay.
The value used isn't yet in the tree, but this allows for local testing.

No change of behaviour at the moment.

* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setWebGLUsingMetal):
(WebCore::RuntimeEnabledFeatures::webGLUsingMetal const):
* platform/graphics/GraphicsContextGLAttributes.h: New useMetal attribute.
* platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:
(WebCore::InitializeEGLDisplay):
(WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL):

Source/WTF:

Reviewed by Sam Weinig.

New internal feature flag "WebGL on Metal".

* Scripts/Preferences/WebPreferencesInternal.yaml:

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

17 months ago[Win] fast/url/data-url-mediatype.html is failing
ryanhaddad@apple.com [Thu, 10 Dec 2020 18:53:28 +0000 (18:53 +0000)]
[Win] fast/url/data-url-mediatype.html is failing
https://bugs.webkit.org/show_bug.cgi?id=219720

Unreviewed test gardening.

* platform/win/fast/url/data-url-mediatype-expected.txt: Added.

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

17 months ago[CMake] Use TARGET_PROPERTY to set includes for executables
don.olmstead@sony.com [Thu, 10 Dec 2020 18:08:18 +0000 (18:08 +0000)]
[CMake] Use TARGET_PROPERTY to set includes for executables
https://bugs.webkit.org/show_bug.cgi?id=219743

Reviewed by Michael Catanzaro.

Source/JavaScriptCore:

Use $<TARGET_PROPERTY:JavaScriptCore,INCLUDE_DIRECTORIES> for all executables being
built alongside JavaScriptCore. This simplifies the includes for those targets.

Additionally relocate the setting of include directories for LLInt executables
so they're next to the rest of their definitions.

* CMakeLists.txt:
* shell/CMakeLists.txt:

Source/WebKit:

Use $<TARGET_PROPERTY:WebKit,INCLUDE_DIRECTORIES> for all executables being
built alongside WebKit. This simplifies the includes for those targets.

* CMakeLists.txt:

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

17 months ago[Flapak SDK] Add envvar to enable verbose mode
lmoura@igalia.com [Thu, 10 Dec 2020 18:07:19 +0000 (18:07 +0000)]
[Flapak SDK] Add envvar to enable verbose mode
https://bugs.webkit.org/show_bug.cgi?id=219744

Reviewed by Adrian Perez de Castro.

While webkit-flatpak has the --verbose option, some scripts like
run-minibrowser, run-gtk-tests etc might not expose it to the user.

This change checks for WEBKIT_SDK_VERBOSE in order to be able to
control it regardless of command line options.

* flatpak/flatpakutils.py:
(WebkitFlatpak.load_from_args):

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

17 months agoUnreviewed, reverting r270542.
cdumez@apple.com [Thu, 10 Dec 2020 18:06:09 +0000 (18:06 +0000)]
Unreviewed, reverting r270542.

Seems to have regressed perf benchmarks

Reverted changeset:

"[iOS] Stop leaking an XPC boost message to XPC services"
https://bugs.webkit.org/show_bug.cgi?id=219453
https://trac.webkit.org/changeset/270542

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

17 months agoprepare-ChangeLog won't parse rdar://nnnnnnnn URLs in fetchRadarURLFromBugXMLData()
ddkilzer@apple.com [Thu, 10 Dec 2020 18:05:39 +0000 (18:05 +0000)]
prepare-ChangeLog won't parse rdar://nnnnnnnn URLs in fetchRadarURLFromBugXMLData()
<https://webkit.org/b/219645>
<rdar://problem/72182806>

Reviewed by Darin Adler.

Relax the format for rdar:// URLs not to require angle brackets
(<>) or the "problem/" pseudo-path.

Include drive-by fixes for global variables in prepare-ChangeLog
that cause warnings when running tests:

    Variable "$var" is not available

* Scripts/prepare-ChangeLog:
(main):
- Move %attributeCache from global scope into this subroutine,
  then pass to generateFileList() to fix a variable warning.
(fetchRadarURLFromBugXMLData):
- Update regex that parses rdar:// URLs.  This fixes the bug.
(attributeCommand):
- Add argument for $attributeCache hash ref since it is no
  longer a global variable.
- Move definition of $devNull here to fix a variable warning.
(generateFileList):
- Add argument for $attributeCache hash ref to pass through to
  attributeCommand().
* Scripts/webkitperl/prepare-ChangeLog_unittest/fetchRadarURLFromBugXMLData.pl:
- Add tests for newly supported rdar:// URL formats.
* Scripts/webkitperl/prepare-ChangeLog_unittest/filenameWithParentheses.pl:
- Update to pass $attributeCache to attributeCommand().

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

17 months ago[LFC][IFC] Introduce InlineTextItem::isWordSeparator
zalan@apple.com [Thu, 10 Dec 2020 17:57:37 +0000 (17:57 +0000)]
[LFC][IFC] Introduce InlineTextItem::isWordSeparator
https://bugs.webkit.org/show_bug.cgi?id=219695

Reviewed by Antti Koivisto.

This is in preparation for using it to make space for word-spacing.

* layout/inlineformatting/InlineItem.cpp:
* layout/inlineformatting/InlineItem.h:
* layout/inlineformatting/InlineTextItem.cpp:
(WebCore::Layout::InlineTextItem::createAndAppendTextItems):
* layout/inlineformatting/InlineTextItem.h:
(WebCore::Layout::InlineTextItem::isWordSeparator const):
(WebCore::Layout::InlineTextItem::createWhitespaceItem):
(WebCore::Layout::InlineTextItem::createNonWhitespaceItem):
(WebCore::Layout::InlineTextItem::InlineTextItem):
(WebCore::Layout::InlineTextItem::left const):
(WebCore::Layout::InlineTextItem::right const):

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

17 months ago[LFC][IFC] Line available width computation should be based on the content logical...
zalan@apple.com [Thu, 10 Dec 2020 17:44:57 +0000 (17:44 +0000)]
[LFC][IFC] Line available width computation should be based on the content logical right.
https://bugs.webkit.org/show_bug.cgi?id=219693

Reviewed by Antti Koivisto.

This is in preparation for adding proper support for negative word spacing values where the negative value
pulls the content on the line to the logical left direction making more space for subsequent content.

* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::appendInlineBoxStart):
(WebCore::Layout::Line::appendTextContent):
(WebCore::Layout::Line::appendNonReplacedInlineBox):
(WebCore::Layout::Line::appendLineBreak):
(WebCore::Layout::Line::appendWordBreakOpportunity):
* layout/inlineformatting/InlineLine.h:
(WebCore::Layout::Line::contentLogicalRight const):
* layout/inlineformatting/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::placeInlineContent):
(WebCore::Layout::LineBuilder::close):
(WebCore::Layout::LineBuilder::handleInlineContent):
(WebCore::Layout::LineBuilder::rebuildLine):
(WebCore::Layout::LineBuilder::rebuildLineForTrailingSoftHyphen):

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

17 months ago[iOS] TestWebKitAPI.GPUProcess.WebProcessTerminationAfterTooManyGPUProcessCrashes...
cdumez@apple.com [Thu, 10 Dec 2020 17:16:39 +0000 (17:16 +0000)]
[iOS] TestWebKitAPI.GPUProcess.WebProcessTerminationAfterTooManyGPUProcessCrashes is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=219719
<rdar://problem/72158303>

Reviewed by Darin Adler.

We currently have an issue where the audio track gets removed after the GPUProcess
crashes. This is what is causing GPUProcess.WebProcessTerminationAfterTooManyGPUProcessCrashes
to be flaky on iOS. For the same reason, GPUProcess.CrashWhilePlayingVideo was flaky on
iOS until we temporarily disabled the checks in r270328. For now, do the same thing as in r270328
for WebProcessTerminationAfterTooManyGPUProcessCrashes since I have not found the reason why
we lose audio on iOS after a GPU process crash yet and we don't want to keep a flaky test on
the bots.

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

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

17 months agoGate VP9 exposure in MediaCapabilities on VP9DecoderEnabled preference
youenn@apple.com [Thu, 10 Dec 2020 16:10:35 +0000 (16:10 +0000)]
Gate VP9 exposure in MediaCapabilities on VP9DecoderEnabled preference
https://bugs.webkit.org/show_bug.cgi?id=219640

Reviewed by Eric Carlson.

Source/WebCore:

Add a boolean to enable/disable VP9 exposure.
Set it according to page settings.
Update scripts to correctly generate setVPXX setters.
Expose VP9DecoderEnabled value through internals API.

Test: media/mediacapabilities/vp9.html

* Modules/mediacapabilities/MediaCapabilities.cpp:
(WebCore::MediaCapabilities::decodingInfo):
* Scripts/GenerateSettings.rb:
* platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp:
(WebCore::createMediaPlayerDecodingConfigurationCocoa):
* platform/mediacapabilities/MediaDecodingConfiguration.h:
(WebCore::MediaDecodingConfiguration::encode const):
(WebCore::MediaDecodingConfiguration::decode):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::vp9DecoderEnabled const):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:

Source/WTF:

* Scripts/Preferences/WebPreferencesExperimental.yaml:

LayoutTests:

* media/mediacapabilities/vp9-expected.txt: Added.
* media/mediacapabilities/vp9.html: Added.

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

17 months agoICE does not resolve for `turns` relay candidates rooted in LetsEncrypt CA
youenn@apple.com [Thu, 10 Dec 2020 15:37:49 +0000 (15:37 +0000)]
ICE does not resolve for `turns` relay candidates rooted in LetsEncrypt CA
https://bugs.webkit.org/show_bug.cgi?id=219274

Reviewed by Eric Carlson.

Source/ThirdParty/libwebrtc:

* Configurations/libwebrtc.iOS.exp:
* Configurations/libwebrtc.iOSsim.exp:
* Configurations/libwebrtc.mac.exp:

Source/WebCore:

Introduce a new runtime flag that is used to control whether using the new webrtc socket code path or not.

* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::webRTCPlatformSocketsEnabled const):
(WebCore::RuntimeEnabledFeatures::setWebRTCPlatformSocketsEnabled):

Source/WebKit:

Use NWConnection for client TCP sockets.
This allows piggy-backing on this API for things such as proxies or certificate validation.
Implementation does opening a TCP socket with TLS using NWConnection:
- If the socket is created for STUN/TURN, it is sending packets as is. For receiving data, the socket
will make sure to split received data in meaningful messages that WebProcess will process.
- If the socket is TCP for data, sent data is prefixed with the size of the data. For received data,
the length of the message is read and we wait to receive the whole message data to send it to WebProcess.

We enable that new code path based on an experimental feature.
Tested manually with TURNS servers and TCP-only connections.

* NetworkProcess/webrtc/NetworkRTCProvider.cpp:
(WebKit::NetworkRTCProvider::createClientTCPSocket):
* NetworkProcess/webrtc/NetworkRTCProvider.h:
(WebKit::NetworkRTCProvider::setPlatformSocketsEnabled):
* NetworkProcess/webrtc/NetworkRTCProvider.messages.in:
* NetworkProcess/webrtc/NetworkRTCSocketSocketCocoa.h: Added.
* NetworkProcess/webrtc/NetworkRTCSocketSocketCocoa.mm: Added.
(WebKit::socketQueue):
(WebKit::NetworkRTCSocketSocketCocoa::createClientTCPSocket):
(WebKit::isStunMessage):
(WebKit::getSTUNOrTURNMessageLength):
(WebKit::extractSTUNOrTURNMessages):
(WebKit::extractMessages):
(WebKit::processMessage):
(WebKit::NetworkRTCSocketSocketCocoa::NetworkRTCSocketSocketCocoa):
(WebKit::NetworkRTCSocketSocketCocoa::close):
(WebKit::NetworkRTCSocketSocketCocoa::setOption):
(WebKit::dataFromVector):
(WebKit::NetworkRTCSocketSocketCocoa::sendTo):
* SourcesCocoa.txt:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
(WebKit::LibWebRTCSocketFactory::setConnection):

Source/WTF:

* Scripts/Preferences/WebPreferencesExperimental.yaml:

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

17 months ago[iOS][FCR] Add new look for input type=range
akeerthi@apple.com [Thu, 10 Dec 2020 15:12:13 +0000 (15:12 +0000)]
[iOS][FCR] Add new look for input type=range
https://bugs.webkit.org/show_bug.cgi?id=219698
<rdar://problem/72144727>

Reviewed by Wenson Hsieh.

Source/WebCore:

The new appearance matches the appearance of UIKit's UISlider.

Tests: fast/forms/ios/form-control-refresh/range/background-color.html
       fast/forms/ios/form-control-refresh/range/border.html
       fast/forms/ios/form-control-refresh/range/datalist.html
       fast/forms/ios/form-control-refresh/range/style-height.html
       fast/forms/ios/form-control-refresh/range/style-width.html
       fast/forms/ios/form-control-refresh/range/value.html

* css/formControlsIOS.css:
(input[type="range"]::-webkit-slider-thumb, input[type="range"]::-webkit-slider-thumb:active):

The pressed appearance of slider thumbs on iOS is the same as the
unpressed appearance.

* rendering/RenderSlider.cpp:
(WebCore::RenderSlider::valueRatio const):
* rendering/RenderSlider.h:

Added the valueRatio() method so that the appropriate portion of the
slider can be filled when the value is non-zero.

* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::adjustStyle):

Consult supportsBoxShadow() rather than unconditionally dropping the
box shadow for native controls.

* rendering/RenderTheme.h:
(WebCore::RenderTheme::supportsBoxShadow const):

Preserve the default behavior of dropping box shadows for native controls.

* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::paintSliderTrack):
(WebCore::RenderThemeIOS::paintSliderThumbDecorations):
(WebCore::RenderThemeIOS::paintProgressBar):
(WebCore::RenderThemeIOS::supportsBoxShadow const):

Slider thumbs rely on box shadows for their appearance. Other controls
may also be able to support box shadows; more investigation is
needed, which is outside the scope of this patch.

(WebCore::RenderThemeIOS::paintProgressBarWithFormControlRefresh):

Removed acronym to follow style guidelines.

(WebCore::RenderThemeIOS::paintSliderTrackWithFormControlRefresh):

LayoutTests:

Added tests to verify the stylability of inputs with the new appearance.

* fast/forms/ios/form-control-refresh/range/background-color-expected.html: Added.
* fast/forms/ios/form-control-refresh/range/background-color.html: Added.
* fast/forms/ios/form-control-refresh/range/border-expected.html: Added.
* fast/forms/ios/form-control-refresh/range/border.html: Added.
* fast/forms/ios/form-control-refresh/range/datalist-expected-mismatch.html: Added.
* fast/forms/ios/form-control-refresh/range/datalist.html: Added.
* fast/forms/ios/form-control-refresh/range/style-height-expected.html: Added.
* fast/forms/ios/form-control-refresh/range/style-height.html: Added.
* fast/forms/ios/form-control-refresh/range/style-width-expected-mismatch.html: Added.
* fast/forms/ios/form-control-refresh/range/style-width.html: Added.
* fast/forms/ios/form-control-refresh/range/value-expected-mismatch.html: Added.
* fast/forms/ios/form-control-refresh/range/value.html: Added.

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

17 months ago[GTK] Fix EventSender wheel phase names
lmoura@igalia.com [Thu, 10 Dec 2020 15:02:07 +0000 (15:02 +0000)]
[GTK] Fix EventSender wheel phase names
https://bugs.webkit.org/show_bug.cgi?id=219726

Reviewed by Carlos Garcia Campos.

It was causing the events to be sent with 0 phase as the momentum
phase switch overwrote it.

* WebKitTestRunner/gtk/EventSenderProxyGtk.cpp:
(WTR::EventSenderProxy::mouseScrollByWithWheelAndMomentumPhases):

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

17 months ago[LFC][IFC] Remove redundant Line::lineLogicalLeft
zalan@apple.com [Thu, 10 Dec 2020 14:52:30 +0000 (14:52 +0000)]
[LFC][IFC] Remove redundant Line::lineLogicalLeft
https://bugs.webkit.org/show_bug.cgi?id=219704

Reviewed by Antti Koivisto.

Now that the line builder tracks the left offset, the line does not need to have this bit anymore.

* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::appendInlineBoxEnd):
(WebCore::Layout::Line::moveLogicalLeft): Deleted.
* layout/inlineformatting/InlineLine.h:
(WebCore::Layout::Line::contentLogicalRight const): Deleted.
* layout/inlineformatting/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::handleFloatContent):

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

17 months ago[LFC][IFC] Remove old SLL logic of not letting the measured width to be < 0
zalan@apple.com [Thu, 10 Dec 2020 14:27:42 +0000 (14:27 +0000)]
[LFC][IFC] Remove old SLL logic of not letting the measured width to be < 0
https://bugs.webkit.org/show_bug.cgi?id=219724

Reviewed by Antti Koivisto.

This is in preparation for adding proper negative letter spacing support (similar to negative word spacing).
While negative widths seem a bit odd, the line builder will use this information to position
the runs properly (offset the run using the negative value and size it to 0.)

* layout/inlineformatting/text/TextUtil.cpp:
(WebCore::Layout::TextUtil::width):
(WebCore::Layout::TextUtil::fixedPitchWidth):

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

17 months agoUnified WebKit build fails
graouts@webkit.org [Thu, 10 Dec 2020 13:28:00 +0000 (13:28 +0000)]
Unified WebKit build fails
https://bugs.webkit.org/show_bug.cgi?id=219734

Reviewed by Tim Horton.

* UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.h:
* UIProcess/SpeechRecognitionRemoteRealtimeMediaSource.h:
* UIProcess/SpeechRecognitionRemoteRealtimeMediaSourceManager.cpp:

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

17 months agoExpose RTCRtpSFrameTransform as SFrameTransform
youenn@apple.com [Thu, 10 Dec 2020 12:49:00 +0000 (12:49 +0000)]
Expose RTCRtpSFrameTransform as SFrameTransform
https://bugs.webkit.org/show_bug.cgi?id=219675

Reviewed by Eric Carlson.

Source/WebCore:

Covered by updated tests.

* Modules/mediastream/RTCRtpSFrameTransform.idl:
* bindings/js/WebCoreBuiltinNames.h:

LayoutTests:

* http/wpt/webrtc/sframe-transform-expected.txt:
* http/wpt/webrtc/sframe-transform.html:
* webrtc/audio-sframe.html:
* webrtc/sframe-keys.html:
* webrtc/video-sframe.html:

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

17 months agoUnreviewed, build fix after r270616
jiewen_tan@apple.com [Thu, 10 Dec 2020 11:26:15 +0000 (11:26 +0000)]
Unreviewed, build fix after r270616

Source/WebKit:

Adds a platform have flag.

* Platform/spi/Cocoa/AuthenticationServicesCoreSPI.h:
* UIProcess/WebAuthentication/Cocoa/AuthenticationServicesCoreSoftLink.h:
* UIProcess/WebAuthentication/Cocoa/AuthenticationServicesCoreSoftLink.mm:
* UIProcess/WebAuthentication/Cocoa/AuthenticatorPresenterCoordinator.mm:
(WebKit::AuthenticatorPresenterCoordinator::AuthenticatorPresenterCoordinator):
* UIProcess/WebAuthentication/Cocoa/WKASCAuthorizationPresenterDelegate.h:
* UIProcess/WebAuthentication/Cocoa/WKASCAuthorizationPresenterDelegate.mm:

Source/WTF:

Adds a platform have flag.

* wtf/PlatformHave.h:

LayoutTests:

Turns the modern WebAuthn feature off for this test.

* http/wpt/webauthn/public-key-credential-create-failure-local-silent.https.html:

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

17 months agoSupport aspect-ratio on replaced elements
commit-queue@webkit.org [Thu, 10 Dec 2020 10:09:41 +0000 (10:09 +0000)]
Support aspect-ratio on replaced elements
https://bugs.webkit.org/show_bug.cgi?id=219200

Patch by Rob Buis <rbuis@igalia.com> on 2020-12-10
Reviewed by Darin Adler.

Source/WebCore:

Take CSS aspect-ratio into account when calculating replaced element dimensions.

* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::computeAspectRatioInformationForRenderBox const): override
the context renderer aspect ratio with the replaced element aspect ratio.
(WebCore::RenderReplaced::computeIntrinsicRatioInformation const): compute
intrinsicRatio using CSS aspect-ratio information if it is provided.
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::computeIntrinsicRatioInformation const): compute
intrinsicRatio using CSS aspect-ratio for SVG root elements.

LayoutTests:

Enable some tests that pass now.

* TestExpectations:

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

17 months ago[css-flex] RenderFlexibleBox::computeMainSizeFromAspectRatioUsing() must obbey box...
svillar@igalia.com [Thu, 10 Dec 2020 09:21:48 +0000 (09:21 +0000)]
[css-flex] RenderFlexibleBox::computeMainSizeFromAspectRatioUsing() must obbey box-sizing
https://bugs.webkit.org/show_bug.cgi?id=219690

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

* web-platform-tests/css/css-flexbox/flex-aspect-ratio-img-row-005-expected.txt: Replaced one FAIL by PASS expectation.
* web-platform-tests/css/css-flexbox/image-as-flexitem-size-007-expected.txt: Ditto.
* web-platform-tests/css/css-flexbox/image-as-flexitem-size-007v-expected.txt: Ditto.

Source/WebCore:

The method was not handling the cases in which box-sizing was border-box and thus it was incorrectly using
border and padding to compute sizes based on aspect ratios (the aspect ratio must be applied to content box).

This fixes 3 subtests from the WPT test suite.

* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::computeMainSizeFromAspectRatioUsing const): Use a lambda to substract border and
padding extent when box-sizing is border-box.
(WebCore::RenderFlexibleBox::computeInnerFlexBaseSizeForChild): Do not substract border and padding because
computeMainSizeFromAspectRatioUsing now always returns the content box size.

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

17 months ago[WebAuthn] Adopt new UI for the Security Key makeCredential flow
jiewen_tan@apple.com [Thu, 10 Dec 2020 08:41:43 +0000 (08:41 +0000)]
[WebAuthn] Adopt new UI for the Security Key makeCredential flow
https://bugs.webkit.org/show_bug.cgi?id=219708
<rdar://problem/72154735>

Reviewed by Brent Fulgham.

Source/WebKit:

This patch adopts the new AuthenticationServices' UI. The idea is to use AuthenticatorPresenterCoordinator
as the middle layer to connect to the new UI while keeping the existing interfaces the same in the AuthenticatorManager
to handle the interactions between UI and authenticators.

Covered by manual tests.

* Platform/spi/Cocoa/AuthenticationServicesCoreSPI.h: Added.
SPI for the new UI.

* Resources/SandboxProfiles/ios/com.apple.WebKit.WebAuthn.sb:
* Scripts/process-entitlements.sh:
Added new sandbox rules for Remote SpringBoard services which are used by the new UI.

* SourcesCocoa.txt:
Paperwork.

* UIProcess/WebAuthentication/AuthenticatorManager.cpp:
(WebKit::AuthenticatorManager::handleRequest):
(WebKit::AuthenticatorManager::cancel):
(WebKit::AuthenticatorManager::enableModernWebAuthentication):
(WebKit::AuthenticatorManager::clearState):
(WebKit::AuthenticatorManager::serviceStatusUpdated):
(WebKit::AuthenticatorManager::authenticatorStatusUpdated):
(WebKit::AuthenticatorManager::requestPin):
(WebKit::AuthenticatorManager::selectAssertionResponse):
(WebKit::AuthenticatorManager::startDiscovery):
(WebKit::AuthenticatorManager::runPanel):
(WebKit::AuthenticatorManager::runPresenter):
(WebKit::AuthenticatorManager::invokePendingCompletionHandler):
* UIProcess/WebAuthentication/AuthenticatorManager.h:
Teached AuthenticatorManager to use the new UI's presenter when it is available. Otherwise, it falls back to the old UI.

* UIProcess/WebAuthentication/Cocoa/AuthenticationServicesCoreSoftLink.h: Added.
* UIProcess/WebAuthentication/Cocoa/AuthenticationServicesCoreSoftLink.mm: Added.
* UIProcess/WebAuthentication/Cocoa/AuthenticatorPresenterCoordinator.h: Added.
* UIProcess/WebAuthentication/Cocoa/AuthenticatorPresenterCoordinator.mm: Added.
(WebKit::AuthenticatorPresenterCoordinator::AuthenticatorPresenterCoordinator):
(WebKit::AuthenticatorPresenterCoordinator::updatePresenter):
(WebKit::AuthenticatorPresenterCoordinator::requestPin):
(WebKit::AuthenticatorPresenterCoordinator::selectAssertionResponse):
(WebKit::AuthenticatorPresenterCoordinator::dimissPresenter):
* UIProcess/WebAuthentication/Cocoa/WKASCAuthorizationPresenterDelegate.h: Added.
* UIProcess/WebAuthentication/Cocoa/WKASCAuthorizationPresenterDelegate.mm: Added.
(-[WKASCAuthorizationPresenterDelegate initWithCoordinator:]):
(-[WKASCAuthorizationPresenterDelegate authorizationPresenter:credentialRequestedForLoginChoice:authenticatedContext:completionHandler:]):
(-[WKASCAuthorizationPresenterDelegate authorizationPresenter:validateUserEnteredPIN:completionHandler:]):
Introduced the AuthenticatorPresenterCoordinator to handle the new UI.

* WebAuthnProcess/WebAuthnProcess.cpp:
(WebKit::WebAuthnProcess::WebAuthnProcess):
(WebKit::WebAuthnProcess::setMockWebAuthenticationConfiguration):
Teached WebAuthnProcess to inform AuthenticatorManager about its existence.

* WebKit.xcodeproj/project.pbxproj:
Paperwork.

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm:
(TestWebKitAPI::TEST):
Adjusted to the new behavior.

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

17 months agoFix redundant assert
commit-queue@webkit.org [Thu, 10 Dec 2020 07:51:45 +0000 (07:51 +0000)]
Fix redundant assert
https://bugs.webkit.org/show_bug.cgi?id=219725

Patch by Dmitry Bezhetskov <dbezhetskov@igalia.com> on 2020-12-09
Reviewed by Ross Kirsling.

* runtime/JSArrayBufferPrototype.cpp:
(JSC::arrayBufferSlice):

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

17 months ago[macOS] Remove com.apple.PowerManagement.control from WebContent sandbox
pvollan@apple.com [Thu, 10 Dec 2020 07:23:13 +0000 (07:23 +0000)]
[macOS] Remove com.apple.PowerManagement.control from WebContent sandbox
https://bugs.webkit.org/show_bug.cgi?id=219685
<rdar://problem/70497033>

Reviewed by Darin Adler.

Remove com.apple.PowerManagement.control from WebContent sandbox on macOS, since there are no reports of this being in use.

No new tests, since the result will depend on macOS version.

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

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

17 months agoSupport overscroll-behavior parsing
cathiechen@igalia.com [Thu, 10 Dec 2020 06:39:21 +0000 (06:39 +0000)]
Support overscroll-behavior parsing
https://bugs.webkit.org/show_bug.cgi?id=219305

Reviewed by Simon Fraser.

Based on Frédéric Wang's patch.

LayoutTests/imported/w3c:

Update expectations for overscroll-behavior parsing tests.

* web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
* web-platform-tests/css/css-overscroll-behavior/inheritance-expected.txt:
* web-platform-tests/css/css-overscroll-behavior/overscroll-behavior-logical-expected.txt:
* web-platform-tests/css/css-overscroll-behavior/parsing/overscroll-behavior-computed-expected.txt:
* web-platform-tests/css/css-overscroll-behavior/parsing/overscroll-behavior-valid-expected.txt:
* web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt:

Source/WebCore:

Support parsing CSS properties: overscroll-behavior, overscroll-behavior-x and overscroll-behavior-y.

Tests: fast/css/overscroll-behavior-invalidate-if-disabled.html
       fast/css/overscroll-behavior-validate-if-enable.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::settings const):
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
* css/CSSComputedStyleDeclaration.h:
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator OverscrollBehavior const):
* css/CSSProperties.json:
* css/CSSStyleDeclaration.cpp:
(WebCore::CSSStyleDeclaration::settings const):
(WebCore::CSSStyleDeclaration::namedItem):
(WebCore::CSSStyleDeclaration::setNamedItem):
(WebCore::CSSStyleDeclaration::supportedPropertyNames const):
* css/CSSStyleDeclaration.h:
* css/CSSValueKeywords.in:
* css/StyleProperties.cpp:
(WebCore::StyleProperties::getPropertyValue const):
(WebCore::StyleProperties::asText const):
* css/parser/CSSParserContext.cpp:
(WebCore::CSSParserContext::CSSParserContext):
(WebCore::operator==):
* css/parser/CSSParserContext.h:
(WebCore::CSSParserContextHash::hash):
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeOverscrollBehavior):
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::CSSPropertyParser::consumeOverscrollBehaviorShorthand):
(WebCore::CSSPropertyParser::parseShorthand):
* css/parser/CSSPropertyParser.h:
* platform/ScrollTypes.h:
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::overscrollBehaviorX const):
(WebCore::RenderStyle::overscrollBehaviorY const):
(WebCore::RenderStyle::setOverscrollBehaviorX):
(WebCore::RenderStyle::setOverscrollBehaviorY):
(WebCore::RenderStyle::initialOverscrollBehaviorX):
(WebCore::RenderStyle::initialOverscrollBehaviorY):
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator== const):
* rendering/style/StyleRareNonInheritedData.h:

Source/WebKitLegacy/win:

Add an experimental feature flag for overscroll-behavior.

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

Source/WTF:

Add an experimental feature flag for overscroll-behavior.

* Scripts/Preferences/WebPreferencesExperimental.yaml:

Tools:

Add support for testing overscroll-behavior parsing.

* DumpRenderTree/TestOptions.cpp:
(WTR::TestOptions::defaults):

LayoutTests:

Test overscrollBehavior's validation when enable or disable OverscrollBehaviorEnabled.

* fast/css/overscroll-behavior-invalidate-if-disabled-expected.txt: Added.
* fast/css/overscroll-behavior-invalidate-if-disabled.html: Added.
* fast/css/overscroll-behavior-validate-if-enable-expected.txt: Added.
* fast/css/overscroll-behavior-validate-if-enable.html: Added.
* platform/ios-13/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
* platform/ios-wk2/imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt:
* platform/ios/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:

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

17 months ago[Media in GPU Process][MSE] Implement basic video playback
peng.liu6@apple.com [Thu, 10 Dec 2020 05:04:06 +0000 (05:04 +0000)]
[Media in GPU Process][MSE] Implement basic video playback
https://bugs.webkit.org/show_bug.cgi?id=219402

Reviewed by Jer Noble.

Source/WebCore:

Implement the video playback support when the MSE media player runs in the GPU process.

* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::setPrivateAndOpen): Propagate the time fudge factor to
`MediaSourcePrivate` so that `SourceBufferPrivate` can use it.
(WebCore::MediaSource::setDurationInternal): Propagate the duration information
to `MediaSourcePrivate` so that `SourceBufferPrivate` can use it.
(WebCore::MediaSource::streamEndedWithError): Mark the stream is end in `MediaSourcePrivate`.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::SourceBuffer):
(WebCore::SourceBuffer::~SourceBuffer):
(WebCore::SourceBuffer::buffered const):
(WebCore::SourceBuffer::sourceBufferPrivateAppendComplete): Move the code to update
`buffered` to `SourceBufferPrivate` to make sure the `buffered` attribute is updated timely.
(WebCore::SourceBuffer::maximumBufferSize const):
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment): Add a completionHandler
parameter to notify the caller (`SourceBufferParser`) that the track buffer manager (`SourceBufferPrivate`)
has handled the initialization segment and is ready to receive media samples.
(WebCore::SourceBuffer::extraMemoryCost const):
(WebCore::SourceBuffer::reportExtraMemoryAllocated):
(WebCore::SourceBuffer::setMaximumQueueDepthForTrackID):
(WebCore::SourceBuffer::sourceBufferPrivateBufferedDirtyChanged):
(WebCore::SourceBuffer::sourceBufferPrivateBufferedRangesChanged):
(WebCore::SourceBuffer::isBufferedDirty const):
(WebCore::SourceBuffer::setBufferedDirty):
(WebCore::SourceBuffer::sourceBufferPrivateHasAudio const): Deleted.
(WebCore::SourceBuffer::sourceBufferPrivateHasVideo const): Deleted.
* Modules/mediasource/SourceBuffer.h:
Some parameters and return values are changed from `size_t` to `uint64_t` because they
need to pass with IPC messages when we run the MSE media player in the GPU process.

* platform/graphics/MediaSourcePrivate.h:
(WebCore::MediaSourcePrivate::setTimeFudgeFactor):
(WebCore::MediaSourcePrivate::timeFudgeFactor const):

* platform/graphics/SourceBufferPrivate.cpp:
(WebCore::SourceBufferPrivate::setBufferedDirty):
(WebCore::SourceBufferPrivate::setBufferedRanges):
(WebCore::SourceBufferPrivate::updateBufferedFromTrackBuffers):
(WebCore::SourceBufferPrivate::appendCompleted):
(WebCore::SourceBufferPrivate::bufferedSamplesForTrackID):
(WebCore::SourceBufferPrivate::provideMediaData):
(WebCore::SourceBufferPrivate::reenqueueMediaForTime):
(WebCore::SourceBufferPrivate::reenqueueMediaIfNeeded):
(WebCore::removeSamplesFromTrackBuffer):
(WebCore::SourceBufferPrivate::evictCodedFrames):
(WebCore::SourceBufferPrivate::totalTrackBufferSizeInBytes const):
(WebCore::SourceBufferPrivate::addTrackBuffer):
(WebCore::SourceBufferPrivate::didReceiveInitializationSegment):
(WebCore::SourceBufferPrivate::didReceiveSample):
* platform/graphics/SourceBufferPrivate.h:
(WebCore::SourceBufferPrivate::hasAudio const):
(WebCore::SourceBufferPrivate::hasVideo const):
(WebCore::SourceBufferPrivate::startChangingType):
(WebCore::SourceBufferPrivate::setMaximumQueueDepthForTrackID):
(WebCore::SourceBufferPrivate::timeFudgeFactor const):
(WebCore::SourceBufferPrivate::setActive): Deleted.
(WebCore::SourceBufferPrivate::setCurrentTimeFudgeFactor): Deleted.
(WebCore::SourceBufferPrivate::buffered const): Deleted.
(WebCore::SourceBufferPrivate::isBufferedDirty const): Deleted.
(WebCore::SourceBufferPrivate::setBufferedDirty): Deleted.

* platform/graphics/SourceBufferPrivateClient.h:
`SourceBufferPrivate` can figure out the values of `hasAudio` and `hasVideo` because
it manages the track buffers, so the functions `sourceBufferPrivateHasAudio()` and
`sourceBufferPrivateHasVideo()` can be removed.

* platform/graphics/VideoTrackPrivate.h:

* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
(WebCore::MediaSourcePrivateAVFObjC::MediaSourcePrivateAVFObjC):
(WebCore::MediaSourcePrivateAVFObjC::durationChanged):

* platform/graphics/avfoundation/objc/SourceBufferParserAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferParserAVFObjC.mm:
(WebCore::SourceBufferParserAVFObjC::didParseStreamDataAsAsset):
Use a semaphore to hold the parser thread until the track buffer manager has handled
the initialization segment.

* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
(WebCore::SourceBufferPrivateAVFObjC::didParseInitializationData):
(WebCore::SourceBufferPrivateAVFObjC::appendCompleted):
(WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
(WebCore::SourceBufferPrivateAVFObjC::timeFudgeFactor const):
(WebCore::SourceBufferPrivateAVFObjC::hasVideo const): Deleted.
(WebCore::SourceBufferPrivateAVFObjC::hasAudio const): Deleted.

* platform/graphics/cocoa/SourceBufferParser.h:

* platform/graphics/cocoa/SourceBufferParserWebM.cpp:
(WebCore::SourceBufferParserWebM::OnClusterBegin):
* platform/graphics/cocoa/SourceBufferParserWebM.h:
The same as `SourceBufferPrivateAVFObjC`.

* platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.cpp:
(WebCore::MediaSourcePrivateGStreamer::durationChanged):
(WebCore::MediaSourcePrivateGStreamer::markEndOfStream):
(WebCore::MediaSourcePrivateGStreamer::unmarkEndOfStream):
* platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.h:

* platform/mock/mediasource/MockMediaSourcePrivate.cpp:
(WebCore::MockMediaSourcePrivate::durationChanged):
* platform/mock/mediasource/MockMediaSourcePrivate.h:
* platform/mock/mediasource/MockSourceBufferPrivate.cpp:
(WebCore::MockSourceBufferPrivate::append):
(WebCore::MockSourceBufferPrivate::didReceiveInitializationSegment):
(WebCore::MockSourceBufferPrivate::setMaximumQueueDepthForTrackID):
(WebCore::MockSourceBufferPrivate::hasVideo const): Deleted.
(WebCore::MockSourceBufferPrivate::hasAudio const): Deleted.
* platform/mock/mediasource/MockSourceBufferPrivate.h:

Source/WebKit:

Implement the necessary functions with IPC to support media playback.

* GPUProcess/media/RemoteAudioTrackProxy.cpp:
(WebKit::RemoteAudioTrackProxy::configuration): Rename `identifier` to `trackId`
because it is easy to confuse with `TrackPrivateRemoteIdentifier`.

* GPUProcess/media/RemoteMediaPlayerProxy.cpp:
(WebKit::RemoteMediaPlayerProxy::loadMediaSource):
(WebKit::RemoteMediaPlayerProxy::updateCachedState): For MSE media player, `SourceBuffer`
provides the buffered ranges, so `RemoteMediaPlayerProxy` does not need to report this
information to the `MediaPlayer` object in the Web process.
* GPUProcess/media/RemoteMediaPlayerProxy.h:
* GPUProcess/media/RemoteMediaPlayerProxy.messages.in:

* GPUProcess/media/RemoteMediaSourceProxy.cpp:
(WebKit::RemoteMediaSourceProxy::duration const):
(WebKit::RemoteMediaSourceProxy::buffered const):
(WebKit::RemoteMediaSourceProxy::durationChanged):
(WebKit::RemoteMediaSourceProxy::setReadyState):
* GPUProcess/media/RemoteMediaSourceProxy.h:
* GPUProcess/media/RemoteMediaSourceProxy.messages.in:

* GPUProcess/media/RemoteSourceBufferProxy.cpp:
(WebKit::RemoteSourceBufferProxy::RemoteSourceBufferProxy):
(WebKit::RemoteSourceBufferProxy::~RemoteSourceBufferProxy):
(WebKit::RemoteSourceBufferProxy::sourceBufferPrivateDidReceiveInitializationSegment):
(WebKit::RemoteSourceBufferProxy::sourceBufferPrivateDurationChanged):
(WebKit::RemoteSourceBufferProxy::sourceBufferPrivateDidParseSample):
(WebKit::RemoteSourceBufferProxy::sourceBufferPrivateAppendComplete):
(WebKit::RemoteSourceBufferProxy::sourceBufferPrivateDidReceiveRenderingError):
(WebKit::RemoteSourceBufferProxy::sourceBufferPrivateBufferedDirtyChanged):
(WebKit::RemoteSourceBufferProxy::sourceBufferPrivateBufferedRangesChanged):
(WebKit::RemoteSourceBufferProxy::setActive):
(WebKit::RemoteSourceBufferProxy::setReadyState):
(WebKit::RemoteSourceBufferProxy::updateBufferedFromTrackBuffers):
(WebKit::RemoteSourceBufferProxy::evictCodedFrames):
(WebKit::RemoteSourceBufferProxy::addTrackBuffer):
(WebKit::RemoteSourceBufferProxy::reenqueueMediaIfNeeded):
(WebKit::RemoteSourceBufferProxy::trySignalAllSamplesInTrackEnqueued):
(WebKit::RemoteSourceBufferProxy::sourceBufferPrivateHasAudio const): Deleted.
(WebKit::RemoteSourceBufferProxy::sourceBufferPrivateHasVideo const): Deleted.
* GPUProcess/media/RemoteSourceBufferProxy.h:
* GPUProcess/media/RemoteSourceBufferProxy.messages.in:

* GPUProcess/media/RemoteTextTrackProxy.cpp:
(WebKit::RemoteTextTrackProxy::configuration):
* GPUProcess/media/RemoteVideoTrackProxy.cpp:
(WebKit::RemoteVideoTrackProxy::configuration):

* GPUProcess/media/TextTrackPrivateRemoteConfiguration.h:
(WebKit::TextTrackPrivateRemoteConfiguration::encode const):
(WebKit::TextTrackPrivateRemoteConfiguration::decode):

* GPUProcess/media/TrackPrivateRemoteConfiguration.h:
(WebKit::TrackPrivateRemoteConfiguration::encode const):
(WebKit::TrackPrivateRemoteConfiguration::decode):

* WebProcess/GPU/media/AudioTrackPrivateRemote.cpp:
(WebKit::AudioTrackPrivateRemote::updateConfiguration):
* WebProcess/GPU/media/AudioTrackPrivateRemote.h:

* WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
(WebKit::MediaPlayerPrivateRemote::load):

* WebProcess/GPU/media/MediaSourcePrivateRemote.cpp:
(WebKit::MediaSourcePrivateRemote::durationChanged):
(WebKit::MediaSourcePrivateRemote::isEnded const):
(WebKit::MediaSourcePrivateRemote::setReadyState):
* WebProcess/GPU/media/MediaSourcePrivateRemote.h:

* WebProcess/GPU/media/SourceBufferPrivateRemote.cpp:
(WebKit::SourceBufferPrivateRemote::setReadyState):
(WebKit::SourceBufferPrivateRemote::flush):
(WebKit::SourceBufferPrivateRemote::setActive):
(WebKit::SourceBufferPrivateRemote::updateBufferedFromTrackBuffers):
(WebKit::SourceBufferPrivateRemote::evictCodedFrames):
(WebKit::SourceBufferPrivateRemote::addTrackBuffer):
(WebKit::SourceBufferPrivateRemote::reenqueueMediaIfNeeded):
(WebKit::SourceBufferPrivateRemote::trySignalAllSamplesInTrackEnqueued):
(WebKit::SourceBufferPrivateRemote::sourceBufferPrivateDidReceiveInitializationSegment):
(WebKit::SourceBufferPrivateRemote::sourceBufferPrivateDurationChanged):
(WebKit::SourceBufferPrivateRemote::sourceBufferPrivateDidParseSample):
(WebKit::SourceBufferPrivateRemote::sourceBufferPrivateBufferedDirtyChanged):
(WebKit::SourceBufferPrivateRemote::sourceBufferPrivateBufferedRangesChanged):
(WebKit::SourceBufferPrivateRemote::enqueueSample): Deleted.
* WebProcess/GPU/media/SourceBufferPrivateRemote.h:
* WebProcess/GPU/media/SourceBufferPrivateRemote.messages.in:

* WebProcess/GPU/media/TextTrackPrivateRemote.cpp:
(WebKit::TextTrackPrivateRemote::updateConfiguration):

* WebProcess/GPU/media/VideoTrackPrivateRemote.cpp:
(WebKit::VideoTrackPrivateRemote::updateConfiguration):

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

17 months ago[GPU Process] Allow form controls to be painted when iOS form control refresh is...
wenson_hsieh@apple.com [Thu, 10 Dec 2020 01:12:19 +0000 (01:12 +0000)]
[GPU Process] Allow form controls to be painted when iOS form control refresh is enabled
https://bugs.webkit.org/show_bug.cgi?id=219718

Reviewed by Tim Horton.

Ensures that form controls show up when using the GPU process, when the iOS form control refresh setting is
enabled. All form controls post-refresh are implemented in such a way that they're compatible with graphics
contexts in the web process that are not backed by platform graphics context objects. See below for more
details.

This was added as a temporary workaround to avoid crashing when enabling GPU process in r199037.

* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paint):
* rendering/RenderTheme.h:

Makes `RenderTheme::canPaint` true by default on the base `RenderTheme` class, so that all platforms don't need
to individually override it and return true. Additionally plumbs a `WebCore::Settings` object through this
method, so that we can consult it on iOS.

(WebCore::RenderTheme::canPaint const):
* rendering/RenderThemeAdwaita.h:
* rendering/RenderThemeCocoa.h:
* rendering/RenderThemeCocoa.mm:
(WebCore::RenderThemeCocoa::canPaint const): Deleted.
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::canPaint const):

When iOS form control refresh is enabled, return true; otherwise, return true only if there is a platform
`CGContextRef`.

* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::canPaint const):

Preserve existing behavior by returning true here if (and only if) there is a platform `CGContextRef`.

* rendering/RenderThemePlayStation.h:
* rendering/RenderThemeWin.h:

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

17 months agoMarked some WPT worklet tests as flaky
ggaren@apple.com [Thu, 10 Dec 2020 00:35:58 +0000 (00:35 +0000)]
Marked some WPT worklet tests as flaky
https://bugs.webkit.org/show_bug.cgi?id=219717

Reviewed by Chris Dumez.

* TestExpectations: Marked as flaky:

imported/w3c/web-platform-tests/worklets/animation-worklet-csp.https.html
imported/w3c/web-platform-tests/worklets/animation-worklet-referrer.https.html
imported/w3c/web-platform-tests/worklets/layout-worklet-referrer.https.html

These tests flake a little on Apple platforms, e.g.:

https://build.webkit.org/builders/Apple-Mojave-Release-WK1-Tests/builds/19881
https://build.webkit.org/builders/Apple-Mojave-Release-WK1-Tests/builds/19880
https://build.webkit.org/builders/Apple-Mojave-Release-WK1-Tests/builds/19830

...and a lot on WPE platforms.

Also, animation and layout worklets are not supported features yet.

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

17 months agoFix for focus tracking in isolated tree mode.
andresg_22@apple.com [Thu, 10 Dec 2020 00:35:27 +0000 (00:35 +0000)]
Fix for focus tracking in isolated tree mode.
https://bugs.webkit.org/show_bug.cgi?id=219662

Reviewed by Chris Fleizach.

Covered by existing tests.

- AXIsolatedTree::setFocusedNodeID and applyPendingChanges now properly
handle the focused node ID update when the focused object changes.
- AccessibilityObject::setFocused sets focus and activates the
corresponding view. This was done in the wrapper baseAccessibilitySetFocus
method, but this is a more appropriate place for this core functionality.
- Some code cleanup, ASSERT checks of appropriate thread, and additional
logging.

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::setFocused):
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::setFocused):
* accessibility/AccessibilityScrollView.cpp:
(WebCore::AccessibilityScrollView::setFocused):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _accessibilitySetFocus:]):
* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::page const):
(WebCore::AXIsolatedObject::document const):
(WebCore::AXIsolatedObject::documentFrameView const):
* accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::setFocusedNodeID):
(WebCore::AXIsolatedTree::applyPendingChanges):
* accessibility/mac/WebAccessibilityObjectWrapperBase.h:
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(-[WebAccessibilityObjectWrapperBase baseAccessibilitySetFocus:]):
Deleted, not needed since core functionality is now in AccessibilityObject::setFocused.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
(-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):

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

17 months agostress/intl-datetimeformat-formatrange.js and stress/intl-datetimeformat-formatrange...
commit-queue@webkit.org [Thu, 10 Dec 2020 00:23:43 +0000 (00:23 +0000)]
stress/intl-datetimeformat-formatrange.js and stress/intl-datetimeformat-formatrange-relevant-extensions.js fail with ICU 65.1
https://bugs.webkit.org/show_bug.cgi?id=218763
<rdar://problem/71257288>

Patch by Michael Catanzaro <mcatanzaro@gnome.org> on 2020-12-09
Reviewed by Yusuke Suzuki.

There are strange differences between the output of similar ICU versions on macOS compared
to Linux, for reasons unknown. Make these tests more robust to different output by stripping
all "thin space" characters from the actual results and replacing them with regular spaces.
The thin space characters are only used by older versions of ICU, but it seems that the
versions in which it is used either differ between macOS and Linux, or else change within a
particular major version, so it's hard to use ICU version checks for this.

* stress/intl-datetimeformat-formatrange-relevant-extensions-ja.js:
(shouldBe):
* stress/intl-datetimeformat-formatrange-relevant-extensions.js:
(shouldBe):
* stress/intl-datetimeformat-formatrange-should-not-handle-gregorian-change-date.js:
* stress/intl-datetimeformat-formatrange.js:
(shouldBe):
(test):
* stress/intl-datetimeformat-formatrangetoparts-relevant-extensions-ja.js:
(shouldBe):
* stress/intl-datetimeformat-formatrangetoparts-relevant-extensions.js:
(shouldBe):
* stress/intl-datetimeformat-formatrangetoparts-should-not-handle-gregorian-change-date.js:
* stress/intl-datetimeformat-formatrangetoparts.js:
(shouldBe):

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

17 months agoAdd max age for a root to be reused.
dewei_zhu@apple.com [Wed, 9 Dec 2020 23:13:28 +0000 (23:13 +0000)]
Add max age for a root to be reused.
https://bugs.webkit.org/show_bug.cgi?id=219628

Reviewed by Ryosuke Niwa.

In order to prevent reusing a stale root, we should set a limit on the age of a root to be reused.
* public/include/manifest-generator.php: Added 'maxRootReuseAgeInDays' to manifest.
* public/v3/models/build-request.js: Added root age check.
(BuildRequest.prototype.async findBuildRequestWithSameRoots):
* public/v3/models/commit-set.js: Extended 'areAllRootsAvailable' with root age check.
(CommitSet.prototype.areAllRootsAvailable):
* public/v3/models/manifest.js:
(Manifest.fetch): Made it async.
(Manifest.async fetchRawResponse): Extract fetching raw manifest out so that 'maxRootReuseAgeInDays'
can be read without resetting other data models. Also added code to only fetch from API if requesting
/data/manifest.json returns 404.
(Manifest._didFetchManifest):
* server-tests/api-manifest-tests.js: Updated unit tests.
* unit-tests/build-request-tests.js: Updated unit tests and add new tests.
* unit-tests/manifest-test.js: Added unit tests.

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

17 months ago[Cocoa] Web Inspector: add support for creating extension tabs in WebInspectorUI...
bburg@apple.com [Wed, 9 Dec 2020 23:08:25 +0000 (23:08 +0000)]
[Cocoa] Web Inspector: add support for creating extension tabs in WebInspectorUI via _WKInspectorExtension
https://bugs.webkit.org/show_bug.cgi?id=219380

Reviewed by Devin Rousso and Timothy Hatcher.

Source/WebInspectorUI:

* UserInterface/Controllers/WebInspectorExtensionController.js:
(WI.WebInspectorExtensionController):
(WI.WebInspectorExtensionController.prototype._makeNextExtensionTabID):
(WI.WebInspectorExtensionController.prototype.unregisterExtension):
(WI.WebInspectorExtensionController.prototype.createTabForExtension):
* UserInterface/Main.html:
* UserInterface/Protocol/InspectorFrontendAPI.js:
(InspectorFrontendAPI.createTabForExtension):
* UserInterface/Views/GeneralTabBarItem.js:
(WI.GeneralTabBarItem.fromTabContentView):
(WI.GeneralTabBarItem.get displayName): Deleted.
* UserInterface/Views/PinnedTabBarItem.js:
(WI.PinnedTabBarItem.fromTabContentView):
(WI.PinnedTabBarItem):
* UserInterface/Views/TabContentView.js:
(WI.TabContentView.prototype.get tabBarItem):
(WI.TabContentView.prototype.tabInfo):
(WI.TabContentView.prototype.get managesNavigationSidebarPanel): Deleted.
(WI.TabContentView.prototype.attached): Deleted.
* UserInterface/Views/WebInspectorExtensionTabContentView.css: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKInspectorExtension.h.
(.content-view.web-inspector-extension-tab > iframe):
* UserInterface/Views/WebInspectorExtensionTabContentView.js: Copied from Source/WebKit/UIProcess/API/APIInspectorExtension.h.
(WI.WebInspectorExtensionTabContentView):
(WI.WebInspectorExtensionTabContentView.prototype.tabInfo):
(WI.WebInspectorExtensionTabContentView.prototype.get type):
(WI.WebInspectorExtensionTabContentView.prototype.get supportsSplitContentBrowser):
(WI.WebInspectorExtensionTabContentView.prototype.get extensionTabID):
(WI.WebInspectorExtensionTabContentView.prototype.initialLayout):

Source/WebKit:

Add a new method to _WKInspectorExtension for creating an extension tab in WebInpectorUI.
This can be used to implement browser.devtools.panels.create() as provided by the Web Extensions API.

* Platform/Logging.h: Add Inspector channel for error logging.
* Shared/InspectorExtensionTypes.h: Add a missing EnumTraits case.
* WebKit.xcodeproj/project.pbxproj:
* Sources.txt: Add files.

* UIProcess/API/APIInspectorExtension.h:
* UIProcess/API/APIInspectorExtension.cpp:
(API::InspectorExtension::InspectorExtension):
(API::InspectorExtension::create):
(API::InspectorExtension::createTab):
Inspector extensions need to be able to invoke commands in the WebProcess-side
extension proxy controller, so keep a WeakRef to the extension controller that
created the extension object. Also, implement the new API by forwarding it on.

* UIProcess/API/Cocoa/_WKInspector.mm:
(-[_WKInspector registerExtensionWithID:displayName:completionHandler:]):
Adapt to the new constructor as explained above.

* UIProcess/API/Cocoa/_WKInspectorExtensionInternal.h:
Expose member m_remoteInspectorPorxy for use in the API::InspectorExtension constructor.

* UIProcess/API/Cocoa/_WKInspectorExtension.h:
* UIProcess/API/Cocoa/_WKInspectorExtension.mm:
(-[_WKInspectorExtension initWithIdentifier:]): Deleted.

(-[_WKInspectorExtension createTabWithName:tabIconURL:sourceURL:completionHandler:]):
Implement new API.

* UIProcess/API/Cocoa/_WKRemoteWebInspectorViewControllerInternal.h: Added.
Make the RefPtr<RemoteWebInspectorProxy> member variable accessible to the API object constructor.

* UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm:
(-[_WKRemoteWebInspectorViewController registerExtensionWithID:displayName:completionHandler:]):
Adapt to new constructor as explained above.

* UIProcess/Inspector/WebInspectorUIExtensionControllerProxy.h:
* UIProcess/Inspector/WebInspectorUIExtensionControllerProxy.cpp:
(WebKit::WebInspectorUIExtensionControllerProxy::createTabForExtension):
Forward the request to the inspector frontend WebProcess.

* WebProcess/Inspector/WebInspectorUIExtensionController.messages.in:
Add a new async IPC command for creating a new inspector extension tab.

* WebProcess/Inspector/WebInspectorUIExtensionController.h:
* WebProcess/Inspector/WebInspectorUIExtensionController.cpp:
(WebKit::WebInspectorUIExtensionController::unwrapEvaluationResultAsObject):
Added. Pull out the code needed for error-handling this common operation.

(WebKit::WebInspectorUIExtensionController::createTabForExtension):
Added. Call into InspectorFrontendAPI to request a new tab. Turn the result
into an InspectorExtensionError or InspectorExtensionTabID and send the IPC reply.

* UIProcess/RemoteLayerTree/mac/ScrollingTreeOverflowScrollingNodeRemoteMac.h:
Fix unified sources fallout.

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