WebKit-https.git
9 months ago[LFC] Update the block box/container list
zalan@apple.com [Fri, 12 Feb 2021 12:05:12 +0000 (12:05 +0000)]
[LFC] Update the block box/container list
https://bugs.webkit.org/show_bug.cgi?id=221800
<rdar://problem/74178203>

Reviewed by Antti Koivisto.

Add DisplayType::FlowRoot to isBlockContainer/isBlockLevelBox and DisplayType::Grid to isBlockLevelBox.

* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::isBlockLevelBox const):
(WebCore::Layout::Box::isBlockContainer const):

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

9 months ago[LFC][IFC] LineLayout::enclosingBorderBoxRectFor reports content box size
zalan@apple.com [Fri, 12 Feb 2021 11:51:15 +0000 (11:51 +0000)]
[LFC][IFC] LineLayout::enclosingBorderBoxRectFor reports content box size
https://bugs.webkit.org/show_bug.cgi?id=221778

Reviewed by Antti Koivisto.

Before 272724, inline boxes included their paddings and borders in the content box geometry.
Now we can just simply return the border box rect.

* layout/integration/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::enclosingBorderBoxRectFor const):

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

9 months agoCrash in InsertTextCommand::doApply
svillar@igalia.com [Fri, 12 Feb 2021 11:29:32 +0000 (11:29 +0000)]
Crash in InsertTextCommand::doApply
https://bugs.webkit.org/show_bug.cgi?id=213514

Reviewed by Ryosuke Niwa.

Source/WebCore:

The InsertTextCommand might delete the current selection before inserting the text. In that case and when
the selection was ending inside an empty row of a table the code was calling CompositeEditCommand::removeNode()
directly to delete the empty row. That method however does not properly update the m_endingPosition of
the CompositeEditCommand leaving the current selection in an inconsistent state. Replaced that call by
removeNodeUpdatingStates() which ends up calling removeNode() but only after updating the selection state.

Test: editing/deleting/insert-in-orphaned-selection-crash.html

* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::removePreviouslySelectedEmptyTableRows): Replaced
CompositeEditCommand::removeNode() by removeNodeUpdatingStates().

LayoutTests:

* editing/deleting/insert-in-orphaned-selection-crash-expected.txt: Added.
* editing/deleting/insert-in-orphaned-selection-crash.html: Added.

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

9 months agoMake RemoteRealtimeVideoSource a RealtimeVideoCaptureSource
youenn@apple.com [Fri, 12 Feb 2021 10:54:32 +0000 (10:54 +0000)]
Make RemoteRealtimeVideoSource a RealtimeVideoCaptureSource
https://bugs.webkit.org/show_bug.cgi?id=221747

Reviewed by Eric Carlson.

Source/WebCore:

Introduce isVideoSource to be able to get presets data from RealtimeVideoSource.
Expose presets in RealtimeVideoSource for GPUProcess to send it to WebProcess.
Remove no longer used m_defaultSize member.
Update RealtimeVideoSource to set some of its members when its capture source is ready,
including settings, size, frame rate and name.
Covered by existing tests.

* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/RealtimeVideoCaptureSource.cpp:
(WebCore::RealtimeVideoCaptureSource::prepareToProduceData):
(WebCore::RealtimeVideoCaptureSource::presetsData):
* platform/mediastream/RealtimeVideoCaptureSource.h:
* platform/mediastream/RealtimeVideoSource.cpp:
(WebCore::RealtimeVideoSource::whenReady):
* platform/mediastream/RealtimeVideoSource.h:

Source/WebKit:

All capture video sources are now deriving from RealtimeVideoCaptureSource.
This allows to expose a RealtimeVideoSource that can handle changes of resolution and frame rate in software as needed.
This also allows to better align audio and video sources on iOS: there will only be one running source at any given time.
Covered by existing tests.

* Scripts/webkit/messages.py:
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
(WebKit::UserMediaCaptureManagerProxy::capabilities):
(WebKit::UserMediaCaptureManagerProxy::generatePresets):
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
* WebProcess/cocoa/RemoteRealtimeAudioSource.cpp:
(WebKit::RemoteRealtimeAudioSource::createRemoteMediaSource):
(WebKit::RemoteRealtimeAudioSource::setAsReady):
* WebProcess/cocoa/RemoteRealtimeVideoSource.cpp:
(WebKit::RemoteRealtimeVideoSource::create):
(WebKit::RemoteRealtimeVideoSource::RemoteRealtimeVideoSource):
(WebKit::RemoteRealtimeVideoSource::createRemoteMediaSource):
(WebKit::RemoteRealtimeVideoSource::setAsReady):
(WebKit::RemoteRealtimeVideoSource::remoteVideoSampleAvailable):
(WebKit::RemoteRealtimeVideoSource::setFrameRateWithPreset):
(WebKit::RemoteRealtimeVideoSource::prefersPreset):
(WebKit::RemoteRealtimeVideoSource::gpuProcessConnectionDidClose):
* WebProcess/cocoa/RemoteRealtimeVideoSource.h:
* WebProcess/cocoa/UserMediaCaptureManager.cpp:
(WebKit::UserMediaCaptureManager::VideoFactory::createVideoCaptureSource):
(WebKit::UserMediaCaptureManager::DisplayFactory::createDisplayCaptureSource):

LayoutTests:

* fast/mediastream/resources/getDisplayMedia-utils.js:
(async waitForHeight):
(async waitForWidth):
Updated to fail instead of timing out.
* fast/mediastream/resources/getUserMedia-helper.js:
Removing no longer needed code that made it impossible to run the tests in browser.

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

9 months agoNullopt crash in DOMSelection::getRangeAt
rniwa@webkit.org [Fri, 12 Feb 2021 09:38:18 +0000 (09:38 +0000)]
Nullopt crash in DOMSelection::getRangeAt
https://bugs.webkit.org/show_bug.cgi?id=221786

Reviewed by Darin Adler.

No new tests since we don't have any way to reproduce this crash.

* page/DOMSelection.cpp:
(WebCore::DOMSelection::getRangeAt): Added a nullopt check with an assertion.

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

9 months agoSource/WebCore:
said@apple.com [Fri, 12 Feb 2021 09:10:38 +0000 (09:10 +0000)]
Source/WebCore:
Make Pattern hold a NativeImage instead of an Image
https://bugs.webkit.org/show_bug.cgi?id=221637

Reviewed by Simon Fraser.

This will make caching the Pattern data in the GPUP straightforward since
all we need is to cache the NativeImage and encode the pattern data.

* html/canvas/CanvasPattern.cpp:
(WebCore::CanvasPattern::create):
(WebCore::CanvasPattern::CanvasPattern):
* html/canvas/CanvasPattern.h:
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::createPattern):
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::buildArrayForCanvasPattern):
Extract a NativeImage of an Image. The platform Patterns deal with
NativeImages only.

* platform/graphics/Image.h:
Remove ImageHandle.

* platform/graphics/Pattern.cpp:
(WebCore::Pattern::create):
(WebCore::Pattern::Pattern):
(WebCore::Pattern::setPatternSpaceTransform):
* platform/graphics/Pattern.h:
(WebCore::Pattern::Parameters::encode const):
(WebCore::Pattern::Parameters::decode):
(WebCore::Pattern::encode const): Deleted.
(WebCore::Pattern::decode): Deleted.
Make the new struct 'Parameters' holds all the members other than the
NativeImage. This struct + RenderingResourceIdentifer of the NativeImage
will be recorded for the strokePattern and the fillPattern.

* platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::FillSource::FillSource):
* platform/graphics/cairo/PatternCairo.cpp:
(WebCore::Pattern::createPlatformPattern const):
* platform/graphics/cg/PatternCG.cpp:
(WebCore::Pattern::createPlatformPattern const):
The platform Pattern deals only with NativeImages.

* platform/graphics/displaylists/DisplayList.cpp:
(WebCore::DisplayList::DisplayList::shouldDumpForFlags):
SetState::state() is renamed to SetStateItem::stateChange() since it
returns GraphicsContextStateChange.

* platform/graphics/displaylists/DisplayListItemBuffer.cpp:
(WebCore::DisplayList::ItemHandle::apply):
SetState::apply() has to be a special case.

* platform/graphics/displaylists/DisplayListItems.cpp:
(WebCore::DisplayList::SetState::SetState):
(WebCore::DisplayList::SetState::apply):
(WebCore::DisplayList::operator<<):
(WebCore::DisplayList::SetState::apply const): Deleted.
Add a new constructor for SetState to be used by the decoder. All the
members of GraphicsContextStateChange will be copied but strokePattern
and fillPattern will be created only when their NativeImages are resolved
in the SetState::apply().

* platform/graphics/displaylists/DisplayListItems.h:
(WebCore::DisplayList::SetState::stateChange const):
(WebCore::DisplayList::SetState::strokePatternParameters const):
(WebCore::DisplayList::SetState::fillPatternParameters const):
(WebCore::DisplayList::SetState::strokePatternImageIdentifier const):
(WebCore::DisplayList::SetState::fillPatternImageIdentifier const):
(WebCore::DisplayList::SetState::encode const):
(WebCore::DisplayList::SetState::decode):
(WebCore::DisplayList::SetState::state const): Deleted.
Specialize the encode and the decoding of strokePattern and fillPattern
by using the Pattern::Parameters and the RenderingResourceIdentifer of
the NativeImage.

* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::cacheNativeImage):
(WebCore::DisplayList::Recorder::appendStateChangeItem):
(WebCore::DisplayList::Recorder::drawNativeImage):
(WebCore::DisplayList::Recorder::drawPattern):
* platform/graphics/displaylists/DisplayListRecorder.h:
Cache the NativeImages of strokePattern and fillPattern.

* platform/graphics/displaylists/DisplayListReplayer.cpp:
(WebCore::DisplayList::applySetStateItem):
(WebCore::DisplayList::Replayer::applyItem):
Resolve the NativeImages of strokePattern and fillPattern from the cached
NativeImages.

* platform/graphics/filters/FETile.cpp:
(WebCore::FETile::platformApplySoftware):
* rendering/RenderLayerBacking.cpp:
(WebCore::patternForDescription):
* rendering/svg/RenderSVGResourcePattern.cpp:
(WebCore::RenderSVGResourcePattern::buildPattern):
Patterns should be created with NativeImages.

Source/WebKit:
Make Pattern hold a NativeImage instead of an Image
https://bugs.webkit.org/show_bug.cgi?id=221637

Reviewed by Simon Fraser.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<ImageHandle>::encode): Deleted.
(IPC::ArgumentCoder<ImageHandle>::decode): Deleted.
* Shared/WebCoreArgumentCoders.h:
Delete the encoding and decoding of Image since it is not used anymore

LayoutTests:
[GPU Process] Implement SetState DisplayList item
https://bugs.webkit.org/show_bug.cgi?id=219468

Reviewed by Simon Fraser.

* gpu-process/TestExpectations:
Unmark tests that are no longer crash.

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

9 months agoIncrease network layout resource load priority for prioritized loads
antti@apple.com [Fri, 12 Feb 2021 08:32:11 +0000 (08:32 +0000)]
Increase network layout resource load priority for prioritized loads
https://bugs.webkit.org/show_bug.cgi?id=221751

Reviewed by Geoffrey Garen.

Currently visibility based prioritization only affects resource load scheduler.
We should increase the priority passed to the network layer and so the server too.

* NetworkProcess/NetworkDataTask.h:
(WebKit::NetworkDataTask::setPriority):
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::reprioritizeRequest):
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkLoadScheduler.cpp:
(WebKit::NetworkLoadScheduler::HostContext::shouldDelayLowPriority const):
(WebKit::NetworkLoadScheduler::HostContext::schedule):
(WebKit::NetworkLoadScheduler::HostContext::unschedule):
(WebKit::NetworkLoadScheduler::HostContext::prioritize):
* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::setPriority):

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

9 months agodrawGlyphs() should take a Glyph* and an Advance* instead of a GlyphBuffer
mmaxfield@apple.com [Fri, 12 Feb 2021 06:53:17 +0000 (06:53 +0000)]
drawGlyphs() should take a Glyph* and an Advance* instead of a GlyphBuffer
https://bugs.webkit.org/show_bug.cgi?id=221765

Reviewed by Simon Fraser.

Making it take a GlyphBuffer is misleading because it only uses the glyph array and the advance array
from inside the GlyphBuffer. A GlyphBuffer also holds a bunch of extra data like glyph origins and an
initial advance. GlyphBuffers internally have a flatten() function which incorporate the origins into
the advances, and this flatten() function needs to have been called before calling drawGlyphs(). Our
code ASSERT()s this, and after the assertion, we shouldn't need the entire GlyphBuffer any more.

No new tests because there is no behavior change.

* platform/graphics/Font.cpp:
* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::drawGlyphBuffer const):
* platform/graphics/FontCascade.h:
* platform/graphics/GlyphBufferMembers.h:
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::drawGlyphs):
* platform/graphics/GraphicsContext.h:
* platform/graphics/GraphicsContextImpl.h:
* platform/graphics/cairo/GraphicsContextImplCairo.cpp:
(WebCore::GraphicsContextImplCairo::drawGlyphs):
* platform/graphics/cairo/FontCairo.cpp:
(WebCore::FontCascade::drawGlyphs):
* platform/graphics/cairo/GraphicsContextImplCairo.h:
* platform/graphics/coretext/FontCascadeCoreText.cpp:
(WebCore::FontCascade::drawGlyphs):
* platform/graphics/displaylists/DisplayListDrawGlyphsRecorder.h:
* platform/graphics/displaylists/DisplayListDrawGlyphsRecorderCoreText.cpp:
(WebCore::DisplayList::DrawGlyphsRecorder::drawGlyphs):
* platform/graphics/displaylists/DisplayListDrawGlyphsRecorderHarfBuzz.cpp:
(WebCore::DisplayList::DrawGlyphsRecorder::drawGlyphs):
* platform/graphics/displaylists/DisplayListDrawGlyphsRecorderWin.cpp:
(WebCore::DisplayList::DrawGlyphsRecorder::drawGlyphs):
* platform/graphics/displaylists/DisplayListItems.cpp:
(WebCore::DisplayList::DrawGlyphs::apply const):
(WebCore::DisplayList::DrawGlyphs::generateGlyphBuffer const): Deleted.
* platform/graphics/displaylists/DisplayListItems.h:
* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::drawGlyphs):
* platform/graphics/displaylists/DisplayListRecorder.h:
* platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp:
(Nicosia::CairoOperationRecorder::drawGlyphs):
* platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h:
* rendering/mathml/MathOperator.cpp:
(WebCore::MathOperator::paintGlyph):
(WebCore::MathOperator::paint):
* rendering/mathml/RenderMathMLToken.cpp:
(WebCore::RenderMathMLToken::paint):

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

9 months ago[WPE] event.ctrlKey and other are false in keydown event
rego@igalia.com [Fri, 12 Feb 2021 05:43:50 +0000 (05:43 +0000)]
[WPE] event.ctrlKey and other are false in keydown event
https://bugs.webkit.org/show_bug.cgi?id=221760

Reviewed by Adrian Perez de Castro.

Source/WebKit:

This is the same issue that was fixed for WebKitGTK in r272489.

Test: fast/events/keyboardevent-modifier.html

* Shared/libwpe/WebEventFactory.cpp:
(WebKit::modifiersForEventModifiers):
(WebKit::modifiersForKeyboardEvent):
(WebKit::WebEventFactory::createWebKeyboardEvent):

LayoutTests:

* platform/wpe/TestExpectations: The test passes now.

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

9 months ago[LFC][Integration] The root box's display type should stay Display::Block
zalan@apple.com [Fri, 12 Feb 2021 05:12:51 +0000 (05:12 +0000)]
[LFC][Integration] The root box's display type should stay Display::Block
https://bugs.webkit.org/show_bug.cgi?id=221801

Reviewed by Antti Koivisto.

* layout/integration/LayoutIntegrationBoxTree.cpp:
(WebCore::LayoutIntegration::BoxTree::updateStyle):

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

9 months agoUnreviewed build fix after r272758; include missing change to RuntimeEnabledFeatures.
jer.noble@apple.com [Fri, 12 Feb 2021 03:24:52 +0000 (03:24 +0000)]
Unreviewed build fix after r272758; include missing change to RuntimeEnabledFeatures.

* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setOpusDecoderEnabled):
(WebCore::RuntimeEnabledFeatures::opusDecoderEnabled const):

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

9 months agoWeb Inspector: "Show Extended Gridlines" option for grid overlay does not work
nvasilyev@apple.com [Fri, 12 Feb 2021 02:56:51 +0000 (02:56 +0000)]
Web Inspector: "Show Extended Gridlines" option for grid overlay does not work
https://bugs.webkit.org/show_bug.cgi?id=221775

Reviewed by Devin Rousso.

Replace all mentions of "Gridlines" with "GridLines" (camelcase).

Source/JavaScriptCore:

* inspector/protocol/DOM.json:

Source/WebCore:

* inspector/InspectorOverlay.h:
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::showGridOverlay):
* inspector/agents/InspectorDOMAgent.h:

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

9 months agoREGRESSION(r272293) WebGL 1.0.2 test expectations say HTTPS
commit-queue@webkit.org [Fri, 12 Feb 2021 02:19:42 +0000 (02:19 +0000)]
REGRESSION(r272293) WebGL 1.0.2 test expectations say HTTPS
https://bugs.webkit.org/show_bug.cgi?id=221774
<rdar://problem/74149867>

Patch by Alex Christensen <achristensen@webkit.org> on 2021-02-11
Reviewed by Geoff Garen.

Source/WebCore:

www.opengl.org is in the list of hosts that support HTTPS, which affected our test expectations.
Since we need a domain to test with anyways for bug 221591, we may as well use this one.

* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::makeSecureIfNecessary):

LayoutTests:

* http/tests/contentextensions/make-https-expected.txt:
* http/tests/webgl/1.0.2/origin-clean-conformance-expected.txt:
* http/tests/webgl/1.0.2/readPixelsBadArgs-expected.txt:

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

9 months agoCodeBlock::propagateTransitions() should also handle OpSetPrivateBrand's LLInt IC.
mark.lam@apple.com [Fri, 12 Feb 2021 02:14:03 +0000 (02:14 +0000)]
CodeBlock::propagateTransitions() should also handle OpSetPrivateBrand's LLInt IC.
https://bugs.webkit.org/show_bug.cgi?id=221787

Reviewed by Yusuke Suzuki.

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

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

9 months agoMake WebKitLegacy.CrossPartitionFileSchemeAccess stop timing out on EWS bots
achristensen@apple.com [Fri, 12 Feb 2021 02:08:08 +0000 (02:08 +0000)]
Make WebKitLegacy.CrossPartitionFileSchemeAccess stop timing out on EWS bots
https://bugs.webkit.org/show_bug.cgi?id=206956

* TestWebKitAPI/Tests/mac/CrossPartitionFileSchemeAccess.mm:
This test times out sometimes, but only on bots. Let's kick the can down the road.

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

9 months agoUnreviewed, reverting r272603.
achristensen@apple.com [Fri, 12 Feb 2021 02:03:48 +0000 (02:03 +0000)]
Unreviewed, reverting r272603.

Broke test, has room for improvement

Reverted changeset:

"Synthesize range responses if needed in WebCoreNSURLSession"
https://bugs.webkit.org/show_bug.cgi?id=221072
https://trac.webkit.org/changeset/272603

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

9 months ago[Python-3] Update pylint version
don.olmstead@sony.com [Fri, 12 Feb 2021 01:56:37 +0000 (01:56 +0000)]
[Python-3] Update pylint version
https://bugs.webkit.org/show_bug.cgi?id=221785

Reviewed by Jonathan Bedard.

Update pylint on Python 3 to version 2.6.0 which supports >=3.5.

Update pylint on Python 2.7 to the last 0.x version, 0.28.0. The logilab packages are
specific to this version only so they are moved into the block.

* Scripts/webkitpy/__init__.py:

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

9 months agoTools:
jbedard@apple.com [Fri, 12 Feb 2021 01:24:44 +0000 (01:24 +0000)]
Tools:
[run-webkit-tests] Update PHP module configuration
https://bugs.webkit.org/show_bug.cgi?id=221776
<rdar://problem/74248860>

Reviewed by Alexey Proskuryakov.

* Scripts/webkitpy/layout_tests/servers/apache_http_server.py:
(LayoutTestApacheHttpd.__init__): Optionally exclude PHP init directory.
* Scripts/webkitpy/port/base.py:
(Port._darwin_php_version): Add -x version.

LayoutTests:
       [run-webkit-tests] Update PHP module configuration
https://bugs.webkit.org/show_bug.cgi?id=221776
<rdar://problem/74248860>

Reviewed by Alexey Proskuryakov.

* http/conf/apache2.4-x-httpd.conf: Added.

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

9 months ago[WPE] Fix WPEQt tests after r272707
lmoura@igalia.com [Fri, 12 Feb 2021 01:18:29 +0000 (01:18 +0000)]
[WPE] Fix WPEQt tests after r272707
https://bugs.webkit.org/show_bug.cgi?id=220681

Reviewed by Carlos Garcia Campos.

Setting the title became async, so we must wait for it to be
processed.

Same patch as r271578, reapplying after original change was reapplied
in r272707.

* TestWebKitAPI/Tests/WPEQt/TestLoad.cpp:
(TestLoad::main):
* TestWebKitAPI/Tests/WPEQt/TestLoadHtml.cpp:
(TestLoadHtml::main):
* TestWebKitAPI/Tests/WPEQt/TestLoadRequest.cpp:
(TestLoadRequest::main):
* TestWebKitAPI/Tests/WPEQt/TestRunJavaScript.cpp:
(TestRunJavaScript::main):

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

9 months agoReview usage of adoptNS()
cdumez@apple.com [Fri, 12 Feb 2021 00:48:45 +0000 (00:48 +0000)]
Review usage of adoptNS()
https://bugs.webkit.org/show_bug.cgi?id=221779

Reviewed by Alex Christensen.

Review usage of adoptNS():
1. Make sure we call adoptNS() as soon as we allocate the object instead of doing it later on, as this is less error-prone
2. Fix cases where we called adoptNS() but really should have retained instead of adopting

Source/WebCore:

* platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
(WebCore::PlatformCAFilters::filterValueForOperation):
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(WebCore::PlatformCALayerCocoa::addAnimationForKey):
* platform/mediarecorder/cocoa/AudioSampleBufferCompressor.mm:
(WebCore::AudioSampleBufferCompressor::gradualDecoderRefreshCount):
* platform/network/cocoa/ResourceRequestCocoa.mm:
(WebCore::ResourceRequest::doUpdatePlatformRequest):
(WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
* platform/text/cocoa/LocaleCocoa.mm:
(WebCore::createDateTimeFormatter):
* testing/Internals.mm:
(WebCore::Internals::encodedPreferenceValue):

Source/WebKit:

* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::makeNode):
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
(WebKit::RemoteLayerTreeHost::makeNode):

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

9 months ago[LFC][Integration] Add scrollable overflow support
zalan@apple.com [Fri, 12 Feb 2021 00:39:10 +0000 (00:39 +0000)]
[LFC][Integration] Add scrollable overflow support
https://bugs.webkit.org/show_bug.cgi?id=221777

Reviewed by Simon Fraser.

Normally inline level boxes stretch the line box with their margin box. However inline boxes
behave differently. They stretch the line box with their layout bounds (->glyph sizes)
and they contribute to scrollable overflow with their border boxes (note that vertical margin is ignored on inline boxes).
e.g <div><span style="padding: 100px">text</span></div>
^^ the line will not be stretched to include the 200px vertical padding, but instead the padding is added to the scrollable overflow area.
(see fast/inline/inline-content-with-padding-left-right.html)

* layout/integration/LayoutIntegrationInlineContentBuilder.cpp:
(WebCore::LayoutIntegration::InlineContentBuilder::build const):
(WebCore::LayoutIntegration::InlineContentBuilder::createDisplayLines const):

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

9 months ago[Mac] Add Experimental Opus Codec support
jer.noble@apple.com [Fri, 12 Feb 2021 00:08:36 +0000 (00:08 +0000)]
[Mac] Add Experimental Opus Codec support
https://bugs.webkit.org/show_bug.cgi?id=221745

Reviewed by Eric Carlson.

Source/ThirdParty/libwebrtc:

Copy libopus headers into the libwebrtc header directory.

* libwebrtc.xcodeproj/project.pbxproj:

Source/WebCore:

Add support for the Opus Codec in a WebM container by parsing the Opus private
codec data into a CoreAudio-specific magic cookie, and using that cookie to
initialize an AudioFormatDescription necessary to instantiate the CoreAudio
Opus decoder.

This magic cookie requires information both from the private codec data, but
also requires information parsed directly from the stream itself; update the
createOpusAudioFormatDescription() to take frame data as well as cookie data.

* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::opusDecoderEnabled):
(WebCore::PlatformMediaSessionManager::setOpusDecoderEnabled):
* platform/audio/PlatformMediaSessionManager.h:
* platform/graphics/cocoa/SourceBufferParserWebM.cpp:
(WebCore::SourceBufferParserWebM::AudioTrackData::consumeFrameData):
* platform/graphics/cocoa/WebMAudioUtilitiesCocoa.h:
* platform/graphics/cocoa/WebMAudioUtilitiesCocoa.mm:
(WebCore::createAudioFormatDescriptionForFormat):
(WebCore::opusConfigToFrameDuration):
(WebCore::opusConfigToBandwidth):
(WebCore::cookieFromOpusCodecPrivate):
(WebCore::isOpusDecoderAvailable):
(WebCore::createOpusAudioFormatDescription):
(WebCore::createVorbisAudioFormatDescription):

Source/WebKit:

* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):

Source/WTF:

Add a new experimental feature setting, disabled by default, controlling whether to
enable parsing of Opus tracks from WebM files.

* Scripts/Preferences/WebPreferencesExperimental.yaml:
* wtf/PlatformEnableCocoa.h:

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

9 months agoUnreviewed, reverting r270578.
said@apple.com [Thu, 11 Feb 2021 23:30:57 +0000 (23:30 +0000)]
Unreviewed, reverting r270578.
https://bugs.webkit.org/show_bug.cgi?id=221110

Caused incorrect image layout inside a flexbox container.

LayoutTests/imported/w3c:

* web-platform-tests/css/css-flexbox/flex-aspect-ratio-img-row-013-expected.txt:
* web-platform-tests/css/css-flexbox/image-as-flexitem-size-003-expected.txt:
* web-platform-tests/css/css-flexbox/image-as-flexitem-size-003v-expected.txt:
* web-platform-tests/css/css-flexbox/image-as-flexitem-size-004-expected.txt:
* web-platform-tests/css/css-flexbox/image-as-flexitem-size-004v-expected.txt:

Source/WebCore:

* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::computeMainSizeFromAspectRatioUsing const):
(WebCore::RenderFlexibleBox::childCrossSizeIsDefinite const):

LayoutTests:

* TestExpectations:

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

9 months agoRemove unused WebKit::LocalStorageDatabaseTracker::deleteAllDatabases()
ddkilzer@apple.com [Thu, 11 Feb 2021 22:57:34 +0000 (22:57 +0000)]
Remove unused WebKit::LocalStorageDatabaseTracker::deleteAllDatabases()
<https://webkit.org/b/221734>
<rdar://problem/74215959>

Reviewed by Alexey Proskuryakov.

* NetworkProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
(WebKit::LocalStorageDatabaseTracker::deleteAllDatabases): Delete.
* NetworkProcess/WebStorage/LocalStorageDatabaseTracker.h:
(WebKit::LocalStorageDatabaseTracker::deleteAllDatabases): Delete.
- Remove this method since it's not used anywhere. This fixes a
  missing symbol linker error for
  WebCore::SQLiteFileSystem::deleteEmptyDatabaseDirectory() when
  building WebKit.framework with dead code stripping turned off
  since that method was not exported from WebCore.framework.

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

9 months ago[iOS][FCR] Add new picker for <select multiple> elements
akeerthi@apple.com [Thu, 11 Feb 2021 22:25:28 +0000 (22:25 +0000)]
[iOS][FCR] Add new picker for <select multiple> elements
https://bugs.webkit.org/show_bug.cgi?id=221636
<rdar://problem/72399337>

Reviewed by Wenson Hsieh.

Source/WebKit:

Test: fast/forms/ios/form-control-refresh/select/select-multiple-picker.html

* UIProcess/ios/forms/WKFormSelectControl.mm:
(-[WKFormSelectControl initWithView:]):
* UIProcess/ios/forms/WKFormSelectPicker.h:
* UIProcess/ios/forms/WKFormSelectPicker.mm:
(-[WKSelectPickerTableViewController initWithView:]):

The new picker is a table view with style UITableStyleInsetGrouped.

(-[WKSelectPickerTableViewController viewWillAppear:]):

Enable/disable the next/previous accessory buttons accordingly.

(-[WKSelectPickerTableViewController numberOfRowsInGroup:]):
(-[WKSelectPickerTableViewController numberOfSectionsInTableView:]):

There will always be at least one section, to display the empty message.
Adding groups will add more sections to the table view.

(-[WKSelectPickerTableViewController tableView:numberOfRowsInSection:]):
(-[WKSelectPickerTableViewController tableView:heightForHeaderInSection:]):

The header for the first section is an inset matching table view inset.

(-[WKSelectPickerTableViewController tableView:heightForFooterInSection:]):

An empty first section should not have a footer if there are more sections
after it. This can occur when the first option belongs to a group.

(-[WKSelectPickerTableViewController tableView:titleForHeaderInSection:]):
(-[WKSelectPickerTableViewController tableView:viewForFooterInSection:]):

Return nil so that the footer height is obeyed.

(-[WKSelectPickerTableViewController tableView:viewForHeaderInSection:]):

The header view displays the group name along with a button to collapse
the section.

(-[WKSelectPickerTableViewController collapseSection:]):

Collapsing sections is implemented by removing the corresponding rows
from the data source. The button is animated by changing its transform.

(-[WKSelectPickerTableViewController findItemIndexAt:]):
(-[WKSelectPickerTableViewController optionItemAtIndexPath:]):
(-[WKSelectPickerTableViewController tableView:cellForRowAtIndexPath:]):
(-[WKSelectPickerTableViewController tableView:didSelectRowAtIndexPath:]):
(-[WKSelectPickerTableViewController next:]):
(-[WKSelectPickerTableViewController previous:]):
(-[WKSelectPickerTableViewController close:]):
(-[WKSelectMultiplePicker initWithView:]):
(-[WKSelectMultiplePicker configurePresentation]):

Display the picker as a half-sheet (that can be dragged up into a
fullscreen view) on iPhones, and as a popover on iPads.

(-[WKSelectMultiplePicker controlView]):
(-[WKSelectMultiplePicker controlBeginEditing]):
(-[WKSelectMultiplePicker controlEndEditing]):
(-[WKSelectMultiplePicker presentationControllerDidDismiss:]):
(-[WKSelectMultiplePicker _indexPathForRow:]):
(-[WKSelectMultiplePicker selectRow:inComponent:extendingSelection:]):

Added testing hook to support layout testing.

LayoutTests:

Added a test which selects options using the new multi-select picker.
Grouped, ungrouped, and disabled options are all tested.

* fast/forms/ios/form-control-refresh/select/select-multiple-picker-expected.txt: Added.
* fast/forms/ios/form-control-refresh/select/select-multiple-picker.html: Added.

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

9 months agoReduce string copies when converting from NSString/CFStringRef to WTF::String
commit-queue@webkit.org [Thu, 11 Feb 2021 22:24:00 +0000 (22:24 +0000)]
Reduce string copies when converting from NSString/CFStringRef to WTF::String
https://bugs.webkit.org/show_bug.cgi?id=221766

Patch by Alex Christensen <achristensen@webkit.org> on 2021-02-11
Reviewed by Geoff Garen.

This reduces the string copies from two to one which should speed up many things.
The cost is that for non-Latin1-encodable strings of length less than 1024, we now do an allocation
and a reallocation, whereas before we were doing just one allocation.  I think even in this case, though,
the cost of a reallocation should be comparable to the cost of doing a double string copy,
and the benefit of reducing a string copy everywhere is compelling.

I also reduced duplicate code by combining the CF and NS implementations.

* wtf/text/WTFString.h:
* wtf/text/cf/StringCF.cpp:
(WTF::String::String):
* wtf/text/cocoa/StringCocoa.mm:
(WTF::String::String): Deleted.

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

9 months ago[webkitpy] Use commits.webkit.org instead of trac
jbedard@apple.com [Thu, 11 Feb 2021 22:22:49 +0000 (22:22 +0000)]
[webkitpy] Use commits.webkit.org instead of trac
https://bugs.webkit.org/show_bug.cgi?id=221764
<rdar://problem/74242815>

Reviewed by Aakash Jain.

* Scripts/webkitpy/common/config/urls.py:
(view_revision_url):
* Scripts/webkitpy/tool/commands/download_unittest.py:
* Scripts/webkitpy/tool/commands/upload_unittest.py:
* Scripts/webkitpy/tool/steps/closebugforlanddiff_unittest.py:
(CloseBugForLandDiffTest.test_empty_state):
* Scripts/webkitpy/tool/steps/commit_unittest.py:
(CommitTest._test_check_test_expectations):
* Scripts/webkitpy/tool/steps/preparechangelogforrevert_unittest.py:
(UpdateChangeLogsForRevertTest):

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

9 months ago[GPUP] <audio> won't load when URL ends with .php causing some tests to time out
cdumez@apple.com [Thu, 11 Feb 2021 22:05:29 +0000 (22:05 +0000)]
[GPUP] <audio> won't load when URL ends with .php causing some tests to time out
https://bugs.webkit.org/show_bug.cgi?id=221695

Reviewed by Eric Carlson.

Source/WebCore:

No new tests, covered by unskipped layout tests.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerEngineUpdated):
(WebCore::HTMLMediaElement::mediaPlayerDidInitializeMediaEngine):
We were calling HTMLMediaElement::audioSourceProvider() in mediaPlayerEngineUpdated() which
happens right after we've constructed the MediaPlayerPrivate but before we've called
load() on the MediaPlayerPrivate. The issue was that calling audioSourceProvider() would
initialize the AudioSourceProvider and end up sending the RemoteMediaPlayerProxy::CreateAudioSourceProvider
IPC to the GPUProcess. RemoteMediaPlayerProxy::createAudioSourceProvider() would return early
because m_player->audioSourceProvider() returns null. The reason m_player->audioSourceProvider()
returns null is because it's MediaPlayerPrivate is still a NullMediaPlayerPrivate, because
MediaPlayer::load() has not been called in the GPUProcess yet. For this reason, I moved the
audioSourceProvider() initialization from mediaPlayerEngineUpdated() to
mediaPlayerDidInitializeMediaEngine(). mediaPlayerDidInitializeMediaEngine() happens right
after we've called MediaPlayerPrivate::load() which will end up calling MediaPlayer::load()
in the GPUProcess.

* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::loadWithNextMediaEngine):
Pass an empty ContentType to MediaPlayerPrivate::load() when we did not have a content type
but guessed one based on the extension. This ends up getting passed to the MediaPlayer
in the GPUProcess and it is important it knows it does not have a content type so that
it can guess one from the extension and try the next media engine if it cannot find one.

LayoutTests:

Unskip tests that are no longer timing out.

* gpu-process/TestExpectations:

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

9 months ago[iOS] Some checkboxes and radio buttons are clipped on top
akeerthi@apple.com [Thu, 11 Feb 2021 21:57:38 +0000 (21:57 +0000)]
[iOS] Some checkboxes and radio buttons are clipped on top
https://bugs.webkit.org/show_bug.cgi?id=221736
<rdar://problem/73956812>

Reviewed by Simon Fraser.

Source/WebCore:

The clipping occurs due to integral rounding of the paint rect in
both RenderBox::paintBoxDecorations, as well as using the integral
rect in RenderTheme::paint. To fix, use FloatRect and the device
pixel snapped rect when painting these elements.

Tests: fast/forms/ios/form-control-refresh/checkbox/subpixel-clipping.html
       fast/forms/ios/form-control-refresh/radio/subpixel-clipping.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::paintBoxDecorations):

Moved into RenderTheme to avoid duplication.

* rendering/RenderElement.cpp:
(WebCore::RenderElement::paintOutline):

Moved into RenderTheme to avoid duplication.

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

Use the device pixel snapped rect when painting checkboxes and radio
buttons.

* rendering/RenderTheme.h:
(WebCore::RenderTheme::adjustedPaintRect):

On most platforms, no adjustment is performed.

(WebCore::RenderTheme::paintCheckbox):
(WebCore::RenderTheme::paintRadio):
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::adjustedPaintRect):

On iOS, radio buttons and checkboxes always have a square painting
rect. Updated to use FloatRect, rather than IntRect, to avoid
clipping.

(WebCore::RenderThemeIOS::paintCheckbox):
(WebCore::RenderThemeIOS::paintRadio):
* rendering/RenderThemeWin.h:

LayoutTests:

Added reference mismatch tests to verify that the clipping no longer
occurs. The tests work by drawing an overlay smaller than the actual
size of the checkbox/radio input. If the input is clipped, only the
overlay will be visible, matching the "-expected-mismatch.html".
However, if the input is drawn correctly, the overlay will not cover
the entire input, and a mismatch will occur.

* fast/forms/ios/form-control-refresh/checkbox/subpixel-clipping-expected-mismatch.html: Added.
* fast/forms/ios/form-control-refresh/checkbox/subpixel-clipping.html: Added.
* fast/forms/ios/form-control-refresh/radio/subpixel-clipping-expected-mismatch.html: Added.
* fast/forms/ios/form-control-refresh/radio/subpixel-clipping.html: Added.

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

9 months ago[Cocoa][GPUP] Move RemoteCommandListener into the GPU Process
jer.noble@apple.com [Thu, 11 Feb 2021 21:49:12 +0000 (21:49 +0000)]
[Cocoa][GPUP] Move RemoteCommandListener into the GPU Process
https://bugs.webkit.org/show_bug.cgi?id=221732

Reviewed by Eric Carlson.

Source/WebCore:

Refactor RemoteCommandListener to allow its methods to work over XPC:

- Rather than having a synchronous client method to query whether seeking is
  supported, require clients to set seekability explicitly.
- Change the RemoteCommandArgument from a union to an Optional<double>.
- Allow clients to query the MediaPlaybackTarget through the session rather
  than wait for a notification that the playback target changed.

Additionally, add a mini-factory functionality to RemoteCommandListener to allow
clients to specify a different subclass to be created at runtime.

* Modules/webaudio/AudioContext.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::didReceiveRemoteControlCommand):
* html/HTMLMediaElement.h:
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::didReceiveRemoteControlCommand):
* html/MediaElementSession.h:
* platform/NowPlayingManager.cpp:
(WebCore::NowPlayingManager::didReceiveRemoteControlCommand):
(WebCore::NowPlayingManager::setNowPlayingInfo):
(WebCore::NowPlayingManager::supportsSeeking const): Deleted.
* platform/NowPlayingManager.h:
* platform/RemoteCommandListener.cpp:
(WebCore::remoteCommandListenerCreationFunction):
(WebCore::RemoteCommandListener::setCreationFunction):
(WebCore::RemoteCommandListener::resetCreationFunction):
(WebCore::RemoteCommandListener::create):
(WebCore::RemoteCommandListener::RemoteCommandListener):
(WebCore::RemoteCommandListener::setSupportsSeeking):
* platform/RemoteCommandListener.h:
(WebCore::RemoteCommandListener::RemoteCommandListener): Deleted.
(WebCore::RemoteCommandListener::updateSupportedCommands): Deleted.
(WebCore::RemoteCommandListener::client const): Deleted.
* platform/audio/PlatformMediaSession.cpp:
(WebCore::PlatformMediaSession::didReceiveRemoteControlCommand):
* platform/audio/PlatformMediaSession.h:
* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::processDidReceiveRemoteControlCommand):
* platform/audio/PlatformMediaSessionManager.h:
* platform/audio/cocoa/MediaSessionManagerCocoa.h:
* platform/audio/cocoa/MediaSessionManagerCocoa.mm:
(WebCore::MediaSessionManagerCocoa::scheduleSessionStatusUpdate):
* platform/audio/ios/MediaSessionHelperIOS.h:
* platform/audio/ios/MediaSessionHelperIOS.mm:
(MediaSessionHelperiOS::activeVideoRouteDidChange):
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::sessionWillBeginPlayback):
* platform/ios/RemoteCommandListenerIOS.h:
* platform/ios/RemoteCommandListenerIOS.mm:
(WebCore::RemoteCommandListenerIOS::create):
(WebCore::RemoteCommandListenerIOS::RemoteCommandListenerIOS):
(WebCore::RemoteCommandListenerIOS::updateSupportedCommands):
(WebCore::RemoteCommandListener::create): Deleted.
* platform/mac/RemoteCommandListenerMac.h:
* platform/mac/RemoteCommandListenerMac.mm:
(WebCore::RemoteCommandListenerMac::create):
(WebCore::RemoteCommandListenerMac::updateSupportedCommands):
(WebCore::RemoteCommandListenerMac::RemoteCommandListenerMac):
(WebCore::RemoteCommandListener::create): Deleted.
* testing/Internals.cpp:
(WebCore::Internals::postRemoteControlCommand):

Source/WebKit:

Add a new Remote/Proxy class pair to facilitate RemoteCommandListener being
created in the GPU Process.

* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* GPUProcess/GPUConnectionToWebProcess.cpp:
(WebKit::GPUConnectionToWebProcess::createRemoteCommandListener):
(WebKit::GPUConnectionToWebProcess::releaseRemoteCommandListener):
* GPUProcess/GPUConnectionToWebProcess.h:
* GPUProcess/GPUConnectionToWebProcess.messages.in:
* GPUProcess/media/RemoteRemoteCommandListenerProxy.cpp:
(WebKit::RemoteRemoteCommandListenerProxy::RemoteRemoteCommandListenerProxy):
(WebKit::RemoteRemoteCommandListenerProxy::didReceiveRemoteControlCommand):
(WebKit::RemoteRemoteCommandListenerProxy::updateSupportedCommands):
* GPUProcess/media/RemoteRemoteCommandListenerProxy.h:
* GPUProcess/media/RemoteRemoteCommandListenerProxy.messages.in:
* Scripts/webkit/messages.py:
* Sources.txt:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/GPU/GPUProcessConnection.cpp:
(WebKit::GPUProcessConnection::didReceiveRemoteCommand):
* WebProcess/GPU/media/RemoteRemoteCommandListener.cpp: Added.
(WebKit::RemoteRemoteCommandListener::create):
(WebKit::RemoteRemoteCommandListener::RemoteRemoteCommandListener):
(WebKit::RemoteRemoteCommandListener::~RemoteRemoteCommandListener):
(WebKit::RemoteRemoteCommandListener::gpuProcessConnectionDidClose):
(WebKit::RemoteRemoteCommandListener::didReceiveRemoteControlCommand):
* WebProcess/GPU/media/RemoteRemoteCommandListener.h:
* WebProcess/GPU/media/RemoteRemoteCommandListener.messages.in:
* WebProcess/GPU/media/RemoteRemoteCommandListenerIdentifier.h:
* WebProcess/GPU/media/ios/RemoteMediaSessionHelper.cpp:
(WebKit::RemoteMediaSessionHelper::activeVideoRouteDidChange):
* WebProcess/GPU/webrtc/MediaRecorderPrivate.cpp:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::setUseGPUProcessForMedia):

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

9 months agoSetIntegrityLevel should call [[DefineOwnProperty]] with partial descriptor
shvaikalesh@gmail.com [Thu, 11 Feb 2021 21:38:10 +0000 (21:38 +0000)]
SetIntegrityLevel should call [[DefineOwnProperty]] with partial descriptor
https://bugs.webkit.org/show_bug.cgi?id=221497

Reviewed by Yusuke Suzuki.

JSTests:

* stress/arguments-define-property-throws-out-of-memory.js: Added.
* stress/freeze-invokes-out-of-memory.js: Removed.
* stress/object-freeze-with-arguments-no-oom-error.js: Added.
* stress/object-freeze-with-proxy-defineProperty.js: Added.

Source/JavaScriptCore:

This patch prevents [[GetOwnProperty]] result descriptor from being reused for
[[DefineOwnProperty]]. Instead, partial descriptor with only [[Configurable]]
and (conditionally) [[Writable]] fields is passed, which is observable by
ProxyObject's "defineProperty" trap (and possibly any other opaque object).

Also, replaces isDataDescriptor() check with negated isAccessorDescriptor()
as per spec [1], which is equivalent in this case yet is false dichotomy
for partial descriptors.

Aligns JSC with V8 and SpiderMonkey.

[1]: https://tc39.es/ecma262/#sec-setintegritylevel (step 7.b.ii)

* runtime/ObjectConstructor.cpp:
(JSC::setIntegrityLevel):

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

9 months agoUse a template to simplify repetitive code in ColorSpaceCG.cpp
darin@apple.com [Thu, 11 Feb 2021 21:34:08 +0000 (21:34 +0000)]
Use a template to simplify repetitive code in ColorSpaceCG.cpp
https://bugs.webkit.org/show_bug.cgi?id=221770

Reviewed by Sam Weinig.

* platform/graphics/cg/ColorSpaceCG.cpp:
(WebCore::namedColorSpace): Added.
(WebCore::sRGBColorSpaceRef): Use namedColorSpace. Also took out long-obsolete
workaround for a bug in pre-2013 versions of Core Graphics on Windows.
(WebCore::adobeRGB1998ColorSpaceRef): Ditto.
(WebCore::displayP3ColorSpaceRef): Ditto.
(WebCore::extendedSRGBColorSpaceRef): Ditto.
(WebCore::ITUR_2020ColorSpaceRef): Ditto.
(WebCore::linearSRGBColorSpaceRef): Ditto.
(WebCore::ROMMRGBColorSpaceRef): Ditto.
(WebCore::xyzColorSpaceRef): Ditto.

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

9 months ago[ MacOS Debug wk2] imported/w3c/web-platform-tests/worklets/animation-worklet-service...
cdumez@apple.com [Thu, 11 Feb 2021 21:33:19 +0000 (21:33 +0000)]
[ MacOS Debug wk2] imported/w3c/web-platform-tests/worklets/animation-worklet-service-worker-interception.https.html is a flakey text failure
https://bugs.webkit.org/show_bug.cgi?id=221731
<rdar://problem/74213595>

Unreviewed, skip animation & layout worklets tests since we do not support those and it is
causing those tests to be flaky.

LayoutTests/imported/w3c:

* web-platform-tests/worklets/animation-worklet-service-worker-interception.https-expected.txt:

LayoutTests:

* TestExpectations:

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

9 months ago[Cocoa] IPC decoder is using decoded size to allocate memory for an array
darin@apple.com [Thu, 11 Feb 2021 21:30:31 +0000 (21:30 +0000)]
[Cocoa] IPC decoder is using decoded size to allocate memory for an array
https://bugs.webkit.org/show_bug.cgi?id=221773

Reviewed by Geoffrey Garen.

* Shared/Cocoa/ArgumentCodersCocoa.mm:
(IPC::decodeArrayInternal): As with other similar structures, such a Vector and
CFArray, don't use the size to preallocate space when decoding an NSArray. The
decoded size is potentially incorrect, which we will discover indirectly when
decoding the array elements; we can't safely use the size to make a choice about
allocating memory beforehand.

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

9 months agobuild.webkit.org should display commit identifier in builds
aakash_jain@apple.com [Thu, 11 Feb 2021 19:59:28 +0000 (19:59 +0000)]
build.webkit.org should display commit identifier in builds
https://bugs.webkit.org/show_bug.cgi?id=221730

Reviewed by Jonathan Bedard.

* CISupport/build-webkit-org/steps.py:
(ExtractTestResults.finished):
(ShowIdentifier): build-step to show commit identifier.
(ShowIdentifier.__init__):
(ShowIdentifier.start):
(ShowIdentifier.evaluateCommand):
(ShowIdentifier.getLastBuildStepByName):
(ShowIdentifier.url_for_identifier):
(ShowIdentifier.getResultSummary): Display custom failure message.
(ShowIdentifier.hideStepIf): Hide this step if successful.
* CISupport/build-webkit-org/steps_unittest.py:
(BuildStepMixinAdditions.executedSteps): filter wasn't working as expected with python 3, replaced
with list comprehension.
(TestShowIdentifier): Added unit-tests.
(TestShowIdentifier.test_success):
(TestShowIdentifier.test_failure):
* CISupport/build-webkit-org/factories.py: Added ShowIdentifier build step.

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

9 months agoscroll-snap demo should use new spec
commit-queue@webkit.org [Thu, 11 Feb 2021 19:33:25 +0000 (19:33 +0000)]
scroll-snap demo should use new spec
https://bugs.webkit.org/show_bug.cgi?id=184046

Patch by Martin Robinson <mrobinson@igalia.com> on 2021-02-11
Reviewed by Wenson Hsieh.

Update the scroll-snap demo to reflect the modern specification. This
demo isn't currently linked from the site, but if it's every linked again
it will now reflect the current specification.

This maintains the old CSS so that the demo continues to work with
old versions of Safari.

* demos/scroll-snap/index.html: Update the descriptions in the demo to reflect
the newest version of the specification.

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

9 months ago[macOS] Add telemetry for a likely-unused call to ipc-posix-shm-read-data
bfulgham@apple.com [Thu, 11 Feb 2021 19:23:15 +0000 (19:23 +0000)]
[macOS] Add telemetry for a likely-unused call to ipc-posix-shm-read-data
https://bugs.webkit.org/show_bug.cgi?id=221733
<rdar://problem/74214692>

Reviewed by Per Arne Vollan.

Add telemetry to confirm this is unsed.

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

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

9 months ago[iOS][FCR] Range inputs have an incorrect RTL appearance
akeerthi@apple.com [Thu, 11 Feb 2021 19:17:11 +0000 (19:17 +0000)]
[iOS][FCR] Range inputs have an incorrect RTL appearance
https://bugs.webkit.org/show_bug.cgi?id=221758
<rdar://problem/74236993>

Reviewed by Wenson Hsieh.

Source/WebCore:

Test: fast/forms/ios/form-control-refresh/range/rtl-appearance.html

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

In a right-to-left appearance, the track should begin filling from
the right.

LayoutTests:

Added a reference mismatch test to verify that a range input with
dir="rtl" has a distinct appearance from a standard range input.

* fast/forms/ios/form-control-refresh/range/rtl-appearance-expected-mismatch.html: Added.
* fast/forms/ios/form-control-refresh/range/rtl-appearance.html: Added.

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

9 months agoWeb Inspector: Grid section in Layout panel gets out of sync with grid overlay after...
commit-queue@webkit.org [Thu, 11 Feb 2021 19:12:17 +0000 (19:12 +0000)]
Web Inspector: Grid section in Layout panel gets out of sync with grid overlay after reopening Web Inspector
https://bugs.webkit.org/show_bug.cgi?id=221728
<rdar://problem/74212444>

Patch by Razvan Caliman <rcaliman@apple.com> on 2021-02-11
Reviewed by BJ Burg.

Hide all shown grid overlays when the WebInspector is closed.

* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::willDestroyFrontendAndBackend):
(WebCore::InspectorDOMAgent::highlightNodeList):
(WebCore::InspectorDOMAgent::buildObjectForNode):
(WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):

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

9 months agoJSC EWSes should be triggered by change in any jsc file
aakash_jain@apple.com [Thu, 11 Feb 2021 18:50:39 +0000 (18:50 +0000)]
JSC EWSes should be triggered by change in any jsc file
https://bugs.webkit.org/show_bug.cgi?id=221756

Reviewed by Jonathan Bedard.

* CISupport/ews-build/steps.py:
(CheckPatchRelevance): Used generic jsc regex.
* CISupport/ews-build/steps_unittest.py: Made the unit-tests more generic by using for loop to check multiple filenames.

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

9 months agoWeb Inspector: Add settings UI for CSS Grid overlay
commit-queue@webkit.org [Thu, 11 Feb 2021 18:33:38 +0000 (18:33 +0000)]
Web Inspector: Add settings UI for CSS Grid overlay
https://bugs.webkit.org/show_bug.cgi?id=221556
<rdar://problem/74100005>

Patch by Razvan Caliman <rcaliman@apple.com> on 2021-02-11
Reviewed by Devin Rousso.

Add UI to toggle configuration options for the CSS Grid overlay.
When an option's value changes, all shown overlays are refreshed.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Base/Setting.js:
* UserInterface/Controllers/OverlayManager.js:
(WI.OverlayManager):
(WI.OverlayManager.prototype.showGridOverlay):
(WI.OverlayManager.prototype._handleGridSettingChanged):
* UserInterface/Views/CSSGridSection.css:
(.css-grid-section .node-link,):
(.css-grid-section :is(.heading, .title)):
* UserInterface/Views/CSSGridSection.js:
(WI.CSSGridSection.prototype.initialLayout):

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

9 months agoReturning sRGB from CG color space functions on failure is too error prone
weinig@apple.com [Thu, 11 Feb 2021 17:43:57 +0000 (17:43 +0000)]
Returning sRGB from CG color space functions on failure is too error prone
https://bugs.webkit.org/show_bug.cgi?id=221676

Reviewed by Darin Adler.

Source/WebCore:

* platform/graphics/cg/ColorCG.cpp:
(WebCore::leakCGColor):
Switch to checking for nullptr rather than sRGB and be explicit about where we can
and cannot use conversion to ExtendedSRGB, rather than the old behavior where we
would secretly use sRGB on platforms without ExtendedSRGB and expect CG to clamp for
us.

* platform/graphics/cg/ColorSpaceCG.cpp:
(WebCore::sRGBColorSpaceRef):
(WebCore::adobeRGB1998ColorSpaceRef):
(WebCore::displayP3ColorSpaceRef):
(WebCore::extendedSRGBColorSpaceRef):
(WebCore::ITUR_2020ColorSpaceRef):
(WebCore::labColorSpaceRef):
(WebCore::linearSRGBColorSpaceRef):
(WebCore::ROMMRGBColorSpaceRef):
(WebCore::xyzColorSpaceRef):
* platform/graphics/cg/ColorSpaceCG.h:
(WebCore::cachedNullableCGColorSpace):
(WebCore::cachedCGColorSpace):
Rename cachedCGColorSpace to cachedNullableCGColorSpace to indicate that it can
now return nullptr for unsupported color spaces. Add explicit guards around color
space accessors to ensure they are only called on platforms where they are known
to be supported.

* platform/graphics/cg/GradientCG.cpp:
(WebCore::Gradient::createCGGradient):
Be explicit about which color space is being used for the gradien when extended colors are present.
This is the same behavior as before, but previously it would happen silently beneath extendedSRGBColorSpaceRef()
which is a suprising result.

Source/WTF:

* wtf/PlatformHave.h:
Add specific macros for color spaces supported by Core Graphics.

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

9 months ago[MacOS] Enable Audio Capture in GPUProcess by default
youenn@apple.com [Thu, 11 Feb 2021 17:30:34 +0000 (17:30 +0000)]
[MacOS] Enable Audio Capture in GPUProcess by default
https://bugs.webkit.org/show_bug.cgi?id=221400

Reviewed by Eric Carlson.

Source/WebKit:

Covered by existing API tests, in particular TestWebKitAPI.WebKit.OnDeviceChangeCrash.

* WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
We need to synchronously fill the granted requests, otherwise there is a risk that
the granted requests will be cleared (on page close for instance) and then later filled
for the page that was gone.
* Shared/WebPreferencesDefaultValues.cpp:
(WebKit::defaultCaptureAudioInGPUProcessEnabled):

Tools:

* TestWebKitAPI/Tests/WebKit/GetUserMediaReprompt.mm:
(-[GetUserMediaRepromptTestView haveStream:]):
Increase timeout since capture might require spinning GPUProcess.

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

9 months agoComplete XRSession::requestAnimationFrame implementation
commit-queue@webkit.org [Thu, 11 Feb 2021 17:26:14 +0000 (17:26 +0000)]
Complete XRSession::requestAnimationFrame implementation
https://bugs.webkit.org/show_bug.cgi?id=220979

Patch by Sergio Villar Senin  <svillar@igalia.com> and Imanol Fernandez <ifernandez@igalia.com> on 2021-02-11
Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Enable XRSession RAF tests.

* web-platform-tests/webxr/xrSession_requestAnimationFrame_timestamp.https-expected.txt: Added.

Source/WebCore:

- Implement the render loop for immersive and inline XR sessions.
- Implement WebXR render state updates.
- Create the FrameData struct used to query frame specific data from XR devices.
- Use window RAF for inline XR sessions.
- Implement WebFakeXRDevice testing rendering loop using a timer.
- Implement OpenXR session states and session tracking.
- Improve OpenXR event handling.

Tested by the WebXR platform tests.

* Modules/webxr/WebXRFrame.cpp: Add m_active, m_time and m_session members
(WebCore::WebXRFrame::create):
(WebCore::WebXRFrame::WebXRFrame):
* Modules/webxr/WebXRFrame.h:
(WebCore::WebXRFrame::setTime):
(WebCore::WebXRFrame::setActive):
(WebCore::WebXRFrame::isActive const):

* Modules/webxr/WebXRRenderState.h: Add m_compositionDisabled member and output canvas setter
(WebCore::WebXRRenderState::setOutputCanvas):
(WebCore::WebXRRenderState::compositionDisabled const):
(WebCore::WebXRRenderState::setCompositionDisabled):

* Modules/webxr/WebXRSession.cpp:
(WebCore::WebXRSession::create):
(WebCore::WebXRSession::WebXRSession):
(WebCore::WebXRSession::initialize): required to creat the XRFrame with makeRef(this)
(WebCore::WebXRSession::requestReferenceSpace): implement reference space creation
(WebCore::WebXRSession::requestAnimationFrame): implement render loop for immersive and inline sessions
(WebCore::WebXRSession::applyPendingRenderState): implement WebXR render state updates
(WebCore::WebXRSession::frameShouldBeRendered const): add check based on the spec
(WebCore::WebXRSession::requestFrame): implement helper function to dispatch a frame request to XR devices
(WebCore::WebXRSession::onFrame): process the XR frame and call the RAF callbacks
* Modules/webxr/WebXRSession.h:

* Modules/webxr/WebXRSystem.cpp: Implement render loop using window raf loop.
(WebCore::WebXRSystem::WebXRSystem):
(WebCore::WebXRSystem::DummyInlineDevice::DummyInlineDevice): Add ScriptExecutionContext
(WebCore::WebXRSystem::DummyInlineDevice::requestFrame): Adapt to the new interface

* Modules/webxr/WebXRSystem.h:
* Modules/webxr/WebXRWebGLLayer.cpp:
(WebCore::WebXRWebGLLayer::canvas const): Implement canvas getter
* Modules/webxr/WebXRWebGLLayer.h:
(WebCore::WebXRWebGLLayer::compositionDisabled const): add
(WebCore::WebXRWebGLLayer::setCompositionDisabled): add

* platform/xr/PlatformXR.h: Add FrameData struct

* platform/xr/openxr/PlatformXROpenXR.cpp: Implement render loop using OpenXR API
(PlatformXR::OpenXRDevice::resetSession):
(PlatformXR::OpenXRDevice::shutDownTrackingAndRendering):
(PlatformXR::OpenXRDevice::pollEvents): Implement event loop to query m_sessionState
(PlatformXR::sessionIsActive): add
(PlatformXR::sessionIsRunning): add
(PlatformXR::OpenXRDevice::beginSession):
(PlatformXR::xrViewToViewData): helper function to convert data from OpenXR
(PlatformXR::OpenXRDevice::requestFrame): start OpenXR frame, query pose and view data
(PlatformXR::OpenXRDevice::waitUntilStopping): properly wait for OpenXR event before ending the session.
* platform/xr/openxr/PlatformXROpenXR.h:

* testing/WebFakeXRDevice.cpp: Implement render loop using a timer
(WebCore::SimulatedXRDevice::SimulatedXRDevice):
(WebCore::SimulatedXRDevice::~SimulatedXRDevice):
(WebCore::SimulatedXRDevice::shutDownTrackingAndRendering):
(WebCore::SimulatedXRDevice::stopTimer):
(WebCore::SimulatedXRDevice::frameTimerFired):
(WebCore::SimulatedXRDevice::requestFrame):
* testing/WebFakeXRDevice.h:

LayoutTests:

* platform/wpe/TestExpectations:

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

9 months ago[Flatpak SDK] Fix env forwarding for older flatpak versions
lmoura@igalia.com [Thu, 11 Feb 2021 17:09:48 +0000 (17:09 +0000)]
[Flatpak SDK] Fix env forwarding for older flatpak versions
https://bugs.webkit.org/show_bug.cgi?id=221757

Rubber-stamped by Philippe Normand.

Older flatpak versions (pre 1.10) might not have been patched for the
envvar CVE that triggered the new behavior and would still be
receiving the environment through envvars instead of the --args file
descriptor.

* flatpak/webkit-bwrap:

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

9 months ago[CMake] WEBKIT_EXECUTABLE can incorrectly link framework
don.olmstead@sony.com [Thu, 11 Feb 2021 16:58:24 +0000 (16:58 +0000)]
[CMake] WEBKIT_EXECUTABLE can incorrectly link framework
https://bugs.webkit.org/show_bug.cgi?id=221703

Reviewed by Michael Catanzaro.

.:

After r272484 which added an additional test for TestJavaScriptCore the PlayStation build
began failing with an unresolved symbol in bmalloc. On PlayStation both WTF and bmalloc
are linked into JavaScriptCore. That library was building successfully which implied that
WTF was being erroniously linked into TestJavaScriptCore.

Inside _WEBKIT_EXECUTABLE_LINK_FRAMEWORK there was an invalid conditional which was causing
WTF to be linked. Fixed the logic to ensure that if the requested framework is linked into
another framework that is being linked then it is not added to the linker.

* Source/cmake/WebKitMacros.cmake:

Source/JavaScriptCore:

GTK compiles JavaScriptCore as a SHARED library but the symbols from WTF are not being
properly exposed from it. Workaround this by linking WTF directly until GTK turns on
hidden visibility and properly exports symbols.

* shell/PlatformGTK.cmake:

Tools:

GTK compiles JavaScriptCore as a SHARED library but the symbols from WTF are not being
properly exposed from it. Workaround this by linking WTF directly until GTK turns on
hidden visibility and properly exports symbols.

* TestWebKitAPI/CMakeLists.txt:
* TestWebKitAPI/PlatformGTK.cmake:

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

9 months agoRework RGB color types to be more declarative to reduce code duplication and make...
weinig@apple.com [Thu, 11 Feb 2021 16:36:28 +0000 (16:36 +0000)]
Rework RGB color types to be more declarative to reduce code duplication and make progress toward better automatic conversion
https://bugs.webkit.org/show_bug.cgi?id=221677

Reviewed by Darin Adler.

Source/WebCore:

The "RGB" family of colors (those inheriting from RGBType) all share a common structure
can be generalized to simplify their conversions and centralize their definitions.

To do this, each RGB color type now defines a "Descriptor" type (e.g. SRGBDescriptor for
SRGBA) which includes:
    - What transfer function it uses (e.g. SRGBTransferFunction)
    - What whitePoint it is defined for (e.g. WhitePoint::D65)
    - What matrices it uses to convert from linear to xyz and from xyz to linear.

Then using type aliases, the color type is defined using the descriptor and one of the four
base types: BoundedGammaEncoded, BoundedLinearEncoded, ExtendedGammaEncoded, and ExtendedLinearEncoded.
So, for the SRGBA family of color types, they are defined as:

    template<typename T> using SRGBA = BoundedGammaEncoded<T, SRGBADescriptor<T>>;
    template<typename T> using LinearSRGBA = BoundedLinearEncoded<T, SRGBADescriptor<T>>;
    template<typename T> using ExtendedSRGBA = ExtendedGammaEncoded<T, SRGBADescriptor<T>>;
    template<typename T> using LinearExtendedSRGBA = ExtendedLinearEncoded<T, SRGBADescriptor<T>>;

By using type aliases like this, we gain the ability to easily set up relationships between
the types. For instance, the BoundedGammaEncoded type has the following members:

    using LinearCounterpart = BoundedLinearEncoded<T, D>;
    using ExtendedCounterpart = ExtendedGammaEncoded<T, D>;

Where D is the "Descriptor" it was made with. This allows helper functions such as the conversion
functions to automatically know what counterpart to use without having to write specialized versions
for each pair. This will aid in unifying conversion functions further.

This change also removes the XYZReference member of the color types, replacing it with the
WhitePoint, which can be used to construct the XYZReference as is done by the new XYZFor<> alias.
This will allow for straigthforward comparisons when we stop always converting through XYZA.

As a result of moving the matrices to the color type descriptors, we can now simplify all the
linear to xyz and xyz to linear conversions to use generic functions (called linearToXYZ and
xyzToLinear not suprisingly) and since the descriptors also include the transfer function we
can further simplify the gamma conversion functions to no longer explicitly passing the transfer
function.

Two consequenes of using complex type aliases for the color types, rather than direct structs, is
that we can no longer easily forward declare the color types, so ColorTypes.h is included in a few
more places now, and the deduction guides we had been using don't work, so we must explicitly specify
the type in a few places. We should be able to reduce the amount included in most places by splitting
up the color types into their own headers, and only including the needed color type, only SRGBA in
practice.

This also adds back a missing clamp to the conversion from SRGBA<float> to SRGBA<uint8_t> that I didn't
intend to remove in a previous patch, but I am not actual sure is necessary. While I work that out,
better to add it back.

* css/parser/CSSParser.h:
* css/parser/CSSParserFastPaths.h:
* platform/graphics/Color.cpp:
(WebCore::Color::lightened const):
(WebCore::Color::darkened const):
* platform/graphics/ColorComponents.h:
(WebCore::mapColorComponents):
* platform/graphics/ColorConversion.cpp:
(WebCore::toLinear):
(WebCore::toGammaEncoded):
(WebCore::A98RGB<float>>::convert):
(WebCore::LinearA98RGB<float>>::convert):
(WebCore::DisplayP3<float>>::convert):
(WebCore::LinearDisplayP3<float>>::convert):
(WebCore::ExtendedSRGBA<float>>::convert):
(WebCore::LinearExtendedSRGBA<float>>::convert):
(WebCore::ProPhotoRGB<float>>::convert):
(WebCore::LinearProPhotoRGB<float>>::convert):
(WebCore::Rec2020<float>>::convert):
(WebCore::LinearRec2020<float>>::convert):
(WebCore::SRGBA<float>>::convert):
(WebCore::LinearSRGBA<float>>::convert):
(WebCore::xyzToLinear):
(WebCore::linearToXYZ):
(WebCore::XYZFor<LinearA98RGB<float>>>::convert):
(WebCore::XYZFor<LinearDisplayP3<float>>>::convert):
(WebCore::XYZFor<LinearExtendedSRGBA<float>>>::convert):
(WebCore::XYZFor<LinearProPhotoRGB<float>>>::convert):
(WebCore::XYZFor<LinearRec2020<float>>>::convert):
(WebCore::XYZFor<LinearSRGBA<float>>>::convert):
(WebCore::Lab<float>>::convert):
(WebCore::XYZFor<Lab<float>>>::convert):
(WebCore::XYZFor<A98RGB<float>>>::convert):
(WebCore::XYZFor<DisplayP3<float>>>::convert):
(WebCore::XYZFor<ExtendedSRGBA<float>>>::convert):
(WebCore::HSLA<float>>::convert):
(WebCore::XYZFor<HSLA<float>>>::convert):
(WebCore::HWBA<float>>::convert):
(WebCore::XYZFor<HWBA<float>>>::convert):
(WebCore::LCHA<float>>::convert):
(WebCore::XYZFor<LCHA<float>>>::convert):
(WebCore::XYZFor<ProPhotoRGB<float>>>::convert):
(WebCore::XYZFor<Rec2020<float>>>::convert):
(WebCore::XYZFor<SRGBA<float>>>::convert):
(WebCore::LinearA98RGB<float>::ReferenceXYZ>::convert): Deleted.
(WebCore::LinearDisplayP3<float>::ReferenceXYZ>::convert): Deleted.
(WebCore::LinearExtendedSRGBA<float>::ReferenceXYZ>::convert): Deleted.
(WebCore::LinearProPhotoRGB<float>::ReferenceXYZ>::convert): Deleted.
(WebCore::LinearRec2020<float>::ReferenceXYZ>::convert): Deleted.
(WebCore::LinearSRGBA<float>::ReferenceXYZ>::convert): Deleted.
(WebCore::Lab<float>::ReferenceXYZ>::convert): Deleted.
(WebCore::A98RGB<float>::ReferenceXYZ>::convert): Deleted.
(WebCore::DisplayP3<float>::ReferenceXYZ>::convert): Deleted.
(WebCore::ExtendedSRGBA<float>::ReferenceXYZ>::convert): Deleted.
(WebCore::HSLA<float>::ReferenceXYZ>::convert): Deleted.
(WebCore::HWBA<float>::ReferenceXYZ>::convert): Deleted.
(WebCore::LCHA<float>::ReferenceXYZ>::convert): Deleted.
(WebCore::ProPhotoRGB<float>::ReferenceXYZ>::convert): Deleted.
(WebCore::Rec2020<float>::ReferenceXYZ>::convert): Deleted.
(WebCore::SRGBA<float>::ReferenceXYZ>::convert): Deleted.
* platform/graphics/ColorConversion.h:
(WebCore::ColorConversion::convert):
* platform/graphics/ColorTypes.h:
(WebCore::asColorComponents):
* platform/graphics/ImageBackingStore.h:
(WebCore::ImageBackingStore::blendPixel):
(WebCore::ImageBackingStore::pixelValue const):
* platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
(WebCore::makeSimpleColorFromARGBCFArray):
* platform/graphics/cg/ColorCG.cpp:
(WebCore::roundAndClampToSRGBALossy):
* platform/graphics/filters/FilterOperation.h:
* platform/graphics/mac/ColorMac.mm:
(WebCore::makeSimpleColorFromNSColor):
* platform/ios/ColorIOS.mm:
(WebCore::colorFromUIColor):

Source/WebKit:

* UIProcess/API/wpe/WebKitColor.cpp:
(webkitColorToWebCoreColor):
Update to specify SRGBA<float>, which is now required due to lack of deduction guides through
type aliases.

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

9 months agoAudio is sometimes distorted when using createMediaElementSource
cdumez@apple.com [Thu, 11 Feb 2021 16:28:12 +0000 (16:28 +0000)]
Audio is sometimes distorted when using createMediaElementSource
https://bugs.webkit.org/show_bug.cgi?id=221553

Reviewed by Eric Carlson.

AudioSourceProviderAVFObjC::provideInput() was calculating the number of
frames available in the RingBuffer like so:
`endFrame - (m_readCount + writeAheadCount)`

The issue is that when writeAheadCount is greater than 0, (m_readCount + writeAheadCount)
can become greater than endFrame, causing us to end up with a super large number of
available frames. This can lead us to render garbage because we may be reading more
frames than available the RingBuffer.

I have also made a change in the case where rendering has already started were we ignore
writeAheadCount and render whatever we have in the RingBuffer. After we've started rendering,
deciding not to render because of writeAheadCount, even though there are available frames
in the RingBuffer, is really hurtful to user experience. This was reproducible on
https://www.waveplayer.info/createmediaelementsource-test/ where we would start rendering
for a bit, then output silence and then pick up rendering again (this time for good).

* platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
(WebCore::AudioSourceProviderAVFObjC::provideInput):

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

9 months agoCrash when UI-side compositing is enabled on macOS
simon.fraser@apple.com [Thu, 11 Feb 2021 16:09:10 +0000 (16:09 +0000)]
Crash when UI-side compositing is enabled on macOS
https://bugs.webkit.org/show_bug.cgi?id=221740

Reviewed by Tim Horton.

When UI-side compositing is enabled on macOS, WebProcess::updatePageScreenProperties()
crashes because allOf(m_pageMap.values(), ...) return a null WebPage. We're inside
WebProcess::createWebPage() here, so haven't set the HashMap value yet.

* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::updatePageScreenProperties):

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

9 months agoRemove FontSelector dependence in CSSFontFace when creating a new FontFace wrapper
clord@igalia.com [Thu, 11 Feb 2021 16:06:08 +0000 (16:06 +0000)]
Remove FontSelector dependence in CSSFontFace when creating a new FontFace wrapper
https://bugs.webkit.org/show_bug.cgi?id=221753

Reviewed by Myles C. Maxfield.

Add a parameter to the CSSFontFace-based FontFace constructor to allow
specifying the ScriptExecutionContext and therefore allow removal of
another dependence on m_fontSelector in CSSFontFace.

No new tests because there is no behavior change.

* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::wrapper):
* css/CSSFontFace.h:
* css/FontFace.cpp:
(WebCore::FontFace::create):
(WebCore::FontFace::FontFace):
* css/FontFace.h:
* css/FontFaceSet.cpp:
(WebCore::FontFaceSet::Iterator::next):
(WebCore::FontFaceSet::load):

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

9 months agoAdd more Selenium key codes for test_driver.send_keys()
rego@igalia.com [Thu, 11 Feb 2021 15:25:20 +0000 (15:25 +0000)]
Add more Selenium key codes for test_driver.send_keys()
https://bugs.webkit.org/show_bug.cgi?id=221674

Reviewed by Carlos Garcia Campos.

LayoutTests/imported/w3c:

Add more Selenium key codes (https://seleniumhq.github.io/selenium/docs/api/py/webdriver/selenium.webdriver.common.keys.html).
Not all of them are added, only the ones that are supported in eventSender.keyDown().

* web-platform-tests/html/semantics/forms/form-submission-0/implicit-submission.optional-expected.txt: Updated expectations
as this test was using the code for ENTER.
* web-platform-tests/resources/testdriver-vendor.js:

LayoutTests:

* platform/ios/imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/implicit-submission.optional-expected.txt: Copied from LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/implicit-submission.optional-expected.txt.

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

9 months ago[LFC][IFC] Introduce dedicated logical rect getter for each inline level box type
zalan@apple.com [Thu, 11 Feb 2021 14:56:18 +0000 (14:56 +0000)]
[LFC][IFC] Introduce dedicated logical rect getter for each inline level box type
https://bugs.webkit.org/show_bug.cgi?id=221725

Reviewed by Antti Koivisto.

This helps when different type of rects (margin vs. border) are returned for different type of boxes.

* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):
* layout/inlineformatting/InlineLineBox.cpp:
(WebCore::Layout::LineBox::logicalRectForTextRun const):
(WebCore::Layout::LineBox::logicalRectForLineBreakBox const):
(WebCore::Layout::LineBox::logicalRectForInlineLevelBox const):
(WebCore::Layout::LineBox::logicalMarginRectForAtomicInlineLevelBox const):
(WebCore::Layout::LineBox::logicalRectForInlineBox const):
(WebCore::Layout::LineBox::logicalMarginRectForInlineLevelBox const): Deleted.
* layout/inlineformatting/InlineLineBox.h:
* layout/integration/LayoutIntegrationInlineContentBuilder.cpp:
(WebCore::LayoutIntegration::InlineContentBuilder::createDisplayNonRootInlineBoxes const):
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::showInlineTreeAndRuns):

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

9 months ago[LFC][IFC] Inline boxes have incorrect content box height/width values
zalan@apple.com [Thu, 11 Feb 2021 14:46:56 +0000 (14:46 +0000)]
[LFC][IFC] Inline boxes have incorrect content box height/width values
https://bugs.webkit.org/show_bug.cgi?id=221739

Reviewed by Antti Koivisto.

Do not include horizontal and vertical padding and borders when computing the content box size.

* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):
* layout/inlineformatting/InlineLineBox.cpp:
(WebCore::Layout::LineBox::logicalRectForInlineBox const):

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

9 months ago[macOS] Add syscall to allow list in WebContent sandbox
pvollan@apple.com [Thu, 11 Feb 2021 14:44:10 +0000 (14:44 +0000)]
[macOS] Add syscall to allow list in WebContent sandbox
https://bugs.webkit.org/show_bug.cgi?id=221705
<rdar://problem/74162777>

Reviewed by Brent Fulgham.

Add required syscall to allow list in WebContent sandbox on macOS.

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

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

9 months agoRemove GPUProcess flag in MediaRecorder tests
youenn@apple.com [Thu, 11 Feb 2021 14:40:38 +0000 (14:40 +0000)]
Remove GPUProcess flag in MediaRecorder tests
https://bugs.webkit.org/show_bug.cgi?id=221401

Reviewed by Eric Carlson.

We will remove http/wpt/mediarecorder/MediaRecorder-AV-audio-video-dataavailable.html once rdar://problem/74043225 is fixed.

* http/wpt/mediarecorder/pause-recording.html:
Increase timer to cope with added latency introduced by IPC messaging.

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

9 months agoNon unified build fixes for mid February 2021
svillar@igalia.com [Thu, 11 Feb 2021 14:18:29 +0000 (14:18 +0000)]
Non unified build fixes for mid February 2021
https://bugs.webkit.org/show_bug.cgi?id=221749

Reviewed by Youenn Fablet.

Source/WebCore:

* CMakeLists.txt:
* Modules/mediastream/SFrameUtils.cpp:
* Modules/mediastream/STUNMessageParsing.h:
* bindings/js/WebCoreBuiltinNames.h:
* dom/EventTargetFactory.in:
* inspector/InspectorFrontendAPIDispatcher.cpp:
(WebCore::InspectorFrontendAPIDispatcher::evaluateOrQueueExpression):
* workers/DedicatedWorkerGlobalScope.cpp:
* workers/Worker.cpp:

Source/WebKit:

* GPUProcess/graphics/RemoteRenderingBackend.cpp:
* GPUProcess/media/RemoteCDMInstanceProxy.cpp:

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

9 months agoUnreviewed test gardening.
svillar@igalia.com [Thu, 11 Feb 2021 13:42:42 +0000 (13:42 +0000)]
Unreviewed test gardening.

* platform/ios/TestExpectations: Replaced Failure by ImageOnlyFailure for a couple of tests I imported yesterday.

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

9 months agoSplit RemoteRealtimeMediaSource in two audio-specific and video-specific classes
youenn@apple.com [Thu, 11 Feb 2021 11:08:23 +0000 (11:08 +0000)]
Split RemoteRealtimeMediaSource in two audio-specific and video-specific classes
https://bugs.webkit.org/show_bug.cgi?id=221608

Reviewed by Eric Carlson.

Split RemoteRealtimeMediaSource in RemoteRealtimeAudioSource and RemoteRealtimeVideoSource.
This will allow RemoteRealtimeVideoSource to become a RealtimeVideoCaptureSource in a follow-up
to properly handle fan-out to multiple clones with various frame rates and resolutions.
This also allows removing differences of behaviors between audio and video classes.

No change of behavior.

* SourcesCocoa.txt:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/cocoa/RemoteCaptureSampleManager.cpp:
(WebKit::RemoteCaptureSampleManager::addSource):
(WebKit::RemoteCaptureSampleManager::didUpdateSourceConnection):
(WebKit::RemoteCaptureSampleManager::RemoteAudio::RemoteAudio):
* WebProcess/cocoa/RemoteCaptureSampleManager.h:
* WebProcess/cocoa/RemoteRealtimeAudioSource.cpp: Added.
(WebKit::RemoteRealtimeAudioSource::create):
(WebKit::RemoteRealtimeAudioSource::RemoteRealtimeAudioSource):
(WebKit::RemoteRealtimeAudioSource::createRemoteMediaSource):
(WebKit::RemoteRealtimeAudioSource::~RemoteRealtimeAudioSource):
(WebKit::RemoteRealtimeAudioSource::whenReady):
(WebKit::RemoteRealtimeAudioSource::didFail):
(WebKit::RemoteRealtimeAudioSource::setAsReady):
(WebKit::RemoteRealtimeAudioSource::setCapabilities):
(WebKit::RemoteRealtimeAudioSource::setSettings):
(WebKit::RemoteRealtimeAudioSource::remoteAudioSamplesAvailable):
(WebKit::RemoteRealtimeAudioSource::connection):
(WebKit::RemoteRealtimeAudioSource::startProducingData):
(WebKit::RemoteRealtimeAudioSource::stopProducingData):
(WebKit::RemoteRealtimeAudioSource::capabilities):
(WebKit::RemoteRealtimeAudioSource::applyConstraints):
(WebKit::RemoteRealtimeAudioSource::applyConstraintsSucceeded):
(WebKit::RemoteRealtimeAudioSource::applyConstraintsFailed):
(WebKit::RemoteRealtimeAudioSource::hasEnded):
(WebKit::RemoteRealtimeAudioSource::captureStopped):
(WebKit::RemoteRealtimeAudioSource::captureFailed):
(WebKit::RemoteRealtimeAudioSource::gpuProcessConnectionDidClose):
* WebProcess/cocoa/RemoteRealtimeAudioSource.h: Copied from Source/WebKit/WebProcess/cocoa/RemoteRealtimeMediaSource.h.
(WebKit::RemoteRealtimeAudioSource::identifier const):
* WebProcess/cocoa/RemoteRealtimeVideoSource.cpp: Renamed from Source/WebKit/WebProcess/cocoa/RemoteRealtimeMediaSource.cpp.
(WebKit::RemoteRealtimeVideoSource::create):
(WebKit::RemoteRealtimeVideoSource::RemoteRealtimeVideoSource):
(WebKit::RemoteRealtimeVideoSource::createRemoteMediaSource):
(WebKit::RemoteRealtimeVideoSource::~RemoteRealtimeVideoSource):
(WebKit::RemoteRealtimeVideoSource::whenReady):
(WebKit::RemoteRealtimeVideoSource::didFail):
(WebKit::RemoteRealtimeVideoSource::setAsReady):
(WebKit::RemoteRealtimeVideoSource::clone):
(WebKit::RemoteRealtimeVideoSource::setCapabilities):
(WebKit::RemoteRealtimeVideoSource::setSettings):
(WebKit::RemoteRealtimeVideoSource::remoteVideoSampleAvailable):
(WebKit::RemoteRealtimeVideoSource::connection):
(WebKit::RemoteRealtimeVideoSource::startProducingData):
(WebKit::RemoteRealtimeVideoSource::stopProducingData):
(WebKit::RemoteRealtimeVideoSource::setShouldApplyRotation):
(WebKit::RemoteRealtimeVideoSource::capabilities):
(WebKit::RemoteRealtimeVideoSource::applyConstraints):
(WebKit::RemoteRealtimeVideoSource::applyConstraintsSucceeded):
(WebKit::RemoteRealtimeVideoSource::applyConstraintsFailed):
(WebKit::RemoteRealtimeVideoSource::hasEnded):
(WebKit::RemoteRealtimeVideoSource::captureStopped):
(WebKit::RemoteRealtimeVideoSource::captureFailed):
(WebKit::RemoteRealtimeVideoSource::stopBeingObserved):
(WebKit::RemoteRealtimeVideoSource::requestToEnd):
(WebKit::RemoteRealtimeVideoSource::gpuProcessConnectionDidClose):
* WebProcess/cocoa/RemoteRealtimeVideoSource.h: Renamed from Source/WebKit/WebProcess/cocoa/RemoteRealtimeMediaSource.h.
* WebProcess/cocoa/UserMediaCaptureManager.cpp:
(WebKit::UserMediaCaptureManager::addAudioSource):
(WebKit::UserMediaCaptureManager::removeAudioSource):
(WebKit::UserMediaCaptureManager::addVideoSource):
(WebKit::UserMediaCaptureManager::removeVideoSource):
(WebKit::UserMediaCaptureManager::sourceStopped):
(WebKit::UserMediaCaptureManager::sourceEnded):
(WebKit::UserMediaCaptureManager::captureFailed):
(WebKit::UserMediaCaptureManager::sourceMutedChanged):
(WebKit::UserMediaCaptureManager::sourceSettingsChanged):
(WebKit::UserMediaCaptureManager::remoteVideoSampleAvailable):
(WebKit::UserMediaCaptureManager::applyConstraintsSucceeded):
(WebKit::UserMediaCaptureManager::applyConstraintsFailed):
(WebKit::UserMediaCaptureManager::AudioFactory::createAudioCaptureSource):
(WebKit::UserMediaCaptureManager::VideoFactory::createVideoCaptureSource):
(WebKit::UserMediaCaptureManager::DisplayFactory::createDisplayCaptureSource):
* WebProcess/cocoa/UserMediaCaptureManager.h:
(WebKit::UserMediaCaptureManager::remoteCaptureSampleManager):

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

9 months agoHandle min-width/min-height:auto for aspect-ratio
commit-queue@webkit.org [Thu, 11 Feb 2021 10:55:20 +0000 (10:55 +0000)]
Handle min-width/min-height:auto for aspect-ratio
https://bugs.webkit.org/show_bug.cgi?id=220582

Patch by Rob Buis <rbuis@igalia.com> on 2021-02-11
Reviewed by Antti Koivisto.

Source/WebCore:

Implement automatic minimum size [1] handling for aspect-ratio
as specified here [2].

[1] https://drafts.csswg.org/css-sizing-3/#automatic-minimum-size
[2] https://drafts.csswg.org/css-sizing-4/#aspect-ratio-minimum

* rendering/RenderBox.cpp:
(WebCore::RenderBox::constrainLogicalWidthInFragmentByMinMax const):
(WebCore::RenderBox::constrainLogicalHeightByMinMax const):
(WebCore::RenderBox::computePositionedLogicalWidthUsing const):
(WebCore::RenderBox::computePositionedLogicalHeight const):
(WebCore::RenderBox::computePositionedLogicalHeightUsing const):

LayoutTests:

Enable tests that pass now.

* TestExpectations:

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

9 months agoRemove another use of FontSelector from within CSSFontFace
mmaxfield@apple.com [Thu, 11 Feb 2021 10:06:38 +0000 (10:06 +0000)]
Remove another use of FontSelector from within CSSFontFace
https://bugs.webkit.org/show_bug.cgi?id=221071

Reviewed by Darin Adler.

Source/WebCore:

Instead of CSSFontFace directly knowing about CSSFontSelector, we can just make CSSFontSelector
inherit from CSSFontFace::Client.

Also, clean up the callback methods a little bit.

Tests: fast/text/font-loading-multiple-documents.html
       fast/text/font-loading-multiple-sets.html

* css/CSSFontFace.cpp:
(WebCore::iterateClients):
(WebCore::CSSFontFace::CSSFontFace):
(WebCore::CSSFontFace::fontLoadEventOccurred):
(WebCore::CSSFontFace::updateStyleIfNeeded):
* css/CSSFontFace.h:
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::fontLoaded):
(WebCore::CSSFontSelector::fontStyleUpdateNeeded):
* css/CSSFontSelector.h:

LayoutTests:

* fast/text/font-loading-multiple-documents-expected.html: Added.
* fast/text/font-loading-multiple-documents.html: Added.
* fast/text/font-loading-multiple-sets-expected.txt: Added.
* fast/text/font-loading-multiple-sets.html: Added.

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

9 months ago[Flatpak SDK] Support multiple builds running at the same time
lmoura@igalia.com [Thu, 11 Feb 2021 09:29:22 +0000 (09:29 +0000)]
[Flatpak SDK] Support multiple builds running at the same time
https://bugs.webkit.org/show_bug.cgi?id=221711

Reviewed by Philippe Normand.

Instead of writing the environment to a file, read the --setenv
arguments from the --args file descriptor passed to webkit-bwrap like
bwrap itself would do.

* flatpak/flatpakutils.py: Do not write the env file anymore
(WebkitFlatpak.run_in_sandbox):
* flatpak/webkit-bwrap: Read the environment from the args file
descriptor.

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

9 months agothe nested grid container which has replaced item with 'max-height' has wrong width...
commit-queue@webkit.org [Thu, 11 Feb 2021 08:44:54 +0000 (08:44 +0000)]
the nested grid container which has replaced item with 'max-height' has wrong width(0px).
https://bugs.webkit.org/show_bug.cgi?id=219194

Patch by Ziran Sun <zsun@igalia.com> on 2021-02-11
Reviewed by Javier Fernandez.
LayoutTests/imported/w3c:

The test is imported from WPT.

* web-platform-tests/css/css-grid/grid-items/grid-auto-margin-and-replaced-item-001-expected.html: Added.
* web-platform-tests/css/css-grid/grid-items/grid-auto-margin-and-replaced-item-001.html: Added.
* web-platform-tests/css/css-sizing/percentage-height-in-flexbox-expected.txt: Added.

Source/WebCore:

Width of a nested grid container with margin:auto returns 0 when their item has "max-height".
This causes the grid item's position wrong due to the wrongly comuputed auto-margin value.
This change is to check whether the preferred logical width is dirty when the grid area changes.

It's a reland of r272338, which got reverted because it broken
imported/w3c/web-platform-tests/css/css-sizing/percentage-height-in-flexbox.html on ios. This change
actually fixes the test failure in the flexbox test. Hence, updating test expectation file of
the flexbox test seems working.

This is an import of Chromium change at
https://chromium-review.googlesource.com/c/chromium/src/+/2503910
This change also imported needsPreferredWidthsRecalculation() from Chromium to RenderReplaced to
address the test case specified here.

Test: imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-auto-margin-and-replaced-item-001.html

* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild const):
(WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild const):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::needsPreferredWidthsRecalculation const):
* rendering/RenderReplaced.h:

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

9 months ago[Webpage translation] Add support for the -_translate: action on WKContentView
wenson_hsieh@apple.com [Thu, 11 Feb 2021 07:25:58 +0000 (07:25 +0000)]
[Webpage translation] Add support for the -_translate: action on WKContentView
https://bugs.webkit.org/show_bug.cgi?id=221713
Source/WebKit:

Reviewed by Tim Horton.

Add another way to trigger web page translation on iOS, via the `-_translate:` selector.

* Platform/spi/ios/UIKitSPI.h:

Add a new staged SPI declaration on `UIWKTextInteractionAssistant`. Additionally remove an old staging
declaration for a method in `UIWebGeolocationPolicyDecider`.

* UIProcess/API/ios/WKWebViewIOS.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _translateForWebView:]):

Grab the currently selected text and invoke the new method on `UIWKTextInteractionAssistant`.

(-[WKContentView _addShortcutForWebView:]):

Drive-by fix: remove an extraneous `nil` check.

(-[WKContentView canPerformActionForWebView:withSender:]):

Return `YES` if the selection is ranged, and we're not inside a password input.

Tools:

<rdar://problem/73902020>

Reviewed by Tim Horton.

Add an API test to exercise `-canPerformAction:withSender:` with the new action.

* TestWebKitAPI/Tests/WebKitCocoa/WKWebViewEditActions.mm:

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

9 months agoMove AudioHardwareListener into the GPU Process
jer.noble@apple.com [Thu, 11 Feb 2021 07:24:24 +0000 (07:24 +0000)]
Move AudioHardwareListener into the GPU Process
https://bugs.webkit.org/show_bug.cgi?id=221455

Reviewed by Eric Carlson.

Source/WebCore:

Allow clients to override the creation method for AudioHardwareListener::create().

* platform/audio/AudioHardwareListener.cpp:
(WebCore::audioHardwareListenerCreationFunction):
(WebCore::AudioHardwareListener::setCreationFunction):
(WebCore::AudioHardwareListener::resetCreationFunction):
(WebCore::AudioHardwareListener::create):
* platform/audio/AudioHardwareListener.h:
* platform/audio/mac/AudioHardwareListenerMac.cpp:
(WebCore::AudioHardwareListener::create): Deleted.

Source/WebKit:

Add a new Remote pair of classes, RemoteAudioHardwareListener/Proxy.

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* GPUProcess/GPUConnectionToWebProcess.cpp:
(WebKit::GPUConnectionToWebProcess::createAudioHardwareListener):
(WebKit::GPUConnectionToWebProcess::releaseAudioHardwareListener):
* GPUProcess/GPUConnectionToWebProcess.h:
* GPUProcess/GPUConnectionToWebProcess.messages.in:
* GPUProcess/media/RemoteAudioHardwareListenerProxy.cpp:
(WebKit::RemoteAudioHardwareListenerProxy::RemoteAudioHardwareListenerProxy):
(WebKit::RemoteAudioHardwareListenerProxy::audioHardwareDidBecomeActive):
(WebKit::RemoteAudioHardwareListenerProxy::audioHardwareDidBecomeInactive):
(WebKit::RemoteAudioHardwareListenerProxy::audioOutputDeviceChanged):
* GPUProcess/media/RemoteAudioHardwareListenerProxy.h:
* GPUProcess/media/RemoteLegacyCDMFactoryProxy.cpp:
* Scripts/webkit/messages.py:
* Sources.txt:
* SourcesCocoa.txt:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/GPU/media/RemoteAudioHardwareListener.cpp: Added.
(WebKit::RemoteAudioHardwareListener::create):
(WebKit::RemoteAudioHardwareListener::RemoteAudioHardwareListener):
(WebKit::RemoteAudioHardwareListener::~RemoteAudioHardwareListener):
(WebKit::RemoteAudioHardwareListener::gpuProcessConnectionDidClose):
(WebKit::RemoteAudioHardwareListener::audioHardwareDidBecomeActive):
(WebKit::RemoteAudioHardwareListener::audioHardwareDidBecomeInactive):
(WebKit::RemoteAudioHardwareListener::audioOutputDeviceChanged):
* WebProcess/GPU/media/RemoteAudioHardwareListener.h:
* WebProcess/GPU/media/RemoteAudioHardwareListener.messages.in:
* WebProcess/GPU/media/RemoteAudioHardwareListenerIdentifier.h:
* WebProcess/GPU/webrtc/MediaRecorderPrivate.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::setUseGPUProcessForMedia):

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

9 months ago[WebAuthn] Update - [ASCAppleIDCredential initWithUser:...] to match the latest SPI
jiewen_tan@apple.com [Thu, 11 Feb 2021 06:26:32 +0000 (06:26 +0000)]
[WebAuthn] Update - [ASCAppleIDCredential initWithUser:...] to match the latest SPI
https://bugs.webkit.org/show_bug.cgi?id=221723
<rdar://problem/74038383>

Reviewed by Brent Fulgham.

No tests.

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

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

9 months agoUse event loop to set title
commit-queue@webkit.org [Thu, 11 Feb 2021 06:22:38 +0000 (06:22 +0000)]
Use event loop to set title
https://bugs.webkit.org/show_bug.cgi?id=218496

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

Source/WebCore:

Use event loop to set title to avoid calling WebFrameLoaderClient
within HTMLTitleElement::insertedIntoAncestor.

* dom/Document.cpp:
(WebCore::Document::updateTitle):
* dom/Document.h:
(WebCore::Document::titleWithDirection const):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::setTitle):
* loader/EmptyClients.h:
* page/Chrome.cpp:
(WebCore::Chrome::print):
* page/ChromeClient.h:

Source/WebKit:

Add title parameter to PrintFrame message.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::printFrame):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::print):
* WebProcess/WebCoreSupport/WebChromeClient.h:

Source/WebKitLegacy/mac:

Adjust to API change.

* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::print):

Source/WebKitLegacy/win:

Adjust to API change.

* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::print):
* WebCoreSupport/WebChromeClient.h:

Tools:

Adapt unit tests to wait for title change tasks
to be processed.

* TestWebKitAPI/Tests/WebKit/PageLoadState.cpp:
(TestWebKitAPI::didChangeTitle):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitGLib/TestAuthentication.cpp:
(testWebViewAuthenticationFailure):
(testWebViewAuthenticationNoCredential):
(testWebViewAuthenticationSuccess):
(testWebViewAuthenticationEmptyRealm):
* TestWebKitAPI/Tests/WebKitGLib/TestBackForwardList.cpp:
(testBackForwardListNavigation):
* TestWebKitAPI/Tests/WebKitGLib/TestLoaderClient.cpp:
(testWebViewTitle):
* TestWebKitAPI/Tests/WebKitGLib/TestSSL.cpp:
(testLoadFailedWithTLSErrors):
* TestWebKitAPI/Tests/WebKitGLib/TestWebKitSettings.cpp:
(testWebKitSettingsJavaScriptMarkup):
* TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebView.cpp:
(testWebViewTitleChange):

LayoutTests:

Adapt tests to make sure pending title change tasks
are processed before the test is done.

* TestExpectations:
* fast/dom/title-text-property-2.html:
* fast/dom/title-text-property-assigning-empty-string.html:
* fast/dom/title-text-property.html:
* http/tests/globalhistory/history-delegate-basic-title-expected.txt:
* http/tests/globalhistory/history-delegate-basic-title.html:
* http/tests/loading/basic-auth-load-URL-with-consecutive-slashes-expected.txt:
* http/tests/loading/basic-auth-load-URL-with-consecutive-slashes.html:
* http/tests/loading/redirect-with-no-location-crash-expected.txt:
* http/tests/loading/redirect-with-no-location-crash.html:
* platform/mac-wk2/TestExpectations:
* platform/win/http/tests/loading/basic-auth-load-URL-with-consecutive-slashes-expected.txt: Copied from LayoutTests/http/tests/loading/basic-auth-load-URL-with-consecutive-slashes-expected.txt.
* platform/wk2/http/tests/loading/basic-auth-load-URL-with-consecutive-slashes-expected.txt:
* platform/wk2/http/tests/loading/redirect-with-no-location-crash-expected.txt:

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

9 months agoMove pal/spi/cocoa/CoreTextSPI.h to pal/spi/cf/CoreTextSPI.h
mmaxfield@apple.com [Thu, 11 Feb 2021 05:28:46 +0000 (05:28 +0000)]
Move pal/spi/cocoa/CoreTextSPI.h to pal/spi/cf/CoreTextSPI.h
https://bugs.webkit.org/show_bug.cgi?id=221683

Reviewed by Simon Fraser.

Core Text has a C API, and doesn't depend on UIKit/AppKit. It also exists on Windows,
where there is no Cocoa. And pal/spi/cf already includes things like CoreAudioSPI.h
and CoreVideoSPI.h

Source/WebCore:

No new tests because there is no behavior change.

* platform/cocoa/DragImageCocoa.mm:
* platform/graphics/Font.cpp:
* platform/graphics/cocoa/FontCacheCoreText.cpp:
* platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
* platform/graphics/cocoa/SystemFontDatabaseCoreText.h:
* platform/graphics/coretext/FontCascadeCoreText.cpp:
* platform/graphics/coretext/FontCoreText.cpp:
* platform/graphics/coretext/FontPlatformDataCoreText.cpp:
* platform/graphics/coretext/GlyphPageCoreText.cpp:
* platform/graphics/mac/ComplexTextControllerCoreText.mm:
* platform/graphics/mac/FontCustomPlatformData.cpp:
* platform/graphics/mac/SimpleFontDataCoreText.cpp:
* rendering/RenderThemeCocoa.mm:
* rendering/RenderThemeIOS.mm:
* testing/Internals.cpp:

Source/WebCore/PAL:

* PAL.xcodeproj/project.pbxproj:
* pal/PlatformMac.cmake:
* pal/spi/cf/CoreTextSPI.h: Renamed from Source/WebCore/PAL/pal/spi/cocoa/CoreTextSPI.h.

Source/WebKit:

* Shared/Cocoa/CoreTextHelpers.mm:
* Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
* UIProcess/ios/forms/WKNumberPadView.mm:
* WebProcess/WebPage/WebPage.cpp:

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

9 months agoUnreviewed, reverting r272702.
ryanhaddad@apple.com [Thu, 11 Feb 2021 05:23:52 +0000 (05:23 +0000)]
Unreviewed, reverting r272702.

Caused assertion failure on macOS debug WK2 bots

Reverted changeset:

"Stop using GenericCallback from WebPageProxy"
https://bugs.webkit.org/show_bug.cgi?id=221653
https://trac.webkit.org/changeset/272702

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

9 months ago[ Big Sur ] imported/w3c/web-platform-tests/css/css-flexbox/contain-size-layout-abspo...
ryanhaddad@apple.com [Thu, 11 Feb 2021 04:49:47 +0000 (04:49 +0000)]
[ Big Sur ] imported/w3c/web-platform-tests/css/css-flexbox/contain-size-layout-abspos-flex-container-crash.html is failing
https://bugs.webkit.org/show_bug.cgi?id=221681

Unreviewed test gardening.

Consolidate test baselines for mac since the result is the same across configurations.

* platform/mac-catalina/imported/w3c/web-platform-tests/css/css-flexbox/contain-size-layout-abspos-flex-container-crash-expected.txt: Removed.
* platform/mac/imported/w3c/web-platform-tests/css/css-flexbox/contain-size-layout-abspos-flex-container-crash-expected.txt: Renamed from LayoutTests/platform/mac-catalina-wk1/imported/w3c/web-platform-tests/css/css-flexbox/contain-size-layout-abspos-flex-container-crash-expected.txt.

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

9 months agoReduce the overhead of DocumentFragment in innerHTML & outerHTML
rniwa@webkit.org [Thu, 11 Feb 2021 03:18:46 +0000 (03:18 +0000)]
Reduce the overhead of DocumentFragment in innerHTML & outerHTML
https://bugs.webkit.org/show_bug.cgi?id=221535
<rdar://problem/73861015>

Reviewed by Geoffrey Garen.

Source/WebCore:

This patch reduces the overhead of using DocumentFragment in innerHTMl and outerHTML setters by
1. Cache DocumentFragment used for innerHTML and outerHTML.
2. Adding a fast path to removeAllChildrenWithScriptAssertion when removing child nodes from (1)
immediately before appending it to the new parent. This is safe for now since no DOM nodes or API
store information about its root node or parent node when it's DocumentFragment, and and there
are no node flags to be updated or invalidated since we're removing already-disconnected nodes
to which no script ever had access up until this point. We release-assert these conditions before
going into the fast path.

No new tests since there should be no observable behavior change.

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::removeAllChildrenWithScriptAssertion): Added a fast path. See above.
* dom/Document.cpp:
(WebCore::Document::commonTeardown): Clear m_documentFragmentForInnerOuterHTML as it would keep
the ownewr document (this Document) alive otherwise.
(WebCore::Document::documentFragmentForInnerOuterHTML): Added. Lazily create a DocumentFragment
used to parse the fragment for innerHTML and outerHTML setters. Remove any child nodes left in
the document fragment in the case the last call to replaceChildrenWithFragment took a fast path
for a single text node, which case we don't remove any child nodes from DocumentFragment.
* dom/Document.h:
* dom/DocumentFragment.h:
(WebCore::DocumentFragment::setIsDocumentFragmentForInnerOuterHTML): Added.
* dom/Node.h:
(WebCore::Node::isDocumentFragmentForInnerOuterHTML const): Added.
* editing/markup.cpp:
(WebCore::createFragmentForMarkup): Extracted from createFragmentForInnerOuterHTML to share code
between createFragmentForInnerOuterHTML and createContextualFragment.
(WebCore::createFragmentForInnerOuterHTML): Reuse the fragment in createFragmentForMarkup.
(WebCore::createContextualFragment): Don't reuse the fragment in createFragmentForMarkup as this
function is used by Range::createContextualFragment which exposes the document fragment to
arbitrary author scripts.
(WebCore::hasOneChild): Deleted since we now have Node::hasOneChild.
(WebCore::hasOneTextChild): Use Node::hasOneChild.
(WebCore::replaceChildrenWithFragment): Added assertions to make sure we don't have any child nodes
left after replacing the children.

Source/WTF:

Added a helper function for writing assertions.

* wtf/WeakPtr.h:
(WTF::WeakPtrFactory::isInitialized const): Added.

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

9 months agoStop using GenericCallback from WebPageProxy
achristensen@apple.com [Thu, 11 Feb 2021 03:06:39 +0000 (03:06 +0000)]
Stop using GenericCallback from WebPageProxy
https://bugs.webkit.org/show_bug.cgi?id=221653

Reviewed by Chris Dumez.

There are still two uses in the DrawingAreaProxy implementations, but those are quite tangled and deserve their own patch.

* UIProcess/API/APIAttachment.cpp:
(API::Attachment::updateAttributes):
* UIProcess/API/APIAttachment.h:
* UIProcess/API/C/WKPage.cpp:
(CompletionHandler<void):
(WKPageRenderTreeExternalRepresentation):
(WKPageGetSourceForFrame):
(WKPageGetContentsAsString):
(WKPageGetBytecodeProfile):
(WKPageGetSamplingProfilerOutput):
(WTF::Function<void): Deleted.
* UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
(API::Attachment::updateFromSerializedRepresentation):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _insertAttachmentWithFileWrapper:contentType:completion:]):
(-[WKWebView _getContentsAsStringWithCompletionHandler:]):
(-[WKWebView _getContentsOfAllFramesAsStringWithCompletionHandler:]):
* UIProcess/API/Cocoa/_WKAttachment.mm:
(-[_WKAttachment setFileWrapper:contentType:completion:]):
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::startSpeaking):
* UIProcess/GenericCallback.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::dispatchActivityStateChange):
(WebKit::WebPageProxy::getRenderTreeExternalRepresentation):
(WebKit::WebPageProxy::getSourceForFrame):
(WebKit::WebPageProxy::getContentsAsString):
(WebKit::WebPageProxy::getBytecodeProfile):
(WebKit::WebPageProxy::getSamplingProfilerOutput):
(WebKit::WebPageProxy::getSelectionOrContentsAsString):
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::didFailLoadForFrame):
(WebKit::WebPageProxy::resetState):
(WebKit::WebPageProxy::installActivityStateChangeCompletionHandler):
(WebKit::WebPageProxy::insertAttachment):
(WebKit::WebPageProxy::updateAttachmentAttributes):
(WebKit::WebPageProxy::didInsertAttachmentWithIdentifier):
(WebKit::WebPageProxy::clearLoadDependentCallbacks): Deleted.
(WebKit::WebPageProxy::voidCallback): Deleted.
(WebKit::WebPageProxy::stringCallback): Deleted.
(WebKit::WebPageProxy::invalidateStringCallback): Deleted.
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _shareForWebView:]):
(-[WKContentView _defineForWebView:]):
(-[WKContentView accessibilityRetrieveSpeakSelectionContent]):
(-[WKContentView applyAutocorrection:toString:withCompletionHandler:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::applyAutocorrection):
* UIProcess/mac/WKTextFinderClient.mm:
(-[WKTextFinderClient getSelectedText:]):
* WebProcess/Notifications/NotificationPermissionRequestManager.h:
* WebProcess/WebCoreSupport/WebNotificationClient.h:
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::activityStateDidChange):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::activityStateDidChange):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::reinitializeWebPage):
(WebKit::WebPage::setActivityState):
(WebKit::WebPage::getContentsAsString):
(WebKit::WebPage::getRenderTreeExternalRepresentation):
(WebKit::WebPage::getSelectionOrContentsAsString):
(WebKit::WebPage::getSourceForFrame):
(WebKit::WebPage::getBytecodeProfile):
(WebKit::WebPage::getSamplingProfilerOutput):
(WebKit::WebPage::insertAttachment):
(WebKit::WebPage::updateAttachmentAttributes):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::applyAutocorrection):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::handleActivityStateChangeCallbacks):
(WebKit::TiledCoreAnimationDrawingArea::activityStateDidChange):

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

9 months ago[LFC][IFC] Logical width of a line box is equal to the inner logical width of its...
zalan@apple.com [Thu, 11 Feb 2021 02:25:21 +0000 (02:25 +0000)]
[LFC][IFC] Logical width of a line box is equal to the inner logical width of its containing block
https://bugs.webkit.org/show_bug.cgi?id=221648

Reviewed by Antti Koivisto.

This is is used when horizontal scrolling is allowed (not supported atm).

* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::LineBoxBuilder::build):
(WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes):
* layout/inlineformatting/InlineLineBox.cpp:
(WebCore::Layout::LineBox::LineBox):
(WebCore::Layout::m_contentLogicalWidth):
* layout/inlineformatting/InlineLineBox.h:
(WebCore::Layout::LineBox::contentLogicalWidth const):

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

9 months agoWebCore::genericFamily() should use checked_cf_cast<>
ddkilzer@apple.com [Thu, 11 Feb 2021 02:25:03 +0000 (02:25 +0000)]
WebCore::genericFamily() should use checked_cf_cast<>
<https://webkit.org/b/221521>

Reviewed by Sam Weinig.

* platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
(WebCore::genericFamily):
- Switch from dynamic_cf_cast<> to checked_cf_cast<> because we
  always expect a CFStringRef type object to be returned from
  CTFontDescriptorCopyAttribute().

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

9 months ago[CMake] Enable hidden visibility on JSCOnly
don.olmstead@sony.com [Thu, 11 Feb 2021 02:22:21 +0000 (02:22 +0000)]
[CMake] Enable hidden visibility on JSCOnly
https://bugs.webkit.org/show_bug.cgi?id=221726

Reviewed by Yusuke Suzuki.

Turn on hidden visibility for all *NIX ports of JSCOnly. To properly export the symbols
from WTF/bmalloc OBJECT libraries are used. This requires CMake 3.12 or later to
function properly.

* Source/cmake/OptionsJSCOnly.cmake:

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

9 months agoREGRESSION (r269824) IOSurface allocation failure causes crash in RemoteLayerBackingS...
simon.fraser@apple.com [Thu, 11 Feb 2021 01:26:14 +0000 (01:26 +0000)]
REGRESSION (r269824) IOSurface allocation failure causes crash in RemoteLayerBackingStore::display()
https://bugs.webkit.org/show_bug.cgi?id=221729
rdar://72651289

Reviewed by Tim Horton.

The refactoring in r269824 dropped a null check on the front buffer surface (IOSurface allocation
can fail when the process reaches a hardcoded limit). Restore the null check.

* Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::display):

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

9 months ago[PlayStation] Add initial RESOURCE_USAGE implementation
chris.reid@sony.com [Thu, 11 Feb 2021 00:11:34 +0000 (00:11 +0000)]
[PlayStation] Add initial RESOURCE_USAGE implementation
https://bugs.webkit.org/show_bug.cgi?id=221706

Reviewed by Ross Kirsling.

.:

* Source/cmake/OptionsPlayStation.cmake:

Source/WebCore:

Add initial RESOURCE_USAGE data for the inspector.
CPU usage and total memory information is just stubbed out for now.

* PlatformPlayStation.cmake:
* page/playstation/ResourceUsageOverlayPlayStation.cpp: Added.
* page/playstation/ResourceUsageThreadPlayStation.cpp: Added.

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

9 months agoRemove MediaSourcePrivateClient::monitorSourceBuffers()
peng.liu6@apple.com [Thu, 11 Feb 2021 00:07:25 +0000 (00:07 +0000)]
Remove MediaSourcePrivateClient::monitorSourceBuffers()
https://bugs.webkit.org/show_bug.cgi?id=220945

Reviewed by Youenn Fablet.

Source/WebCore:

Remove MediaSourcePrivateClient::monitorSourceBuffers() for all ports except GStreamer
port because MediaSourcePrivate does not call it. This patch also adds some log messages
related to seeking.

No new tests, no functional change.

* Modules/mediasource/MediaSource.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::seekWithTolerance):
* platform/graphics/MediaSourcePrivateClient.h:
* platform/graphics/SourceBufferPrivate.cpp:
(WebCore::SourceBufferPrivate::appendCompleted):
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:

Source/WebKit:

* GPUProcess/media/RemoteMediaSourceProxy.cpp:
(WebKit::RemoteMediaSourceProxy::monitorSourceBuffers): Deleted.
* GPUProcess/media/RemoteMediaSourceProxy.h:

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

9 months ago[WebAuthn] Produce ClientDataJSON in the SPI
jiewen_tan@apple.com [Wed, 10 Feb 2021 23:50:37 +0000 (23:50 +0000)]
[WebAuthn] Produce ClientDataJSON in the SPI
https://bugs.webkit.org/show_bug.cgi?id=221623
<rdar://problem/71509394>

Reviewed by Brent Fulgham.

Source/WebKit:

Instead of asking the clients of the SPI to pre-calculate the ClientDataJSON hash for us, we do
that in the SPI space ourselves.

Covered by API tests.

* UIProcess/API/Cocoa/_WKAuthenticatorAssertionResponse.mm:
(-[_WKAuthenticatorAssertionResponse initWithClientDataJSON:rawId:extensions:authenticatorData:signature:userHandle:]):
(-[_WKAuthenticatorAssertionResponse initWithRawId:extensions:authenticatorData:signature:userHandle:]): Deleted.
* UIProcess/API/Cocoa/_WKAuthenticatorAssertionResponseInternal.h:
* UIProcess/API/Cocoa/_WKAuthenticatorAttestationResponse.mm:
(-[_WKAuthenticatorAttestationResponse initWithClientDataJSON:rawId:extensions:attestationObject:]):
(-[_WKAuthenticatorAttestationResponse initWithRawId:extensions:attestationObject:]): Deleted.
* UIProcess/API/Cocoa/_WKAuthenticatorAttestationResponseInternal.h:
* UIProcess/API/Cocoa/_WKAuthenticatorResponse.h:
* UIProcess/API/Cocoa/_WKAuthenticatorResponse.mm:
(-[_WKAuthenticatorResponse initWithClientDataJSON:rawId:extensions:]):
(-[_WKAuthenticatorResponse initWithRawId:extensions:]): Deleted.
* UIProcess/API/Cocoa/_WKAuthenticatorResponseInternal.h:
Adds a field to return the JSON serialized bytes for the ClientDataJSON.

* UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h:
* UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm:
(produceClientDataJson):
(produceClientDataJsonHash):
(wkAuthenticatorAttestationResponse):
(-[_WKWebAuthenticationPanel makeCredentialWithChallenge:origin:options:completionHandler:]):
(wkAuthenticatorAssertionResponse):
(-[_WKWebAuthenticationPanel getAssertionWithChallenge:origin:options:completionHandler:]):
(-[_WKWebAuthenticationPanel makeCredentialWithHash:options:completionHandler:]): Deleted.
(-[_WKWebAuthenticationPanel getAssertionWithHash:options:completionHandler:]): Deleted.
Modifies the SPI to accept a challenge and an origin to calculate the ClientDataJSON.

Tools:

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

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

9 months agoAdding self to contributor.json file.
rubent_22@apple.com [Wed, 10 Feb 2021 23:44:54 +0000 (23:44 +0000)]
Adding self to contributor.json file.

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

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

9 months agoNon-unified build fixes, early February 2021 edition
don.olmstead@sony.com [Wed, 10 Feb 2021 23:27:13 +0000 (23:27 +0000)]
Non-unified build fixes, early February 2021 edition
https://bugs.webkit.org/show_bug.cgi?id=221701

Unreviewed non-unified build fixes.

Source/JavaScriptCore:

* bytecode/IterationModeMetadata.h:
* bytecode/SetPrivateBrandStatus.h:

Source/WebCore:

* rendering/RenderImage.cpp:

Source/WebKit:

* NetworkProcess/PrivateClickMeasurementManager.cpp:

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

9 months agoUnreviewed, reverting r272507.
ryanhaddad@apple.com [Wed, 10 Feb 2021 22:35:59 +0000 (22:35 +0000)]
Unreviewed, reverting r272507.

Caused TestWebKitAPI.WebKit.OnDeviceChangeCrash to become a
flaky timeout

Reverted changeset:

"[MacOS] Enable Audio Capture in GPUProcess by default"
https://bugs.webkit.org/show_bug.cgi?id=221400
https://trac.webkit.org/changeset/272507

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

9 months agoWe should not static_assert on an ENABLE() macro.
mark.lam@apple.com [Wed, 10 Feb 2021 22:00:54 +0000 (22:00 +0000)]
We should not static_assert on an ENABLE() macro.
https://bugs.webkit.org/show_bug.cgi?id=221714
rdar://74197896

Reviewed by Yusuke Suzuki.

This is because the ENABLE() macro reduces to a macro expression
`(defined ENABLE_##WTF_FEATURE && ENABLE_##WTF_FEATURE)` which is not a C++
expression that a static_assert can evaluate.

* llint/LLIntData.cpp:
* llint/LLIntData.h:
(JSC::LLInt::getCodePtr):
(JSC::LLInt::getWide16CodePtr):
(JSC::LLInt::getWide32CodePtr):

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

9 months ago[Cocoa] Web Inspector: add support for evaluating script on the inspected page via...
bburg@apple.com [Wed, 10 Feb 2021 21:34:27 +0000 (21:34 +0000)]
[Cocoa] Web Inspector: add support for evaluating script on the inspected page via _WKInspectorExtension
https://bugs.webkit.org/show_bug.cgi?id=221567
<rdar://71208534>

Reviewed by Devin Rousso.

Source/WebCore:

This patch adds support for handling returned Promise values in an intelligent way.
If a callback was supplied, then wait for the promise to settle and invoke the
callback with its settled result. To support this, the dispatcher keeps a map of
unfulfilled DOMPromises and the callback that is chained to the DOMPromise.

* inspector/InspectorFrontendAPIDispatcher.h:
* inspector/InspectorFrontendAPIDispatcher.cpp:
(WebCore::InspectorFrontendAPIDispatcher::~InspectorFrontendAPIDispatcher):
(WebCore::InspectorFrontendAPIDispatcher::reset):
Clear the pending responses map when destructing or resetting the dispatcher.

(WebCore::InspectorFrontendAPIDispatcher::frontendGlobalObject):
Upgrade from JSGlobalObject to JSDOMGlobalObject, which is needed to call JSDOMPromise methods.

(WebCore::InspectorFrontendAPIDispatcher::evaluateOrQueueExpression):
The meat of this patch. Chain a Function onto the JSDOMPromise. Inside the lambda function,
try to look up and invoke the corresponding EvaluationResultHandler for this evaluation result.

(WebCore::InspectorFrontendAPIDispatcher::invalidatePendingResponses):
Since these are CompletionHandlers we need to call them one way or another.

Source/WebInspectorUI:

This patch adds InspectorFrontendAPI.evaluateScriptForExtension().

* UserInterface/Controllers/WebInspectorExtensionController.js:
(WI.WebInspectorExtensionController.prototype.evaluateScriptForExtension):
Translate arguments into a corresponding RuntimeAgent.evaluate invocation.
The parameters are not yet implemented, and will be filled in by a subsequent patch.

* UserInterface/Models/WebInspectorExtension.js: Add new error enum value.

* UserInterface/Protocol/InspectorFrontendAPI.js:
(InspectorFrontendAPI.evaluateScriptForExtension):
Plumbing.

Source/WebKit:

This patch adds a new method to _WKInspectorExtension which is used to implement
`browser.devtools.inspectedWindow.eval` in the Web Extensions API.

* Shared/InspectorExtensionTypes.h:
* Shared/InspectorExtensionTypes.cpp:
(WebKit::inspectorExtensionErrorToString):
Add enum value NotImplemented.

* UIProcess/API/APIInspectorExtension.h:
* UIProcess/API/APIInspectorExtension.cpp:
(API::InspectorExtension::evaluateScript):
Plumbing.

* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(nsErrorFromExceptionDetails):
Move this helper up near the top as it is now exposed via <WebKit/WKWebViewInternal.h>.

* UIProcess/API/Cocoa/_WKInspectorExtension.h:
* UIProcess/API/Cocoa/_WKInspectorExtension.mm:
(-[_WKInspectorExtension evaluateScript:frameURL:contextSecurityOrigin:useContentScriptContext:completionHandler:]):
Add new method to evaluate script in the inspected page. The semantics of the parameters
are intended to match those of `browser.devtools.inspectedWindow.eval`.

* UIProcess/Inspector/WebInspectorUIExtensionControllerProxy.h:
* UIProcess/Inspector/WebInspectorUIExtensionControllerProxy.cpp:
(WebKit::WebInspectorUIExtensionControllerProxy::evaluateScriptForExtension):
Plumbing.

* WebProcess/Inspector/WebInspectorUIExtensionController.h:
* WebProcess/Inspector/WebInspectorUIExtensionController.messages.in:
Add new message for evaluateScript.

* WebProcess/Inspector/WebInspectorUIExtensionController.cpp:
(WebKit::WebInspectorUIExtensionController::parseInspectorExtensionErrorFromEvaluationResult):
Support the new error enum value.

(WebKit::WebInspectorUIExtensionController::unregisterExtension):
(WebKit::WebInspectorUIExtensionController::createTabForExtension):
Drive-by, simplify this by passing the EvaluationResult value without unwrapping.

(WebKit::WebInspectorUIExtensionController::evaluateScriptForExtension):
This is the meat of the patch. Call out to InspectorFrontendAPI.evaluateScriptForExtension.
Inspect the return value and invoke the completion handler with the result or an error.

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

9 months ago[MacOS] animations/keyframe-pseudo-shadow.html is flakey failing.
ryanhaddad@apple.com [Wed, 10 Feb 2021 21:27:48 +0000 (21:27 +0000)]
[MacOS] animations/keyframe-pseudo-shadow.html is flakey failing.
https://bugs.webkit.org/show_bug.cgi?id=221491

Unreviewed test gardening.

Patch by Amir Mark Jr <amir_mark@apple.com> on 2021-02-10

* platform/mac/TestExpectations:

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

9 months ago[GPUP] Reset expectations of media related tests
peng.liu6@apple.com [Wed, 10 Feb 2021 21:16:13 +0000 (21:16 +0000)]
[GPUP] Reset expectations of media related tests
https://bugs.webkit.org/show_bug.cgi?id=221700

Unreviewed test gardening.

* gpu-process/TestExpectations:

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

9 months ago[build.webkit.org] Remove code specific to old Buildbot
aakash_jain@apple.com [Wed, 10 Feb 2021 21:06:30 +0000 (21:06 +0000)]
[build.webkit.org] Remove code specific to old Buildbot
https://bugs.webkit.org/show_bug.cgi?id=221558

Reviewed by Jonathan Bedard.

* CISupport/build-webkit-org/buildbot.tac:
* CISupport/build-webkit-org/loadConfig.py:
* CISupport/build-webkit-org/loadConfig_unittest.py:
* CISupport/build-webkit-org/master.cfg: Removed.
* CISupport/build-webkit-org/steps.py:
(TestWithFailureCount.getText): Deleted.
(TestWithFailureCount.getText2): Deleted.
(CompileWebKit.createSummary): Deleted.
(RunWebKitTests._parseRunWebKitTestsOutput): Deleted.
(RunWebKitTests.commandComplete): Deleted.
(RunWebKitTests.getText): Deleted.
(RunWebKitTests.getText2): Deleted.
(ExtractTestResults.start): Deleted.
* CISupport/ews-build/steps.py:
* CISupport/ews-build/steps_unittest.py:

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

9 months agoWebGL IPC messages are delivered out of order
commit-queue@webkit.org [Wed, 10 Feb 2021 21:04:13 +0000 (21:04 +0000)]
WebGL IPC messages are delivered out of order
https://bugs.webkit.org/show_bug.cgi?id=221488

Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2021-02-10
Reviewed by Chris Dumez.

Sync messages are delivered before earlier async messages, if some other
WebKit part waits on sync replies.

No new tests, makes the existing WebGL --use-gpu-process tests a bit less
flakey.

* WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.h:
* WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp:
Mark all async messages with IPC::SendOption::DispatchMessageEvenWhenWaitingForSyncReply.
There are no messages in the receiver message list that would make sense
to be delivered out of order.

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

9 months agoDo not differentiate between Release and Production via ENABLE_DEVELOPER_MODE
ap@apple.com [Wed, 10 Feb 2021 20:55:02 +0000 (20:55 +0000)]
Do not differentiate between Release and Production via ENABLE_DEVELOPER_MODE
https://bugs.webkit.org/show_bug.cgi?id=221684

Reviewed by Sam Weinig.

It is invalid to create behaviors that are different between these. There is
almost no difference in usage scenarios between build modes - either can be
produced by CI for validation, either can be used for local testing, etc.

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

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):

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

9 months agoWebCore::createBusFromInMemoryAudioFile() may crash under ExtAudioFileRead()
cdumez@apple.com [Wed, 10 Feb 2021 20:34:18 +0000 (20:34 +0000)]
WebCore::createBusFromInMemoryAudioFile() may crash under ExtAudioFileRead()
https://bugs.webkit.org/show_bug.cgi?id=221642
<rdar://72789841>

Reviewed by Geoffrey Garen.

The crash seems to indicate we are passing an AudioBufferList to ExtAudioFileRead()
that contains a null buffer. It is not obvious how this is happening but I have made
the following changes:
1. createAudioBufferList() / destroyAudioListBuffer() implementation is now shared
   on both macOS and iOS. The implementation now uses fastCalloc and returns null
   in case of failure to allocate.
2. createAudioBufferList() was renamed to tryCreateAudioBufferList() to make it clear
   it can return null. All call sites now properly deal with tryCreateAudioBufferList()
   potentially return null
3. Add a new validateAudioBufferList() function which makes sure that the AudioBufferList
   we are about to pass to ExtAudioFileRead() does not contain any null buffer. In case
   of validation failure, we log an error, generate a simulated crash log and early return
   gracefully instead of crashing later on.
4. Added more assertions to help catch bugs.

* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/audio/cocoa/AudioFileReaderCocoa.cpp: Added.
(WebCore::tryCreateAudioBufferList):
(WebCore::destroyAudioBufferList):
(WebCore::validateAudioBufferList):
* platform/audio/cocoa/AudioFileReaderCocoa.h: Added.
* platform/audio/ios/AudioFileReaderIOS.cpp:
(WebCore::AudioFileReader::createBus):
(WebCore::createAudioBufferList): Deleted.
(WebCore::destroyAudioBufferList): Deleted.
* platform/audio/mac/AudioFileReaderMac.cpp:
(WebCore::AudioFileReader::createBus):
(WebCore::createAudioBufferList): Deleted.
(WebCore::destroyAudioBufferList): Deleted.

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

9 months agoRename testcase to indicate hang
commit-queue@webkit.org [Wed, 10 Feb 2021 20:31:53 +0000 (20:31 +0000)]
Rename testcase to indicate hang
https://bugs.webkit.org/show_bug.cgi?id=221375

Patch by Rob Buis <rbuis@igalia.com> on 2021-02-10
Reviewed by Ryosuke Niwa.

Rename testcase to indicate hang rather than crash.

* plugins/embed-creation-hang-expected.txt: Renamed from LayoutTests/plugins/embed-creation-crash-expected.txt.
* plugins/embed-creation-hang.html: Renamed from LayoutTests/plugins/embed-creation-crash.html.

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

9 months agoWeb Inspector: Display all CSS grids on page in Layout panel
commit-queue@webkit.org [Wed, 10 Feb 2021 20:02:54 +0000 (20:02 +0000)]
Web Inspector: Display all CSS grids on page in Layout panel
https://bugs.webkit.org/show_bug.cgi?id=221145
<rdar://problem/73764515>

Patch by Razvan Caliman <rcaliman@apple.com> on 2021-02-10
Reviewed by Devin Rousso.

Source/WebInspectorUI:

Show a list of CSS Grid containers in the Layout sidebar panel of the Elements Tab.
Whenever grid nodes are added to or removed from the page, the list is updated.

Clicking on a checkbox next to a grid node toggles the Grid overlay for that node.
Changing the color of the swatch next to a grid node updates the color of the overlay if it is visible.

Add OverlayManager to mediate showing and hiding Grid overlays.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Base/Main.js:
(WI.loaded):
* UserInterface/Controllers/OverlayManager.js: Added.
(WI.OverlayManager):
(WI.OverlayManager.prototype.get nodesWithGridOverlay):
(WI.OverlayManager.prototype.showGridOverlay):
(WI.OverlayManager.prototype.hideGridOverlay):
`OverlayManager` is a singleton used to show and hide overlays for nodes on the inspected page.
It maintains state of all overlays that are visible on the page. It fires events when they are shown or hidden.

* UserInterface/Main.html:
* UserInterface/Models/DOMNode.js:
(WI.DOMNode):
(WI.DOMNode.prototype.set layoutContextType):
(WI.DOMNode.prototype.markDestroyed):
Whenever a node is removed from the DOM, its `layoutContextType` property changes to `null`.
This dispatches a `WI.DOMNode.Event.LayoutContextTypeChanged` event which is handled in `CSSGridSection`
to refresh the list of grid node containers on the page.

* UserInterface/Views/BoxModelDetailsSectionRow.js:
(WI.BoxModelDetailsSectionRow.prototype.set nodeStyles):
* UserInterface/Views/CSSGridSection.css: Added.
(.css-grid-section .node-link):
(.css-grid-section .heading):
* UserInterface/Views/CSSGridSection.js: Added.
(WI.CSSGridSection):
(WI.CSSGridSection.prototype.attached):
(WI.CSSGridSection.prototype.detached):
(WI.CSSGridSection.prototype.initialLayout):
(WI.CSSGridSection.prototype.layout):
(WI.CSSGridSection.prototype._handleGridOverlayStateChanged):
(WI.CSSGridSection.prototype._handleLayoutContextTypeChanged):
(WI.CSSGridSection.prototype._refreshGridNodeSet):
`CSSGridSection` is a new `View` under `LayoutDetailsSidebarPanel`.
It holds a list of grid nodes on the page and a set of configuration options
to pass when showing the Grid overlay (upcoming in separate patch).

* UserInterface/Views/LayoutDetailsSidebarPanel.css: Added.
(.details-section.layout-css-grid > .content > .group > .row > .css-grid-section):
* UserInterface/Views/LayoutDetailsSidebarPanel.js:
(WI.LayoutDetailsSidebarPanel.prototype.initialLayout):

LayoutTests:

DOMNode.layoutContextType is null when not defined.
Update layout test and corresponding expected result.

* inspector/css/nodeLayoutContextTypeChanged-expected.txt:
* inspector/css/nodeLayoutContextTypeChanged.html:

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

9 months agoUse HAVE(PEPPER_UI_CORE) instead of PLATFORM(WATCHOS) to guard code that uses PepperU...
wenson_hsieh@apple.com [Wed, 10 Feb 2021 19:58:12 +0000 (19:58 +0000)]
Use HAVE(PEPPER_UI_CORE) instead of PLATFORM(WATCHOS) to guard code that uses PepperUICore
https://bugs.webkit.org/show_bug.cgi?id=221679

Reviewed by Tim Horton.

Source/WebKit:

Use `HAVE(PEPPER_UI_CORE)` instead of `PLATFORM(WATCHOS)` in code that depends on PepperUICore, either directly
or indirectly. While technically equivalent, the former is more semantically precise. Common examples of this
include dependencies on Quickboard for text input, or PepperUICore category extensions on common UIKit classes
(e.g. digital crown support in `WKScrollView.mm`). No change in behavior.

Inspired by <https://bugs.webkit.org/show_bug.cgi?id=221649#c2>.

* Platform/spi/watchos/PepperUICoreSPI.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _willStartScrollingOrZooming]):
(-[WKContentView _didEndScrollingOrZooming]):
(-[WKContentView _updateTextInputTraits:]):
(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]):
(-[WKContentView _elementDidBlur]):
(-[WKContentView reloadContextViewForPresentedListViewController]):
(-[WKContentView _wheelChangedWithEvent:]):
(-[WKContentView _simulateTextEntered:]):
(-[WKContentView selectFormAccessoryPickerRow:]):
(-[WKContentView selectFormAccessoryHasCheckedItemAtRow:]):
(-[WKContentView textContentTypeForTesting]):
(-[WKContentView formInputLabel]):
(-[WKContentView setTimePickerValueToHour:minute:]):
* UIProcess/ios/WKScrollView.mm:
(-[WKScrollView initWithFrame:]):
* UIProcess/ios/forms/WKDatePickerViewController.h:
* UIProcess/ios/forms/WKDatePickerViewController.mm:
* UIProcess/ios/forms/WKFocusedFormControlView.h:
* UIProcess/ios/forms/WKFocusedFormControlView.mm:
* UIProcess/ios/forms/WKNumberPadView.h:
* UIProcess/ios/forms/WKNumberPadView.mm:
* UIProcess/ios/forms/WKNumberPadViewController.h:
* UIProcess/ios/forms/WKNumberPadViewController.mm:
* UIProcess/ios/forms/WKQuickboardListViewController.h:
* UIProcess/ios/forms/WKQuickboardListViewController.mm:
* UIProcess/ios/forms/WKSelectMenuListViewController.h:
* UIProcess/ios/forms/WKSelectMenuListViewController.mm:
* UIProcess/ios/forms/WKTextInputListViewController.h:
* UIProcess/ios/forms/WKTextInputListViewController.mm:
* UIProcess/ios/forms/WKTimePickerViewController.h:
* UIProcess/ios/forms/WKTimePickerViewController.mm:

Source/WTF:

Add the `HAVE(PEPPER_UI_CORE)` compile-time flag.

* wtf/PlatformHave.h:

Tools:

* WebKitTestRunner/cocoa/TestRunnerWKWebView.mm:
(isQuickboardViewController):

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

9 months agoREGRESSION (r272628): [macOS] TestWebKitAPI.WKWebView.SnapshotImageError is consisten...
achristensen@apple.com [Wed, 10 Feb 2021 19:41:06 +0000 (19:41 +0000)]
REGRESSION (r272628): [macOS] TestWebKitAPI.WKWebView.SnapshotImageError is consistently failing
https://bugs.webkit.org/show_bug.cgi?id=221702

I got a little carried away with my error reduction.  This one needs an error.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView takeSnapshotWithConfiguration:completionHandler:]):

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

9 months ago[iOS][FCR] Add reduced motion animation for indeterminate progress bars
akeerthi@apple.com [Wed, 10 Feb 2021 19:27:35 +0000 (19:27 +0000)]
[iOS][FCR] Add reduced motion animation for indeterminate progress bars
https://bugs.webkit.org/show_bug.cgi?id=221680
<rdar://problem/74191515>

Reviewed by Wenson Hsieh.

The reduced motion animation for indeterminate progress bars is an
opacity pulse from 30% to 60%.

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

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

9 months ago[ews] Remove old build.webkit.org unit-tests
aakash_jain@apple.com [Wed, 10 Feb 2021 19:01:15 +0000 (19:01 +0000)]
[ews] Remove old build.webkit.org unit-tests
https://bugs.webkit.org/show_bug.cgi?id=221678

Reviewed by Jonathan Bedard.

* CISupport/ews-build/factories.py:
(ServicesFactory.__init__):
* CISupport/ews-build/factories_unittest.py:
(TestTestsFactory.test_services_factory):
* CISupport/ews-build/steps.py:
(ReRunWebKitPerlTests.evaluateCommand):
(RunBuildWebKitOrgOldUnitTests): Deleted.
(RunBuildWebKitOrgOldUnitTests.__init__): Deleted.
(RunBuildWebKitOrgOldUnitTests.getResultSummary): Deleted.
* CISupport/ews-build/steps_unittest.py:
(TestRunBuildWebKitOrgUnitTests.test_failure):
(TestRunBuildWebKitOrgOldUnitTests): Deleted.
(TestRunBuildWebKitOrgOldUnitTests.setUp): Deleted.
(TestRunBuildWebKitOrgOldUnitTests.tearDown): Deleted.
(TestRunBuildWebKitOrgOldUnitTests.test_success): Deleted.
(TestRunBuildWebKitOrgOldUnitTests.test_failure): Deleted.

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

9 months agoDon't crash when reparsing an arrow function and the parsing invariant is broken
sbarati@apple.com [Wed, 10 Feb 2021 18:46:57 +0000 (18:46 +0000)]
Don't crash when reparsing an arrow function and the parsing invariant is broken
https://bugs.webkit.org/show_bug.cgi?id=221632
<rdar://71874091>

Reviewed by Tadeu Zagallo and Mark Lam.

We have code where we assert that when reparsing an arrow function,
we see the '=>' token after parsing the parameters. Since we already
parsed the arrow function before, this assertion makes sense. But somehow,
this is leading to crashes on real websites. We don't know why this invariant
is being broken. I'm changing this to a debug assert, and we're tracking
the full fix in:
https://bugs.webkit.org/show_bug.cgi?id=221633

* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseInner):

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

9 months ago[LFC][Integration] Paint invalidation for inline element style changes
antti@apple.com [Wed, 10 Feb 2021 18:26:43 +0000 (18:26 +0000)]
[LFC][Integration] Paint invalidation for inline element style changes
https://bugs.webkit.org/show_bug.cgi?id=221669

Reviewed by Zalan Bujtas.

Source/WebCore:

Test: fast/repaint/inline-style-change.html

Compute the repaint rect for RenderInline.

* layout/integration/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::visualOverflowBoundingBoxRectFor const):
* layout/integration/LayoutIntegrationLineLayout.h:
* rendering/RenderInline.cpp:
(WebCore::RenderInline::linesVisualOverflowBoundingBox const):
(WebCore::RenderInline::clippedOverflowRectForRepaint const):

LayoutTests:

* fast/repaint/inline-style-change-expected.txt: Added.
* fast/repaint/inline-style-change.html: Added.

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

9 months agoUpdate status in contributors.json
pgriffis@igalia.com [Wed, 10 Feb 2021 18:23:51 +0000 (18:23 +0000)]
Update status in contributors.json

Unreviewed.

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

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

9 months agoPCM: Expired reports get sent at the same time after a session restart
katherine_cheney@apple.com [Wed, 10 Feb 2021 17:38:10 +0000 (17:38 +0000)]
PCM: Expired reports get sent at the same time after a session restart
https://bugs.webkit.org/show_bug.cgi?id=221555
<rdar://problem/73724816>

Reviewed by John Wilander.

Since PCM data is now persisted, we need to address the case of a
session-restart after 24-48+ hours. We should not send all overdue
attributions in the same burst in case multiple have the same destination
and could identify a user cross-site.

This patch kicks off the timer to fire pending attributions on session-start
and sends one report at a time. If more than one overdue report exists
at any time, we schedule the timer for a random interval between 15 and
30 minutes.

In theory this could result in some attributions never being sent if a
user keeps quitting and restarting a session. In practice this is
probably unlikely. Protecting the user's privacy is a hard requirement,
so we think possible starvation of some reports is the right tradeoff.

* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
(WebKit::ResourceLoadStatisticsDatabaseStore::clearSentAttribution):
(WebKit::ResourceLoadStatisticsDatabaseStore::clearSentAttributions): Deleted.
* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
* NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::clearSentAttribution):
(WebKit::WebResourceLoadStatisticsStore::clearSentAttributions): Deleted.
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
Remove unused SQLite query. Update the query to sort attributed PCM
by earliestTimeToSend, which seems important now that we send only
one overdue report at a time. Change the clearSentAttributions
function to take only a single attribution.

* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::NetworkSession):
Convert m_privateClickMeasurement to a unique_ptr so we can wait to
create it after WebResourceLoadStatisticsStore is created. This ensures
that the call to create the SQLite database will run on a
background thread before we try to collect overdue PCM attributions.

(WebKit::NetworkSession::storePrivateClickMeasurement):
(WebKit::NetworkSession::handlePrivateClickMeasurementConversion):
(WebKit::NetworkSession::dumpPrivateClickMeasurement):
(WebKit::NetworkSession::clearPrivateClickMeasurement):
(WebKit::NetworkSession::clearPrivateClickMeasurementForRegistrableDomain):
(WebKit::NetworkSession::setPrivateClickMeasurementOverrideTimerForTesting):
(WebKit::NetworkSession::markAttributedPrivateClickMeasurementsAsExpiredForTesting):
(WebKit::NetworkSession::setPrivateClickMeasurementConversionURLForTesting):
(WebKit::NetworkSession::markPrivateClickMeasurementsAsExpiredForTesting):
(WebKit::NetworkSession::firePrivateClickMeasurementTimerImmediately):
* NetworkProcess/NetworkSession.h:
* NetworkProcess/PrivateClickMeasurementManager.cpp:
(WebKit::PrivateClickMeasurementManager::PrivateClickMeasurementManager):
(WebKit::PrivateClickMeasurementManager::firePendingAttributionRequest):
(WebKit::PrivateClickMeasurementManager::attribute):
Drive-by fixes to add protectedThis and check if PrivateClickMeasurementManager
is still alive when this lambda is called.

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

9 months ago[watchOS] Adopt PUICQuickboardController for text input
wenson_hsieh@apple.com [Wed, 10 Feb 2021 17:07:58 +0000 (17:07 +0000)]
[watchOS] Adopt PUICQuickboardController for text input
https://bugs.webkit.org/show_bug.cgi?id=221649

Reviewed by Tim Horton.

Source/WebKit:

Refactor text input on watchOS to use `PUICQuickboardController`, instead of custom WebKit subclasses of
`PUICQuickboardListViewController`. This new API serves the same purpose as the current list view controller
subclass, by providing a view that offers options to dictate, scribble, and choose text suggestions. See below
for more details.

For the time being, this new `PUICQuickboardController` doesn't provide a way to render a custom header view
for us to show the domain name; to avoid introducing a security or privacy bug in the interim, guard this behind
a WebKit-exposed runtime-enabled setting that's off by default. We can remove this setting and instead just use
the `HAVE(QUICKBOARD_CONTROLLER)` build-time flag once support for the custom header view is complete.

* Platform/spi/watchos/PepperUICoreSPI.h:

Include a couple of new headers if `HAVE(QUICKBOARD_CONTROLLER)` is set.

* UIProcess/ios/WKContentViewInteraction.h:

Add a `_presentedQuickboardController` instance variable if `HAVE(QUICKBOARD_CONTROLLER)` is set.

* UIProcess/ios/WKContentViewInteraction.mm:

Add protocol conformance to `PUICQuickboardControllerDelegate`.

(-[WKContentView _updateInteractionTintColor:]):
(-[WKContentView tintColorDidChange]):

Refactor this to take `UITextInputTraits`, instead of using `_traits`.

(-[WKContentView textInputTraits]):
(-[WKContentView _updateTextInputTraits:]):

Refactor this to modify the given set of text input traits given current focused element information state,
rather than operating on the `_traits` instance variable. This refactoring allows us to share logic when setting
up text input traits on both iOS and watchOS; in the former case, we're setting up a set of cached `_traits` on
the content view, but in the latter case, we're modifying a newly created `PUICTextInputContext` that we'll then
set on the `PUICQuickboardController`.

(-[WKContentView _createQuickboardController:]):

Add a helper method to create and return a new `PUICQuickboardController` that's suitable for the current
focused element's state.

(-[WKContentView presentViewControllerForCurrentFocusedElement]):

Present the view controller for the focused element, by either using a custom WebKit-owned
`PUICQuickboardListViewController` subclass, or by using a new `PUICQuickboardController` with a custom text
input context. Note that in the latter case, we may not be able to invoke the UI delegate hook
`-_webView:didPresentFocusedElementViewController:`, since the presenting view controller's transition
coordinator may not have been created yet in the scenario where we're spinning up the Quickboard view service
for the first time, since the call to establish the XPC connection is asynchronous in PepperUICore, and we don't
attempt to present the remote view controller until the connection is established. This makes it so that we
can't rely on the `-didPresentFocusedElementViewController:` hook in WebKitTestRunner to know when a
`PUICQuickboardController` has finished presenting.

To work around this, we teach the test harness to override `-presentViewController:animated:completion:` and
call into the test runner's `WKWebView` subclass when a remote quickboard controller is done presenting. In the
longer term, we will require SPI from PepperUICore to present a `PUICQuickboardController` with a completion
block.

(-[WKContentView _isPresentingFullScreenInputView]):

A "full screen input view" for the focused element is now present if either `_presentedQuickboardController` is
set, or `_presentedFullScreenInputViewController` is set.

(-[WKContentView dismissAllInputViewControllers:]):

Dismiss either the currently presented `_presentedQuickboardController` or
`_presentedFullScreenInputViewController`, and invoke the UI delegate method
`-_webView:didDismissFocusedElementViewController:` when finished.

(-[WKContentView quickboardController:textInputValueDidChange:]):
(-[WKContentView quickboardControllerTextInputValueCancelled:]):
(-[WKContentView dismissQuickboardViewControllerAndRevealFocusedFormOverlayIfNecessary:]):
(-[WKContentView textContentTypeForQuickboard]):

Refactor `-_updateTextInputTraits:` to call a helper method (`-textContentTypeForQuickboard`) on watchOS to
convert the current focused element information to a `UITextContentType`.

(-[WKContentView textContentTypeForListViewController:]):
(-[WKContentView _simulateTextEntered:]):
(-[WKContentView textContentTypeForTesting]):
(-[WKContentView formInputLabel]):

Update a few internal testing hooks to handle the case where we have a `_presentedQuickboardController` instead
of a `_presentedFullScreenInputViewController`.

(-[WKContentView _updateInteractionTintColor]): Deleted.
* UIProcess/ios/forms/WKTextInputListViewController.mm:
(-[WKTextInputListViewController additionalTrayButtons]): Suppress a deprecation warning.

Source/WTF:

Add a new internal setting. See other ChangeLogs for more detail.

* Scripts/Preferences/WebPreferencesInternal.yaml:

Tools:

Make some small tweaks to WebKitTestRunner in support of using `PUICQuickboardController` for text input.

* WebKitTestRunner/Configurations/Base.xcconfig:
* WebKitTestRunner/Configurations/WebKitTestRunnerApp.xcconfig:

Adjust the test harness on watchOS to link against PepperUICore, so that we can reference the
`PUICQuickboardViewController` and `PUICQuickboardRemoteViewController` classes below.

* WebKitTestRunner/cocoa/TestRunnerWKWebView.h:
* WebKitTestRunner/cocoa/TestRunnerWKWebView.mm:
(isQuickboardViewController):
(-[TestRunnerWKWebView _didPresentViewController:]):

Override `-presentViewController:animated:completion:` on the view controller below, and call this new method
on the `TestRunnerWKWebView` when a view controller is finished presenting. We need to do this to ensure that
the input view presentation callbacks continue to work after adopting `PUICQuickboardController`; see WebKit
ChangeLog for more details.

* WebKitTestRunner/ios/PlatformWebViewIOS.mm:
(-[PlatformWebViewController presentViewController:animated:completion:]):

LayoutTests:

Enable `QuickboardControllerForTextInputEnabled`, on relevant versions of watchOS.

* fast/forms/watchos/delete-content-in-text-field.html:
* fast/forms/watchos/edit-text-field-calls-injected-bundle.html:
* fast/forms/watchos/form-control-label-text.html:
* fast/forms/watchos/time-picker-value-change.html:
* fast/forms/watchos/username-text-content-type.html:

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