⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Timeline



Apr 18, 2021:

11:57 PM Changeset in webkit [276237] by Manuel Rego Casasnovas
  • 5 edits
    1 delete in trunk/LayoutTests

[selectors] Update :focus-visible tests from WPT
https://bugs.webkit.org/show_bug.cgi?id=224601
<rdar://problem/76827947>

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Fix expectations that were broken due to a mistake in the previous commit.
The tests had some extra changes due to webkit.org/224658, the tests were modified but not the expectations.

  • web-platform-tests/css/selectors/focus-visible-002-expected.txt:
  • web-platform-tests/css/selectors/focus-visible-003-expected.txt:
  • web-platform-tests/css/selectors/focus-visible-004-expected.txt:

LayoutTests:

Remove glib expectations as they match the main ones.

  • platform/glib/imported/w3c/web-platform-tests/css/selectors/focus-visible-002-expected.txt: Removed.
  • platform/glib/imported/w3c/web-platform-tests/css/selectors/focus-visible-003-expected.txt: Removed.
  • platform/glib/imported/w3c/web-platform-tests/css/selectors/focus-visible-004-expected.txt: Removed.
11:32 PM Changeset in webkit [276236] by Wenson Hsieh
  • 4 edits
    2 adds in trunk

Selected image overlay text should never be visible
https://bugs.webkit.org/show_bug.cgi?id=224734
<rdar://problem/76806399>

Reviewed by Darin Adler.

Source/WebCore:

Make a slight adjustment to the UA stylesheet to ensure that image overlay text is never visible. See below for
more details.

Test: fast/images/image-extraction/image-overlay-with-selection-styles.html

  • html/shadow/imageOverlay.css:

(div.image-overlay-text::selection):

Enforce selected text styles for image overlay text.

  • rendering/RenderElement.cpp:

(WebCore::RenderElement::selectionPseudoStyle const):

Make an additional adjustment when computing selection pseudo styles for UA shadow root content. Currently, for
elements inside a UA shadow root, we always immediately ascend to the shadow host; this means that ::selection
pseudo selectors currently don't work in UA stylesheets, since they're skipped when resolving styles, upon
painting selected text.

To fix this, we can let the element's own pseudo styles take precedence over the shadow host's renderer in the
case where we have a selection pseudo style. While we're here, also replace a few raw pointers with RefPtr.

LayoutTests:

Add a new layout test.

  • fast/images/image-extraction/image-overlay-with-selection-styles-expected.html: Added.
  • fast/images/image-extraction/image-overlay-with-selection-styles.html: Added.
11:13 PM Changeset in webkit [276235] by commit-queue@webkit.org
  • 17 edits in trunk

Support contain: layout
https://bugs.webkit.org/show_bug.cgi?id=223569

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

Source/WebCore:

This patch implements layout containment as specified[1].
It adds shouldApplyLayoutContainment to check whether the
element applies for layout containment. Is so, then:

  • an independent formatting context is established.
  • any overflow is treated as ink overflow.
  • an absolute positioning and fixed positioning

containing block is established.

  • a stacking context is created.
  • for baseline handling, the box is treated as having no

baseline. For grid/flexible box containers/items, this needs
a baseline synthesized from the border edges [2], for buttons it
requires a baseline synthesized from the margin edges [2, 3].

[1] https://drafts.csswg.org/css-contain-2/#layout-containment
[2] https://drafts.csswg.org/css-align-3/#synthesize-baseline
[3] https://www.w3.org/TR/CSS2/visudet.html#propdef-vertical-align

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::firstLineBaseline const):
(WebCore::RenderBlock::inlineBlockBaseline const):

  • rendering/RenderBlockFlow.cpp:

(WebCore::RenderBlockFlow::firstLineBaseline const):
(WebCore::RenderBlockFlow::inlineBlockBaseline const):

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::createsNewFormattingContext const):
(WebCore::RenderBox::layoutOverflowRectForPropagation const):

  • rendering/RenderBox.h:
  • rendering/RenderButton.cpp:

(WebCore::RenderButton::baselinePosition const):

  • rendering/RenderElement.h:

(WebCore::RenderElement::canContainFixedPositionObjects const):
(WebCore::RenderElement::canContainAbsolutelyPositionedObjects const):

  • rendering/RenderFlexibleBox.cpp:

(WebCore::RenderFlexibleBox::firstLineBaseline const):

  • rendering/RenderGrid.cpp:

(WebCore::RenderGrid::firstLineBaseline const):

  • rendering/RenderListBox.cpp:

(WebCore::RenderListBox::baselinePosition const):

  • rendering/RenderObject.cpp:

(WebCore::objectIsRelayoutBoundary):
(WebCore::shouldApplyLayoutContainment):

  • rendering/RenderObject.h:

(WebCore::RenderObject::isAtomicInlineLevelBox const):

  • rendering/RenderTable.cpp:

(WebCore::RenderTable::firstLineBaseline const):

  • rendering/style/RenderStyle.h:

(WebCore::RenderStyle::containsLayout const):

  • style/StyleAdjuster.cpp:

(WebCore::Style::Adjuster::adjust const):

LayoutTests:

Unskip tests that pass now.

7:43 PM Changeset in webkit [276234] by Diego Pino Garcia
  • 2 edits in trunk/LayoutTests

[GLIB] Unreviewed test gardening. Marked css-transforms/animation/rotate-composition.html as failure after r276231.

  • platform/glib/TestExpectations:
6:56 PM Changeset in webkit [276233] by Fujii Hironori
  • 2 edits
    3 adds in trunk/LayoutTests

[WinCairo] Unreviewed test gardening

  • platform/wincairo-wk1/http/tests/xmlhttprequest/redirect-cross-origin-post-expected.txt: Added.
  • platform/wincairo-wk1/http/tests/xmlhttprequest/simple-cross-origin-denied-events-post-expected.txt: Added.
  • platform/wincairo/TestExpectations:
2:14 PM Changeset in webkit [276232] by weinig@apple.com
  • 5 edits in trunk/Source/WebCore

GraphicsLayer::distributeOpacity, GraphicsLayer::setOpacityInternal and GraphicsLayer::accumulatedOpacity are never used
https://bugs.webkit.org/show_bug.cgi?id=224732

Reviewed by Darin Adler.

Remove dead code.

  • platform/graphics/GraphicsLayer.cpp:

(WebCore::GraphicsLayer::accumulatedOpacity const): Deleted.
(WebCore::GraphicsLayer::distributeOpacity): Deleted.

  • platform/graphics/GraphicsLayer.h:

(WebCore::GraphicsLayer::setOpacityInternal): Deleted.

  • platform/graphics/ca/GraphicsLayerCA.cpp:
  • platform/graphics/ca/GraphicsLayerCA.h:
11:12 AM Changeset in webkit [276231] by graouts@webkit.org
  • 9 edits in trunk

Fix interpolation of the rotate CSS property
https://bugs.webkit.org/show_bug.cgi?id=224730

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Mark 123 WPT progressions.

  • web-platform-tests/css/css-transforms/animation/rotate-composition-expected.txt:
  • web-platform-tests/css/css-transforms/animation/rotate-interpolation-expected.txt:
  • web-platform-tests/css/css-transforms/animation/transform-interpolation-001-expected.txt:
  • web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-002-expected.txt:
  • web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-002-expected.txt:
  • web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-002-expected.txt:

Source/WebCore:

Implement the CSS Transforms spec about animating the rotateZ() function
for the simplified case where only the angle is interpolated.

  • platform/graphics/transforms/RotateTransformOperation.cpp:

(WebCore::RotateTransformOperation::blend):

9:42 AM Changeset in webkit [276230] by youenn@apple.com
  • 12 edits in trunk

Blob URLs should use for their owner origin for CSP checks
https://bugs.webkit.org/show_bug.cgi?id=224535
<rdar://76458106>

Reviewed by Alex Christensen.

Source/WebCore:

Before the patch, we were checking blob origin directly with ancestors.
As per https://w3c.github.io/webappsec-csp/#match-url-to-source-expression step 4.1,
we need to get the URL origin, which by spec is the origin of the blob creator.
We only do this for navigation loads as script loads should be kept the current way, as a cross-site scripting protection,
and to remain compatible with other browsers.

Make some refactoring to add helper routines to get origin and secure context state of blob URLs in BlobURL.
Make use of it in MixedContentChecker as a refactoring.
Make use of the helper routine in ContentSecurityPolicySource::matches to fix the bug.

Test: http/tests/security/frame-src-and-blob-download.https.html

  • fileapi/BlobURL.cpp:

(WebCore::blobOwner):
(WebCore::BlobURL::getOriginURL):
(WebCore::BlobURL::isSecureBlobURL):

  • fileapi/BlobURL.h:
  • fileapi/ThreadableBlobRegistry.cpp:

(WebCore::isBlobURLContainsNullOrigin):

  • loader/MixedContentChecker.cpp:

(WebCore::MixedContentChecker::isMixedContent):

  • page/SecurityOrigin.cpp:

(WebCore::SecurityOrigin::isSecure):

  • page/csp/ContentSecurityPolicy.cpp:

(WebCore::ContentSecurityPolicy::urlMatchesSelf const):

  • page/csp/ContentSecurityPolicy.h:
  • page/csp/ContentSecurityPolicySourceList.cpp:

(WebCore::ContentSecurityPolicySourceList::matches const):

LayoutTests:

  • http/tests/security/frame-src-and-blob-download.https-expected.txt: Added.
  • http/tests/security/frame-src-and-blob-download.https.html:
  • http/tests/security/resources/frame-src-and-blob-download-frame.html: Added.
  • platform/mac-wk1/TestExpectations:
  • platform/win/TestExpectations:
6:40 AM Changeset in webkit [276229] by Alan Bujtas
  • 2 edits in trunk/Tools

Update name in contributors.json
https://bugs.webkit.org/show_bug.cgi?id=224731

Unreviewed.

  • Scripts/webkitpy/common/config/contributors.json:
5:45 AM Changeset in webkit [276228] by cathiechen
  • 4 edits in trunk

The implicit aspect-ratio from width and height attributes with float value is not accurate enough
https://bugs.webkit.org/show_bug.cgi?id=224664

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

The aspect ratio test case with width "0.8" and height "0.2" in img-aspect-ratio.html has passed. This patch doesn't change the behavior of
the original aspect ratio test case(assert_ratio(images[5], 133/106)) which is related to bug 206161.

  • web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio-expected.txt:

Source/WebCore:

The width and height attributes should impact the aspect ratio only not the intrinsic size which should be from the content.
Since computeAspectRatioInformationForRenderBox doesn't change the intrinsic size now, so we can remove it from computePreferredLogicalWidths.

  • rendering/RenderReplaced.cpp:

(WebCore::RenderReplaced::computeIntrinsicRatioInformation const): Width and height attributes change intrinsicRatio only, not intrinsicSize.
(WebCore::RenderReplaced::computePreferredLogicalWidths): computeAspectRatioInformationForRenderBox doesn't change intrinsicSize now, so we can remove this.

1:35 AM Changeset in webkit [276227] by ysuzuki@apple.com
  • 2 edits in trunk/Source/JavaScriptCore

Unreviewed, build fix
https://bugs.webkit.org/show_bug.cgi?id=224715

  • dfg/DFGDesiredWatchpoints.h:
1:06 AM Changeset in webkit [276226] by ysuzuki@apple.com
  • 18 edits in trunk/Source/JavaScriptCore

[JSC] Do not use Bag<> for DFG / FTL watchpoints
https://bugs.webkit.org/show_bug.cgi?id=224715

Reviewed by Darin Adler.

While Bag<> is useful since its allocated memory will not be moved,
this is really memory-inefficient data structure. Each entry gets a
tail pointer (so adding 8 bytes) and we allocate each entry separately.

In DFG and FTL, we are using Bag<> for watchpoints. But this is not necessary actually: thanks to
concurrent compilers, our watchpoint registration is batched at the end of compilation. This means
that we have a way to know how many watchpoints we should register at that point.

In this patch, we introduce WatchpointCollector. In DesiredGlobalProperties, we run reallyAdd twice
with WatchpointCollector. First time, we just count # of watchpoints. Then we allocate FixedVector<XXXWatchpoint>
and install them. Since we do not (cannot) grow this fixed vector, watchpoint's address will not be changed as required.

We also move DesiredGlobalProperties under DesiredWatchpoints since this basically registers watchpoints.

  • bytecode/AdaptiveInferredPropertyValueWatchpointBase.cpp:

(JSC::AdaptiveInferredPropertyValueWatchpointBase::AdaptiveInferredPropertyValueWatchpointBase):
(JSC::AdaptiveInferredPropertyValueWatchpointBase::initialize):

  • bytecode/AdaptiveInferredPropertyValueWatchpointBase.h:
  • bytecode/CodeBlockJettisoningWatchpoint.h:
  • dfg/DFGAdaptiveInferredPropertyValueWatchpoint.cpp:

(JSC::DFG::AdaptiveInferredPropertyValueWatchpoint::AdaptiveInferredPropertyValueWatchpoint):
(JSC::DFG::AdaptiveInferredPropertyValueWatchpoint::initialize):

  • dfg/DFGAdaptiveInferredPropertyValueWatchpoint.h:
  • dfg/DFGAdaptiveStructureWatchpoint.cpp:

(JSC::DFG::AdaptiveStructureWatchpoint::AdaptiveStructureWatchpoint):
(JSC::DFG::AdaptiveStructureWatchpoint::initialize):

  • dfg/DFGAdaptiveStructureWatchpoint.h:
  • dfg/DFGCommonData.cpp:

(JSC::DFG::CommonData::validateReferences):
(JSC::DFG::CommonData::clearWatchpoints):

  • dfg/DFGCommonData.h:
  • dfg/DFGDesiredGlobalProperties.cpp:

(JSC::DFG::DesiredGlobalProperties::reallyAdd):

  • dfg/DFGDesiredGlobalProperties.h:
  • dfg/DFGDesiredWatchpoints.cpp:

(JSC::DFG::ArrayBufferViewWatchpointAdaptor::add):
(JSC::DFG::SymbolTableAdaptor::add):
(JSC::DFG::FunctionExecutableAdaptor::add):
(JSC::DFG::AdaptiveStructureWatchpointAdaptor::add):
(JSC::DFG::DesiredWatchpoints::addLazily):
(JSC::DFG::DesiredWatchpoints::reallyAdd):
(JSC::DFG::DesiredWatchpoints::areStillValidOnMainThread):
(JSC::DFG::WatchpointCollector::finalize):

  • dfg/DFGDesiredWatchpoints.h:

(JSC::DFG::SetPointerAdaptor::add):
(JSC::DFG::GenericDesiredWatchpoints::reallyAdd):

  • dfg/DFGGraph.cpp:

(JSC::DFG::Graph::watchGlobalProperty):

  • dfg/DFGGraph.h:
  • dfg/DFGPlan.cpp:

(JSC::DFG::Plan::reallyAdd):
(JSC::DFG::Plan::isStillValidOnMainThread):
(JSC::DFG::Plan::cancel):

  • dfg/DFGPlan.h:

(JSC::DFG::Plan::transitions):
(JSC::DFG::Plan::globalProperties): Deleted.

12:43 AM Changeset in webkit [276225] by ysuzuki@apple.com
  • 2 edits in trunk/Source/WebCore

Use binary-search in LocaleToScriptMapping
https://bugs.webkit.org/show_bug.cgi?id=224727

Reviewed by Darin Adler.

This patch removes HashMaps in LocaleToScriptMapping, and binary-search onto the constant data arrays.
These maps are not frequently used. Keys of the maps can be encoded into uint32_t or uint64_t so that
comparison becomes super cheap and we can initialize this array at compile-time.

We introduce ScriptName(uint32_t) and LocaleName(uint64_t) instead of String. And ues it and generate
sorted constant data array for mappings. We use binary-search to look entry up. Since # of entries are
not huge (~200), comparisons are extremely cheap (uint32_t / uint64_t comparison), and this is not a
hot code, we can just use binary-search here and eliminate HashMaps' memory allocation.

  • platform/text/LocaleToScriptMapping.cpp:

(WebCore::PackedASCIILowerCodes::PackedASCIILowerCodes):
(WebCore::PackedASCIILowerCodes::parse):
(WebCore::PackedASCIILowerCodes::operator==):
(WebCore::PackedASCIILowerCodes::operator!=):
(WebCore::PackedASCIILowerCodes::operator<):
(WebCore::PackedASCIILowerCodes::operator<=):
(WebCore::PackedASCIILowerCodes::operator>):
(WebCore::PackedASCIILowerCodes::operator>=):
(WebCore::PackedASCIILowerCodes::value const):
(WebCore::scriptNameToCode):
(WebCore::localeToScriptCodeForFontSelection):

12:14 AM Changeset in webkit [276224] by ysuzuki@apple.com
  • 18 edits in trunk/Source/JavaScriptCore

[JSC] Make more DFG/FTL data FixedVector/Vector
https://bugs.webkit.org/show_bug.cgi?id=224713

Reviewed by Darin Adler.

  1. DFG::JITCode::m_osrEntry / DFG::JITCode::m_osrExit / DFG::JITCode::m_speculationRecovery are changed to FixedVector. They are added at compiling time, and after that, these vectors are not modified. So when finalizing, we can easily make it FixedVector. We also change OSREntry::{m_reshufflings,m_expectedValues} to FixedVector and FixedOperands.
  2. FTL::JITCode::m_osrExit is changed from SegmentedVector to Vector. We are still using Vector since it also involves osrExitDescriptor. But later, we should merge m_osrExit to osrExitDescriptor. Vector is still better than SegmentedVector since it wastes several entries per segment. SegmentedVector was used to use a direct pointer of OSRExit (this is not possible in Vector since this pointer can be invalidated after growing), but usage of that is fairly limited so that we can just replace them with m_index + osrExit vector.
  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::tallyFrequentExitSites):

  • bytecode/Operands.h:

(JSC::Operands::Operands):

  • dfg/DFGJITCode.cpp:

(JSC::DFG::JITCode::shrinkToFit):
(JSC::DFG::JITCode::liveRegistersToPreserveAtExceptionHandlingCallSite):
(JSC::DFG::JITCode::validateReferences):
(JSC::DFG::JITCode::findPC):
(JSC::DFG::JITCode::finalizeOSREntrypoints):

  • dfg/DFGJITCode.h:
  • dfg/DFGJITCompiler.cpp:

(JSC::DFG::JITCompiler::linkOSRExits):
(JSC::DFG::JITCompiler::link):
(JSC::DFG::JITCompiler::noticeOSREntry):
(JSC::DFG::JITCompiler::appendExceptionHandlingOSRExit):

  • dfg/DFGJITCompiler.h:

(JSC::DFG::JITCompiler::appendOSRExit):
(JSC::DFG::JITCompiler::appendSpeculationRecovery):

  • dfg/DFGOSREntry.h:
  • dfg/DFGOSRExit.cpp:

(JSC::DFG::JSC_DEFINE_JIT_OPERATION):

  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::speculationCheck):
(JSC::DFG::SpeculativeJIT::emitInvalidationPoint):
(JSC::DFG::SpeculativeJIT::linkOSREntries):

  • ftl/FTLJITCode.cpp:

(JSC::FTL::JITCode::shrinkToFit):
(JSC::FTL::JITCode::validateReferences):
(JSC::FTL::JITCode::liveRegistersToPreserveAtExceptionHandlingCallSite):
(JSC::FTL::JITCode::findPC):

  • ftl/FTLJITCode.h:
  • ftl/FTLOSRExit.cpp:

(JSC::FTL::OSRExitDescriptor::prepareOSRExitHandle):
(JSC::FTL::OSRExit::OSRExit):

  • ftl/FTLOSRExit.h:
  • ftl/FTLOSRExitCompiler.cpp:

(JSC::FTL::JSC_DEFINE_JIT_OPERATION):

  • ftl/FTLOSRExitHandle.cpp:

(JSC::FTL::OSRExitHandle::emitExitThunk):

  • ftl/FTLOSRExitHandle.h:

(JSC::FTL::OSRExitHandle::OSRExitHandle):

  • ftl/FTLPatchpointExceptionHandle.cpp:

(JSC::FTL::PatchpointExceptionHandle::scheduleExitCreationForUnwind):

12:10 AM Changeset in webkit [276223] by Chris Dumez
  • 3 edits in trunk/Source/WebKit

Update LibWebRTCCodecsProxy to use a Lock
https://bugs.webkit.org/show_bug.cgi?id=224728

Reviewed by Darin Adler.

Update LibWebRTCCodecsProxy to use a Lock, instead of a std::atomic<bool> that
has to be kept up to date. I think this simplifies the code a bit. Adding / Removing
encoder / decoder is not very hot code as far as I know and there will very rarely
be contention since allowsExitUnderMemoryPressure() is only called on memory pressure.

m_encoder / m_decoder are still always modified from the background thread. However, we
now check from the main thread if they are empty by locking.

  • GPUProcess/webrtc/LibWebRTCCodecsProxy.h:
  • GPUProcess/webrtc/LibWebRTCCodecsProxy.mm:

(WebKit::LibWebRTCCodecsProxy::close):
(WebKit::LibWebRTCCodecsProxy::createH264Decoder):
(WebKit::LibWebRTCCodecsProxy::createH265Decoder):
(WebKit::LibWebRTCCodecsProxy::createVP9Decoder):
(WebKit::LibWebRTCCodecsProxy::releaseDecoder):
(WebKit::LibWebRTCCodecsProxy::decodeFrame):
(WebKit::LibWebRTCCodecsProxy::setFrameSize):
(WebKit::LibWebRTCCodecsProxy::createEncoder):
(WebKit::LibWebRTCCodecsProxy::releaseEncoder):
(WebKit::LibWebRTCCodecsProxy::initializeEncoder):
(WebKit::LibWebRTCCodecsProxy::encodeFrame):
(WebKit::LibWebRTCCodecsProxy::setEncodeRates):
(WebKit::LibWebRTCCodecsProxy::allowsExitUnderMemoryPressure const):
(WebKit::LibWebRTCCodecsProxy::updateHasEncodersOrDecoders): Deleted.

Apr 17, 2021:

10:23 PM Changeset in webkit [276222] by Chris Dumez
  • 6 edits in trunk

GPUConnectionToWebProcess::allowsExitUnderMemoryPressure() should check if libWebRTCCodecsProxy is used
https://bugs.webkit.org/show_bug.cgi?id=224709

Reviewed by Darin Adler.

Source/WebKit:

If the libWebRTCCodecsProxy has either encoders or decoders then the GPUProcess should not
exit under memory pressure, since it is not idle.

  • GPUProcess/GPUConnectionToWebProcess.cpp:

(WebKit::GPUConnectionToWebProcess::allowsExitUnderMemoryPressure const):

  • GPUProcess/webrtc/LibWebRTCCodecsProxy.h:
  • GPUProcess/webrtc/LibWebRTCCodecsProxy.mm:

(WebKit::LibWebRTCCodecsProxy::createH264Decoder):
(WebKit::LibWebRTCCodecsProxy::createH265Decoder):
(WebKit::LibWebRTCCodecsProxy::createVP9Decoder):
(WebKit::LibWebRTCCodecsProxy::releaseDecoder):
(WebKit::LibWebRTCCodecsProxy::createEncoder):
(WebKit::LibWebRTCCodecsProxy::releaseEncoder):
(WebKit::LibWebRTCCodecsProxy::updateHasEncodersOrDecoders):
(WebKit::LibWebRTCCodecsProxy::allowsExitUnderMemoryPressure const):
Use a std::atomic<bool> to determine if the LibWebRTCCodecsProxy has encoders/decoders since
allowsExitUnderMemoryPressure() gets called on the main thread but m_encoders / m_decoders
get updated on a background thread.

Tools:

Add API test coverage.

  • TestWebKitAPI/Tests/WebKitCocoa/GPUProcess.mm:

(runMemoryPressureExitTest):
(waitUntilCaptureState):
(TEST):

9:47 PM Changeset in webkit [276221] by commit-queue@webkit.org
  • 10 edits in trunk/Source/WebKit

Unhandled IPC messages should use correct format with the decoder.destinationID() ASSERT message
https://bugs.webkit.org/show_bug.cgi?id=224335

Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2021-04-17
Reviewed by Antti Koivisto.

Use PRIu64 instead of llu in the ASSERT messages for printing unhandled message destination.
uint64_t is printf'ed with PRIu64.

  • Scripts/webkit/messages.py:

(generate_message_handler):

  • Scripts/webkit/tests/TestWithIfMessageMessageReceiver.cpp:

(WebKit::TestWithIfMessage::didReceiveMessage):

  • Scripts/webkit/tests/TestWithImageDataMessageReceiver.cpp:

(WebKit::TestWithImageData::didReceiveMessage):
(WebKit::TestWithImageData::didReceiveSyncMessage):

  • Scripts/webkit/tests/TestWithLegacyReceiverMessageReceiver.cpp:

(WebKit::TestWithLegacyReceiver::didReceiveTestWithLegacyReceiverMessage):
(WebKit::TestWithLegacyReceiver::didReceiveSyncTestWithLegacyReceiverMessage):

  • Scripts/webkit/tests/TestWithSemaphoreMessageReceiver.cpp:

(WebKit::TestWithSemaphore::didReceiveMessage):
(WebKit::TestWithSemaphore::didReceiveSyncMessage):

  • Scripts/webkit/tests/TestWithStreamBufferMessageReceiver.cpp:

(WebKit::TestWithStreamBuffer::didReceiveMessage):

  • Scripts/webkit/tests/TestWithStreamMessageReceiver.cpp:

(WebKit::TestWithStream::didReceiveStreamMessage):

  • Scripts/webkit/tests/TestWithSuperclassMessageReceiver.cpp:

(WebKit::TestWithSuperclass::didReceiveSyncMessage):

  • Scripts/webkit/tests/TestWithoutAttributesMessageReceiver.cpp:

(WebKit::TestWithoutAttributes::didReceiveMessage):
(WebKit::TestWithoutAttributes::didReceiveSyncMessage):

9:24 PM Changeset in webkit [276220] by Wenson Hsieh
  • 13 edits in trunk/Source

[macOS] Add some support for webpage translation in WebKitLegacy
https://bugs.webkit.org/show_bug.cgi?id=224683
<rdar://problem/75641882>

Reviewed by Darin Adler.

Source/WebCore:

Remove compile-time guards around ContextMenuItemTagAddHighlightToCurrentGroup and
ContextMenuItemTagAddHighlightToNewGroup, so that we can keep these internal WebCore context menu tags in sync
with the SPI-exposed enum values in WebUIDelegatePrivate.h. See WebKitLegacy ChangeLog for more details.

  • page/ContextMenuController.cpp:

(WebCore::ContextMenuController::contextMenuItemSelected):
(WebCore::ContextMenuController::checkOrEnableIfNeeded const):

  • platform/ContextMenuItem.cpp:

(WebCore::isValidContextMenuAction):

  • platform/ContextMenuItem.h:

Source/WebKit:

Remove some more compile-time guards, now that the WebCore enum is not conditional on ENABLE(APP_HIGHLIGHT).
See WebCore/ChangeLog for more information.

  • Shared/API/c/WKSharedAPICast.h:

(WebKit::toAPI):
(WebKit::toImpl):

  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::contextMenuItemSelected):

  • UIProcess/mac/WebContextMenuProxyMac.mm:

(WebKit::menuItemIdentifier):

Source/WebKitLegacy/mac:

Add support for the webpage translation context menu item in WebKitLegacy. See below for more details.

  • WebView/WebHTMLView.mm:

(toAction):
(toTag):

Introduce the WebMenuItemTagTranslate enum value, and use it as the tag value when creating an NSMenuItem
for the Translate action.

(createMenuItem):

  • WebView/WebUIDelegatePrivate.h:

Unfortunately, in order to support a particular internal client of WebKitLegacy, we need to expose
WebMenuItemTagTranslate as an enum value in this existing enumeration of context menu item tags. This is
because the client's implementation of -webView:contextMenuItemsForElement:defaultMenuItems: rejects context
menu items by default, unless the item tag is within the set of item tags that they support.

This client will need to add the enum value of WebMenuItemTagTranslate into their allow-list.

  • WebView/WebView.mm:

(+[WebView _canHandleContextMenuTranslation]):

Softlink against and check with TranslationUIServices to see if we should be showing the Translate menu item.

(-[WebView _handleContextMenuTranslation:selectionBounds:menuLocation:]):

Handle the menu action by creating and presenting a new LTUITranslationViewController using the given
information.

  • WebView/WebViewInternal.h:
8:49 PM Changeset in webkit [276219] by Wenson Hsieh
  • 9 edits in trunk

Remove PromisedAttachmentInfo::blobURL and adjacent code
https://bugs.webkit.org/show_bug.cgi?id=224720

Reviewed by Ryosuke Niwa.

Source/WebCore:

Remove this member of PromisedAttachmentInfo. See WebKit ChangeLog for more details.

  • editing/Editor.cpp:

(WebCore::Editor::promisedAttachmentInfo):

  • platform/PromisedAttachmentInfo.h:

(WebCore::PromisedAttachmentInfo::operator bool const):

Source/WebKit:

The blobURL member of PromisedAttachmentInfo was originally introduced to facilitate drag and drop support
for attachment elements in WebKit2, by writing blob URL data to temporary file paths on behalf of
NSFilePromiseProvider when starting a drag on attachment elements backed by blobs. However, this was
superceded by use of NSFileWrapper and the _WKAttachment SPI instead, such that we only support dragging
attachment elements if they correspond to API Attachment objects in the UI process. This means we can remove
this blobURL, along with the file name and content type members of the struct (which were only added to
support the ability to drag blob-backed attachments).

Code that utilized this member was originally introduced in <https://trac.webkit.org/r235202>, and was
subsequently removed in <https://trac.webkit.org/r240687>.

  • Shared/WebCoreArgumentCoders.cpp:

(IPC::ArgumentCoder<PromisedAttachmentInfo>::encode):
(IPC::ArgumentCoder<PromisedAttachmentInfo>::decode):

  • UIProcess/Cocoa/WebViewImpl.mm:

(-[WKPromisedAttachmentContext initWithIdentifier:fileName:]):
(WebKit::WebViewImpl::writeToURLForFilePromiseProvider):
(WebKit::WebViewImpl::startDrag):
(-[WKPromisedAttachmentContext initWithIdentifier:blobURL:fileName:]): Deleted.
(-[WKPromisedAttachmentContext blobURL]): Deleted.

  • UIProcess/ios/WKContentViewInteraction.mm:

(-[WKContentView _prepareToDragPromisedAttachment:]):

Tools:

Rebaseline a couple of iOS WKAttachment tests that are failing on recent versions of the iOS SDK. The content
type of text files that are inserted as attachments is now a MIME type rather than a UTI, which is still valid
since it is valid for the content type of an attachment to be either a MIME type or UTI.

  • TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm:

(TestWebKitAPI::TEST):

8:40 PM Changeset in webkit [276218] by Chris Dumez
  • 5 edits in trunk/Source/WebKit

Use WebProcess::existingGPUProcessConnection() whenever possible
https://bugs.webkit.org/show_bug.cgi?id=224725

Reviewed by Darin Adler.

Use WebProcess::existingGPUProcessConnection() whenever possible, instead of WebProcess::ensureGPUProcessConnection().
This avoids relaunching the GPUProcess if it has already exited.

  • WebProcess/GPU/media/RemoteAudioHardwareListener.cpp:

(WebKit::RemoteAudioHardwareListener::~RemoteAudioHardwareListener):

  • WebProcess/GPU/webrtc/AudioMediaStreamTrackRenderer.cpp:

(WebKit::AudioMediaStreamTrackRenderer::~AudioMediaStreamTrackRenderer):

  • WebProcess/cocoa/RemoteRealtimeAudioSource.cpp:

(WebKit::RemoteRealtimeAudioSource::~RemoteRealtimeAudioSource):

  • WebProcess/cocoa/RemoteRealtimeVideoSource.cpp:

(WebKit::RemoteRealtimeVideoSource::~RemoteRealtimeVideoSource):

6:19 PM Changeset in webkit [276217] by ysuzuki@apple.com
  • 3 edits in trunk/Source/JavaScriptCore

Unreviewed, suppress warnings
https://bugs.webkit.org/show_bug.cgi?id=224616

  • runtime/HashMapImpl.h:
  • runtime/HashMapImplInlines.h:

(JSC::areKeysEqual):
(JSC::wangsInt64Hash):

6:03 PM Changeset in webkit [276216] by commit-queue@webkit.org
  • 30 edits
    8 adds in trunk

Add support for inline-{start/end} values to float & clear properties
https://bugs.webkit.org/show_bug.cgi?id=218087

Patch by Tim Nguyen <ntim@apple.com> on 2021-04-17
Reviewed by Antti Koivisto & Zalan Bujtas.

Imported reftests from: https://github.com/web-platform-tests/wpt/commit/47e7176242e2ca4ca68d6cfe032619ccf44d55a6
Enabled: imported/w3c/web-platform-tests/css/css-logical/logical-values-float-clear.html

LayoutTests/imported/w3c:

  • web-platform-tests/css/css-box/parsing/clear-computed-expected.txt:
  • web-platform-tests/css/css-box/parsing/clear-valid-expected.txt:
  • web-platform-tests/css/css-box/parsing/float-computed-expected.txt:
  • web-platform-tests/css/css-box/parsing/float-valid-expected.txt:
  • web-platform-tests/css/css-logical/logical-values-float-clear-1-expected.html: Added.
  • web-platform-tests/css/css-logical/logical-values-float-clear-1.html: Added.
  • web-platform-tests/css/css-logical/logical-values-float-clear-2-expected.html: Added.
  • web-platform-tests/css/css-logical/logical-values-float-clear-2.html: Added.
  • web-platform-tests/css/css-logical/logical-values-float-clear-3-expected.html: Added.
  • web-platform-tests/css/css-logical/logical-values-float-clear-3.html: Added.
  • web-platform-tests/css/css-logical/logical-values-float-clear-4-expected.html: Added.
  • web-platform-tests/css/css-logical/logical-values-float-clear-4.html: Added.
  • web-platform-tests/css/css-logical/logical-values-float-clear-expected.txt:
  • web-platform-tests/css/css-logical/w3c-import.log:

Source/WebCore:

Tests: imported/w3c/web-platform-tests/css/css-logical/logical-values-float-clear-1.html

imported/w3c/web-platform-tests/css/css-logical/logical-values-float-clear-2.html
imported/w3c/web-platform-tests/css/css-logical/logical-values-float-clear-3.html
imported/w3c/web-platform-tests/css/css-logical/logical-values-float-clear-4.html

  • css/CSSPrimitiveValueMappings.h:

(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator Clear const):
(WebCore::CSSPrimitiveValue::operator Float const):

  • css/CSSValueKeywords.in:
  • css/parser/CSSParserFastPaths.cpp:

(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):

  • display/css/DisplayStyle.cpp:

(WebCore::Display::Style::Style):

  • layout/integration/LayoutIntegrationBoxTree.cpp:

(WebCore::LayoutIntegration::BoxTree::buildTree):

  • layout/layouttree/LayoutBox.cpp:

(WebCore::Layout::Box::isFloatingPositioned const):

  • layout/layouttree/LayoutTreeBuilder.cpp:

(WebCore::Layout::TreeBuilder::createLayoutBox):
(WebCore::Layout::TreeBuilder::buildTableStructure):

  • rendering/ComplexLineLayout.cpp:

(WebCore::ComplexLineLayout::layoutRunsAndFloats):
(WebCore::ComplexLineLayout::layoutRunsAndFloatsInRange):

  • rendering/FloatingObjects.cpp:

(WebCore::FloatingObject::FloatingObject):

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::computeBlockPreferredLogicalWidths const):

  • rendering/RenderBlockFlow.cpp:

(WebCore::RenderBlockFlow::marginOffsetForSelfCollapsingBlock):
(WebCore::RenderBlockFlow::marginBeforeEstimateForChild const):
(WebCore::RenderBlockFlow::computeLogicalLocationForFloat):
(WebCore::RenderBlockFlow::positionNewFloats):
(WebCore::RenderBlockFlow::clearFloats):
(WebCore::RenderBlockFlow::getClearDelta):
(WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):

  • rendering/RenderBlockFlow.h:
  • rendering/line/BreakingContext.h:

(WebCore::BreakingContext::handleBR):

  • rendering/line/LineBreaker.cpp:

(WebCore::LineBreaker::reset):

  • rendering/line/LineBreaker.h:

(WebCore::LineBreaker::usedClear):

  • rendering/style/RenderStyle.cpp:

(WebCore::RenderStyle::usedClear):
(WebCore::RenderStyle::usedFloat):

  • rendering/style/RenderStyle.h:

(WebCore::RenderStyle::isFloating const):
(WebCore::RenderStyle::initialFloating):

  • rendering/style/RenderStyleConstants.cpp:

(WebCore::operator<<):

  • rendering/style/RenderStyleConstants.h:
  • style/StyleAdjuster.cpp:

(WebCore::Style::Adjuster::adjust const):

LayoutTests:

5:27 PM Changeset in webkit [276215] by Diego Pino Garcia
  • 2 edits
    2 adds in trunk/LayoutTests

[GLIB] Unreviewed test gardening. Emit new baseline after r276193.

  • platform/glib/TestExpectations:
  • platform/glib/http/tests/xmlhttprequest/simple-cross-origin-denied-events-post-expected.txt: Added.
5:10 PM Changeset in webkit [276214] by Chris Dumez
  • 5 edits in trunk/Source

LibWebRTCCodecs eagerly launches the GPUProcess and always relaunches it on exit
https://bugs.webkit.org/show_bug.cgi?id=224704

Reviewed by Darin Adler.

LibWebRTCCodecs eagerly launches the GPUProcess and always relaunches it on exit. The GPUProcess
should only be (re-)launched when needed. In the case of the LibWebRTCCodecs, it seems it only
needs a GPUProcess connection if it has m_decoders / m_encoders are non-empty.

  • WebProcess/GPU/webrtc/LibWebRTCCodecs.cpp:

(WebKit::LibWebRTCCodecs::ensureGPUProcessConnectionOnMainThread):
Renamed startListeningForIPC() to ensureGPUProcessConnectionOnMainThread(). Only do the
connection initialization if m_connection is not null.

(WebKit::LibWebRTCCodecs::ensureGPUProcessConnectionAndDispatchToThread):
Version of dispatchToThread() which makes sure that the GPUProcessConnection is initialized
before dispatching. It is used when constructing a decoder / encoder. It sets the
m_needsGPUProcessConnection flag to true to indicate someone needed the connection
(and that we should re-initiate it in case it is severed). If the connection is already
initialized, then it does a simple dispatchToThread(). If the connection is not initialized
yet, then we have to hop to the main thread (if not already on it) to initialize the
GPUProcessConnection.

(WebKit::LibWebRTCCodecs::gpuProcessConnectionMayNoLongerBeNeeded):
Function that gets called on the background thread every time a encoder / decoder is
removed. Its purpose is to set m_needsGPUProcessConnection back to false once we no
longer have any encoder / decoder, so that gpuProcessConnectionDidClose() does not
attempt to relaunch the GPUProcess if it goes away.

LibWebRTCCodecs::setCallbacks():
Check if VP9Support is enabled via PlatformMediaSessionManager instead of from the
GPUProcessConnection. This avoids eagerly launching the GPUProcess. The
GPUProcessConnection constructor gets its VPx support information from
PlatformMediaSessionManager anyway. The WebPage constructor is where the VPx support
information comes from and it updates the VPx flags on the PlatformMediaSessionManager.
The WebPage constructor only updates the VPx flags on the GPUProcessConnection if this
connection already exists to avoid eagerly launching the GPUProcess.

(WebKit::LibWebRTCCodecs::createDecoder):

  • Call ensureGPUProcessConnectionAndDispatchToThread() instead of dispatchToThread() to make sure we have a GPUProcessConnection before creating the decoder.
  • Add a missing locker for m_connectionLock on the background thread since it is using m_connection (pre-existing bug).

(WebKit::LibWebRTCCodecs::releaseDecoder):
Call gpuProcessConnectionMayNoLongerBeNeeded() to reset the m_needsGPUProcessConnection
flag to false if necessary.

(WebKit::LibWebRTCCodecs::createEncoder):

  • Call ensureGPUProcessConnectionAndDispatchToThread() instead of dispatchToThread() to make sure we have a GPUProcessConnection before creating the encoder.

(WebKit::LibWebRTCCodecs::releaseEncoder):
Call gpuProcessConnectionMayNoLongerBeNeeded() to reset the m_needsGPUProcessConnection
flag to false if necessary.

(WebKit::LibWebRTCCodecs::gpuProcessConnectionDidClose):

  • Clear m_connection when the GPUProcess connection is severed (note that this does not necessarily indicate a crash since the GPUProcess exits when idle and under memory pressure).
  • Only re-initiate the GPUProcess connection if m_needsGPUProcessConnection is true, meaning that we have encoders/decoders. I use this flag instead of checking m_encoders & m_decoders since those containers are modified on the background thread and this function is called on the main thread.
  • WebProcess/GPU/webrtc/LibWebRTCCodecs.h:

(WebKit::LibWebRTCCodecs::create):

  • Stop calling startListeningForIPC() on construction as we don't want to launch the GPUProcess

until an encoder / decoder is created.

  • Fix a pre-existing issue where the class subclasses ThreadSafeRefCounted (via ThreadMessageReceiverRefCounted) and yet was using std::unique_ptr<> instead of RefPtr<>.
  • WebProcess/WebProcess.h:
4:55 PM Changeset in webkit [276213] by commit-queue@webkit.org
  • 2 edits in trunk/LayoutTests

Unreviewed, reverting r276178.
https://bugs.webkit.org/show_bug.cgi?id=224724

tests still broken

Reverted changeset:

"[ macOS Wk2 ] media/media-fragments/TC0051.html is flakey
crashing"
https://bugs.webkit.org/show_bug.cgi?id=222277
https://trac.webkit.org/changeset/276178

4:22 PM Changeset in webkit [276212] by Chris Dumez
  • 4 edits in trunk/Source/WebKit

RemoteImageDecoderAVFManager should never re-launch the GPUProcess on destruction
https://bugs.webkit.org/show_bug.cgi?id=224723

Reviewed by Darin Adler.

RemoteImageDecoderAVFManager was calling ensureGPUProcessConnection() it is destructor,
just to remove itself as an IPC message receiver. This means it could unnecessarily
relaunch the GPUProcess. This patch addresses that.

This patch also makes it so that RemoteImageDecoderAVFManager registers itself as a
client of the GPUProcessConnection, so that it gets notified when the connection gets
severed. Right now, I only do very basic crash handling but this paves the way to do
better in the future. I did fix a bug where the RemoteImageDecoderAVFManager would
not re-register itself as a message receiver after a GPUProcess re-launch.

  • WebProcess/GPU/media/RemoteImageDecoderAVF.cpp:

(WebKit::RemoteImageDecoderAVF::RemoteImageDecoderAVF):

  • WebProcess/GPU/media/RemoteImageDecoderAVFManager.cpp:

(WebKit::RemoteImageDecoderAVFManager::createImageDecoder):
(WebKit::RemoteImageDecoderAVFManager::deleteRemoteImageDecoder):
(WebKit::RemoteImageDecoderAVFManager::~RemoteImageDecoderAVFManager):
(WebKit::RemoteImageDecoderAVFManager::gpuProcessConnectionDidClose):
(WebKit::RemoteImageDecoderAVFManager::ensureGPUProcessConnection):
(WebKit::RemoteImageDecoderAVFManager::gpuProcessConnection const): Deleted.

  • WebProcess/GPU/media/RemoteImageDecoderAVFManager.h:
3:55 PM Changeset in webkit [276211] by basuke.suzuki@sony.com
  • 6 edits in trunk/Source/WebCore

[Curl] Remove warnings on curl layer.
https://bugs.webkit.org/show_bug.cgi?id=224721

Reviewed by Darin Adler.

Remove unused parameters to prevent warnings. For CurlRequest, it passes
member variable to private method which is meaningless so that it was
removed.

Covered by existing test files.

  • platform/network/curl/CookieJarDB.cpp:

(WebCore::CookieJarDB::createPrepareStatement):

  • platform/network/curl/CurlFormDataStream.cpp:

(WebCore::CurlFormDataStream::read):

  • platform/network/curl/CurlRequest.cpp:

(WebCore::CurlRequest::setupTransfer):
(WebCore::CurlRequest::setupPUT):
(WebCore::CurlRequest::setupPOST):

  • platform/network/curl/CurlRequest.h:
  • platform/network/curl/NetworkStorageSessionCurl.cpp:

(WebCore::NetworkStorageSession::setCookiesFromDOM const):

3:40 PM Changeset in webkit [276210] by Chris Lord
  • 2 edits in trunk/Source/WebCore

Create local copy of CSSParserContext in CSSPropertyParserWorkerSafe
https://bugs.webkit.org/show_bug.cgi?id=224675

Reviewed by Darin Adler.

Make sure to hold a copy of the CSSParserContext in
CSSPropertyParserWorkerSafe functions as CSSParserImpl only takes a
reference.

  • css/parser/CSSParserWorkerSafe.cpp:
3:38 PM Changeset in webkit [276209] by commit-queue@webkit.org
  • 10 edits in trunk

Consider making CSSStyleSheet::rules() just an alias of CSSStyleSheet::cssRules().
https://bugs.webkit.org/show_bug.cgi?id=197725

Patch by Tyler Wilcock <Tyler Wilcock> on 2021-04-17
Reviewed by Darin Adler.

LayoutTests/imported/w3c:

To match other browsers and the below WPT, CSSStyleSheet.rules now aliases
CSSStyleSheet.cssRulesForBindings, meaning we pass two more tests.

  • web-platform-tests/css/cssom/CSSStyleSheet-expected.txt:

Source/WebCore:

To match other browsers (Blink and Gecko) and pass a WPT, CSSStyleSheet.rules now aliases
CSSStyleSheet.cssRulesForBindings. CSSStyleSheet.rulesForBindings is deleted.

Tested by
imported/w3c/web-platform-tests/css/cssom/CSSStyleSheet.html.

  • css/CSSStyleSheet.cpp:

(WebCore::CSSStyleSheet::rulesForBindings): Deleted.
(WebCore::CSSStyleSheet::rules): Deleted.

  • css/CSSStyleSheet.h:

Change rules() to be an inlined alias for cssRulesForBindings().

  • css/CSSStyleSheet.idl:

Remove [ImplementedAs=rulesForBindings], as this function has been
deleted.

Source/WebKit:

CSSStyleSheet.rules has been changed to alias CSSStyleSheet.cssRulesForBindings. Now,
to access just the CSSRuleList, CSSStyleSheet.cssRules must be called.

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.cpp:

(webkit_dom_css_style_sheet_get_rules):
Use CSSStyleSheet.cssRules instead of CSSStyleSheet.rules (deleted
with this patch) to get access to the CSSRuleList of this
stylesheet.

Source/WebKitLegacy/mac:

CSSStyleSheet.rules has been changed to alias CSSStyleSheet.cssRulesForBindings. Now,
to access just the CSSRuleList, CSSStyleSheet.cssRules must be called.

  • DOM/DOMCSSStyleSheet.mm:

(-[DOMCSSStyleSheet rules]):
Update this function to call IMPL->cssRules instead of IMPL->rules.

3:21 PM Changeset in webkit [276208] by commit-queue@webkit.org
  • 4 edits
    2 adds in trunk

Media queries with max-width greater than 999999999px evaluate to false
https://bugs.webkit.org/show_bug.cgi?id=224097

Patch by Tyler Wilcock <Tyler Wilcock> on 2021-04-17
Reviewed by Darin Adler.

We now evaluate <length> values in media queries with double
Source/WebCore:

precision instead of int precision to match other browsers and pass a WPT.

See similar method in Chromium:
https://github.com/chromium/chromium/blob/09a0b960b27f6e08fbe67ad97e6c4fb55ada383f/third_party/blink/renderer/core/css/media_query_evaluator.cc#L436

Test: fast/media/media-query-lengths-evaluate-with-double-precision.html
and WPT imported/w3c/web-platform-tests/css/mediaqueries/min-width-001.xht

  • css/MediaQueryEvaluator.cpp:

(WebCore::computeLength):
Return Optional<double> rather than int& out-value.

(WebCore::deviceHeightEvaluate):
(WebCore::deviceWidthEvaluate):
(WebCore::heightEvaluate):
(WebCore::widthEvaluate):
Evaluate length values as doubles instead of ints.

LayoutTests:

precision instead of int precision to match other browsers and pass another WPT.

Remove ImageOnlyFailure for imported/w3c/web-platform-tests/css/mediaqueries/min-width-001.xht
because it passes now.

  • fast/media/media-query-lengths-evaluate-with-double-precision-expected.html:

Added.

  • fast/media/media-query-lengths-evaluate-with-double-precision.html:

Added to test properties that WPT min-width-001.xht doesn't
(min-height, device-min-height, device-min-width).

2:13 PM Changeset in webkit [276207] by Alan Bujtas
  • 2 edits in trunk/Source/WebCore

[Cleanup] Remove redundant BreakingContext::m_currentStyle
https://bugs.webkit.org/show_bug.cgi?id=224717

Reviewed by Antti Koivisto.

  • rendering/line/BreakingContext.h:

(WebCore::BreakingContext::BreakingContext):
(WebCore::BreakingContext::initializeForCurrentObject):
(WebCore::BreakingContext::handleBR):
(WebCore::BreakingContext::handleText):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

1:59 PM Changeset in webkit [276206] by Brent Fulgham
  • 2 edits in trunk/Source/WebCore

Perform port blocking earlier in the load
https://bugs.webkit.org/show_bug.cgi?id=224525
<rdar://problem/75440591>

Unreviewed follow-up (suggested by David Kilzer)

  • loader/DocumentLoader.cpp:

(WebCore::DocumentLoader::willSendRequest): Restore an m_frame nullptr check.,

1:16 PM Changeset in webkit [276205] by basuke.suzuki@sony.com
  • 3 edits in trunk/Source/WebCore

[clang 11] Remove warning when converting WebCore::maxValueForCssLength from int to float
https://bugs.webkit.org/show_bug.cgi?id=224714

Reviewed by Chris Dumez.

On clang 11, the conversion from const int WebCore::maxValueForCssLength (= 33554429) to
float generates conversion warning:

warning: implicit conversion from 'const int' to 'float' changes value from 33554429 to 33554428

Changing the target type from float to double works for this. Length constructor accept double
so that there's no drawback with this change.

No test because it's compiler behavior.

  • style/StyleBuilderConverter.h:

(WebCore::Style::BuilderConverter::convertWordSpacing):

1:07 PM Changeset in webkit [276204] by weinig@apple.com
  • 169 edits in trunk/Source

Move RuntimeEnabledFeatures to Settings (Part 1)
https://bugs.webkit.org/show_bug.cgi?id=224440

Reviewed by Alex Christensen.

Move a few RuntimeEnabledFeatures to Settings to consolidate settings
in one object and removes the need for additional boilerplate. This
is now possible as Settings are now accessible in workers.

Moves PeerConnectionEnabled, WebGLUsingMetal, WebGL2Enabled, WebGPUEnabled
and MaskWebGLStringsEnabled.

Source/WebCore:

  • Modules/mediastream/RTCAnswerOptions.idl:
  • Modules/mediastream/RTCCertificate.idl:
  • Modules/mediastream/RTCConfiguration.idl:
  • Modules/mediastream/RTCDTMFSender.idl:
  • Modules/mediastream/RTCDTMFToneChangeEvent.idl:
  • Modules/mediastream/RTCDataChannel.idl:
  • Modules/mediastream/RTCDataChannelEvent.idl:
  • Modules/mediastream/RTCIceCandidate.idl:
  • Modules/mediastream/RTCIceCandidateInit.idl:
  • Modules/mediastream/RTCIceConnectionState.idl:
  • Modules/mediastream/RTCIceGatheringState.idl:
  • Modules/mediastream/RTCIceServer.idl:
  • Modules/mediastream/RTCIceTransport.idl:
  • Modules/mediastream/RTCIceTransportState.idl:
  • Modules/mediastream/RTCOfferAnswerOptions.idl:
  • Modules/mediastream/RTCOfferOptions.idl:
  • Modules/mediastream/RTCPeerConnection.idl:
  • Modules/mediastream/RTCPeerConnectionIceErrorEvent.idl:
  • Modules/mediastream/RTCPeerConnectionIceEvent.idl:
  • Modules/mediastream/RTCPeerConnectionState.idl:
  • Modules/mediastream/RTCPriorityType.idl:
  • Modules/mediastream/RTCRtcpParameters.idl:
  • Modules/mediastream/RTCRtpCapabilities.idl:
  • Modules/mediastream/RTCRtpCodecCapability.idl:
  • Modules/mediastream/RTCRtpCodecParameters.idl:
  • Modules/mediastream/RTCRtpCodingParameters.idl:
  • Modules/mediastream/RTCRtpContributingSource.idl:
  • Modules/mediastream/RTCRtpDecodingParameters.idl:
  • Modules/mediastream/RTCRtpEncodingParameters.idl:
  • Modules/mediastream/RTCRtpFecParameters.idl:
  • Modules/mediastream/RTCRtpHeaderExtensionParameters.idl:
  • Modules/mediastream/RTCRtpParameters.idl:
  • Modules/mediastream/RTCRtpReceiver.idl:
  • Modules/mediastream/RTCRtpRtxParameters.idl:
  • Modules/mediastream/RTCRtpSendParameters.idl:
  • Modules/mediastream/RTCRtpSender.idl:
  • Modules/mediastream/RTCRtpSynchronizationSource.idl:
  • Modules/mediastream/RTCRtpTransceiver.idl:
  • Modules/mediastream/RTCRtpTransceiverDirection.idl:
  • Modules/mediastream/RTCSdpType.idl:
  • Modules/mediastream/RTCSessionDescription.idl:
  • Modules/mediastream/RTCSignalingState.idl:
  • Modules/mediastream/RTCStatsReport.idl:
  • Modules/mediastream/RTCTrackEvent.idl:
  • Modules/webgpu/GPUBindGroupLayoutBinding.idl:
  • Modules/webgpu/GPUBindGroupLayoutDescriptor.idl:
  • Modules/webgpu/GPUBlendDescriptor.idl:
  • Modules/webgpu/GPUBufferDescriptor.idl:
  • Modules/webgpu/GPUBufferUsage.idl:
  • Modules/webgpu/GPUCanvasContext.idl:
  • Modules/webgpu/GPUColor.idl:
  • Modules/webgpu/GPUColorStateDescriptor.idl:
  • Modules/webgpu/GPUColorWrite.idl:
  • Modules/webgpu/GPUCompareFunction.idl:
  • Modules/webgpu/GPUDepthStencilStateDescriptor.idl:
  • Modules/webgpu/GPUErrorFilter.idl:
  • Modules/webgpu/GPUExtent3D.idl:
  • Modules/webgpu/GPULoadOp.idl:
  • Modules/webgpu/GPUOrigin3D.idl:
  • Modules/webgpu/GPUOutOfMemoryError.idl:
  • Modules/webgpu/GPURequestAdapterOptions.idl:
  • Modules/webgpu/GPUSamplerDescriptor.idl:
  • Modules/webgpu/GPUShaderStage.idl:
  • Modules/webgpu/GPUStoreOp.idl:
  • Modules/webgpu/GPUTextureDescriptor.idl:
  • Modules/webgpu/GPUTextureFormat.idl:
  • Modules/webgpu/GPUTextureUsage.idl:
  • Modules/webgpu/GPUUncapturedErrorEvent.idl:
  • Modules/webgpu/GPUValidationError.idl:
  • Modules/webgpu/GPUVertexAttributeDescriptor.idl:
  • Modules/webgpu/GPUVertexBufferDescriptor.idl:
  • Modules/webgpu/GPUVertexInputDescriptor.idl:
  • Modules/webgpu/Navigator+GPU.idl:
  • Modules/webgpu/NavigatorGPU.cpp:
  • Modules/webgpu/WebGPU.idl:
  • Modules/webgpu/WebGPUAdapter.idl:
  • Modules/webgpu/WebGPUBindGroup.idl:
  • Modules/webgpu/WebGPUBindGroupBinding.idl:
  • Modules/webgpu/WebGPUBindGroupDescriptor.idl:
  • Modules/webgpu/WebGPUBindGroupLayout.idl:
  • Modules/webgpu/WebGPUBuffer.idl:
  • Modules/webgpu/WebGPUBufferBinding.idl:
  • Modules/webgpu/WebGPUCommandBuffer.idl:
  • Modules/webgpu/WebGPUCommandEncoder.idl:
  • Modules/webgpu/WebGPUComputePassEncoder.idl:
  • Modules/webgpu/WebGPUComputePipeline.idl:
  • Modules/webgpu/WebGPUComputePipelineDescriptor.idl:
  • Modules/webgpu/WebGPUDevice.idl:
  • Modules/webgpu/WebGPUDeviceErrorScopes.idl:
  • Modules/webgpu/WebGPUDeviceEventHandler.idl:
  • Modules/webgpu/WebGPUPipelineDescriptorBase.idl:
  • Modules/webgpu/WebGPUPipelineLayout.idl:
  • Modules/webgpu/WebGPUPipelineLayoutDescriptor.idl:
  • Modules/webgpu/WebGPUProgrammablePassEncoder.idl:
  • Modules/webgpu/WebGPUProgrammableStageDescriptor.idl:
  • Modules/webgpu/WebGPUQueue.idl:
  • Modules/webgpu/WebGPURenderPassDescriptor.idl:
  • Modules/webgpu/WebGPURenderPassEncoder.idl:
  • Modules/webgpu/WebGPURenderPipeline.idl:
  • Modules/webgpu/WebGPURenderPipelineDescriptor.idl:
  • Modules/webgpu/WebGPUSampler.idl:
  • Modules/webgpu/WebGPUShaderModule.idl:
  • Modules/webgpu/WebGPUShaderModuleDescriptor.idl:
  • Modules/webgpu/WebGPUSwapChain.idl:
  • Modules/webgpu/WebGPUTexture.idl:
  • Modules/webgpu/WebGPUTextureView.idl:
  • Modules/webgpu/WorkerNavigator+GPU.idl:
  • Modules/webgpu/WorkerNavigatorGPU.cpp:
  • Modules/webxr/Navigator+WebXR.idl:
  • Modules/webxr/WebXRBoundedReferenceSpace.idl:
  • Modules/webxr/WebXRFrame.idl:
  • Modules/webxr/WebXRInputSource.idl:
  • Modules/webxr/WebXRInputSourceArray.idl:
  • Modules/webxr/WebXRLayer.idl:
  • Modules/webxr/WebXRPose.idl:
  • Modules/webxr/WebXRReferenceSpace.idl:
  • Modules/webxr/WebXRRenderState.idl:
  • Modules/webxr/WebXRRigidTransform.idl:
  • Modules/webxr/WebXRSession.idl:
  • Modules/webxr/WebXRSpace.idl:
  • Modules/webxr/WebXRSystem.cpp:
  • Modules/webxr/WebXRSystem.idl:
  • Modules/webxr/WebXRView.idl:
  • Modules/webxr/WebXRViewerPose.idl:
  • Modules/webxr/WebXRViewport.idl:
  • Modules/webxr/WebXRWebGLLayer.idl:
  • Modules/webxr/XREnvironmentBlendMode.idl:
  • Modules/webxr/XREye.idl:
  • Modules/webxr/XRHandedness.idl:
  • Modules/webxr/XRInputSourceEvent.idl:
  • Modules/webxr/XRInputSourcesChangeEvent.idl:
  • Modules/webxr/XRInteractionMode.idl:
  • Modules/webxr/XRReferenceSpaceEvent.idl:
  • Modules/webxr/XRReferenceSpaceType.idl:
  • Modules/webxr/XRRenderStateInit.idl:
  • Modules/webxr/XRSessionEvent.idl:
  • Modules/webxr/XRSessionInit.idl:
  • Modules/webxr/XRSessionMode.idl:
  • Modules/webxr/XRTargetRayMode.idl:
  • Modules/webxr/XRVisibilityState.idl:
  • Modules/webxr/XRWebGLLayerInit.idl:
  • html/HTMLCanvasElement.cpp:
  • html/canvas/WebGL2RenderingContext.cpp:
  • html/canvas/WebGL2RenderingContext.idl:
  • html/canvas/WebGLRenderingContextBase.cpp:
  • html/canvas/WebGLTransformFeedback.idl:
  • html/canvas/WebGLVertexArrayObject.idl:
  • page/RuntimeEnabledFeatures.h:

(WebCore::RuntimeEnabledFeatures::peerConnectionEnabled const): Deleted.
(WebCore::RuntimeEnabledFeatures::setPeerConnectionEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::setWebGLUsingMetal): Deleted.
(WebCore::RuntimeEnabledFeatures::webGLUsingMetal const): Deleted.
(WebCore::RuntimeEnabledFeatures::setWebGL2Enabled): Deleted.
(WebCore::RuntimeEnabledFeatures::webGL2Enabled const): Deleted.
(WebCore::RuntimeEnabledFeatures::setWebGPUEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::webGPUEnabled const): Deleted.
(WebCore::RuntimeEnabledFeatures::setMaskWebGLStringsEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::maskWebGLStringsEnabled const): Deleted.

  • testing/FakeXRBoundsPoint.idl:
  • testing/FakeXRButtonStateInit.idl:
  • testing/FakeXRInputSourceInit.idl:
  • testing/FakeXRRigidTransformInit.idl:
  • testing/FakeXRViewInit.idl:
  • testing/InternalSettings.cpp:

(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setWebGL2Enabled): Deleted.
(WebCore::InternalSettings::setWebGPUEnabled): Deleted.

  • testing/InternalSettings.h:
  • testing/InternalSettings.idl:
  • testing/Internals.cpp:
  • testing/WebFakeXRDevice.idl:
  • testing/WebFakeXRInputController.idl:
  • testing/WebXRTest.idl:
  • testing/XRSimulateUserActivationFunction.idl:

Source/WebKit:

  • WebProcess/Inspector/RemoteWebInspectorUI.cpp:

(WebKit::RemoteWebInspectorUI::RemoteWebInspectorUI):

  • WebProcess/Inspector/WebInspectorUI.cpp:

(WebKit::WebInspectorUI::enableFrontendFeatures):
(WebKit::WebInspectorUI::WebInspectorUI):

  • WebProcess/Inspector/WebInspectorUI.h:

Source/WTF:

  • Scripts/Preferences/WebPreferences.yaml:
  • Scripts/Preferences/WebPreferencesExperimental.yaml:
12:02 PM Changeset in webkit [276203] by commit-queue@webkit.org
  • 5 edits in trunk

Don't omit conic gradient starting angle when serializing when starting angle is under 0
https://bugs.webkit.org/show_bug.cgi?id=224719

Patch by Tim Nguyen <ntim@apple.com> on 2021-04-17
Reviewed by Ryosuke Niwa.

Updated pre-existing test to cover this case.

Test: LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/parsing/background-image-computed.sub.html

LayoutTests/imported/w3c:

  • web-platform-tests/css/css-backgrounds/parsing/background-image-computed.sub-expected.txt:
  • web-platform-tests/css/css-backgrounds/parsing/background-image-computed.sub.html:

Source/WebCore:

  • css/CSSGradientValue.cpp:

(WebCore::CSSConicGradientValue::customCSSText const):

11:22 AM Changeset in webkit [276202] by Alan Bujtas
  • 4 edits in trunk/Source/WebCore

[Cleanup] Modernize TrailingObjects
https://bugs.webkit.org/show_bug.cgi?id=224712

Reviewed by Antti Koivisto.

Remove redundant c'tor and start using enum class.

  • rendering/line/BreakingContext.h:

(WebCore::BreakingContext::handleText):
(WebCore::checkWhitespaceCollapsingTransitions):
(WebCore::BreakingContext::handleEndOfLine):

  • rendering/line/TrailingObjects.cpp:

(WebCore::TrailingObjects::updateWhitespaceCollapsingTransitionsForTrailingBoxes):

  • rendering/line/TrailingObjects.h:

(WebCore::TrailingObjects::setTrailingWhitespace):
(WebCore::TrailingObjects::clear):
(WebCore::TrailingObjects::TrailingObjects): Deleted.

8:38 AM Changeset in webkit [276201] by Alan Bujtas
  • 3 edits in trunk/Source/WebCore

[Cleanup] BreakingContext::handleText should consistently use the cached renderer
https://bugs.webkit.org/show_bug.cgi?id=224711

Reviewed by Antti Koivisto.

Since this function is not supposed to increment the renderer, let's replace m_current.renderer() with "renderer".

  • rendering/line/BreakingContext.h:

(WebCore::BreakingContext::handleText):

  • rendering/line/TrailingObjects.h:

(WebCore::TrailingObjects::setTrailingWhitespace):

6:48 AM Changeset in webkit [276200] by Alan Bujtas
  • 2 edits in trunk/Source/WebCore

[Cleanup] inlineLogicalWidth should take const RenderObject&
https://bugs.webkit.org/show_bug.cgi?id=224700

Reviewed by Antti Koivisto.

  1. inlineLogicalWidth takes const RenderObject& now.
  2. Both previousInFlowSibling and shouldAddBorderPaddingMargin moved to inlineLogicalWidth
  • rendering/line/BreakingContext.h:

(WebCore::inlineLogicalWidth):
(WebCore::BreakingContext::handleOutOfFlowPositioned):
(WebCore::BreakingContext::handleEmptyInline):
(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::handleText):
(WebCore::shouldAddBorderPaddingMargin): Deleted.
(WebCore::previousInFlowSibling): Deleted.

5:20 AM Changeset in webkit [276199] by aakash_jain@apple.com
  • 3 edits in trunk/Tools

Do not configure Janitor to delete old logs in local testing mode
https://bugs.webkit.org/show_bug.cgi?id=224552

Reviewed by Jonathan Bedard.

  • CISupport/build-webkit-org/master_buildbot2.cfg:
  • CISupport/ews-build/master.cfg:
5:08 AM Changeset in webkit [276198] by Philippe Normand
  • 2 edits in trunk/Source/WebCore

Unreviewed, GTK LTS build fix after r276197

  • platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:

(WebCore::MediaPlayerPrivateGStreamer::configureMediaStreamAudioTracks):

4:23 AM Changeset in webkit [276197] by Philippe Normand
  • 9 edits in trunk

[GStreamer][MediaStream] fast/mediastream/play-newly-added-audio-track.html is failing since added in r260380
https://bugs.webkit.org/show_bug.cgi?id=210840

Reviewed by Xabier Rodriguez-Calvar.

Source/WebCore:

The test was failing mainly because our mediastreamsrc GStreamer element wasn't creating the
corresponding AudioTrackPrivateMediaStream object. The media player should propagate its
volume/mute/is-playing states to the source element. And also until now our mediastreamsrc
element was handling at most one audio track and at most one audio track, but it turns out
multiple audio tracks can be added actually. So I refactored the element internals
accordingly. The InternalSource is now directly observing the corresponding
RealtimeMediaSource, which simplified some code. Observing is also now suspended/resumed
depending on the element state.

We don't implement a GStreamer AudioMediaStreamTrackRenderer class yet, because actual
rendering is still performed from the WebProcess, so early returns were added in
AudioTrackPrivateMediaStream to handle this case.

  • platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:

(WebCore::MediaPlayerPrivateGStreamer::updateTracks):
(WebCore::MediaPlayerPrivateGStreamer::configureMediaStreamAudioTracks):
(WebCore::MediaPlayerPrivateGStreamer::setVolume):
(WebCore::MediaPlayerPrivateGStreamer::setMuted):
(WebCore::MediaPlayerPrivateGStreamer::updateStates):
(WebCore::MediaPlayerPrivateGStreamer::didEnd):

  • platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
  • platform/mediastream/AudioTrackPrivateMediaStream.cpp:

(WebCore::AudioTrackPrivateMediaStream::createRenderer):
(WebCore::AudioTrackPrivateMediaStream::setLogger):
(WebCore::AudioTrackPrivateMediaStream::clear):
(WebCore::AudioTrackPrivateMediaStream::setVolume):
(WebCore::AudioTrackPrivateMediaStream::setAudioOutputDevice):
(WebCore::AudioTrackPrivateMediaStream::volume const):
(WebCore::AudioTrackPrivateMediaStream::audioSamplesAvailable):
(WebCore::AudioTrackPrivateMediaStream::startRenderer):
(WebCore::AudioTrackPrivateMediaStream::stopRenderer):
(WebCore::AudioTrackPrivateMediaStream::createNewRenderer):

  • platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:

(mediaStreamTrackPrivateGetTags):
(WebKitMediaStreamObserver::didRemoveTrack):
(webkitMediaStreamSrcConstructed):
(webkitMediaStreamSrcDispose):
(webkitMediaStreamSrcChangeState):
(webkitMediaStreamSrcPostStreamCollection):
(webkitMediaStreamSrcAddPad):
(ProbeData::ProbeData):
(webkitMediaStreamSrcPadProbeCb):
(webkitMediaStreamSrcAddTrack):
(webkitMediaStreamSrcSetStream):
(webkitMediaStreamSrcTrackEnded):
(InternalSource::trackEnded):
(webkitMediaStreamSrcConfigureAudioTracks):

  • platform/mediastream/gstreamer/GStreamerMediaStreamSource.h:

LayoutTests:

Remove flakyness from test and unflag it on GTK.

  • fast/mediastream/play-newly-added-audio-track.html: addTrack might have asynchronous

effects, so it's better to rely on the trackadded event when testing its result.

  • platform/gtk/TestExpectations:
2:03 AM Changeset in webkit [276196] by commit-queue@webkit.org
  • 2 edits
    1 add in trunk/Tools/buildstream

REGRESSION(r275755): [GStreamer] Crashes on surfaceless i915 platforms
https://bugs.webkit.org/show_bug.cgi?id=224416

Patch by Philippe Normand <pnormand@igalia.com> on 2021-04-17
Reviewed by Adrian Perez de Castro.

Vendor potential fix for https://gitlab.freedesktop.org/mesa/mesa/-/issues/778.

  • elements/sdk/mesa.bst:
  • patches/mesa/0001-i915-Prevent-invalid-framebuffer-usage.patch: Added.
Note: See TracTimeline for information about the timeline view.