blob: 69280853125cfa4120429efef0fe602f1e4e6aa2 [file] [log] [blame]
2022-05-14 Alan Bujtas <zalan@apple.com>
Unreviewed win build fix.
* layout/integration/flex/LayoutIntegrationFlexLayout.cpp:
(WebCore::LayoutIntegration::flexBoxLogicalBorder):
(WebCore::LayoutIntegration::flexBoxLogicalPadding):
(WebCore::LayoutIntegration::FlexLayout::updateFormattingRootGeometryAndInvalidate):
(WebCore::LayoutIntegration::logicalBorder): Deleted.
(WebCore::LayoutIntegration::logicalPadding): Deleted.
2022-05-10 Yusuke Suzuki <ysuzuki@apple.com>
Rename EventTrackingRegions::Event to EventTrackingRegions::EventType
https://bugs.webkit.org/show_bug.cgi?id=240295
Reviewed by Darin Adler.
This patch is follow-up after r293967 by Darin's comment. EventTrackingRegions::Event is not event actually,
it is just an EventType. This patch renames it with EventType. We also rename variables "event" to "eventType".
* page/DebugPageOverlays.cpp:
(WebCore::NonFastScrollableRegionOverlay::drawRect):
* page/Page.cpp:
(WebCore::Page::touchEventRectsForEventForTesting):
* page/Page.h:
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::absoluteEventTrackingRegionsForFrame const):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::computeWheelProcessingSteps):
(WebCore::ScrollingTree::eventTrackingTypeForPoint):
* page/scrolling/ScrollingTree.h:
* platform/EventTrackingRegions.cpp:
(WebCore::EventTrackingRegions::eventName):
(WebCore::EventTrackingRegions::eventNameAtomString): We add this function to have a way to get AtomString event name.
It simplifies Internal code.
(WebCore::EventTrackingRegions::trackingTypeForPoint):
(WebCore::EventTrackingRegions::uniteSynchronousRegion):
* platform/EventTrackingRegions.h:
* testing/Internals.cpp:
(WebCore::Internals::touchEventRectsForEvent):
2022-05-14 Tyler Wilcock <tyler_w@apple.com>
AX: Remove CSSDisplayContentsAXSupportEnabled flag
https://bugs.webkit.org/show_bug.cgi?id=240409
Reviewed by Chris Fleizach.
We added initial support without using this flag and will continue to
fix bugs as we find them, making this flag unnecessary.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setCSSDisplayContentsAXSupportEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::cssDisplayContentsAXSupportEnabled const): Deleted.
2022-05-14 Antti Koivisto <antti@apple.com>
Template TextBoxPainter on line layout path
https://bugs.webkit.org/show_bug.cgi?id=240416
Reviewed by Alan Bujtas.
Painting currently goes via a line layout path agnostic iterator.
This is inefficient since we always know what sort of layout we are painting.
* layout/integration/inline/InlineIteratorBox.cpp:
(WebCore::InlineIterator::Box::visualRect const):
* layout/integration/inline/InlineIteratorBox.h:
(WebCore::InlineIterator::Box::containingBlock const):
(WebCore::InlineIterator::Box::visualRect const): Deleted.
* layout/integration/inline/InlineIteratorBoxLegacyPath.h:
(WebCore::InlineIterator::BoxLegacyPath::containingBlock const):
(WebCore::InlineIterator::BoxLegacyPath::direction const):
(WebCore::InlineIterator::BoxLegacyPath::isFirstLine const):
* layout/integration/inline/InlineIteratorBoxModernPath.h:
(WebCore::InlineIterator::BoxModernPath::containingBlock const):
(WebCore::InlineIterator::BoxModernPath::direction const):
(WebCore::InlineIterator::BoxModernPath::isFirstLine const):
(WebCore::InlineIterator::BoxModernPath::renderText const):
* layout/integration/inline/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::paint):
* rendering/InlineBoxPainter.cpp:
(WebCore::InlineBoxPainter::paintMask):
(WebCore::InlineBoxPainter::paintDecorations):
* rendering/LegacyInlineFlowBox.cpp:
(WebCore::LegacyInlineFlowBox::addTextBoxVisualOverflow):
* rendering/LegacyInlineTextBox.cpp:
(WebCore::LegacyInlineTextBox::paint):
* rendering/LegacyInlineTextBox.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintMaskForTextFillBox):
* rendering/TextBoxPainter.cpp:
(WebCore::LegacyTextBoxPainter::LegacyTextBoxPainter):
(WebCore::ModernTextBoxPainter::ModernTextBoxPainter):
(WebCore::TextBoxPainter<TextBoxPath>::TextBoxPainter):
(WebCore::TextBoxPainter<TextBoxPath>::~TextBoxPainter):
(WebCore::TextBoxPainter<TextBoxPath>::makeIterator const):
(WebCore::TextBoxPainter<TextBoxPath>::paint):
(WebCore::TextBoxPainter<TextBoxPath>::createMarkedTextFromSelectionInBox):
(WebCore::TextBoxPainter<TextBoxPath>::paintBackground):
(WebCore::TextBoxPainter<TextBoxPath>::paintForegroundAndDecorations):
(WebCore::TextBoxPainter<TextBoxPath>::paintCompositionBackground):
(WebCore::TextBoxPainter<TextBoxPath>::paintForeground):
(WebCore::TextBoxPainter<TextBoxPath>::createDecorationPainter):
(WebCore::TextBoxPainter<TextBoxPath>::paintBackgroundDecorations):
(WebCore::TextBoxPainter<TextBoxPath>::paintForegroundDecorations):
(WebCore::TextBoxPainter<TextBoxPath>::paintCompositionUnderlines):
(WebCore::TextBoxPainter<TextBoxPath>::textPosition):
(WebCore::TextBoxPainter<TextBoxPath>::paintCompositionUnderline):
(WebCore::TextBoxPainter<TextBoxPath>::paintPlatformDocumentMarkers):
(WebCore::LegacyTextBoxPainter::calculateUnionOfAllDocumentMarkerBounds):
(WebCore::TextBoxPainter<TextBoxPath>::paintPlatformDocumentMarker):
(WebCore::TextBoxPainter<TextBoxPath>::computePaintRect):
(WebCore::calculateDocumentMarkerBounds):
(WebCore::TextBoxPainter<TextBoxPath>::computeHaveSelection const):
(WebCore::TextBoxPainter<TextBoxPath>::fontCascade const):
(WebCore::TextBoxPainter<TextBoxPath>::textOriginFromPaintRect const):
(WebCore::TextBoxPainter<TextBoxPath>::debugTextShadow const):
(WebCore::TextBoxPainter::TextBoxPainter): Deleted.
(WebCore::TextBoxPainter::~TextBoxPainter): Deleted.
(WebCore::TextBoxPainter::paint): Deleted.
(WebCore::TextBoxPainter::createMarkedTextFromSelectionInBox): Deleted.
(WebCore::TextBoxPainter::paintBackground): Deleted.
(WebCore::TextBoxPainter::paintForegroundAndDecorations): Deleted.
(WebCore::TextBoxPainter::paintCompositionBackground): Deleted.
(WebCore::TextBoxPainter::paintForeground): Deleted.
(WebCore::TextBoxPainter::createDecorationPainter): Deleted.
(WebCore::TextBoxPainter::paintBackgroundDecorations): Deleted.
(WebCore::TextBoxPainter::paintForegroundDecorations): Deleted.
(WebCore::TextBoxPainter::paintCompositionUnderlines): Deleted.
(WebCore::textPosition): Deleted.
(WebCore::TextBoxPainter::paintCompositionUnderline): Deleted.
(WebCore::TextBoxPainter::paintPlatformDocumentMarkers): Deleted.
(WebCore::TextBoxPainter::calculateUnionOfAllDocumentMarkerBounds): Deleted.
(WebCore::TextBoxPainter::paintPlatformDocumentMarker): Deleted.
(WebCore::TextBoxPainter::computePaintRect): Deleted.
(WebCore::TextBoxPainter::calculateDocumentMarkerBounds): Deleted.
(WebCore::TextBoxPainter::computeHaveSelection const): Deleted.
(WebCore::TextBoxPainter::fontCascade const): Deleted.
(WebCore::TextBoxPainter::textOriginFromPaintRect const): Deleted.
(WebCore::TextBoxPainter::debugTextShadow const): Deleted.
* rendering/TextBoxPainter.h:
(WebCore::TextBoxPainter::textBox const):
2022-05-14 Alan Bujtas <zalan@apple.com>
[FFC][Integration] Add "fixed sized/all default value" flex layout
https://bugs.webkit.org/show_bug.cgi?id=240414
Reviewed by Antti Koivisto.
This patch adds support for the simplest possible flex layout (fixed size, no-wrap, no-reversed etc).
* layout/formattingContexts/flex/FlexFormattingContext.cpp:
(WebCore::Layout::FlexFormattingContext::layoutInFlowContentForIntegration):
2022-05-14 Kimmo Kinnunen <kkinnunen@apple.com>
WebCore::IOSurface refers to unused context size
https://bugs.webkit.org/show_bug.cgi?id=240385
Reviewed by Simon Fraser.
Remove unused IOSurface::m_contextSize.
Context related code makes IOSurface error-prone wrt
reusing the IOSurface in the pool.
* platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp:
(WebCore::ImageBufferIOSurfaceBackend::create):
* platform/graphics/cocoa/IOSurface.h:
* platform/graphics/cocoa/IOSurface.mm:
(WebCore::IOSurface::create):
(WebCore::IOSurface::IOSurface):
(WebCore::IOSurface::ensurePlatformContext):
2022-05-14 Simon Fraser <simon.fraser@apple.com>
Use an OptionSet<> for DisplayList::AsTextFlags
https://bugs.webkit.org/show_bug.cgi?id=240415
Reviewed by Alan Bujtas.
Simple adoption of OptionSet<DisplayList::AsTextFlag> in place of DisplayList::AsTextFlags.
* html/HTMLCanvasElement.h:
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::displayListAsText const):
(WebCore::GraphicsLayer::replayDisplayListAsText const):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::displayListAsText const):
(WebCore::GraphicsLayerCA::replayDisplayListAsText const):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/displaylists/DisplayList.cpp:
(WebCore::DisplayList::DisplayList::shouldDumpForFlags):
(WebCore::DisplayList::DisplayList::asText const):
* platform/graphics/displaylists/DisplayList.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::displayListAsText const):
(WebCore::RenderLayerBacking::replayDisplayListAsText const):
* rendering/RenderLayerBacking.h:
* rendering/TextPainter.cpp:
(WebCore::TextPainter::cachedGlyphDisplayListsForTextNodeAsText):
* rendering/TextPainter.h:
* testing/Internals.cpp:
(WebCore::Internals::displayListForElement):
(WebCore::Internals::replayDisplayListForElement):
(WebCore::Internals::cachedGlyphDisplayListsForTextNode):
2022-05-14 Alan Bujtas <zalan@apple.com>
[Repaint] Border ignores currentColor change when hovering
https://bugs.webkit.org/show_bug.cgi?id=240401
Reviewed by Antti Koivisto.
This patch triggers repaint when currentColor is applied on border.
It most likely got broken at r150259 (9 years ago!) when StyleDifferenceRepaintIfText was introduced.
StyleDifferenceRepaintIfText is a "conditional repaint" diff value which only triggers repaint if the renderer has some text content.
Later, r156619 addressed some of the "content with border/outline is not painting" fallout by extending
StyleDifferenceRepaintIfText to RepaintIfTextOrBorderOrOutline.
RepaintIfTextOrBorderOrOutline turns "conditional repaints" to real repaints if, in addition to text, the content has outline/border.
However the fix was neither complete nor proper (it patched the repaint logic by changing hasImmediateNonWhitespaceTextChildOrBorderOrOutline
instead of computing the correct diff value -unconditional Repaint).
Fast-forward to 2020, r267528 ensured that content with outline is no longer a "conditional repaint".
It also made some of the code introduced in r156619 redundant (see hasImmediateNonWhitespaceTextChildOrBorderOrOutline).
This patch expands on r267528 by introducing isEquivalentForPainting for the border data. It ensures that we
compute (unconditional) Repaint diff value, if the border uses currentColor.
Tests: fast/repaint/repaint-current-color-border-on-hover.html
fast/repaint/repaint-pseudo-border-on-hover.html
* rendering/RenderElement.cpp:
(WebCore::RenderElement::hasImmediateNonWhitespaceTextChildOrBorderOrOutline const):
* rendering/style/BorderData.h:
(WebCore::BorderData::isEquivalentForPainting const):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresRepaint const):
2022-05-14 Alan Bujtas <zalan@apple.com>
[FFC][Integration] Add updateFormattingRootGeometryAndInvalidate/updateRenderers
https://bugs.webkit.org/show_bug.cgi?id=240413
Reviewed by Antti Koivisto.
Make sure that the layout box/renderer geometries are all up-to-date.
* layout/integration/flex/LayoutIntegrationFlexLayout.cpp:
(WebCore::LayoutIntegration::logicalBorder):
(WebCore::LayoutIntegration::logicalPadding):
(WebCore::LayoutIntegration::FlexLayout::updateFormattingRootGeometryAndInvalidate):
(WebCore::LayoutIntegration::FlexLayout::layout):
(WebCore::LayoutIntegration::FlexLayout::updateRenderers const):
* layout/integration/flex/LayoutIntegrationFlexLayout.h:
(WebCore::LayoutIntegration::FlexLayout::flexBoxRenderer const):
(WebCore::LayoutIntegration::FlexLayout::flexBoxRenderer):
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::layoutUsingFlexFormattingContext):
2022-05-14 Alan Bujtas <zalan@apple.com>
[FFC][Integration] Do not reset the effective display value for flex root
https://bugs.webkit.org/show_bug.cgi?id=240412
Reviewed by Antti Koivisto.
Non-inline formatting roots (e.g. flex) should not need display type adjustment.
* layout/integration/LayoutIntegrationBoxTree.cpp:
(WebCore::LayoutIntegration::rootBoxStyle):
(WebCore::LayoutIntegration::rootBoxFirstLineStyle):
(WebCore::LayoutIntegration::BoxTree::BoxTree):
(WebCore::LayoutIntegration::BoxTree::updateStyle):
2022-05-14 Alan Bujtas <zalan@apple.com>
[LFC] LayoutState should track the integration formatting context type
https://bugs.webkit.org/show_bug.cgi?id=240411
Reviewed by Antti Koivisto.
Let's not use RuntimeEnabledFeatures to check wheter the integration codepath is enabled as
the new FCs (e.g. flex) don't even have such flags.
* layout/LayoutContext.cpp:
* layout/LayoutState.cpp:
(WebCore::Layout::LayoutState::LayoutState):
(WebCore::Layout::LayoutState::formattingStateForFormattingContext const):
(WebCore::Layout::LayoutState::formattingStateForInlineFormattingContext const):
(WebCore::Layout::LayoutState::formattingStateForFlexFormattingContext const):
(WebCore::Layout::LayoutState::ensureInlineFormattingState):
(WebCore::Layout::LayoutState::ensureFlexFormattingState):
(WebCore::Layout::LayoutState::setViewportSize):
(WebCore::Layout::LayoutState::viewportSize const):
(WebCore::Layout::LayoutState::setIsIntegratedRootBoxFirstChild):
(WebCore::Layout::LayoutState::shouldIgnoreTrailingLetterSpacing const):
(WebCore::Layout::LayoutState::shouldNotSynthesizeInlineBlockBaseline const):
* layout/LayoutState.h:
(WebCore::Layout::LayoutState::isInlineFormattingContextIntegration const):
(WebCore::Layout::LayoutState::isFlexFormattingContextIntegration const):
* layout/floats/FloatingState.cpp:
* layout/formattingContexts/inline/InlineFormattingContext.cpp:
* layout/formattingContexts/inline/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::close):
* layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp:
(WebCore::Layout::InlineDisplayContentBuilder::appendTextDisplayBox):
* layout/integration/flex/LayoutIntegrationFlexLayout.cpp:
(WebCore::LayoutIntegration::FlexLayout::FlexLayout):
* layout/integration/inline/LayoutIntegrationInlineContent.cpp:
* layout/integration/inline/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::LineLayout):
(WebCore::LayoutIntegration::LineLayout::releaseCaches):
2022-05-13 Tim Horton <timothy_horton@apple.com>
ApplePayLogoSystemImage needlessly loads PassKit in WebKit child processes on iOS
https://bugs.webkit.org/show_bug.cgi?id=240404
<rdar://93070349>
Reviewed by Chris Dumez.
* Modules/applepay/ApplePayLogoSystemImage.mm:
(WebCore::passKitBundle):
Adopt systemDirectoryPath instead of unnecessarily loading PassKit just
to find its bundle path (the previous implementation made use of the fact
that `dlopen` internally adjusts the search path to look in the simulator
root, but also resulted in wasted time loading and initializing PassKit
and its dependencies).
2022-05-13 Tim Nguyen <ntim@apple.com>
[css-ui] Unexpose appearance property values already handled by appearance: auto
https://bugs.webkit.org/show_bug.cgi?id=240384
Reviewed by Aditya Keerthi.
These are only used internally, and are handled by appearance: auto in the UA sheets:
- caps-lock-indicator
- color-well
- list-button
- searchfield-decoration
- searchfield-results-decoration
- searchfield-results-button
- searchfield-cancel-button
Test: imported/w3c/web-platform-tests/css/css-ui/appearance-cssom-001.html
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
* css/CSSValueKeywords.in:
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
* platform/ThemeTypes.cpp:
(WebCore::operator<<):
* platform/ThemeTypes.h:
2022-05-13 Tyler Wilcock <tyler_w@apple.com>
Infinite recursion caused by call to accessibilityIsIgnored in the midst of AccessibilityObject::ignoredFromModalPresence
https://bugs.webkit.org/show_bug.cgi?id=240365
Reviewed by Chris Fleizach.
We can get infinite recursion when accessibilityIsIgnored is called as
part of computing AccessibilityObject::ignoredFromModalPresence. One
example of such a cycle:
AXObjectCache::currentModalNode() ->
AccessibilityRenderObject::computeAccessibilityIsIgnored() ->
AccessibilityRenderObject::parentObjectUnignored() ->
AccessibilityObject::accessibilityIsIgnored() ->
AccessibilityObject::ignoredFromModalPresence() ->
AXObjectCache::currentModalNode() ->
...repeat...
This patch fixes this by tracking when we start computing the current
modal node in the AXObjectCache. Then, in AccessibilityObject::accessibilityIsIgnored(),
we don't call AccessibilityObject::ignoredFromModalPresence() if this new state is true,
since in this context we only need to know if the object is inherently
ignored (i.e. ignored disregarding modal presence).
Test: accessibility/aria-modal-with-text-crash.html
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::currentModalNode):
* accessibility/AXObjectCache.h:
Add m_isRetrievingCurrentModalNode.
(WebCore::AXObjectCache::isRetrievingCurrentModalNode): Added.
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::accessibilityIsIgnored const):
Don't call ignoredFromModalPresence if we're in the midst of computing the current modal.
2022-05-13 Brent Fulgham <bfulgham@apple.com>
REGRESSION (r281791): [iOS] WKWebView cannot load local .log file
https://bugs.webkit.org/show_bug.cgi?id=239591
<rdar://problem/92442408>
Unreviewed correction based on a comment from Darin.
* platform/network/ios/WebCoreURLResponseIOS.mm:
(WebCore::adjustMIMETypeIfNecessary):
2022-05-13 Wenson Hsieh <wenson_hsieh@apple.com>
ImageAnalysisQueue should reanalyze image elements whose image sources have changed
https://bugs.webkit.org/show_bug.cgi?id=240371
rdar://93175651
Reviewed by Tim Horton.
Currently, ImageAnalysisQueue maintains the set of all image elements that have been queued for analysis, and
avoids re-queueing such image elements. However, on some websites, this leads to stale analysis results being
shown in certain image elements that have changed image sources (and subsequently finished loaded the new image).
To address this, we introduce a mechanism to remember the latest image URL for image elements that have been
analyzed using the analysis queue; we only avoid reanalyzing these same image elements if the source URL is the
same as the source URL when we last analyzed it.
This allows us (for instance) to handle the scenario where a single image element periodically cycles between
different `src` attribute values.
Test: ImageAnalysisTests.AnalyzeImageAfterChangingSource
* page/ImageAnalysisQueue.cpp:
(WebCore::ImageAnalysisQueue::enqueueIfNeeded):
Also avoid trying to prematurely analyze images whose cached images only contain the null image. This caused
empty results to sometimes be incorrectly cached for some image elements, if analysis is triggered too early.
(WebCore::ImageAnalysisQueue::resumeProcessing):
* page/ImageAnalysisQueue.h:
2022-05-13 Adrian Perez de Castro <aperez@igalia.com>
Non-unified build broken in debug mode
https://bugs.webkit.org/show_bug.cgi?id=240378
Unreviewed non-unified build fixes.
* contentextensions/ContentExtensionCompiler.cpp: Add missing wtf/CrossThreadCopier.h header.
* workers/service/ServiceWorkerClients.cpp: Add missing Logging.h header.
2022-05-13 Tim Nguyen <ntim@apple.com>
[css-ui] Remove caret/progress-bar-value/listitem values from appearance property
https://bugs.webkit.org/show_bug.cgi?id=240390
Reviewed by Aditya Keerthi.
Test: imported/w3c/web-platform-tests/css/css-ui/appearance-cssom-001.html
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
* css/CSSValueKeywords.in:
* platform/ThemeTypes.cpp:
(WebCore::operator<<):
* platform/ThemeTypes.h:
2022-05-13 Andres Gonzalez <andresg_22@apple.com>
Move handling of active descendant changed notifications out of AccessibilityRenderObject.
https://bugs.webkit.org/show_bug.cgi?id=240357
<rdar://problem/93196901>
Reviewed by Chris Fleizach.
No change in functionality.
AXObjectCache::handleActiveDescendantChanged now handles this
notifications as appropriate. This makes the code cleaner and more
straightforward. More importantly this change is necessary for the
refactoring of relationships implementation.
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::handleActiveDescendantChanged):
(WebCore::AXObjectCache::handleAttributeChange):
* accessibility/AXObjectCache.h:
(WebCore::AXObjectCache::handleActiveDescendantChanged):
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityObjectInterface.h:
(WebCore::Accessibility::findRelatedObjectInAncestry):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::activeDescendant const):
(WebCore::AccessibilityRenderObject::shouldNotifyActiveDescendant const): Deleted.
(WebCore::AccessibilityRenderObject::targetElementForActiveDescendant const): Deleted.
(WebCore::AccessibilityRenderObject::handleActiveDescendantChanged): Deleted.
* accessibility/AccessibilityRenderObject.h:
* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::handleActiveDescendantChanged): Deleted.
* accessibility/isolatedtree/AXIsolatedObject.h:
2022-05-13 Anjali Kumar <anjalik_22@apple.com>
Web Inspector: [Meta] Implement Timelines Film Strip
https://bugs.webkit.org/show_bug.cgi?id=239350
Reviewed by Devin Rousso and Patrick Angle.
Test: inspector/timeline/timeline-event-screenshots.html
* inspector/TimelineRecordFactory.cpp:
(WebCore::TimelineRecordFactory::createScreenshotData):
* inspector/TimelineRecordFactory.h:
* inspector/agents/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::didComposite):
(WebCore::InspectorTimelineAgent::willPaint):
(WebCore::InspectorTimelineAgent::didPaint):
(WebCore::InspectorTimelineAgent::toggleInstruments):
(WebCore::InspectorTimelineAgent::captureScreenshot):
(WebCore::toProtocol):
(WebCore::InspectorTimelineAgent::createRecordEntry):
(WebCore::InspectorTimelineAgent::pushCurrentRecord):
* inspector/agents/InspectorTimelineAgent.h:
2022-05-13 Michael Catanzaro <mcatanzaro@redhat.com>
-Wstringop-overflow warning in DocumentWriter.cpp
https://bugs.webkit.org/show_bug.cgi?id=239340
<rdar://problem/93243931>
Reviewed by Chris Dumez.
* loader/DocumentWriter.cpp:
(WebCore::DocumentWriter::end):
2022-05-13 Ziran Sun <zsun@igalia.com>
input.showPicker() should throw when input is readonly/disabled
https://bugs.webkit.org/show_bug.cgi?id=240302
Reviewed by Tim Nguyen.
When input is readonly or disabled, input.showPicker() should throw InvalidStateError.
Test: imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/show-picker-disabled-readonly.html
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::showPicker):
2022-05-13 Michael Catanzaro <mcatanzaro@redhat.com>
-Wreturn-type warning in PathOperation.cpp
https://bugs.webkit.org/show_bug.cgi?id=240383
Reviewed by Chris Dumez.
* rendering/PathOperation.cpp:
(WebCore::RayPathOperation::lengthForPath const):
2022-05-13 Tim Horton <timothy_horton@apple.com>
Add UI-side layers for optionally indicating interaction regions
https://bugs.webkit.org/show_bug.cgi?id=240372
<rdar://problem/87170289>
Reviewed by Dean Jackson.
* page/DebugPageOverlays.cpp:
(WebCore::pathsForRegion):
Move inline rect inflation into InteractionRegion so that all clients get it.
* page/Page.cpp:
(WebCore::Page::shouldBuildInteractionRegions const):
* page/Page.h:
* page/Frame.cpp:
(WebCore::Frame::invalidateContentEventRegionsIfNeeded):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintObject):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::maintainsEventRegion const):
(WebCore::RenderLayerBacking::updateEventRegion):
If the ENABLE() and setting are both enabled, update event regions
due to possible interaction region changes. We could make this more
conservative later, but chances are high that most layers include
interaction regions.
For now, compute interaction regions only for the root layer.
In a future patch, we will adopt the normal fake paint mechanism
and maintain them on the layer that owns them.
* page/InteractionRegion.cpp:
(WebCore::regionForElement):
Move inline rect inflation into InteractionRegion so that all clients get it.
Limit interaction rects to half of the viewport. Ignore regions that are larger.
* page/InteractionRegion.h:
(WebCore::operator==): Added.
(WebCore::InteractionRegion::encode const):
(WebCore::InteractionRegion::decode):
Remove the isInline bit, since we only used it for rect inflation.
* rendering/EventRegion.cpp:
(WebCore::EventRegion::operator== const):
(WebCore::EventRegion::translate):
(WebCore::EventRegion::uniteInteractionRegions):
(WebCore::EventRegion::computeInteractionRegions):
* rendering/EventRegion.h:
(WebCore::EventRegion::interactionRegions const):
(WebCore::EventRegion::encode const):
(WebCore::EventRegion::decode):
Store interaction regions on EventRegion.
2022-05-13 Commit Queue <commit-queue@webkit.org>
Unreviewed, reverting r294113.
https://bugs.webkit.org/show_bug.cgi?id=240381
This bug needs to be addressed using a different approach
Reverted changeset:
"Mail compose: right clicking an image attachment selects it"
https://bugs.webkit.org/show_bug.cgi?id=240315
https://commits.webkit.org/r294113
2022-05-13 Alejandro G. Castro <alex@igalia.com>
[GTK][WPE] Remove leftover for WINDOWS support in GraphicsContextGLGBM
https://bugs.webkit.org/show_bug.cgi?id=240314
GBM is a Linux technology we would need another sharing buffers
technology to add support in Windows. This is leftover from the
code copied originally.
Reviewed by Žan Doberšek.
No new tests, we are just removing some compilation option.
* platform/graphics/gbm/GraphicsContextGLGBM.cpp:
(WebCore::GraphicsContextGLGBM::platformInitializeContext):
2022-05-13 Lauro Moura <lmoura@igalia.com>
Unreviewed, non-unified build fixes
https://bugs.webkit.org/show_bug.cgi?id=240369
* Modules/highlight/HighlightRegister.h:
* rendering/TextPainter.h:
2022-05-13 Zan Dobersek <zdobersek@igalia.com>
[GStreamer] Properly handle DMABuf-containing GstBuffers with missing DMABuf GstCaps feature
https://bugs.webkit.org/show_bug.cgi?id=240374
Reviewed by Chris Lord.
To detect DMABuf-backed GstBuffers, for now we relied on the appropriate
feature being present on the related GstCaps object. This doesn't cover
every decoder which for one reason or another isn't specifying their
caps like this.
For those cases, we have to do a weaker but sufficient check on the
base GstMemory object contained in the GstBuffer, namely test that it
comes from a DMABuf-capable allocator, through using the
gst_is_dmabuf_memory() function. When true, we can proceed on handling
the buffer and its contained DMABuf object.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::pushDMABufToCompositor):
2022-05-13 Zan Dobersek <zdobersek@igalia.com>
[Linux][GBM] Provide utility function for construction of eglCreateImage attributes data
https://bugs.webkit.org/show_bug.cgi?id=240373
Reviewed by Chris Lord.
Provide DMABufEGLUtilities::constructEGLCreateImageAttributes() helper
function that unifies the construction of the EGLImage creation
attributes. For a given DMABufObject and plane index, a Vector of EGLint
attributes for a single-plane EGLImage object is returned, optionally
including the modifier value if requested (when the EGL implementation,
through the necessary extensions, supports modifiers).
The new function replaces duplicated code in GraphicsContextGLGBM and
TextureMapperPlatformLayerProxyDMABuf.
* platform/TextureMapper.cmake:
* platform/graphics/gbm/DMABufEGLUtilities.h: Added.
(WebCore::DMABufEGLUtilities::constructEGLCreateImageAttributes):
* platform/graphics/gbm/GraphicsContextGLGBM.cpp:
(WebCore::GraphicsContextGLANGLE::makeContextCurrent):
* platform/graphics/texmap/TextureMapperPlatformLayerProxyDMABuf.cpp:
(WebCore::TextureMapperPlatformLayerProxyDMABuf::DMABufLayer::createEGLImageData):
2022-05-13 Youenn Fablet <youenn@apple.com>
Remove WorkerLoaderProxy::postTaskForModeToWorkerOrWorkletGlobalScope
https://bugs.webkit.org/show_bug.cgi?id=240299
Reviewed by Alex Christensen.
WorkerLoaderProxy::postTaskForModeToWorkerOrWorkletGlobalScope is no longer needed given we have
ScriptExecutionContext infrastructure that can be used instead.
Covered by existing tests.
* Modules/webaudio/AudioWorkletMessagingProxy.cpp:
(WebCore::AudioWorkletMessagingProxy::postTaskForModeToWorkerOrWorkletGlobalScope): Deleted.
* Modules/webaudio/AudioWorkletMessagingProxy.h:
* Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
(WebCore::WorkerThreadableWebSocketChannel::WorkerThreadableWebSocketChannel):
(WebCore::WorkerThreadableWebSocketChannel::Peer::Peer):
(WebCore::WorkerThreadableWebSocketChannel::Peer::send):
(WebCore::WorkerThreadableWebSocketChannel::Peer::bufferedAmount):
(WebCore::WorkerThreadableWebSocketChannel::Peer::didConnect):
(WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveMessage):
(WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveBinaryData):
(WebCore::WorkerThreadableWebSocketChannel::Peer::didUpdateBufferedAmount):
(WebCore::WorkerThreadableWebSocketChannel::Peer::didStartClosingHandshake):
(WebCore::WorkerThreadableWebSocketChannel::Peer::didClose):
(WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveMessageError):
(WebCore::WorkerThreadableWebSocketChannel::Peer::didUpgradeURL):
(WebCore::WorkerThreadableWebSocketChannel::Bridge::mainThreadInitialize):
(WebCore::WorkerThreadableWebSocketChannel::Bridge::initialize):
* Modules/websockets/WorkerThreadableWebSocketChannel.h:
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::postTaskTo):
(WebCore::ScriptExecutionContext::postTaskForModeToWorkerOrWorklet):
* dom/ScriptExecutionContext.h:
* loader/WorkerThreadableLoader.cpp:
(WebCore::WorkerThreadableLoader::WorkerThreadableLoader):
(WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
(WebCore::m_contextIdentifier):
(WebCore::WorkerThreadableLoader::MainThreadBridge::notifyIsDone):
(WebCore::WorkerThreadableLoader::MainThreadBridge::redirectReceived):
(WebCore::WorkerThreadableLoader::MainThreadBridge::didSendData):
(WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveResponse):
(WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveData):
(WebCore::WorkerThreadableLoader::MainThreadBridge::didFinishLoading):
(WebCore::WorkerThreadableLoader::MainThreadBridge::didFail):
(WebCore::WorkerThreadableLoader::MainThreadBridge::didFinishTiming):
* loader/WorkerThreadableLoader.h:
* workers/WorkerLoaderProxy.h:
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::postTaskForModeToWorkerOrWorkletGlobalScope): Deleted.
* workers/WorkerMessagingProxy.h:
* workers/service/context/ServiceWorkerThreadProxy.h:
* workers/shared/context/SharedWorkerThreadProxy.h:
2022-05-13 Simon Fraser <simon.fraser@apple.com>
Simplify the usage of DrawGlyphsRecorder
https://bugs.webkit.org/show_bug.cgi?id=240363
Reviewed by Myles Maxfield.
Move the DeconstructDrawGlyphs switch from inside DrawGlyphsRecorder to
DisplayList::Recorder, so that DrawGlyphsRecorder is only ever used when deconstructing
glyphs.
Also, ensure that the only time that glyph deconstruction is enabled is when
recording display lists via RemoteDisplayListRecorderProxy. There's no reason for
paintAttachmentText() to need glyph deconstruction.
This is a small perf improvement on the MotionMark Design subtest.
* platform/graphics/DrawGlyphsRecorder.h:
(WebCore::DrawGlyphsRecorder::deconstructDrawGlyphs const): Deleted.
* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::displayListForTextRun const):
* platform/graphics/coretext/DrawGlyphsRecorderCoreText.cpp:
(WebCore::DrawGlyphsRecorder::DrawGlyphsRecorder):
(WebCore::DrawGlyphsRecorder::drawGlyphs):
(WebCore::DrawGlyphsRecorder::drawNativeText):
* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::Recorder):
(WebCore::DisplayList::Recorder::drawGlyphs):
(WebCore::DisplayList::Recorder::drawGlyphsAndCacheFont):
* platform/graphics/displaylists/DisplayListRecorder.h:
* platform/graphics/displaylists/DisplayListRecorderImpl.cpp:
(WebCore::DisplayList::RecorderImpl::RecorderImpl):
* platform/graphics/displaylists/DisplayListRecorderImpl.h:
* platform/graphics/harfbuzz/DrawGlyphsRecorderHarfBuzz.cpp:
(WebCore::DrawGlyphsRecorder::DrawGlyphsRecorder):
* platform/graphics/win/DrawGlyphsRecorderWin.cpp:
(WebCore::DrawGlyphsRecorder::DrawGlyphsRecorder):
* rendering/RenderThemeIOS.mm:
(WebCore::paintAttachmentText):
2022-05-12 Manuel Rego Casasnovas <rego@igalia.com>
Remove unneeded check in HTMLSlotElement::assignedNodes()
https://bugs.webkit.org/show_bug.cgi?id=240340
Reviewed by Ryosuke Niwa.
* html/HTMLSlotElement.cpp:
(WebCore::HTMLSlotElement::assignedNodes const):
2022-05-12 Manuel Rego Casasnovas <rego@igalia.com>
ARIA reflection for FrozenArray<Element> attributes
https://bugs.webkit.org/show_bug.cgi?id=239853
<rdar://problem/92797836>
Reviewed by Chris Dumez.
Implement ARIA reflection for attributes that refer to a list of Elements:
aria-controls, aria-describedby, aria-details, aria-flowto,
aria-labelledby and aria-owns.
For the properties names this patch uses "Elements" suffix:
ariaControlsElements, ariaDescribedByElements, ariaDescribedByElements,
ariaFlowToElements, ariaLabelledByElements, ariaOwnsElements
this matches Chromium implementation and AOM explainer, but not AOM spec:
https://github.com/w3c/aria/issues/1732
* accessibility/AriaAttributes.idl: Add the new properties under
AriaReflectionForElementReferencesEnabled runtime flag.
* bindings/scripts/CodeGenerator.pm:
(GetterExpression): Add function for FrozenArray<Element> properties.
(SetterExpression): Ditto.
* bindings/scripts/test/JS/JSTestObj.cpp: Add tests.
(WebCore::JSTestObjDOMConstructor::construct):
(WebCore::jsTestObj_reflectedElementsArrayAttrGetter):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::setJSTestObj_reflectedElementsArrayAttrSetter):
(WebCore::JSC_DEFINE_CUSTOM_SETTER):
* bindings/scripts/test/TestObj.idl: Add example attribute.
* dom/Element.cpp:
(WebCore::isElementsArrayReflectionAttribute): New utility method to
identify the attributes that refer to a list of Elements.
(WebCore::Element::attributeChanged): Include check for elements
array.
(WebCore::Element::getElementsArrayAttribute const): Implement getter.
(WebCore::Element::setElementsArrayAttribute): Implement setter.
* dom/Element.h: Remove FIXME in ExplicitlySetAttrElementsMap as now
it stores more than one element. Add headers for getter and setter.
2022-05-12 Matt Woodrow <mattwoodrow@apple.com>
Quirk Flightaware.com to use the older number serialization path.
https://bugs.webkit.org/show_bug.cgi?id=240320
Reviewed by Simon Fraser.
Ensures that serialization of matrix() CSS properties uses the older serialization (which
matches ECMA script serialization) since this site expects these to be comparable as strings.
No new tests, since this is a site-specific quirk.
* css/CSSFunctionValue.cpp:
(WebCore::CSSFunctionValue::customCSSText const):
* css/CSSFunctionValue.h:
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::formatNumberValue const):
(WebCore::CSSPrimitiveValue::customCSSText const):
* css/CSSPrimitiveValue.h:
* css/CSSValue.cpp:
(WebCore::CSSValue::cssText const):
* css/CSSValue.h:
(WebCore::CSSValue::CSSValue):
* css/CSSValueList.cpp:
(WebCore::CSSValueList::customCSSText const):
* css/CSSValueList.h:
* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::PropertySetCSSStyleDeclaration::getPropertyValueInternal):
* css/StyleProperties.cpp:
(WebCore::StyleProperties::getPropertyValue const):
* css/StyleProperties.h:
* page/Quirks.cpp:
(WebCore::Quirks::needsFlightAwareSerializationQuirk const):
* page/Quirks.h:
2022-05-12 J Pascoe <j_pascoe@apple.com>
[WebAuthn] Remove document focus requirement for conditional mediation requests
https://bugs.webkit.org/show_bug.cgi?id=240361
rdar://problem/93201070
Reviewed by Brent Fulgham.
This is necessary so conditional mediation requests work when you open a page in
a new tab. Conditional mediation requests do not support security keys and the
request will be aborted if conditional mediation is not available.
* Modules/credentialmanagement/CredentialsContainer.cpp:
(WebCore::CredentialsContainer::get):
2022-05-12 Alan Bujtas <zalan@apple.com>
TextBoxPainter::paintForeground: painting text with no marking/decoration should be simple
https://bugs.webkit.org/show_bug.cgi?id=240319
Reviewed by Simon Fraser.
Let's have a fast codepath for regular, simple text painting.
* rendering/StyledMarkedText.cpp:
(WebCore::StyledMarkedText::computeStyleForUnmarkedMarkedText):
(WebCore::computeStyleForUnmarkedMarkedText): Deleted.
* rendering/StyledMarkedText.h:
(WebCore::StyledMarkedText::StyledMarkedText):
(WebCore::StyledMarkedText::style):
* rendering/TextBoxPainter.cpp:
(WebCore::TextBoxPainter::paintBackground):
(WebCore::TextBoxPainter::paintForegroundAndDecorations):
2022-05-12 Sihui Liu <sihui_liu@apple.com>
StorageMap::removeItem may fail to remove item from map
https://bugs.webkit.org/show_bug.cgi?id=239982
rdar://80891555
* storage/StorageMap.cpp:
(WebCore::StorageMap::removeItem):
Address post-landing review comment from Darin.
2022-05-12 J Pascoe <j_pascoe@apple.com>
[WebAuthn] Include backup state in authenticatorData
https://bugs.webkit.org/show_bug.cgi?id=240353
rdar://problem/93191958
Reviewed by Brent Fulgham.
Add flags for credential backup state: https://github.com/w3c/webauthn/pull/1695
* Modules/webauthn/WebAuthenticationConstants.h:
2022-05-12 Brent Fulgham <bfulgham@apple.com>
REGRESSION (r281791): [iOS] WKWebView cannot load local .log file
https://bugs.webkit.org/show_bug.cgi?id=239591
<rdar://problem/92442408>
Reviewed by Geoffrey Garen.
The refactoring in Bug 229414 did not retain the old behavior on iOS where local
files (which do not get a MIME type assigned by CFNetwork) passed through the
same 'preferredMIMETypeForFileExtensionFromUTType' logic we use on macOS.
* platform/network/ios/WebCoreURLResponseIOS.mm:
(WebCore::adjustMIMETypeIfNecessary):
2022-05-12 Alex Christensen <achristensen@webkit.org>
Make if-domain and unless-domain regexes only look at URL hosts
https://bugs.webkit.org/show_bug.cgi?id=240199
Reviewed by John Wilander.
In bug 234126 I moved how if-domain and unless-domain are done by translating them into a regex.
I overlooked that a domain can be in the path. If we get to '/' then we are at the end of the host.
Covered by an API test.
* contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::getDomainList):
2022-05-11 Kate Cheney <katherine_cheney@apple.com>
Mail compose: right clicking an image attachment selects it
https://bugs.webkit.org/show_bug.cgi?id=240315
rdar://45454933
Reviewed by Wenson Hsieh.
If the page is editable, don't select if the element is an image.
* page/EventHandler.cpp:
(WebCore::EventHandler::sendContextMenuEvent):
2022-05-12 Eric Carlson <eric.carlson@apple.com>
[macOS] Remove support for deprecated ScreenCaptureKit API
https://bugs.webkit.org/show_bug.cgi?id=239511
<rdar://problem/91973817>
Reviewed by Youenn Fablet.
Tested manually.
* platform/mediastream/mac/ScreenCaptureKitCaptureSource.h:
* platform/mediastream/mac/ScreenCaptureKitCaptureSource.mm:
(-[WebCoreScreenCaptureKitHelper stream:didOutputSampleBuffer:ofType:]):
(WebCore::ScreenCaptureKitCaptureSource::ScreenCaptureKitCaptureSource):
(WebCore::ScreenCaptureKitCaptureSource::stop):
(WebCore::ScreenCaptureKitCaptureSource::streamConfiguration):
(WebCore::ScreenCaptureKitCaptureSource::startContentStream):
(WebCore::ScreenCaptureKitCaptureSource::updateStreamConfiguration):
(WebCore::ScreenCaptureKitCaptureSource::streamDidOutputSampleBuffer):
* platform/mediastream/mac/ScreenCaptureKitSharingSessionManager.mm:
(-[WebDisplayMediaPromptHelper sessionDidEnd:]):
(WebCore::ScreenCaptureKitSharingSessionManager::sessionDidEnd):
(WebCore::ScreenCaptureKitSharingSessionManager::takeSharingSessionForFilter):
2022-05-12 Loïc Le Page <llepage@igalia.com>
[GStreamer][VideoCapture] Add support for capturing encoded video streams from a webcam
https://bugs.webkit.org/show_bug.cgi?id=240229
Reviewed by Philippe Normand.
Takes into account encoded video streams produced by a webcam for
video capture.
Manually tested (requires a webcam with encoded video streams).
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
(WebCore::GStreamerVideoCaptureSource::generatePresets):
* platform/mediastream/gstreamer/GStreamerVideoCapturer.cpp:
(WebCore::GStreamerVideoCapturer::createConverter):
(WebCore::GStreamerVideoCapturer::setSize):
(WebCore::GStreamerVideoCapturer::setFrameRate):
(WebCore::GStreamerVideoCapturer::adjustVideoSrcMIMEType):
* platform/mediastream/gstreamer/GStreamerVideoCapturer.h:
2022-05-12 Youenn Fablet <youenn@apple.com>
Add a better mock for audio units used by CoreAudioSharedUnit
https://bugs.webkit.org/show_bug.cgi?id=240231
Reviewed by Eric Carlson.
Move CoreAudioSharedUnit to its own file, CoreAudioSharedUnit.h/CoreAudioSharedUnit.cpp.
Introduce an internal unit to abstract out CoreAudioSharedUnit from actual CoreAudio units.
Implement a CoreAudio based internal unit in CoreAudioSharedUnit.cpp.
Implement a Mock based internal unit in MockAudioSharedUnit.h/MockAudioSharedUnit.mm.
Add inputput/ouput sample rate validation (debug assert and release error returned).
Add a test that uses this validation.
Test: fast/mediastream/audio-unit-reconfigure.html
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/mac/BaseAudioSharedUnit.cpp:
* platform/mediastream/mac/BaseAudioSharedUnit.h:
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
* platform/mediastream/mac/CoreAudioSharedUnit.cpp: Added.
* platform/mediastream/mac/CoreAudioSharedUnit.h: Added.
* platform/mediastream/mac/MockAudioSharedUnit.h:
* platform/mediastream/mac/MockAudioSharedUnit.mm:
2022-05-12 Oriol Brufau <obrufau@igalia.com>
[cssom] Serialize computed '-webkit-text-combine: none'
https://bugs.webkit.org/show_bug.cgi?id=239989
Reviewed by Tim Nguyen.
The computed value of '-webkit-text-combine' was only serialized for
'-webkit-text-combine: horizontal' or 'text-combine-upright: all'.
But the initial value 'none' just produced an empty string.
Test: imported/w3c/web-platform-tests/css/cssom/serialize-all-longhands.html
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
2022-05-12 Zan Dobersek <zdobersek@igalia.com>
[GTK][WPE] Respect and use the DMABuf modifier values
https://bugs.webkit.org/show_bug.cgi?id=240276
Reviewed by Chris Lord.
When wrapping DMABuf objects in EGLImages, the modifier values should be
respected and used to properly and completely describe the DMABuf.
This should be applied in two places. First one is GraphicsContextGLGBM
where the DMABuf is used to back the ANGLE-handled EGLImage. Second one
is TextureMapperPlatformLayerProxyDMABuf, during construction of the
DMABufLayer object used to present the DMABuf inside the composition
engine.
In both cases this primarily relies on the presence of the
EGL_EXT_image_dma_buf_import_modifiers extension. For the first case
detection of this extension is done through ANGLE and its state stored
on the GraphicsContextGLGBM object during context initialization. For
the second case this state is stored on the PlatformDisplay object
after it's retrieved during the EGLDisplay initialization.
If detected, the DMABuf modifier value is included in the attributes
array used for the EGLImage creation call. The actual modifier value is
retrieved from the gbm_bo object, leaving it to libgbm to assess the
best possible formatting of the DMAbuf resource.
* platform/graphics/PlatformDisplay.cpp:
(WebCore::PlatformDisplay::initializeEGLDisplay):
* platform/graphics/PlatformDisplay.h:
(WebCore::PlatformDisplay::eglExtensions const):
* platform/graphics/gbm/GBMBufferSwapchain.cpp:
(WebCore::GBMBufferSwapchain::Buffer::createDMABufObject const):
* platform/graphics/gbm/GraphicsContextGLGBM.cpp:
(WebCore::GraphicsContextGLANGLE::makeContextCurrent):
(WebCore::GraphicsContextGLGBM::platformInitializeContext):
* platform/graphics/gbm/GraphicsContextGLGBM.h:
(WebCore::GraphicsContextGLGBM::eglExtensions):
* platform/graphics/texmap/TextureMapperPlatformLayerProxyDMABuf.cpp:
(WebCore::TextureMapperPlatformLayerProxyDMABuf::DMABufLayer::createEGLImageData):
2022-05-12 Alan Bujtas <zalan@apple.com>
TextBoxPainter::paintBackground should bail out early when nothing to paint
https://bugs.webkit.org/show_bug.cgi?id=240317
Reviewed by Simon Fraser.
Collecting markers and highlights is a somewhat expensive operation while most
of the time the text has neither markers nor highlights. Let's just bail out early when applicable.
* dom/Document.h:
(WebCore::Document::hasHighlightRegister const):
* rendering/TextBoxPainter.cpp:
(WebCore::TextBoxPainter::paintBackground):
2022-05-12 Tim Nguyen <ntim@apple.com>
[:has() pseudo-class] Support invalidation for :target pseudo-class
https://bugs.webkit.org/show_bug.cgi?id=240329
Reviewed by Antti Koivisto.
Test: imported/w3c/web-platform-tests/css/selectors/invalidation/target-pseudo-in-has.html
* dom/Document.cpp:
(WebCore::Document::setCSSTarget):
2022-05-11 Diego Pino Garcia <dpino@igalia.com>
[WPE] Unreviewed, build fix after r293816
https://bugs.webkit.org/show_bug.cgi?id=240330
Build was broken when ENABLE_ORIENTATION_EVENTS=ON
* dom/DeviceOrientationEvent.idl:
2022-05-11 Simon Fraser <simon.fraser@apple.com>
Some RenderStyle::diff() optimizations
https://bugs.webkit.org/show_bug.cgi?id=240323
Reviewed by Alan Bujtas.
Some LengthBox operator== stuff was showing up on profiles, which we can avoid by
first testing m_surroundData pointer equality.
scrollPadding and scrollSnapType live in rareNonInheritedData, so we can move their
comparisons into rareNonInheritedDataChangeRequiresLayout().
changeRequiresRepaint() can check for m_backgroundData and m_surroundData pointer
equality before doing more expensive tests.
These changes reduce the time in RenderStyle::diff() in the MotionMark Design
subtest by ~40%.
* rendering/style/RenderStyle.cpp:
(WebCore::rareNonInheritedDataChangeRequiresLayout):
(WebCore::RenderStyle::changeRequiresLayout const):
(WebCore::RenderStyle::changeRequiresLayerRepaint const):
(WebCore::RenderStyle::changeRequiresRepaint const):
2022-05-11 Wenson Hsieh <wenson_hsieh@apple.com>
ImageAnalysisQueue should extract and analyze images inside of subframes
https://bugs.webkit.org/show_bug.cgi?id=240328
rdar://93134975
Reviewed by Tim Horton.
Teach `ImageAnalysisQueue` to recursively find all images on the page (including images in of subframe content)
and queue them for analysis. To do this, we refactor `enqueueAllImages` to call into a new recursive helper
method, `enqueueAllImagesRecursive`, to look for more candidate image elements that exist inside frame owner
elements (e.g. `iframe`).
Test: ImageAnalysisTests.AnalyzeImagesInSubframes
* page/ImageAnalysisQueue.cpp:
(WebCore::ImageAnalysisQueue::enqueueAllImages):
(WebCore::ImageAnalysisQueue::enqueueAllImagesRecursive):
* page/ImageAnalysisQueue.h:
2022-05-11 Patrick Angle <pangle@apple.com>
Web Inspector: Parse InjectedScriptSource as a built-in to get guaranteed non-user-overriden JSC built-ins
https://bugs.webkit.org/show_bug.cgi?id=152294
Reviewed by Devin Rousso.
* CMakeLists.txt:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Headers.cmake:
* WebCore.xcodeproj/project.pbxproj:
- Build CommandLineAPIModuleSource.js as a builtin, not as a plain header file containing its source code.
* inspector/CommandLineAPIModule.cpp:
(WebCore::CommandLineAPIModule::injectModuleFunction const):
(WebCore::CommandLineAPIModule::source const): Deleted.
* inspector/CommandLineAPIModule.h:
- Provide a JSFunction for module injection instead of raw source code.
* inspector/CommandLineAPIModuleSource.js:
- Similar to JavaScriptCore/inspector/InjectedScriptSource.js, use private names for properties and functions
throughout to get non-user-overridden builtins.
- In `normalizeEventTypes` use a Set instead of an array, since we are processing user-provided types that may
be repeated. This means that we need to iterate over all the types to insert them in the set, but since
`@arrayPush` doesn't support pushing multiple values at the same time this is no more work than using an Array.
2022-05-11 Yury Semikhatsky <yurys@chromium.org>
[WinCairo] Support file downloads
https://bugs.webkit.org/show_bug.cgi?id=240293
Reviewed by Fujii Hironori.
Properly convert suggested file name to utf8.
Coverred by LayoutTests/http/tests/download/literal-utf-8.html.
* platform/network/curl/ResourceResponseCurl.cpp:
(WebCore::ResourceResponse::platformSuggestedFilename const):
2022-05-11 Antti Koivisto <antti@apple.com>
REGRESSION (r291788): MotionMark Suits subtest is 9% regressed
https://bugs.webkit.org/show_bug.cgi?id=240112
rdar://92409900
Reviewed by Alan Bujtas.
Add mechanism to safely update SVG renderer from element without triggering an unnecessary style resolution.
* dom/Document.cpp:
(WebCore::Document::removedLastRef):
(WebCore::Document::resolveStyle):
(WebCore::Document::updateTextRenderer):
(WebCore::Document::updateSVGRenderer):
Use the same mechanism as text updates to schedule SVG rendering updates.
(WebCore::Document::ensurePendingRenderTreeUpdate):
(WebCore::Document::needsStyleRecalc const):
(WebCore::Document::destroyRenderTree):
Ensure any remaining style update get deleted along with the render tree.
* dom/Document.h:
* dom/ElementData.h:
(WebCore::ElementData::svgResourcesInAncestorChainAreDirty const): Deleted.
(WebCore::ElementData::setSVGResourcesInAncestorChainAreDirty const): Deleted.
Not needed anymore, Style::Update remembers what needs updating.
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateRenderTree):
(WebCore::RenderTreeUpdater::updateElementRenderer):
Schedule an update. Currently this really just schedules a layout which pulls in the changes from the element.
* style/StyleUpdate.cpp:
(WebCore::Style::Update::addElement):
(WebCore::Style::Update::addSVGRendererUpdate):
Add a bit to ElementUpdate to indicate that SVG update is needed.
* style/StyleUpdate.h:
* svg/SVGAnimateMotionElement.cpp:
(WebCore::SVGAnimateMotionElement::applyResultsToTarget):
* svg/SVGClipPathElement.cpp:
(WebCore::SVGClipPathElement::svgAttributeChanged):
(WebCore::SVGClipPathElement::childrenChanged):
* svg/SVGElement.cpp:
(WebCore::SVGElement::updateSVGRendererForElementChange):
(WebCore::SVGElement::setSVGResourcesInAncestorChainAreDirty): Deleted.
(WebCore::SVGElement::invalidateSVGResourcesInAncestorChainIfNeeded): Deleted.
Replace setSVGResourcesInAncestorChainAreDirty with the new mechanism. Don't invalidate style.
* svg/SVGElement.h:
* svg/SVGFEBlendElement.cpp:
(WebCore::SVGFEBlendElement::svgAttributeChanged):
* svg/SVGFEColorMatrixElement.cpp:
(WebCore::SVGFEColorMatrixElement::svgAttributeChanged):
* svg/SVGFECompositeElement.cpp:
(WebCore::SVGFECompositeElement::svgAttributeChanged):
* svg/SVGFEConvolveMatrixElement.cpp:
(WebCore::SVGFEConvolveMatrixElement::setOrder):
(WebCore::SVGFEConvolveMatrixElement::setKernelUnitLength):
(WebCore::SVGFEConvolveMatrixElement::svgAttributeChanged):
* svg/SVGFEDiffuseLightingElement.cpp:
(WebCore::SVGFEDiffuseLightingElement::svgAttributeChanged):
* svg/SVGFEDisplacementMapElement.cpp:
(WebCore::SVGFEDisplacementMapElement::svgAttributeChanged):
* svg/SVGFEDropShadowElement.cpp:
(WebCore::SVGFEDropShadowElement::setStdDeviation):
(WebCore::SVGFEDropShadowElement::svgAttributeChanged):
* svg/SVGFEGaussianBlurElement.cpp:
(WebCore::SVGFEGaussianBlurElement::setStdDeviation):
(WebCore::SVGFEGaussianBlurElement::svgAttributeChanged):
* svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::buildPendingResource):
(WebCore::SVGFEImageElement::svgAttributeChanged):
* svg/SVGFEMorphologyElement.cpp:
(WebCore::SVGFEMorphologyElement::setRadius):
(WebCore::SVGFEMorphologyElement::svgAttributeChanged):
* svg/SVGFEOffsetElement.cpp:
(WebCore::SVGFEOffsetElement::svgAttributeChanged):
* svg/SVGFESpecularLightingElement.cpp:
(WebCore::SVGFESpecularLightingElement::svgAttributeChanged):
* svg/SVGFETileElement.cpp:
(WebCore::SVGFETileElement::svgAttributeChanged):
* svg/SVGFilterElement.cpp:
(WebCore::SVGFilterElement::svgAttributeChanged):
(WebCore::SVGFilterElement::childrenChanged):
* svg/SVGFilterPrimitiveStandardAttributes.cpp:
(WebCore::SVGFilterPrimitiveStandardAttributes::svgAttributeChanged):
(WebCore::SVGFilterPrimitiveStandardAttributes::childrenChanged):
(WebCore::SVGFilterPrimitiveStandardAttributes::invalidateFilterPrimitiveParent):
* svg/SVGForeignObjectElement.cpp:
(WebCore::SVGForeignObjectElement::svgAttributeChanged):
* svg/SVGGeometryElement.cpp:
(WebCore::SVGGeometryElement::svgAttributeChanged):
* svg/SVGGradientElement.cpp:
(WebCore::SVGGradientElement::svgAttributeChanged):
(WebCore::SVGGradientElement::childrenChanged):
* svg/SVGGraphicsElement.cpp:
(WebCore::SVGGraphicsElement::svgAttributeChanged):
* svg/SVGImageElement.cpp:
(WebCore::SVGImageElement::svgAttributeChanged):
* svg/SVGLineElement.cpp:
(WebCore::SVGLineElement::svgAttributeChanged):
* svg/SVGLinearGradientElement.cpp:
(WebCore::SVGLinearGradientElement::svgAttributeChanged):
* svg/SVGMarkerElement.cpp:
(WebCore::SVGMarkerElement::svgAttributeChanged):
(WebCore::SVGMarkerElement::childrenChanged):
* svg/SVGMaskElement.cpp:
(WebCore::SVGMaskElement::svgAttributeChanged):
(WebCore::SVGMaskElement::childrenChanged):
* svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::svgAttributeChanged):
* svg/SVGPatternElement.cpp:
(WebCore::SVGPatternElement::svgAttributeChanged):
(WebCore::SVGPatternElement::childrenChanged):
* svg/SVGPolyElement.cpp:
(WebCore::SVGPolyElement::svgAttributeChanged):
* svg/SVGRadialGradientElement.cpp:
(WebCore::SVGRadialGradientElement::svgAttributeChanged):
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::updateCurrentTranslate):
(WebCore::SVGSVGElement::svgAttributeChanged):
* svg/SVGStopElement.cpp:
(WebCore::SVGStopElement::svgAttributeChanged):
* svg/SVGTRefElement.cpp:
(WebCore::SVGTRefElement::svgAttributeChanged):
* svg/SVGTextContentElement.cpp:
(WebCore::SVGTextContentElement::svgAttributeChanged):
* svg/SVGTextPathElement.cpp:
(WebCore::SVGTextPathElement::svgAttributeChanged):
* svg/SVGTextPositioningElement.cpp:
(WebCore::SVGTextPositioningElement::svgAttributeChanged):
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::svgAttributeChanged):
* svg/SVGViewElement.cpp:
(WebCore::SVGViewElement::svgAttributeChanged):
2022-05-10 Wenson Hsieh <wenson_hsieh@apple.com>
[Webpage Translation] Avoid removing elements with no children during text manipulation
https://bugs.webkit.org/show_bug.cgi?id=240287
rdar://91882797
Reviewed by Tim Horton.
After invoking webpage translation on a particular website, the entire page becomes blank and unusable when
scrolling. This happens because of an uncaught JavaScript exception that's thrown when this page's script
attempts to remove an element from its parent using `p.removeChild(c)`, where the node `p` is not a parent of
the given node `c`; this, in turn, happens because `TextManipulationController` has already unparented `c` from
`p` while performing text replacement during translation.
In this particular case, the former child node `c` is an empty `div` element with no text or children. As such,
it's unnecessary to flag this element for removal in the first place, since doing so isn't necessary to fill in
translated text.
We can avoid this issue by simply skipping over such nodes (i.e. containers that contain no text, no child
elements, and also are not replaced elements) to avoid this and similar compatibility issues that arise when
the DOM is mutated underneath the page, during translation.
Test: TextManipulation.CompleteTextManipulationSkipsEmptyContainers
* editing/TextManipulationController.cpp:
(WebCore::TextManipulationController::replace):
2022-05-11 Youenn Fablet <youenn@apple.com>
Add a webshare quirk for youtube
https://bugs.webkit.org/show_bug.cgi?id=240303
<rdar://93042649>
Reviewed by Tim Horton.
Manually tested.
* page/Quirks.cpp:
(WebCore::isYouTubeDocument):
(WebCore::Quirks::shouldDisableWebSharePolicy const):
2022-05-11 Youenn Fablet <youenn@apple.com>
MediaPlayerPrivateRemote::nativeImageForCurrentTime should not use IOSurfaces
https://bugs.webkit.org/show_bug.cgi?id=240226
<rdar://problem/92969905>
Reviewed by Eric Carlson.
Add a way for MediaPlayer to pass the VideoFrame related to the given frame metadata.
Covered by existing tests, in particular:
- LayoutTests/media/video-canvas-createPattern.html
- LayoutTests/media/video-canvas-drawing.html
- LayoutTests/media/video-canvas-drawing-output.html
* platform/graphics/MediaPlayer.cpp:
* platform/graphics/MediaPlayer.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
* platform/mediastream/libwebrtc/VideoFrameLibWebRTC.h:
2022-05-11 Youenn Fablet <youenn@apple.com>
Introduce a canvas-drawImage specific method to get a NativeImage from a video element
https://bugs.webkit.org/show_bug.cgi?id=240275
Reviewed by Eric Carlson.
Introduce shouldGetNativeImageForCanvasDrawing in HTMLVideoElement/MediaPlayer/MediaPlayerPrivate.
If returning true, we call videoFrameForCurrentTime when drawing a video to canvas.
Otherwise, we directly use video.paintCurrentFrameInContext code path.
This allows skipping a code path where videoFrameForCurrentTime is less efficient than video.paintCurrentFrameInContext.
Covered by existing canvas tests.
* html/HTMLVideoElement.cpp:
* html/HTMLVideoElement.h:
* platform/graphics/MediaPlayer.cpp:
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
2022-05-10 Brent Fulgham <bfulgham@apple.com>
Remove the unneeded StylePropertiesBase after Bug 240244
https://bugs.webkit.org/show_bug.cgi?id=240282
Reviewed by Antti Koivisto.
Now that we have removed the abandoned CSSDeferredParser, we no longer need the
StylePropertiesBase class. This patch removes this layer to simplify the code.
* css/StyleProperties.h:
(WebCore::StyleProperties::type const):
(WebCore::StyleProperties::cssParserMode const):
(WebCore::StyleProperties::StyleProperties):
(WebCore::StyleProperties::deref const):
(isType):
(WebCore::StylePropertiesBase::type const): Deleted.
(WebCore::StylePropertiesBase::cssParserMode const): Deleted.
(WebCore::StylePropertiesBase::StylePropertiesBase): Deleted.
(WebCore::StylePropertiesBase::deref const): Deleted.
* css/StyleRule.cpp:
(WebCore::StyleRule::StyleRule):
(WebCore::StyleRule::create):
(WebCore::StyleRule::properties const): Deleted.
* css/StyleRule.h:
2022-05-10 Said Abou-Hallawa <said@apple.com>
[GPU Process] [Filters] FilterImages can be leaked
https://bugs.webkit.org/show_bug.cgi?id=240274
Reviewed by Simon Fraser.
When a FilterEffect is dynamically updated we clear its result FilterImage.
We also need to clear all the result FilterImages of all the FilterEffects
recursively which takes this changing FilterEffect as an input.
Clearing the result FilterImage of the changing FilterEffect happens by
removing the entry from FilterResults::m_results.
Clearing the FilterImages of the dependent FilterEffects happens by using
FilterResults::m_resultReferences.
What is missing is removing the FilterImage entry itself from
FilterResults::m_resultReferences.
* platform/graphics/filters/FilterResults.h:
(WebCore::FilterResults::clearEffectResult):
2022-05-10 Tim Nguyen <ntim@apple.com>
Fix inertness of pseudo-elements
https://bugs.webkit.org/show_bug.cgi?id=239831
Reviewed by Antti Koivisto.
When we adjust style for a pseudo-element, `m_element` and `document().activeModalDialog()` are both null. So we accidentally reset inertness to false in those cases.
Fix this by making checking for m_element's existence too.
Test: imported/w3c/web-platform-tests/inert/inert-pseudo-element-hittest.html
* style/StyleAdjuster.cpp:
(WebCore::Style::Adjuster::adjust const):
2022-05-10 Simon Fraser <simon.fraser@apple.com>
Optimize Replayer::applyItem() slightly
https://bugs.webkit.org/show_bug.cgi?id=240258
Reviewed by Wenson Hsieh.
Convert a series of `if` statements into a switch.
De-templatize applyFontItem<> since DrawGlyphs is the only instantiation, and the
name was confusing.
* platform/graphics/displaylists/DisplayListReplayer.cpp:
(WebCore::DisplayList::applyDrawGlyphs):
(WebCore::DisplayList::Replayer::applyItem):
(WebCore::DisplayList::applyFontItem): Deleted.
2022-05-10 Brent Fulgham <bfulgham@apple.com>
Remove abandoned CSSDeferredParser implementation and feature flag
https://bugs.webkit.org/show_bug.cgi?id=240244
Reviewed by Antti Koivisto.
This patch rolls out the abandoned CSSDeferredParser implementation added in Bug 165743.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSKeyframesRule.cpp:
(WebCore::StyleRuleKeyframes::keyframes const):
(WebCore::StyleRuleKeyframes::wrapperAppendKeyframe):
(WebCore::StyleRuleKeyframes::wrapperRemoveKeyframe):
(WebCore::StyleRuleKeyframes::findKeyframeIndex const):
(WebCore::StyleRuleKeyframes::parseDeferredRulesIfNeeded const): Deleted.
* css/CSSKeyframesRule.h:
* css/StyleProperties.cpp:
(WebCore::MutableStyleProperties::MutableStyleProperties):
(WebCore::StyleProperties::PropertyReference::cssText const):
(WebCore::DeferredStyleProperties::create): Deleted.
(WebCore::DeferredStyleProperties::DeferredStyleProperties): Deleted.
(WebCore::DeferredStyleProperties::parseDeferredProperties): Deleted.
* css/StyleProperties.h:
(WebCore::StylePropertiesBase::deref const):
(isType):
* css/StyleRule.cpp:
(WebCore::StyleRule::properties const):
(WebCore::StyleRuleGroup::childRules const):
(WebCore::StyleRuleGroup::wrapperInsertRule):
(WebCore::StyleRuleGroup::wrapperRemoveRule):
(WebCore::DeferredStyleGroupRuleList::DeferredStyleGroupRuleList): Deleted.
(WebCore::DeferredStyleGroupRuleList::parseDeferredRules): Deleted.
(WebCore::DeferredStyleGroupRuleList::parseDeferredKeyframes): Deleted.
(WebCore::StyleRuleGroup::parseDeferredRulesIfNeeded const): Deleted.
* css/StyleRule.h:
(WebCore::StyleRule::propertiesWithoutDeferredParsing const): Deleted.
(WebCore::StyleRuleGroup::childRulesWithoutDeferredParsing const): Deleted.
* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::parseAuthorStyleSheet):
(WebCore::StyleSheetContents::parseString):
(WebCore::traverseRulesInVector):
(WebCore::StyleSheetContents::traverseSubresources const):
* css/parser/CSSDeferredParser.cpp: Removed.
* css/parser/CSSDeferredParser.h: Removed.
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseSheet):
* css/parser/CSSParser.h:
* css/parser/CSSParserContext.cpp:
(WebCore::operator==):
(WebCore::add):
* css/parser/CSSParserContext.h:
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::CSSParserImpl):
(WebCore::CSSParserImpl::parseStyleSheet):
(WebCore::CSSParserImpl::consumeMediaRule):
(WebCore::CSSParserImpl::consumeSupportsRule):
(WebCore::CSSParserImpl::consumeKeyframesRule):
(WebCore::CSSParserImpl::consumeLayerRule):
(WebCore::CSSParserImpl::consumeContainerRule):
(WebCore::CSSParserImpl::consumeStyleRule):
(WebCore::CSSParserImpl::createDeferredStyleProperties): Deleted.
(WebCore::CSSParserImpl::parseDeferredDeclaration): Deleted.
(WebCore::CSSParserImpl::parseDeferredRuleList): Deleted.
(WebCore::CSSParserImpl::parseDeferredKeyframeList): Deleted.
(WebCore::CSSParserImpl::adoptTokenizerEscapedStrings): Deleted.
* css/parser/CSSParserImpl.h:
(WebCore::CSSParserImpl::tokenizer const):
(WebCore::CSSParserImpl::deferredParser const): Deleted.
* style/ElementRuleCollector.cpp:
(WebCore::Style::ElementRuleCollector::collectMatchingRulesForList):
* style/StyleInvalidator.cpp:
(WebCore::Style::shouldDirtyAllStyle):
* testing/Internals.cpp:
(WebCore::deferredStyleRulesCountForList): Deleted.
(WebCore::Internals::deferredStyleRulesCount): Deleted.
(WebCore::deferredGroupRulesCountForList): Deleted.
(WebCore::Internals::deferredGroupRulesCount): Deleted.
(WebCore::deferredKeyframesRulesCountForList): Deleted.
(WebCore::Internals::deferredKeyframesRulesCount): Deleted.
* testing/Internals.h:
* testing/Internals.idl:
2022-05-10 Youenn Fablet <youenn@apple.com>
Create a stopped CacheStorageConnection for workers in case of detached documents
https://bugs.webkit.org/show_bug.cgi?id=240224
<rdar://problem/92853663>
Reviewed by Chris Dumez.
A worker might not always have a main thread connection as its document may be detached.
In that case, we now create a StoppedCacheStorageConnection that will always return Error::Stopped to any callback.
Covered by existing tests.
* Modules/cache/WorkerCacheStorageConnection.cpp:
(WebCore::StoppedCacheStorageConnection::create):
(WebCore::createMainThreadConnection):
(WebCore::WorkerCacheStorageConnection::WorkerCacheStorageConnection):
(WebCore::WorkerCacheStorageConnection::~WorkerCacheStorageConnection):
(WebCore::WorkerCacheStorageConnection::create): Deleted.
* Modules/cache/WorkerCacheStorageConnection.h:
2022-05-09 Jean-Yves Avenard <jya@apple.com>
com.apple.WebKit.GPU leaks CMBlockBuffer
https://bugs.webkit.org/show_bug.cgi?id=240267
rdar://92655222
Reviewed by Jer Noble.
* platform/graphics/cocoa/CMUtilities.mm:
(WebCore::toCMSampleBuffer): adopt newly created CMBlockBuffer rather than increase the refcount.
2022-05-09 Rob Buis <rbuis@igalia.com>
Check if node is connected after calling mergeWithNeighboringLists
https://bugs.webkit.org/show_bug.cgi?id=240234
Reviewed by Wenson Hsieh.
Check if node is connected after calling mergeWithNeighboringLists since
DOM mutations can change the DOM tree.
* editing/InsertListCommand.cpp:
(WebCore::InsertListCommand::doApplyForSingleParagraph):
2022-05-09 Oriol Brufau <obrufau@igalia.com>
[cssom] Don't index perspective/transform-origin-* in computed styles
https://bugs.webkit.org/show_bug.cgi?id=239670
Reviewed by Darin Adler.
'perspective-origin' and 'transform-origin' are shorthands in WebKit.
The longhands are 'perspective-origin-x/y' and 'transform-origin-x/y/z'.
But these aren't standard properties, so they serialize to empty string
in computed styles. However, they were still indexed.
This patch stops indexing these longhands, so they won't appear when
iterating a computed style. Also, the shorthands will now be indexed.
Test: fast/css/getComputedStyle/computed-style.html
fast/css/getComputedStyle/computed-style-without-renderer.html
imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml.html
imported/w3c/web-platform-tests/css/css-cascade/all-prop-revert-layer.html
imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree.html
imported/w3c/web-platform-tests/css/cssom/serialize-all-longhands.html
svg/css/getComputedStyle-basic.xhtml
* css/CSSProperties.json:
Add "computable" flag.
* css/makeprop.pl:
(skippedFromComputedStyle):
(addProperty):
Let "computable" flag override default logic for indexing or not in
computed styles.
2022-05-09 Nikolaos Mouchtaris <nmouchtaris@apple.com>
Support ray() shape in offset-path
https://bugs.webkit.org/show_bug.cgi?id=233344
Reviewed by Simon Fraser.
Add support for rendering ray path. Involves getting containing block and offset
of the element from the containing block. Using the size of the containing block
and offset, calculate the length of the ray and create a Line path using the length
and angle. Calculating closest/farthest-side and closest/farthest-corner are simple
but calculating side requires some explanation. First, we get the two possible sides of
the containing block the ray could be intersecting with, based on the angle. To calculate
which side is being intersected, if tan(theta) * top/bottom is outside of the containing
block, this means that the ray is intersecting with the other side. Finally, we calculate
the acute angle based on which side we intersected with. Using the length and angle, we
calculate the length of the hypotenuse, which corresponds with the length of the start point
of the ray to its intersection with a side of the containing block. Test 7 is still failing
due to getting incorrect width of containing block (doesn't happen when animating the path
for some reason). Will implement contain in another patch.
* WebCore.xcodeproj/project.pbxproj:
* rendering/PathOperation.cpp:
(WebCore::toPositiveAngle):
(WebCore::RayPathOperation::getLengthForPath const):
(WebCore::RayPathOperation::pathForReferenceRect const):
* rendering/PathOperation.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::setReferenceBoxForPathOperations):
(WebCore::RenderLayer::updateTransform):
* rendering/RenderLayer.h:
* rendering/style/RenderStyle.cpp:
(WebCore::getPathFromPathOperation):
2022-05-09 Alan Bujtas <zalan@apple.com>
Do not use the cached renderer's parent in handleFragmentedFlowStateChange lambda
https://bugs.webkit.org/show_bug.cgi?id=240266
Reviewed by Simon Fraser.
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::normalizeTreeAfterStyleChange):
2022-05-07 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Adjust some viewport behaviors when multitasking mode is enabled
https://bugs.webkit.org/show_bug.cgi?id=240151
rdar://87157773
Reviewed by Tim Horton.
Add a new ViewportConfiguration flag to prefer horizontal scrolling over shrinking to fit when the view layout
size falls under the current "default desktop webpage" of 980pt. See WebKit changes for more details.
* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::initialScaleFromSize const):
(WebCore::ViewportConfiguration::webpageParameters):
(WebCore::ViewportConfiguration::imageDocumentParameters):
Pull the magic value representing the "assumed width of most desktop webpages" (980) out into a named constant,
`defaultDesktopViewportWidth`, so that we can consult it when computing the initial scale.
(WebCore::ViewportConfiguration::description const):
* page/ViewportConfiguration.h:
(WebCore::ViewportConfiguration::setPrefersHorizontalScrollingBelowDesktopViewportWidths):
2022-05-09 Tim Horton <timothy_horton@apple.com>
Const-ify Node::willRespondTo*Events()
https://bugs.webkit.org/show_bug.cgi?id=240246
Reviewed by Wenson Hsieh.
Constify these four methods, because there's no
reason for them not to be, and because it makes
them usable in a const context in a future patch.
* dom/EventNames.h:
(WebCore::EventNames::isTouchRelatedEventType const):
* dom/EventTarget.cpp:
(WebCore::EventTarget::eventTypes const):
* dom/EventTarget.h:
* dom/Node.cpp:
(WebCore::Node::willRespondToMouseMoveEvents const):
(WebCore::Node::willRespondToTouchEvents const):
(WebCore::Node::willRespondToMouseClickEvents const):
(WebCore::Node::willRespondToMouseWheelEvents const):
* dom/Node.h:
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::willRespondToMouseClickEvents const):
* html/HTMLAnchorElement.h:
* html/HTMLButtonElement.cpp:
(WebCore::HTMLButtonElement::willRespondToMouseClickEvents const):
* html/HTMLButtonElement.h:
* html/HTMLElement.cpp:
(WebCore::HTMLElement::willRespondToMouseMoveEvents const):
(WebCore::HTMLElement::willRespondToMouseWheelEvents const):
(WebCore::HTMLElement::willRespondToMouseClickEvents const):
* html/HTMLElement.h:
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::willRespondToMouseClickEvents const):
* html/HTMLImageElement.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::willRespondToMouseClickEvents const):
* html/HTMLInputElement.h:
* html/HTMLLabelElement.cpp:
(WebCore::HTMLLabelElement::willRespondToMouseClickEvents const):
* html/HTMLLabelElement.h:
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::willRespondToMouseClickEvents const):
* html/HTMLPlugInElement.h:
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::willRespondToMouseClickEvents const):
* html/HTMLSelectElement.h:
* html/HTMLSummaryElement.cpp:
(WebCore::HTMLSummaryElement::willRespondToMouseClickEvents const):
* html/HTMLSummaryElement.h:
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::willRespondToMouseClickEvents const):
* html/HTMLTextAreaElement.h:
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::shouldSpinButtonRespondToMouseEvents const):
(WebCore::TextFieldInputType::shouldSpinButtonRespondToWheelEvents const):
* html/TextFieldInputType.h:
* html/shadow/SliderThumbElement.cpp:
(WebCore::SliderThumbElement::willRespondToMouseMoveEvents const):
(WebCore::SliderThumbElement::willRespondToMouseClickEvents const):
* html/shadow/SliderThumbElement.h:
* html/shadow/SpinButtonElement.cpp:
(WebCore::SpinButtonElement::willRespondToMouseMoveEvents const):
(WebCore::SpinButtonElement::willRespondToMouseClickEvents const):
(WebCore::SpinButtonElement::shouldRespondToMouseEvents const):
* html/shadow/SpinButtonElement.h:
* html/shadow/TextControlInnerElements.cpp:
(WebCore::SearchFieldResultsButtonElement::willRespondToMouseClickEvents const):
(WebCore::SearchFieldCancelButtonElement::willRespondToMouseClickEvents const):
* html/shadow/TextControlInnerElements.h:
* mathml/MathMLElement.cpp:
(WebCore::MathMLElement::willRespondToMouseClickEvents const):
* mathml/MathMLElement.h:
* mathml/MathMLSelectElement.cpp:
(WebCore::MathMLSelectElement::willRespondToMouseClickEvents const):
* mathml/MathMLSelectElement.h:
* svg/SVGAElement.cpp:
(WebCore::SVGAElement::willRespondToMouseClickEvents const):
* svg/SVGAElement.h:
2022-05-09 Per Arne Vollan <pvollan@apple.com>
[macOS] HTTP traffic is not filtered in the parental controls filter
https://bugs.webkit.org/show_bug.cgi?id=240180
<rdar://problem/92875540>
Reviewed by Alexey Proskuryakov.
Traditionally, we have not filtered HTTP in the parental controls filter on macOS, since other parts of the system
has taken care of this. This has changed in the most recent macOS version, and WebKit should also filter HTTP in
addition to HTTPS.
* platform/cocoa/ParentalControlsContentFilter.mm:
(WebCore::canHandleResponse):
2022-05-09 Simon Fraser <simon.fraser@apple.com>
Cache the viewport size inside SVGLengthContext
https://bugs.webkit.org/show_bug.cgi?id=240157
Reviewed by Alan Bujtas.
Each call to SVGLengthContext::determineViewport() did an ancestor element walk
looking for a viewport element, and some call sites hit this two or more times
(e.g. for width, then height). So cache m_viewportSize in the class, modernizing
the code to use optionals.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::referenceBoxRect const):
* rendering/svg/LegacyRenderSVGRoot.cpp:
(WebCore::LegacyRenderSVGRoot::computeFloatVisibleRectInContainer const):
* rendering/svg/SVGRenderSupport.cpp:
(WebCore::clipPathReferenceBox):
* svg/SVGLengthContext.cpp:
(WebCore::SVGLengthContext::valueForLength):
(WebCore::SVGLengthContext::convertValueToUserUnits const):
(WebCore::SVGLengthContext::convertValueFromUserUnitsToPercentage const):
(WebCore::SVGLengthContext::convertValueFromPercentageToUserUnits const):
(WebCore::SVGLengthContext::viewportSize const):
(WebCore::SVGLengthContext::computeViewportSize const):
(WebCore::SVGLengthContext::determineViewport const): Deleted.
* svg/SVGLengthContext.h:
2022-05-09 Tim Nguyen <ntim@apple.com>
Implement CSS :modal pseudo class
https://bugs.webkit.org/show_bug.cgi?id=240109
Reviewed by Simon Fraser.
Test: imported/w3c/web-platform-tests/css/selectors/invalidation/modal-pseudo-class-in-has.html
Renames :-internal-modal-dialog to :modal and adds :has() invalidation support.
* css/CSSSelector.cpp:
(WebCore::CSSSelector::selectorText const):
* css/CSSSelector.h:
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne const):
* css/SelectorCheckerTestFunctions.h:
(WebCore::matchesModalPseudoClass):
(WebCore::matchesModalDialogPseudoClass): Deleted.
* css/SelectorPseudoClassAndCompatibilityElementMap.in:
* css/dialog.css:
(dialog:modal):
(dialog:-internal-modal-dialog): Deleted.
* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumePseudo):
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::JSC_DEFINE_JIT_OPERATION):
(WebCore::SelectorCompiler::addPseudoClassType):
* html/HTMLDialogElement.cpp:
(WebCore::HTMLDialogElement::showModal):
(WebCore::HTMLDialogElement::close):
(WebCore::HTMLDialogElement::removedFromAncestor):
(WebCore::HTMLDialogElement::setIsModal):
* html/HTMLDialogElement.h:
2022-05-09 Gabriel Nava Marino <gnavamarino@apple.com>
ASSERT in WebCore::RenderTreeUpdater::updateRenderTree
https://bugs.webkit.org/show_bug.cgi?id=240237
Reviewed by Antti Koivisto.
There are instances where calling findRenderingRoots() in RenderTreeUpdater::commit will
returns two rendering roots, with one of them being an ancestor of the other.
Calling updateRenderTree on the ancestor rendering root could end up removing
the renderer of the descendant rendering root.
This patch merges findRenderingRoots() to RenderTreeUpdater::commit() which, and now we will
ignore the nested root if there is no longer a renderer when it is being processed.
* rendering/updating/RenderTreeUpdater.cpp:
2022-05-09 Tyler Wilcock <tyler_w@apple.com>
AXLogger::streamAXCoreObject is missing a null check for AccessibilityObject dynamicDowncast
https://bugs.webkit.org/show_bug.cgi?id=240228
Reviewed by Andres Gonzalez.
When checking if an object has display:contents, we do:
if (auto* axObject = dynamicDowncast<AccessibilityObject>(&object); axObject->hasDisplayContents())
Which does not have a nullcheck for when the dynamicDowncast fails (i.e. because
the object is not an AccessibilityObject).
* accessibility/AXLogger.cpp:
(WebCore::streamAXCoreObject):
2022-05-09 Kate Cheney <katherine_cheney@apple.com>
Image controls menu button is not appearing for multi-page PDFs
https://bugs.webkit.org/show_bug.cgi?id=240120
rdar://86425721
Reviewed by Megan Gardner.
Test: fast/attachment/attachment-image-controls-basic.html
Refactor image controls button code so it can also be used for PDF
attachments.
* dom/mac/ImageControlsMac.cpp:
(WebCore::ImageControlsMac::handleEvent):
(WebCore::ImageControlsMac::isImageMenuEnabled):
(WebCore::ImageControlsMac::updateImageControls):
(WebCore::ImageControlsMac::tryCreateImageControls):
(WebCore::ImageControlsMac::destroyImageControls):
(WebCore::ImageControlsMac::hasImageControls):
* dom/mac/ImageControlsMac.h:
Handle the PDF case when a click on the image controls button happens.
Move all image controls code to ImageControlsMac where it can be
shared by image and attachment elements.
* html/HTMLAttachmentElement.cpp:
(WebCore::HTMLAttachmentElement::parseAttribute):
(WebCore::HTMLAttachmentElement::childShouldCreateRenderer const):
* html/HTMLAttachmentElement.h:
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::parseAttribute):
(WebCore::HTMLImageElement::didAttachRenderers):
(WebCore::HTMLImageElement::setAttachmentElement):
(WebCore::HTMLImageElement::updateImageControls): Deleted.
(WebCore::HTMLImageElement::tryCreateImageControls): Deleted.
(WebCore::HTMLImageElement::destroyImageControls): Deleted.
(WebCore::HTMLImageElement::hasImageControls const): Deleted.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::isImageMenuEnabled const):
(WebCore::HTMLImageElement::setImageMenuEnabled):
(WebCore::HTMLImageElement::imageMenuEnabled const): Deleted.
* html/shadow/mac/imageControlsMac.css:
The image controls button was originally offset by 20px from the top
and the right. This causes the image controls button to appear in the
middle of a PDF attachment and be difficult to see. This change makes
it flush against the top right corner for both images and PDFs.
(button#image-controls-button):
* page/ChromeClient.h:
(WebCore::ChromeClient::handlePDFServiceClick):
* rendering/RenderAttachment.cpp:
(WebCore::RenderAttachment::RenderAttachment):
(WebCore::RenderAttachment::layout):
(WebCore::RenderAttachment::layoutShadowContent):
* rendering/RenderAttachment.h:
Add canHaveGeneratedChildren() and canHaveChildren() so that
we render the image controls button in the shadow tree.
* rendering/RenderImage.cpp:
(WebCore::RenderImage::RenderImage):
* testing/Internals.cpp:
(WebCore::Internals::hasImageControls const):
2022-05-09 Ziran Sun <zsun@igalia.com>
Make input placeholder line-height declaration !important
https://bugs.webkit.org/show_bug.cgi?id=240225
Reviewed by Tim Nguyen.
This is the same the changes made in chromium at
https://chromium-review.googlesource.com/c/chromium/src/+/3594234
and Firefox change at
https://phabricator.services.mozilla.com/D116907
* css/html.css:
(input::placeholder):
2022-05-09 Antoine Quint <graouts@apple.com>
REGRESSION (r291817): NativeImage passed to RemoteResourceCacheProxy::recordNativeImageUse may be null
https://bugs.webkit.org/show_bug.cgi?id=239649
rdar://92018859
Reviewed by Dean Jackson.
Test: system-preview/svg-image.html
In the case of an <img> pointing to an SVG resource, the nativeImage() is null. We need to handle this case
properly (filed bug 239673), but for now we can at least not crash.
* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::drawSystemImage):
2022-05-09 Youenn Fablet <youenn@apple.com>
CoreAudioCaptureSource::settingsDidChange should not reconfigure the audio unit if CoreAudioCaptureSource is not started
https://bugs.webkit.org/show_bug.cgi?id=240059
Reviewed by Eric Carlson.
We should only ask to reconfigure when source settings change if the source is actually started.
Otherwise, we can wait for the source to start to actually set the unit values and reconfigure if needed.
To make sure to correctly expose settings, we reset them in CoreAudioCaptureSource::settingsDidChange and in
CoreAudioCaptureSource::initializeToStartProducingData.
We also only use the audio unit sample rate if it is rendering audio, otherwise we can change the sample rate at will.
Manually tested.
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
2022-05-09 Miguel Gomez <magomez@igalia.com>
[Nicosia] Canvas animations don't work with threaded rendering
https://bugs.webkit.org/show_bug.cgi?id=227760
<rdar://problem/80588913>
Reviewed by Adrian Perez de Castro.
Implement Nicosia::CairoOperationRecorder::draImageBuffer(), which is required in order to paint
canvas contents into a GraphicsContext.
* platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp:
(Nicosia::CairoOperationRecorder::drawImageBuffer):
2022-05-09 Manuel Rego Casasnovas <rego@igalia.com>
[WinCairo][WK1] accessibility/aria-combobox-control-owns-elements.html is crashing after 250325@main
https://bugs.webkit.org/show_bug.cgi?id=240218
<rdar://problem/92929718>
Reviewed by Joanmarie Diggs.
Fix a wrong ASSERT for AriaReflectionForElementReferencesEnabled.
If AriaReflectionForElementReferencesEnabled is disabled, and you set
one of the attributes that have reflection under that flag,
we'll hit an ASSERT in Element::attributeChanged().
The fact that we set such attribute doesn't mean that the flag
has to be enabled.
Removed the ASSERT and added an if to check if the flag is enabled,
otherwise we don't need to do anything with the map.
* dom/Element.cpp:
(WebCore::Element::attributeChanged):
2022-05-09 Diego Pino Garcia <dpino@igalia.com>
Unreviewed, non-unified build fixes after r293562
* workers/shared/context/SharedWorkerThread.cpp:
* workers/shared/context/SharedWorkerThreadProxy.cpp:
2022-05-08 Said Abou-Hallawa <said@apple.com>
[macOS] REGRESSION (r293825): Find highlight snapshots are incorrectly scaled
https://bugs.webkit.org/show_bug.cgi?id=240203
rdar://92892014
Reviewed by Tim Horton.
takeSnapshots() depends on the snapshot ImageBuffer::resolutionScale() to
set the size of the TextIndicatorData image. r293825 scaled the size of
the ImageBuffer before creation and moved the scaling to the GraphicsContext.
So we have correct scaled pixels but the resolutionScale is 1. So we get
enlarged incorrect image.
The fix is to revert r293825 and fix the iOS snapshot without having to
change snapshotFrameRectWithClip().
* page/FrameSnapshotting.cpp:
(WebCore::snapshotFrameRectWithClip):
2022-05-07 Yusuke Suzuki <ysuzuki@apple.com>
Introduce EventTrackingRegions::Event enum
https://bugs.webkit.org/show_bug.cgi?id=240206
Reviewed by Mark Lam.
We noticed that EventNames 260~ AtomStrings are allocated in scrolling thread only because we are using
eventNames() for EventTrackingRegions. But since use of it is limited, we can just use enum instead.
1. We can make EventTrackingRegions more efficient by using enum instead of String.
2. We can save memory by avoiding EventNames string allocations & AtomStringTable registration.
3. We can make this parameter more strictly typed compared to accepting any kind of Strings
* page/DebugPageOverlays.cpp:
(WebCore::NonFastScrollableRegionOverlay::drawRect):
* page/Page.cpp:
(WebCore::Page::touchEventRectsForEventForTesting):
* page/Page.h:
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::absoluteEventTrackingRegionsForFrame const):
* page/scrolling/ScrollingStateFrameScrollingNode.cpp:
(WebCore::ScrollingStateFrameScrollingNode::dumpProperties const):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::computeWheelProcessingSteps):
(WebCore::ScrollingTree::eventTrackingTypeForPoint):
* page/scrolling/ScrollingTree.h:
* platform/EventTrackingRegions.cpp:
(WebCore::EventTrackingRegions::eventName):
(WebCore::EventTrackingRegions::trackingTypeForPoint):
(WebCore::EventTrackingRegions::uniteSynchronousRegion):
* platform/EventTrackingRegions.h:
* testing/Internals.cpp:
(WebCore::Internals::touchEventRectsForEvent):
* testing/Internals.h:
2022-05-08 Antti Koivisto <antti@apple.com>
Avoid resolving style for elements that only inherit changes from parent
https://bugs.webkit.org/show_bug.cgi?id=240132
<rdar://problem/92867346>
Reviewed by Sam Weinig.
When an inherited property changes we need to update all descendant styles too. Currently this
is done by simply running the full style resolution for them including selector matching and
style building steps.
In the common case nothing changes in descendants expect the inherited properties. This patch implements
a fast-path mechanism that allows us to simply copy the relevant properties from the parent, skipping
all the other work. This is possible if we can prove that the value of these properties is not changed
by any rules targeting the child and that there are no other properties affected by this value change.
The mechanism is only implemented for the 'color' property for now. It can be expanded for other properties later.
It would be especially useful for custom properties.
* css/CSSProperties.json:
* css/makeprop.pl:
Add "fast-path-inherited" codegen property that disables the fast-path if the property is explicitly mutated.
(generateInitialValueSetter):
(generateValueSetter):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::RenderStyle):
(WebCore::RenderStyle::fastPathInheritFrom):
Inherit fast path properties.
(WebCore::RenderStyle::fastPathInheritedEqual const):
(WebCore::RenderStyle::nonFastPathInheritedEqual const):
Test for fast-path property changes.
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::disallowsFastPathInheritance const):
(WebCore::RenderStyle::setDisallowsFastPathInheritance):
Track if can use the mechanism.
(WebCore::RenderStyle::NonInheritedFlags::operator== const):
* rendering/style/StyleInheritedData.cpp:
(WebCore::StyleInheritedData::operator== const):
(WebCore::StyleInheritedData::fastPathInheritedEqual const):
(WebCore::StyleInheritedData::nonFastPathInheritedEqual const):
(WebCore::StyleInheritedData::fastPathInheritFrom):
* rendering/style/StyleInheritedData.h:
* style/StyleBuilderCustom.h:
(WebCore::Style::BuilderCustom::applyValueFill):
(WebCore::Style::BuilderCustom::applyValueStroke):
* style/StyleBuilderState.cpp:
(WebCore::Style::BuilderState::colorFromPrimitiveValueWithResolvedCurrentColor const):
Color value 'currentcolor' is mostly resolved during use time but in the few places we still resolve it during style building
we need to disable the fast-path, since it makes other properties depend on 'color' property.
* style/StyleChange.cpp:
(WebCore::Style::determineChange):
New style change type for fast-path inheritance.
* style/StyleChange.h:
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::styleForStyleable):
Resolve by just copying properties from the parent.
(WebCore::Style::TreeResolver::computeDescendantsToResolve):
(WebCore::Style::TreeResolver::resolveElement):
(WebCore::Style::TreeResolver::determineResolutionType):
Use fast-path if the only reason we are resolving this element is that some supported inherited property changed.
(WebCore::Style::TreeResolver::resolveComposedTree):
(WebCore::Style::TreeResolver::shouldResolveElement): Deleted.
* style/StyleTreeResolver.h:
2022-05-07 Ryosuke Niwa <rniwa@webkit.org>
Add helper functions to queue task on Node with GCReachableRef
https://bugs.webkit.org/show_bug.cgi?id=240204
Reviewed by Chris Dumez.
Added Node::queueTaskKeepingThisNodeAlive, which queues a task to the event loop while keeping "this" Node
and its JS wrapper alive, and Node::queueTaskToDispatchEvent, which queues a task to the event loop to
dispatch an event on "this" Node while keeping it and its JS wrapper alive, and deployed them in elements.
* Modules/model-element/HTMLModelElement.cpp:
(WebCore::HTMLModelElement::setSourceURL): Need to disambiguate which queueTaskToDispatchEvent to use
between Node and ActiveDOMObject.
(WebCore::HTMLModelElement::notifyFinished): Ditto.
* dom/Node.cpp:
(WebCore::Node::queueTaskKeepingThisNodeAlive): Added.
(WebCore::Node::queueTaskToDispatchEvent): Added.
* dom/Node.h:
* html/HTMLDetailsElement.cpp:
(WebCore::HTMLDetailsElement::parseAttribute): Use newly added functions.
* html/HTMLDialogElement.cpp:
(WebCore::HTMLDialogElement::close): Ditto.
(WebCore::HTMLDialogElement::queueCancelTask): Ditto.
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::scheduleSelectEvent): Ditto.
2022-05-07 Cameron McCormack <heycam@apple.com>
Use an OptionSet iterator to skip directly to GraphicsContextState::Change bits to handle
https://bugs.webkit.org/show_bug.cgi?id=239954
<rdar://problem/92593424>
Reviewed by Simon Fraser.
It would be rare for display list SetState items to have many Change
bits set on them. Instead of checking for all 15 bits in mergeChanges,
we can use OptionSet's iterator to skip directly to each changed bit.
Using ctz to turn the Change bit into a bit position helps the
compiler generate compact code to jump to each case in the switch
statement.
On an iPad I tested with, this is a ~2% win on the MotionMark Design
subtest, 5.5% on Leaves, and 1.4% overall.
* platform/graphics/GraphicsContextState.cpp:
(WebCore::toIndex):
(WebCore::GraphicsContextState::mergeChanges):
2022-05-07 Cameron McCormack <heycam@apple.com>
Don't propagate GraphicsContextState change bits into TextPainter's glyph display list recorder
https://bugs.webkit.org/show_bug.cgi?id=239952
<rdar://problem/92635604>
Reviewed by Said Abou-Hallawa and Antti Koivisto.
In FontCascade::displayListForTextRun, we create a
DisplayList::Recorder, then call drawGlyphBuffer. We initialize the
DisplayList::Recorder with the GraphicsContextState of the
GraphicsContext we're drawing to. Just before this, we will have set the
current fill color on that GraphicsContext.
When GPUP DOM rendering is disabled, GraphicsContextCG responds to
setFillColor etc. by updating GraphicsContextState, including setting
the Change flag, then immediately updating the CGContext, and clearing
the Change flag.
But when GPUP DOM rendering is enabled, the GraphicsContext is a
DisplayList::Recorder for the layer we're painting in to. Because
DisplayList::Recorder applies its state changes lazily, it can be in the
situation where its GraphicsContextState has had the fill brush changed,
and the Change flag is still set. So DisplayList::Recorder starts off
with a GraphicsContextState with unapplied changes in it. We end up in
DisplayList::Recorder::drawGlyphsAndCacheFont, which calls
appendStateChangeItemIfNecessary, which sees that the Change bit is set,
and generates a SetInlineFillColor display list item, which is
recorded and then replayed the next time the same text is painted.
This recorded fill color then may be wrong for the next TextPainter
that wants to reuse the cached glyph display list.
Display list recorders should never be initialized with a
GraphicsContextState that has change flags set on it. We can assert
this, then make FontCascade explicitly clear those flags on the state
object it passes in to the DisplayList::Recorder.
Test: fast/text/glyph-display-list-color.html
* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::displayListForTextRun const):
* platform/graphics/GraphicsContextState.cpp:
(WebCore::GraphicsContextState::cloneForRecording const):
* platform/graphics/GraphicsContextState.h:
* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::Recorder):
Add setForceUseGlyphDisplayListForTesting and
cachedGlyphDisplayListsForTextNode functions on Internal for the
test to use:
* rendering/GlyphDisplayListCache.h:
(WebCore::GlyphDisplayListCache::getIfExists):
* rendering/TextPainter.cpp:
(WebCore::TextPainter::shouldUseGlyphDisplayList):
(WebCore::TextPainter::setForceUseGlyphDisplayListForTesting):
(WebCore::TextPainter::cachedGlyphDisplayListsForTextNodeAsText):
* rendering/TextPainter.h:
(WebCore::TextPainter::glyphDisplayListIfExists):
* testing/Internals.cpp:
(WebCore::Internals::setForceUseGlyphDisplayListForTesting):
(WebCore::Internals::cachedGlyphDisplayListsForTextNode):
* testing/Internals.h:
* testing/Internals.idl:
2022-05-06 Wenson Hsieh <wenson_hsieh@apple.com>
Block-style image overlay containers should have lighter shadows
https://bugs.webkit.org/show_bug.cgi?id=240198
rdar://92890194
Reviewed by Tim Horton.
Make some minor adjustments to the style of block-style image overlays. The short and long box-shadows
underneath these boxes should be much lighter, and the font-weight should be normal (400) instead of bold.
* html/shadow/imageOverlay.css:
(div.image-overlay-block):
2022-05-06 Ada Chan <adachan@apple.com>
[WebXR] Update color format used for the multisample render buffer
https://bugs.webkit.org/show_bug.cgi?id=240179
Reviewed by Dean Jackson.
* Modules/webxr/WebXROpaqueFramebuffer.cpp:
(WebCore::WebXROpaqueFramebuffer::setupFramebuffer):
2022-05-06 Simon Fraser <simon.fraser@apple.com>
Optimize shouldApplyContainment methods
https://bugs.webkit.org/show_bug.cgi?id=240164
Reviewed by Alan Bujtas.
Based on a patch by Rob Buis.
Optimize shouldApplyContainment methods by allowing OptionSet as a parameter.
Also restrict the principal box checks to a single location.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computeIntrinsicLogicalWidths const):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::computeIntrinsicLogicalWidths const):
* rendering/RenderElement.h:
(WebCore::RenderElement::canContainFixedPositionObjects const):
(WebCore::RenderElement::canContainAbsolutelyPositionedObjects const):
(WebCore::RenderElement::shouldApplyLayoutOrPaintContainment const):
(WebCore::RenderElement::shouldApplySizeOrStyleContainment const):
(WebCore::RenderElement::shouldApplyLayoutContainment const):
(WebCore::RenderElement::shouldApplyPaintContainment const):
(WebCore::RenderElement::shouldApplySizeContainment const):
(WebCore::RenderElement::shouldApplyInlineSizeContainment const):
(WebCore::RenderElement::shouldApplyStyleContainment const):
(WebCore::RenderElement::shouldApplyAnyContainment const):
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths const):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutBlock):
(WebCore::RenderGrid::computeEmptyTracksForAutoRepeat const):
2022-05-06 Commit Queue <commit-queue@webkit.org>
Unreviewed, reverting r293824.
https://bugs.webkit.org/show_bug.cgi?id=240197
Speedometer2/Angular2-TypeScript-TodoMVC 8% regression
Reverted changeset:
"SWOriginStore is no longer needed"
https://bugs.webkit.org/show_bug.cgi?id=240003
https://commits.webkit.org/r293824
2022-05-06 Patrick Griffis <pgriffis@igalia.com>
CSP: Fix script-src-elem policies in workers
https://bugs.webkit.org/show_bug.cgi?id=239840
Reviewed by Kate Cheney.
Test: http/tests/security/contentSecurityPolicy/script-src-strict-dynamic-and-script-src-elem.html
* page/csp/ContentSecurityPolicyDirectiveList.cpp:
(WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForScript const):
2022-05-06 Tim Nguyen <ntim@apple.com>
Use dynamicDowncast in getPathFromPathOperation()
https://bugs.webkit.org/show_bug.cgi?id=240190
Reviewed by Chris Dumez.
Small cleanup.
* style/StyleBuilderConverter.h:
(WebCore::Style::BuilderConverter::convertPathOperation):
2022-05-06 Rob Buis <rbuis@igalia.com>
Use correct document as root for lazy image observer
https://bugs.webkit.org/show_bug.cgi?id=240083
Reviewed by Simon Fraser.
Use correct document as root for lazy image observer, meaning
elements in the main frame will use the main frame document and
elements in iframes will use the iframe document as root.
Test: imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/scrolling-below-viewport-image-lazy-loading-in-iframe.html
* html/LazyLoadImageObserver.cpp:
(WebCore::LazyLoadImageObserver::intersectionObserver):
2022-05-06 Per Arne Vollan <pvollan@apple.com>
[macOS] Content filter blocking shield is not displayed
https://bugs.webkit.org/show_bug.cgi?id=240178
<rdar://91586177>
Reviewed by Geoffrey Garen.
This is a regression from moving content filtering from the WebContent process to the Network process in r291630.
After r291630, the function to determine if a blocked request can be unblocked, is called in the Network process,
but it is not handling the case where the function to unblock the request is not set. This is causing the load
for blocked URLs to never finish, since the decision handler provided to the unblock request function is never
called. This patch addresses this by calling the decisionhandler with the blocked flag set in this case.
* platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
(WebCore::ContentFilterUnblockHandler::requestUnblockAsync const):
2022-05-06 Per Arne Vollan <pvollan@apple.com>
[macOS] HTTP traffic is not filtered in the parental controls filter
https://bugs.webkit.org/show_bug.cgi?id=240180
<rdar://problem/92875540>
Reviewed by Geoffrey Garen.
Traditionally, we have not filtered HTTP in the parental controls filter on macOS, since other parts of the system
has taken care of this. This appears to have changed now, and WebKit should also filter HTTP in addition to HTTPS.
* platform/cocoa/ParentalControlsContentFilter.mm:
(WebCore::canHandleResponse):
2022-05-06 Manuel Rego Casasnovas <rego@igalia.com>
[selectors] Double script focus after mouse click shouldn't match :focus-visible
https://bugs.webkit.org/show_bug.cgi?id=239472
<rdar://problem/92301472>
Reviewed by Antti Koivisto.
When you do the second script focus, we were setting
m_latestFocusTrigger to FocusTrigger::Bindings, that makes us lose the
information about the previous element that was focused via mouse
click and start matching :focus-visible on that case.
Test: imported/w3c/web-platform-tests/css/selectors/focus-visible-script-focus-020.html
* dom/Document.cpp:
(WebCore::Document::setFocusedElement): We avoid setting
m_latestFocusTrigger if we come from script focus. That way we know if
the previous focused element was focused via mouse click after several
script focus.
2022-05-06 Brent Fulgham <bfulgham@apple.com>
Remove abandoned WKPreference for SelectionPaintingWithoutSelectionGaps
https://bugs.webkit.org/show_bug.cgi?id=240129
Reviewed by Alan Bujtas.
Remove the abandoned WKPreference 'SelectionPaintingWithoutSelectionGaps', which was added to support
the EFL port. As the EFL port is no longer buildable, and this code is never used outside of EFL, we
should remove this dead code.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::shouldPaintSelectionGaps const):
2022-05-06 Gabriel Nava Marino <gnavamarino@apple.com>
null ptr deref in WebCore::Frame::setPrinting
https://bugs.webkit.org/show_bug.cgi?id=240173
Reviewed by Wenson Hsieh.
Check m_doc in Frame::setPrinting before access, as it is a RefPtr that can become null.
* page/Frame.cpp:
(WebCore::Frame::setPrinting):
2022-05-05 Ben Nham <nham@apple.com>
Add support for Notification objects with custom data
https://bugs.webkit.org/show_bug.cgi?id=240153
Reviewed by Chris Dumez.
This adds support for the data attribute in Notification. This holds an arbitrary structured
cloneable object passed through the constructor. The accessor is marked SameObject, which we
implement via CachedAttribute. The wire form of the data is serialized and deserialized in
NotificationData so that persistent notifications properly support this property.
Covered by new and existing layout tests.
* Modules/notifications/Notification.cpp:
(WebCore::createSerializedNotificationData):
(WebCore::Notification::create):
(WebCore::Notification::createForServiceWorker):
(WebCore::Notification::Notification):
(WebCore::Notification::dataForBindings):
* Modules/notifications/Notification.h:
* Modules/notifications/Notification.idl:
* Modules/notifications/NotificationData.cpp:
(WebCore::NotificationData::isolatedCopy const):
(WebCore::NotificationData::isolatedCopy):
* Modules/notifications/NotificationData.h:
(WebCore::NotificationData::encode const):
(WebCore::NotificationData::decode):
* Modules/notifications/NotificationDataCocoa.mm:
(WebCore::NotificationData::fromDictionary):
(WebCore::NotificationData::dictionaryRepresentation const):
* Modules/notifications/NotificationOptions.idl:
* workers/service/ServiceWorkerRegistration.cpp:
(WebCore::ServiceWorkerRegistration::showNotification):
2022-05-06 Brent Fulgham <bfulgham@apple.com>
Remove internal WKPreference for non-iTunesAVOutput now that all platform support it
https://bugs.webkit.org/show_bug.cgi?id=240141
Reviewed by Eric Carlson.
WebKit on macOS has used a different AV Output target than IOS_FAMILY targets because those platforms lacked
the AVOutput option. Now that all platforms share this target, we can consolidate on the correct endpoint and
remove this preference code.
* Modules/airplay/WebMediaSessionManager.cpp:
(WebCore::WebMediaSessionManager::showPlaybackTargetPicker):
* Modules/airplay/WebMediaSessionManagerClient.h:
(WebCore::WebMediaSessionManagerClient::alwaysOnLoggingAllowed const):
(WebCore::WebMediaSessionManagerClient::useiTunesAVOutputContext const): Deleted.
* platform/graphics/MediaPlaybackTargetPicker.h:
* platform/graphics/avfoundation/objc/AVPlaybackTargetPicker.h:
* platform/graphics/avfoundation/objc/AVRoutePickerViewTargetPicker.h:
* platform/graphics/avfoundation/objc/AVRoutePickerViewTargetPicker.mm:
(WebCore::AVRoutePickerViewTargetPicker::outputContextInternal):
(WebCore::AVRoutePickerViewTargetPicker::showPlaybackTargetPicker):
* platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
* platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
(WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker):
2022-05-06 Gabriel Nava Marino <gnavamarino@apple.com>
ASSERT in WebCore::StyleProperties::getGridTemplateValue
https://bugs.webkit.org/show_bug.cgi?id=240172
Reviewed by Dean Jackson.
Update StyleProperties::getGridTemplateValue with a more thorough check
as it is currently only checking the grid:none/grid:initial special keyword.
* css/StyleProperties.cpp:
(WebCore::StyleProperties::getGridTemplateValue const):
2022-05-06 Brent Fulgham <bfulgham@apple.com>
Remove the viewportFitEnabled WKPreference now that it is always on
https://bugs.webkit.org/show_bug.cgi?id=240147
Reviewed by Tim Horton.
Remove the WKPreference 'ViewportFitEnabled' now that it is always enabled on all platforms, and
we do not wish to turn it off in testing or in other debugging circumstances.
* dom/ViewportArguments.cpp:
(WebCore::setViewportFeature):
* dom/ViewportArguments.h:
2022-05-06 Simon Fraser <simon.fraser@apple.com>
Make the various shouldApplyContainment() functions member functions on RenderElement
https://bugs.webkit.org/show_bug.cgi?id=240156
Reviewed by Alan Bujtas.
These were free functions, but make more sense as member functions on RenderElement
since most callers passed `*this`. Just one call site needs to downcast<> to
RenderElement.
No behavior change.
* rendering/GridTrackSizingAlgorithm.cpp:
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computeIntrinsicLogicalWidths const):
(WebCore::RenderBlock::computeBlockPreferredLogicalWidths const):
(WebCore::RenderBlock::firstLineBaseline const):
(WebCore::RenderBlock::inlineBlockBaseline const):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::computeIntrinsicLogicalWidths const):
(WebCore::RenderBlockFlow::adjustBlockChildForPagination):
(WebCore::RenderBlockFlow::adjustSizeContainmentChildForPagination):
(WebCore::RenderBlockFlow::firstLineBaseline const):
(WebCore::RenderBlockFlow::inlineBlockBaseline const):
(WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::styleDidChange):
(WebCore::RenderBox::updateLogicalHeight):
(WebCore::RenderBox::isUnsplittableForPagination const):
(WebCore::RenderBox::layoutOverflowRectForPropagation const):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::updateFromStyle):
* rendering/RenderButton.cpp:
(WebCore::RenderButton::baselinePosition const):
* rendering/RenderCounter.cpp:
(WebCore::makeCounterNode):
(WebCore::RenderCounter::rendererSubtreeAttached):
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::computeIntrinsicLogicalWidths const):
* rendering/RenderElement.h:
(WebCore::RenderElement::canContainFixedPositionObjects const):
(WebCore::RenderElement::canContainAbsolutelyPositionedObjects const):
(WebCore::RenderElement::shouldApplyLayoutContainment const):
(WebCore::RenderElement::shouldApplySizeContainment const):
(WebCore::RenderElement::shouldApplyInlineSizeContainment const):
(WebCore::RenderElement::shouldApplyStyleContainment const):
(WebCore::RenderElement::shouldApplyPaintContainment const):
(WebCore::RenderElement::shouldApplyAnyContainment const):
* rendering/RenderFileUploadControl.cpp:
(WebCore::RenderFileUploadControl::computeIntrinsicLogicalWidths const):
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths const):
(WebCore::RenderFlexibleBox::firstLineBaseline const):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutBlock):
(WebCore::RenderGrid::computeEmptyTracksForAutoRepeat const):
(WebCore::RenderGrid::firstLineBaseline const):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::computeIntrinsicRatioInformation const):
* rendering/RenderInline.h:
* rendering/RenderLayer.cpp:
(WebCore::canCreateStackingContext):
(WebCore::RenderLayer::shouldBeCSSStackingContext const):
(WebCore::RenderLayer::setAncestorChainHasSelfPaintingLayerDescendant):
(WebCore::RenderLayer::setAncestorChainHasVisibleDescendant):
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::computeIntrinsicLogicalWidths const):
(WebCore::RenderListBox::baselinePosition const):
* rendering/RenderMenuList.cpp:
(RenderMenuList::computeIntrinsicLogicalWidths const):
* rendering/RenderObject.cpp:
(WebCore::objectIsRelayoutBoundary):
(WebCore::shouldApplyLayoutContainment): Deleted.
(WebCore::shouldApplySizeContainment): Deleted.
(WebCore::shouldApplyInlineSizeContainment): Deleted.
(WebCore::shouldApplyStyleContainment): Deleted.
(WebCore::shouldApplyPaintContainment): Deleted.
(WebCore::shouldApplyAnyContainment): Deleted.
* rendering/RenderObject.h:
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::computeAspectRatioInformationForRenderBox const):
(WebCore::RenderReplaced::computeIntrinsicRatioInformation const):
* rendering/RenderReplaced.h:
* rendering/RenderSlider.cpp:
(WebCore::RenderSlider::computeIntrinsicLogicalWidths const):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::firstLineBaseline const):
* rendering/RenderTextControl.cpp:
(WebCore::RenderTextControl::computeIntrinsicLogicalWidths const):
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::calculateIntrinsicSize):
* rendering/RenderView.cpp:
(WebCore::RenderView::rendererForRootBackground const):
* rendering/svg/LegacyRenderSVGRoot.cpp:
(WebCore::LegacyRenderSVGRoot::computeIntrinsicRatioInformation const):
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::computeIntrinsicRatioInformation const):
* style/ContainerQueryEvaluator.cpp:
(WebCore::Style::ContainerQueryEvaluator::evaluateSizeFeature const):
2022-05-06 Jer Noble <jer.noble@apple.com>
[Cocoa] Seeking into a xHE-AAC track backed by a SourceBuffer can stall playback
https://bugs.webkit.org/show_bug.cgi?id=239750
<rdar://91922569>
Reviewed by Eric Carlson.
Test: media/media-source/media-mp4-xhe-aac.html
xHE-AAC audio has the concept of an "independant sample", which behaves similarly to an
i-frame in a video codec. This sample is a prerequisite for decoding all samples that
come after it.
When such a track is parsed, those samples are marked as "sync", meaning they, as well as all
subsequent samples before the playhead, will be enqueued as "non-displaying". However, the
AVSampleBufferAudioRenderer does not use the DoNotDisplay sample attachment to control this
behavior. Instead, it relies on the TrimDurationAtStart (which has the effect of setting the
duration of the sample to zero, rendering it inaudible). Without this attachment, the renderer
will get "stuck" waiting for playback to clear out it's queue of samples.
Adopt this TrimDurationAtStart attachment if a given CMSampleBuffer is of the Audio type.
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
(WebCore::MediaSampleAVFObjC::createNonDisplayingCopy const):
2022-05-06 Patrick Griffis <pgriffis@igalia.com>
CSP: Fix incorrect blocked-uri for inline scripts and strict-dynamic policies
https://bugs.webkit.org/show_bug.cgi?id=240136
Reviewed by Kate Cheney.
Test: http/tests/security/contentSecurityPolicy/script-src-strict-dynamic-inline-report.py
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::allowNonParserInsertedScripts const):
2022-05-06 Jer Noble <jer.noble@apple.com>
Video playback fails when using postMessage() during a User Gesture
https://bugs.webkit.org/show_bug.cgi?id=239781
<rdar://91281385>
Reviewed by Eric Carlson.
Test: workers/worker-user-gesture.html
Certain frameworks handle user gestures by sending messages through postMessage() to
to a non-shared worker, where the message is processed and a response is sent back
to the page. In the case of APIs which require a user gesture, this gesture is lost
during the response event, even if it was present in the originating postMessage().
Other web APIs, such as Fetch, have been modified to forward this user gesture through
to the resulting event handlers. This change will expand that forwarding behavior to
include postMessage() to a non-shared Worker context.
When a message is sent to a WorkerContext, the current UserGestureToken is saved inside
a thread-safe RefCounted utility class WorkerUserGestureForwarder. This forwarder is
saved into an ivar of WorkerMessagingProxy, where it can be read during the handling
of a WorkerContext-originated postMessage(). The ivar is cleared immediately after sending
the initial postMessage(). The effect is that all calls to workerScope.postMessage()
made during the handling of a worker.postMessage() event will inherit the user gesture
of that initial call.
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerUserGestureForwarder::create):
(WebCore::WorkerUserGestureForwarder::~WorkerUserGestureForwarder):
(WebCore::WorkerUserGestureForwarder::userGestureToForward const):
(WebCore::WorkerUserGestureForwarder::WorkerUserGestureForwarder):
(WebCore::WorkerMessagingProxy::postMessageToWorkerObject):
(WebCore::WorkerMessagingProxy::postMessageToWorkerGlobalScope):
* workers/WorkerMessagingProxy.h:
2022-05-06 Rob Buis <rbuis@igalia.com>
Add lambda for fragmented flow state change handling
https://bugs.webkit.org/show_bug.cgi?id=240165
Reviewed by Alan Bujtas.
Add lambda for fragmented flow state change handling
and call it in the case where the parent is affected.
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::normalizeTreeAfterStyleChange):
2022-05-06 Jer Noble <jer.noble@apple.com>
[iOS] Infinite recursion at -[WKFullScreenWindowController _exitFullscreenImmediately]
https://bugs.webkit.org/show_bug.cgi?id=239744
<rdar://74201964>
Reviewed by Eric Carlson.
Even after fullscreen is correctly torn down during an immediate exit, fullscreen can never again
be entered for the lifetime of the page. This is due to the ivar m_pendingExitFullscreen being set
to true with no opportunity for that state to be cleared. This occurs because the callbacks for
exiting fullscreen are performed before the lambda form FullscreenManager::exitFullscreen() is
called.
Set m_pendingExitFullscreen inside exitFullscreen(), rather than the lambda, and clear it explicitly
in the cases where fullscreen exiting is not actually necessary.
The mock behavior of Fullscreen inside DumpRenderTree and WebKitTestRunner are not able to exercise
this same path. Track improvements to this mock in bug #239747.
* dom/FullscreenManager.cpp:
(WebCore::FullscreenManager::requestFullscreenForElement):
(WebCore::FullscreenManager::exitFullscreen):
(WebCore::FullscreenManager::setAnimatingFullscreen):
(WebCore::FullscreenManager::setFullscreenControlsHidden):
2022-05-06 Youenn Fablet <youenn@apple.com>
Allow MediaPlayerPrivateMediaStreamAVFObjC to avoid pixel conformers if IOSurfaces are not allowed
https://bugs.webkit.org/show_bug.cgi?id=240113
rdar://92629845
Reviewed by Eric Carlson.
Add a callback in MediaPlayerPrivateMediaStreamAVFObjC to allow use a custom way to create a NativeImage from a VideoFrame.
Small refactoring in PixelBufferConformerCV to share more code with WebKit.
Make sure that SharedVideoFrameReader/Writer support kCVPixelFormatType_420YpCbCr10BiPlanarFullRange.
Covered by existing tests.
* WebCore.xcodeproj/project.pbxproj:
* platform/cocoa/SharedVideoFrameInfo.mm:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
* platform/graphics/cv/CVUtilities.h:
* platform/graphics/cv/PixelBufferConformerCV.cpp:
* platform/graphics/cv/PixelBufferConformerCV.h:
2022-05-06 Youenn Fablet <youenn@apple.com>
Remove usage of PixelBufferConformer in RealtimeOutgoingVideoSourceCocoa
https://bugs.webkit.org/show_bug.cgi?id=240118
Reviewed by Eric Carlson.
Remove RealtimeOutgoingVideoSourceCocoa::convertToYUV, instead use libyuv based converter routine.
Covered by existing canvas -> peer connection tests.
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h:
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.mm:
2022-05-05 Yusuke Suzuki <ysuzuki@apple.com>
Make readArrayBufferViewImpl defensive
https://bugs.webkit.org/show_bug.cgi?id=240154
rdar://92113248
Reviewed by Mark Lam.
Check deserialized value's type before starting using it as JSArrayBuffer*.
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneDeserializer::readArrayBufferViewImpl):
2022-05-06 Miguel Gomez <magomez@igalia.com>
[Nicosia] Images in webkit.org/blog/ don't show up with threaded rendering
https://bugs.webkit.org/show_bug.cgi?id=238259
Reviewed by Carlos Garcia Campos.
Implement Nicosia::CairoOperationRecorder::drawFilteredImageBuffer(), which is required
to render images that have CSS filters applied.
* platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp:
(Nicosia::CairoOperationRecorder::drawFilteredImageBuffer):
* platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h:
2022-05-05 Jean-Yves Avenard <jya@apple.com>
[EME] CDM and friends should be using SharedBuffer rather FragmentedSharedBuffer
https://bugs.webkit.org/show_bug.cgi?id=240111
rdar://92780561
Reviewed by Eric Carlson.
By using SharedBuffer directly we can simplify the code.
The change while extensive is rather trivial as the SharedBuffer used
were already contiguous.
No change in observable behaviour
* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDM::sanitizeInitData):
(WebCore::CDM::supportsInitData):
(WebCore::CDM::sanitizeResponse):
* Modules/encryptedmedia/CDM.h:
* Modules/encryptedmedia/CDMClient.h:
* Modules/encryptedmedia/InitDataRegistry.cpp:
(WebCore::extractKeyIDsKeyids):
(WebCore::sanitizeKeyids):
(WebCore::InitDataRegistry::extractPsshBoxesFromCenc):
(WebCore::InitDataRegistry::extractKeyIDsCenc):
(WebCore::InitDataRegistry::sanitizeCenc):
(WebCore::sanitizeWebM):
(WebCore::extractKeyIDsWebM):
(WebCore::InitDataRegistry::sanitizeInitData):
(WebCore::InitDataRegistry::extractKeyIDs):
* Modules/encryptedmedia/InitDataRegistry.h:
* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::generateRequest):
(WebCore::MediaKeySession::update):
(WebCore::MediaKeySession::remove):
(WebCore::MediaKeySession::enqueueMessage):
(WebCore::MediaKeySession::sendMessage):
* Modules/encryptedmedia/MediaKeySession.h:
* Modules/encryptedmedia/MediaKeyStatusMap.cpp:
(WebCore::keyIdsMatch):
* Modules/encryptedmedia/MediaKeyStatusMap.h:
* Modules/encryptedmedia/MediaKeys.cpp:
(WebCore::MediaKeys::unrequestedInitializationDataReceived):
* Modules/encryptedmedia/MediaKeys.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::cdmClientUnrequestedInitializationDataReceived):
* html/HTMLMediaElement.h:
* platform/encryptedmedia/CDMInstance.h:
* platform/encryptedmedia/CDMInstanceSession.h:
* platform/encryptedmedia/CDMPrivate.h:
* platform/encryptedmedia/CDMProxy.h:
(WebCore::KeyHandle::idAsSharedBuffer const):
* platform/encryptedmedia/CDMUtilities.cpp:
(WebCore::CDMUtilities::parseJSONObject):
* platform/encryptedmedia/CDMUtilities.h:
* platform/encryptedmedia/clearkey/CDMClearKey.cpp:
(WebCore::extractKeyidsLocationFromCencInitData):
(WebCore::isCencInitData):
(WebCore::extractKeyidsFromCencInitData):
(WebCore::extractKeyIdFromWebMInitData):
(WebCore::CDMPrivateClearKey::supportsInitData const):
(WebCore::CDMPrivateClearKey::sanitizeResponse const):
(WebCore::CDMInstanceClearKey::setServerCertificate):
(WebCore::CDMInstanceSessionClearKey::requestLicense):
(WebCore::CDMInstanceSessionClearKey::updateLicense):
(WebCore::CDMInstanceSessionClearKey::removeSessionData):
* platform/encryptedmedia/clearkey/CDMClearKey.h:
* platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
(WebCore::extractSinfData):
(WebCore::extractSchemeAndKeyIdFromSinf):
(WebCore::CDMPrivateFairPlayStreaming::extractKeyIDsSinf):
(WebCore::CDMPrivateFairPlayStreaming::sanitizeSinf):
(WebCore::CDMPrivateFairPlayStreaming::sanitizeSkd):
(WebCore::CDMPrivateFairPlayStreaming::extractKeyIDsSkd):
(WebCore::CDMPrivateFairPlayStreaming::supportsInitData const):
(WebCore::CDMPrivateFairPlayStreaming::sanitizeResponse const):
* platform/graphics/avfoundation/CDMFairPlayStreaming.h:
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
(WebCore::initializationDataForRequest):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::takeUnexpectedKeyRequestForInitializationData):
(WebCore::parseJSONValue):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::setServerCertificate):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::sessionForKeyIDs const):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestLicense):
(WebCore::isEqual):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequests):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::attemptToDecryptWithInstance):
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::copyKeyIDs):
* platform/graphics/gstreamer/eme/CDMThunder.cpp:
(WebCore::CDMPrivateThunder::supportsInitData const):
(WebCore::CDMPrivateThunder::sanitizeResponse const):
(WebCore::CDMInstanceThunder::setServerCertificate):
(WebCore::ParsedResponseMessage::ParsedResponseMessage):
(WebCore::ParsedResponseMessage::payload const):
(WebCore::ParsedResponseMessage::payload):
(WebCore::CDMInstanceSessionThunder::challengeGeneratedCallback):
(WebCore::CDMInstanceSessionThunder::errorCallback):
(WebCore::CDMInstanceSessionThunder::requestLicense):
(WebCore::CDMInstanceSessionThunder::updateLicense):
(WebCore::CDMInstanceSessionThunder::loadSession):
(WebCore::CDMInstanceSessionThunder::removeSessionData):
* platform/graphics/gstreamer/eme/CDMThunder.h:
* testing/MockCDMFactory.cpp:
(WebCore::MockCDMFactory::hasSessionWithID):
(WebCore::MockCDMFactory::removeSessionWithID):
(WebCore::MockCDMFactory::addKeysToSessionWithID):
(WebCore::MockCDMFactory::removeKeysFromSessionWithID):
(WebCore::MockCDMFactory::keysForSessionWithID const):
(WebCore::MockCDM::supportsInitData const):
(WebCore::MockCDM::sanitizeResponse const):
(WebCore::MockCDMInstance::setServerCertificate):
(WebCore::MockCDMInstanceSession::requestLicense):
(WebCore::MockCDMInstanceSession::updateLicense):
(WebCore::MockCDMInstanceSession::removeSessionData):
* testing/MockCDMFactory.h:
2022-05-05 Simon Fraser <simon.fraser@apple.com>
Reduce the number of calls to canContainFixedPositionObjects()
https://bugs.webkit.org/show_bug.cgi?id=240150
Reviewed by Alan Bujtas.
canContainFixedPositionObjects() isn't super cheap, so only call it when we need to remove
the IsFixed bit.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::mapLocalToContainer const):
(WebCore::RenderBox::mapAbsoluteToLocalPoint const):
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::mapLocalToContainer const):
2022-05-05 Chris Dumez <cdumez@apple.com>
Identifier::string() should return an AtomString
https://bugs.webkit.org/show_bug.cgi?id=240122
Reviewed by Yusuke Suzuki.
* animation/KeyframeEffect.cpp:
(WebCore::processKeyframeLikeObject):
* inspector/WebInjectedScriptHost.cpp:
(WebCore::WebInjectedScriptHost::getInternalProperties):
2022-05-05 Nikolaos Mouchtaris <nmouchtaris@apple.com>
Add check if referenced element is SVG for clip-path
https://bugs.webkit.org/show_bug.cgi?id=240096
Reviewed by Simon Fraser.
Add check when creating new ReferencePathOperation that it is referencing
an svg element.
* style/StyleBuilderConverter.h:
(WebCore::Style::BuilderConverter::convertPathOperation):
2022-05-05 Cameron McCormack <heycam@apple.com>
Avoid using WebCore::Colors created with out-of-line components in DrawGlyphsRecorder
https://bugs.webkit.org/show_bug.cgi?id=235604
rdar://88345680
Reviewed by Simon Fraser.
In DrawGlyphsRecorder::recordDrawGlyphs we interrogate the CGContext's
state to find out the current fill and stroke color. This needed to
record color font glyphs correctly. When we're not using a color font,
the CGColors for the fill and stroke will be the same as we set them
in prepareInternalContext.
Those CGColors we create in prepareInternalContext from the
WebCore::Colors (created by calling cachedCGColor) don't record the
exact form the original colors had. CGColors only expose float
components, so Color::createAndPreserveColorSpace conservatively
creates a Color with out-of-line components to store those float
values, even if the original Color the CGColor was created from had
uint8_t components.
Color::operator== treats colors of different forms as being different,
which means we generate additional, unnecessary SetState display list
items changing say the fill color from Color(255, 255, 255) (inline) to
Color(1.0, 1.0, 1.0) (out of line).
We can avoid this by checking whether the context state's fill and
stroke CGColors are the same object as the ones we set in
prepareInternalContext, and if so, set the current fill/stroke brush
based on m_originalState.fillBrush/strokeBrush. In the common case of
a non-color glyph, this brush change will be detected as the same as
the current value, and the SetState item generation will be avoided.
This improves the MotionMark design subtest by 2.4%, and the overall
score by 0.7%, when GPUP DOM rendering is enabled.
* platform/graphics/DrawGlyphsRecorder.h:
* platform/graphics/coretext/DrawGlyphsRecorderCoreText.cpp:
(WebCore::DrawGlyphsRecorder::recordInitialColors):
(WebCore::DrawGlyphsRecorder::prepareInternalContext):
(WebCore::DrawGlyphsRecorder::updateFillColor):
(WebCore::DrawGlyphsRecorder::updateStrokeColor):
2022-05-05 Brent Fulgham <bfulgham@apple.com>
Remove abandoned WKPreference for AlwaysUseAcceleratedOverflowScroll
https://bugs.webkit.org/show_bug.cgi?id=240130
Reviewed by Simon Fraser.
The preference 'AlwaysUseAcceleratedOverflowScroll' and related code are no longer used. We should remove this dead code.
* rendering/RenderLayerScrollableArea.cpp:
(WebCore::RenderLayerScrollableArea::canUseCompositedScrolling const):
2022-05-05 Manuel Rego Casasnovas <rego@igalia.com>
ARIA reflection for Element attributes
https://bugs.webkit.org/show_bug.cgi?id=239852
Reviewed by Chris Dumez.
Implement ARIA reflection for attributes that refer to a single Element:
aria-activedescendant & aria-errormessage.
For the properties names this patch uses "Element" suffix:
ariaActiveDescendantElement & ariaErrorMessageElement;
this matches Chromium implementation and AOM explainer, but not AOM spec:
https://github.com/w3c/aria/issues/1732
This implementation is done following the proposed spec text defined at:
https://github.com/whatwg/html/pull/3917
* accessibility/AriaAttributes.idl: Add ariaActiveDescendantElement &
ariaErrorMessageElement.
* bindings/scripts/CodeGenerator.pm:
(GetterExpression): Add function for Element attributes.
(SetterExpression): Ditto.
* bindings/scripts/test/JS/JSTestObj.cpp: Add tests for element
attribute reflection.
(WebCore::JSTestObjDOMConstructor::construct):
(WebCore::jsTestObj_reflectedElementAttrGetter):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::setJSTestObj_reflectedElementAttrSetter):
(WebCore::JSC_DEFINE_CUSTOM_SETTER):
* bindings/scripts/test/TestObj.idl: Add reflectedElementAttr
attribute.
* dom/Element.cpp:
(WebCore::isElementReflectionAttribute): Utility function to identify
Element reflection attributes.
(WebCore::Element::attributeChanged): If an element reflection
attribute has changed we need to synchronize the map entry by removing
it as it'll be properly updated in setElementAttribute() when needed.
(WebCore::Element::explicitlySetAttrElementsMap): Kind of getter
for the ExplicitlySetAttrElementsMap but that creates the map if it
doesn't exist yet.
(WebCore::Element::explicitlySetAttrElementsMapIfExists const):
Getter for the map.
(WebCore::Element::getElementAttribute const): Implement getter for
element attribute.
(WebCore::Element::setElementAttribute): Implement setter for
element attribute.
* dom/Element.h: Add new method headers and defines the
ExplicitlySetAttrElementsMap, which so far only stores one Element in
the Vector, but uses a Vector in preparation for supporting
FrozenArray<Element> reflection in the future.
* dom/ElementRareData.cpp: Update size of SameSizeAsElementRareData to
include the new pointer.
* dom/ElementRareData.h: Add m_explicitlySetAttrElementsMap attribute.
(WebCore::ElementRareData::explicitlySetAttrElementsMap): Getter.
(WebCore::ElementRareData::useTypes const):Include
ExplicitlySetAttrElementsMap.
* dom/Node.cpp:
(WebCore::stringForRareDataUseType): Add ExplicitlySetAttrElementsMap.
* dom/NodeRareData.h: Ditto.
2022-05-05 Alex Christensen <achristensen@webkit.org>
Remove unnecessary calls to CachedResource::updateBuffer and CachedResource::updateData
https://bugs.webkit.org/show_bug.cgi?id=240126
Reviewed by Chris Dumez.
It adds a function call that does nothing but a redundant assert.
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::updateBufferInternal):
(WebCore::CachedImage::updateBuffer):
(WebCore::CachedImage::updateData):
2022-05-05 Said Abou-Hallawa <said@apple.com>
[GPU Process] NativeImage should share the ShareableBitmap data when it's sent to GPU Process
https://bugs.webkit.org/show_bug.cgi?id=239874
rdar://92031359
Reviewed by Simon Fraser.
* Headers.cmake:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/BackingStoreCopy.h: Added.
* platform/graphics/ImageBufferBackend.h:
(): Deleted.
2022-05-05 Jer Noble <jer.noble@apple.com>
[WK2][Cocoa] Remove use of CVPixelBufferConformer from WebContent process in MediaPlayerPrivateRemote::nativeImageForCurrentTime()
https://bugs.webkit.org/show_bug.cgi?id=240108
<rdar://problem/92773611>
Reviewed by Simon Fraser.
No longer pass a CVPixelBufferRef up through onNewVideoFrameMetadata().
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::onNewVideoFrameMetadata):
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::mediaPlayerOnNewVideoFrameMetadata):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::checkNewVideoFrameMetadata):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::checkNewVideoFrameMetadata):
2022-05-05 Kate Cheney <katherine_cheney@apple.com>
Right click using trackpad crashes Safari
https://bugs.webkit.org/show_bug.cgi?id=240030
rdar://91786269
Reviewed by Tim Horton.
Trackpad on iOS should mimic mac selection behavior and block context
menu clicks that are not made on a text node.
* page/EventHandler.cpp:
(WebCore::EventHandler::selectClosestContextualWordOrLinkFromHitTestResult):
(WebCore::EventHandler::sendContextMenuEvent):
2022-05-05 Youenn Fablet <youenn@apple.com>
Add SharedVideoFrameReader/SharedVideoFrameWriter logging for error cases
https://bugs.webkit.org/show_bug.cgi?id=236066
<rdar://problem/88424960>
Reviewed by Eric Carlson.
No change of behavior.
* platform/cocoa/SharedVideoFrameInfo.mm:
(WebCore::SharedVideoFrameInfo::writePixelBuffer):
2022-05-05 Ziran Sun <zsun@igalia.com>
<input type=color> should have box-sizing: border-box in UA stylesheet
https://bugs.webkit.org/show_bug.cgi?id=197878
Reviewed by Tim Nguyen.
As discussed at [1], We should have box-sizing: border-box for <input type=color>, the same
as buttons. WebKit currently has content-box. This patch is to change it to box-box.
Since <input type=color> is disabled with WebKitLegacy [2], this fix doesn't apply to it. Hence,
for mac-wk1 platform, the test expectation for html/rendering/non-replaced-elements/form-controls/resets.html
stays as it is.
[1] https://github.com/whatwg/html/issues/4281
[2] https://webkit-search.igalia.com/webkit/source/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml#425-437
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::colorInputStyleSheet const):
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::colorInputStyleSheet const):
2022-05-05 Youenn Fablet <youenn@apple.com>
replaceTrack with different constraints stops sending packets
https://bugs.webkit.org/show_bug.cgi?id=239978
<rdar://problem/92624773>
Reviewed by Eric Carlson.
We should always reconfigure the microphone processor even if we are not using it,
as VPIO expects that input and output formats should match.
Manually tested with https://bugs.webkit.org/show_bug.cgi?id=239978 and https://jsfiddle.net/72qsLw9a/.
A follow-up should allow to put more common code between CoreAudioSharedUnit and MockAudioSharedUnit
so that we can write a regression test.
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
2022-05-05 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION(249114@main) [GTK] Crashes on shutdown if the display is not set
https://bugs.webkit.org/show_bug.cgi?id=239767
Reviewed by Michael Catanzaro.
Handle the case of PlatformDisplay created with a nullptr GdkDisplay.
* platform/graphics/PlatformDisplay.cpp:
(WebCore::PlatformDisplay::PlatformDisplay):
* platform/graphics/wayland/PlatformDisplayWayland.cpp:
(WebCore::PlatformDisplayWayland::PlatformDisplayWayland):
(WebCore::PlatformDisplayWayland::~PlatformDisplayWayland):
* platform/graphics/x11/PlatformDisplayX11.cpp:
(WebCore::PlatformDisplayX11::PlatformDisplayX11):
(WebCore::PlatformDisplayX11::~PlatformDisplayX11):
2022-05-05 Said Abou-Hallawa <said@apple.com>
[GPU Process] [iOS] REGRESSION(r293570): Snapshot rendering is not scaled with the device scale factor
https://bugs.webkit.org/show_bug.cgi?id=240100
rdar://92635752
Reviewed by Simon Fraser.
The scaling factor is not set in the GraphicsContext of the
ImageBufferShareableBitmapBackend.
To fix this bug is to make snapshotFrameRectWithClip() handle the scaling
outside the ImageBuffer creation. This is similar to what we do in
GraphicsContext::createAlignedImageBuffer() where we scale the size and
create the ImageBuffer with scaleFactor = 1.
* page/FrameSnapshotting.cpp:
(WebCore::snapshotFrameRectWithClip):
2022-05-05 Youenn Fablet <youenn@apple.com>
SWOriginStore is no longer needed
https://bugs.webkit.org/show_bug.cgi?id=240003
Reviewed by Chris Dumez.
Covered by existing tests.
* Headers.cmake:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* loader/DocumentLoader.cpp:
* workers/service/SWClientConnection.h:
* workers/service/WorkerSWClientConnection.cpp:
* workers/service/WorkerSWClientConnection.h:
* workers/service/server/SWOriginStore.cpp: Removed.
* workers/service/server/SWOriginStore.h: Removed.
* workers/service/server/SWServer.cpp:
* workers/service/server/SWServer.h:
2022-05-04 Devin Rousso <drousso@apple.com>
[Apple Pay] REGRESSION(r291588): `appearance: -apple-pay-button` doesn't work with `border-width: 0`
https://bugs.webkit.org/show_bug.cgi?id=240087
<rdar://problem/92559095>
Reviewed by Kate Cheney.
As of r291588, all `appearance` values now correspond to a specific element (or form control)
with the exception of `-apple-pay-button`, which can be applied to any element. Add logic to
specifically allow for this behavior.
Test: fast/css/appearance-apple-pay-button-border-width.html
* rendering/RenderTheme.cpp:
(WebCore::isAppearanceAllowedForAllElements): Added.
(WebCore::RenderTheme::adjustStyle):
2022-05-04 Alex Christensen <achristensen@webkit.org>
Crash in WindowProxy::setDOMWindow
https://bugs.webkit.org/show_bug.cgi?id=232763
Reviewed by Chris Dumez.
Add a few null checks here and there.
Test: fast/dom/set-dom-window-without-page.html
* bindings/js/WindowProxy.cpp:
(WebCore::WindowProxy::setDOMWindow):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::findFrameForNavigation):
2022-05-04 Simon Fraser <simon.fraser@apple.com>
Improve logging of display list items in IPC messages
https://bugs.webkit.org/show_bug.cgi?id=240053
Reviewed by Cameron McCormack.
In order for IPC arguments to show up in IPCMessages logging, the stream operators
for display list items have to be visible to WebKit2 code. So export them all from
WebCore, but only if !LOG_DISABLED, to avoid code bloat.
* platform/graphics/Font.cpp:
(WebCore::operator<<):
* platform/graphics/Font.h:
* platform/graphics/displaylists/DisplayListItems.cpp:
(WebCore::DisplayList::FillPath::apply const):
(WebCore::DisplayList::operator<<):
* platform/graphics/displaylists/DisplayListItems.h:
2022-05-04 Aditya Keerthi <akeerthi@apple.com>
Indeterminate, checked checkboxes do not render correctly on iOS, GTK, and Windows
https://bugs.webkit.org/show_bug.cgi?id=240015
rdar://92645056
Reviewed by Cameron McCormack.
Checkboxes can have the indeterminate and checked attributes set to
true at the same time. In this scenario, an indeterminate appearance
should be rendered. Reorder logic to ensure that the indeterminate
attribute has precedence when deciding what to draw. This approach
aligns with the macOS logic in ThemeMac.
Test: fast/forms/checkbox-checked-indeterminate.html
* platform/adwaita/ThemeAdwaita.cpp:
(WebCore::ThemeAdwaita::paintCheckbox):
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::paintCheckbox):
* rendering/RenderThemeWin.cpp:
(WebCore::RenderThemeWin::determineState):
2022-05-04 Eric Carlson <eric.carlson@apple.com>
[macOS] ScreenCaptureKitCaptureSource should stop content sharing session when capture ends
https://bugs.webkit.org/show_bug.cgi?id=240086
rdar://91008087
Reviewed by Jer Noble.
Tested manually.
* platform/mediastream/mac/ScreenCaptureKitCaptureSource.mm:
(WebCore::ScreenCaptureKitCaptureSource::~ScreenCaptureKitCaptureSource): Call
-[SCContentSharingSession end].
(WebCore::ScreenCaptureKitCaptureSource::sessionDidEnd): Ditto.
2022-05-04 Michael Saboff <msaboff@apple.com>
[Mac] WebCore should search system content path for nested Frameworks
https://bugs.webkit.org/show_bug.cgi?id=240063
Reviewed by Alexey Proskuryakov.
Changed nested frameworks directory to be below where WebCore will be installed
when building with the system content path.
* Configurations/WebCore.xcconfig:
2022-05-04 Kate Cheney <katherine_cheney@apple.com>
REGRESSION (r293427): [ iOS ] http/tests/quicklook/same-origin-xmlhttprequest-allowed.html is a constant crash and failure (240024)
https://bugs.webkit.org/show_bug.cgi?id=240024
rdar://92678727
Reviewed by Wenson Hsieh.
No new tests, this will fix a failing test.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::isLoadingRemoteArchive):
(WebCore::DocumentLoader::commitData):
(WebCore::DocumentLoader::scheduleArchiveLoad):
* loader/DocumentLoader.h:
2022-05-04 Brent Fulgham <bfulgham@apple.com>
Remove deprecated 'JavaEnabled' feature flag and related code
https://bugs.webkit.org/show_bug.cgi?id=240044
Reviewed by Darin Adler.
We removed support for Java Plug-Ins in macOS 10.15, but never removed the preference. To reduce code complexity
and build times we should remove this unused preference, leaving non-functional stubs to avoid breaking binaries
that expect to call their accessor methods.
* loader/ResourceLoadStatistics.cpp:
(WebCore::navigatorAPIEnumToString):
* loader/ResourceLoadStatistics.h:
* loader/SubframeLoader.cpp:
(WebCore::FrameLoader::SubframeLoader::pluginIsLoadable):
* page/Navigator.cpp:
(WebCore::Navigator::javaEnabled const): Deleted.
* page/Navigator.h:
2022-05-04 Mark Lam <mark.lam@apple.com>
Use IterationStatus in more places.
https://bugs.webkit.org/show_bug.cgi?id=239864
Reviewed by Saam Barati.
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::callerGlobalObject):
* testing/Internals.cpp:
(WebCore::GetCallerCodeBlockFunctor::operator() const):
2022-05-04 Ziran Sun <zsun@igalia.com>
[InputElement] Selection after type change needs to follow HTML specification
https://bugs.webkit.org/show_bug.cgi?id=237361
Reviewed by Chris Dumez.
As per spec at https://html.spec.whatwg.org/multipage/input.html#input-type-change,
following step 7-9, if the previous type doesn't support Selection API and the new type
does, selectionStart and selectionEnd should be 0, selectionDirection should be set to "none".
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::updateType):
(WebCore::HTMLInputElement::runPostTypeUpdateTasks):
(WebCore::HTMLInputElement::initializeInputType):
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::HTMLTextFormControlElement):
2022-05-03 Philippe Normand <philn@igalia.com>
[GStreamer] Mediastream mock audio interruption fixes after r290985
https://bugs.webkit.org/show_bug.cgi?id=239926
Reviewed by Chris Dumez.
Similarly to mock video sources, the GStreamer mock audio sources are now cached in a
hashset, which is used to dispatch interruption requests.
* platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
(WebCore::GStreamerAudioCaptureSource::interrupted const): Avoid runtime critical GObject
warnings that would happen if this method is called before the pipeline has been created.
* platform/mediastream/gstreamer/MockRealtimeAudioSourceGStreamer.cpp: Cache mock sources in a hashset.
(WebCore::MockRealtimeAudioSourceGStreamer::~MockRealtimeAudioSourceGStreamer):
* platform/mediastream/gstreamer/MockRealtimeAudioSourceGStreamer.h:
* platform/mock/MockRealtimeAudioSource.cpp: Dispatch interruption requests to currently
cached GStreamer mock audio sources.
(WebCore::MockRealtimeAudioSource::setIsInterrupted):
* platform/mock/MockRealtimeVideoSource.cpp: Switch to MainThreadNeverDestroyed<T> for caching sources.
(WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource):
(WebCore::MockRealtimeVideoSource::~MockRealtimeVideoSource):
2022-05-04 Kimmo Kinnunen <kkinnunen@apple.com>
DisplayList::Recorder has redundant, unused flushContext
https://bugs.webkit.org/show_bug.cgi?id=239999
Reviewed by Simon Fraser.
Remove DisplayList::Recorder::flushContext(GraphicsContextFlushIdentifier)
It was unused.
"Flush context" is not a display list item. It is a command for the graphics
context, issued a underlying resource is being used outside the graphics context
abstraction. As display list is working inside the abstraction, there's nothing
that could possibly use the underlying resources between flush and the next
item.
GraphicsContextFlushIdentifier cannot possibly be constructed in sensible way
at WebCore level.
* platform/graphics/displaylists/DisplayListItems.h:
* platform/graphics/displaylists/DisplayListRecorder.h:
* platform/graphics/displaylists/DisplayListRecorderImpl.h:
2022-05-04 Megan Gardner <megan_gardner@apple.com>
Enable TextCheckingType::Correction on MacCatalyst.
https://bugs.webkit.org/show_bug.cgi?id=240036
Reviewed by Wenson Hsieh.
Add TextCheckingType::Correction to Catalyst to bring consistency to macOS.
* editing/Editor.cpp:
(WebCore::Editor::markMisspellingsAfterTypingToWord):
(WebCore::Editor::markAndReplaceFor):
(WebCore::Editor::resolveTextCheckingTypeMask):
2022-05-04 Fujii Hironori <Hironori.Fujii@sony.com>
[WinCairo] Crash during MediaPlayerPrivateMediaFoundation::removeListener in the async callback thread
https://bugs.webkit.org/show_bug.cgi?id=239485
Reviewed by Don Olmstead.
WinCairo debug layout tests were observing a random crash while
MediaPlayerPrivateMediaFoundation::AsyncCallback was destructing.
m_mediaPlayer was being accessed without locking m_mutex in
~AsyncCallback.
m_mediaPlayer can be replaced with using a WeakPtr.
There is one more multi-threading problem. IMFAsyncCallback should
use InterlockedIncrement and InterlockedDecrement for
ref-counting.
Implementing the Asynchronous Callback - Win32 apps | Microsoft Docs
<https://docs.microsoft.com/en-us/windows/win32/medfound/implementing-the-asynchronous-callback>
This change re-implemented AsyncCallback with a WeakPtr, Function,
QISearch and Interlocked{In,De}crement.
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::AsyncCallback):
(WebCore::beginGetEvent):
(WebCore::MediaPlayerPrivateMediaFoundation::createSession):
(WebCore::MediaPlayerPrivateMediaFoundation::startCreateMediaSource):
(WebCore::MediaPlayerPrivateMediaFoundation::onCreatedMediaSource):
(WebCore::MediaPlayerPrivateMediaFoundation::onNetworkStateChanged):
(WebCore::MediaPlayerPrivateMediaFoundation::endCreatedMediaSource): Deleted.
(WebCore::MediaPlayerPrivateMediaFoundation::endGetEvent): Deleted.
(WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::~AsyncCallback): Deleted.
(WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::QueryInterface): Deleted.
(WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::AddRef): Deleted.
(WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::Release): Deleted.
(WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::GetParameters): Deleted.
(WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::Invoke): Deleted.
(WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::onMediaPlayerDeleted): Deleted.
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
2022-05-03 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Initialize empty and null AtomString at compile time
https://bugs.webkit.org/show_bug.cgi?id=240031
Reviewed by Mark Lam.
* dom/QualifiedName.cpp:
(WebCore::QualifiedName::init):
* dom/make_names.pl:
(printInit):
2022-05-03 Sihui Liu <sihui_liu@apple.com>
StorageMap::removeItem may fail to remove item from map
https://bugs.webkit.org/show_bug.cgi?id=239982
rdar://80891555
Reviewed by Chris Dumez.
We may have updated m_impl, but we don't update iterator for removal. In this case, item is not removed from
map, but currentSize is updated. The mismatch between currentSize and actual size of the map may lead to
underflow and overflow in currentSize when item is added or removed later.
Test: storage/domstorage/sessionstorage/window-open-remove-item.html
* storage/StorageMap.cpp:
(WebCore::StorageMap::removeItem):
2022-05-03 Chris Dumez <cdumez@apple.com>
REGRESSION (r293703): 358 JSC tests failing
https://bugs.webkit.org/show_bug.cgi?id=240023
<rdar://problem/92676663>
Reviewed by Yusuke Suzuki.
Make sure WTF::initialize() calls AtomString::init() given that JSC now relies on
emptyAtom().
(WebCore::initializeCommonAtomStrings):
* platform/CommonAtomStrings.cpp:
(WebCore::initializeCommonAtomStrings):
2022-05-03 Youenn Fablet <youenn@apple.com>
Fix buggy assert in CoreAudioSharedUnit::configureSpeakerProc
https://bugs.webkit.org/show_bug.cgi?id=240001
Reviewed by Eric Carlson.
Manually tested.
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
Initialize the sampleRate field before using it.
2022-05-03 Youenn Fablet <youenn@apple.com>
AudioMediaStreamTrackRendererUnit::updateRenderSourcesIfNecessary can free memory
https://bugs.webkit.org/show_bug.cgi?id=240002
Reviewed by Eric Carlson.
Manually tested.
* platform/mediastream/cocoa/AudioMediaStreamTrackRendererUnit.cpp:
Overwriting the source vector may lead to freeing AudioSampleDataSources.
This is ok as this happens rarely, add DisableMallocRestrictionsForCurrentThreadScope for that purpose.
2022-05-03 Antti Koivisto <antti@apple.com>
[CSS Cascade Layers] Endless recursion with revert-layer in other tree context
https://bugs.webkit.org/show_bug.cgi?id=239967
<rdar://92449950>
Reviewed by Alan Bujtas.
We should only revert within a tree context (scope).
Adding more comprehensive WPTs separately.
Test: fast/css/revert-layer-tree-context-stack-overflow.html
* style/PropertyCascade.cpp:
(WebCore::Style::PropertyCascade::PropertyCascade):
Pass the property tree scope to the rollback cascade.
(WebCore::Style::PropertyCascade::addMatch):
Don't include properties from lower priority tree scopes to rollback cascade.
Reverse the logic for clarity.
* style/PropertyCascade.h:
(WebCore::Style::PropertyCascade::PropertyCascade):
* style/StyleBuilder.cpp:
(WebCore::Style::Builder::ensureRollbackCascadeForRevert):
(WebCore::Style::Builder::ensureRollbackCascadeForRevertLayer):
(WebCore::Style::Builder::makeRollbackCascadeKey):
Include tree scope to the key.
* style/StyleBuilder.h:
2022-05-03 Youenn Fablet <youenn@apple.com>
ServiceWorkerRegistration update should fail if called from an installing service worker context
https://bugs.webkit.org/show_bug.cgi?id=239962
Reviewed by Chris Dumez.
Implement step 4 of https://w3c.github.io/ServiceWorker/#service-worker-registration-update.
Covered by rebased test.
* workers/service/ServiceWorkerRegistration.cpp:
(WebCore::ServiceWorkerRegistration::update):
2022-05-02 Youenn Fablet <youenn@apple.com>
URL.createObjectURL should not be exposed in service worker contexts
https://bugs.webkit.org/show_bug.cgi?id=239972
Reviewed by Chris Dumez.
Covered by rebased test.
* bindings/scripts/CodeGeneratorJS.pm:
Add support for DedicatedWorker and SharedWorker in binding generator for function scope expsure.
(GenerateRuntimeEnableConditionalStringForExposeScope):
* html/DOMURL.idl:
Update WebIDL as per spec.
2022-05-02 Alan Bujtas <zalan@apple.com>
[Quirks] REGRESSION (r286874): Menu is Cut Off After Pressing Search Icon on Hotels.com
https://bugs.webkit.org/show_bug.cgi?id=239980
<rdar://91992835>
Reviewed by Simon Fraser.
Disable resolution media query on www.hotels.com.
* css/MediaQueryEvaluator.cpp:
(WebCore::resolutionEvaluate):
* page/Quirks.cpp:
(WebCore::Quirks::shouldUseResolutionMedia const):
* page/Quirks.h:
2022-05-02 Oriol Brufau <obrufau@igalia.com>
[cssom] Don't index 'all' shorthand in computed styles
https://bugs.webkit.org/show_bug.cgi?id=239669
Reviewed by Darin Adler.
Computed styles should provide getters for both longhands and shorthands,
but only the former should be indexed.
However, the 'all' shorthand was being indexed as if it was a longhand.
Tests: imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml.html
imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree.html
* css/makeprop.pl:
(skippedFromComputedStyle):
2022-05-02 Devin Rousso <drousso@apple.com>
[Modern Media Controls] REGRESSION(?) tapping a video to start playing for the first time doesn't start playing
https://bugs.webkit.org/show_bug.cgi?id=239918
<rdar://problem/91329117>
Reviewed by Jer Noble.
This happens on iOS because the `<video>` has a `GestureRecognizer` that will attempt to
`play()`, and then the `PlayPauseButton` (which also has a `GestureRecognizer`) will attempt
to `togglePlayback()` (via `PlaybackSupport`), which will `pause()` because the `<video>` is
not `paused`.
When a `<video>` is `play()` for the first time, it may not actually start playing for a
moment (e.g. buffering) even though it will say it's `paused`.
Test: media/modern-media-controls/ios-inline-media-controls/touch/ios-inline-media-controls-shows-start-button.html
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype.togglePlayback):
Also check `hasPlayed` to decide whether to `play()` or `pause()`, as it's set when the first
`"play"` event is handled, as until then we're still not playing yet and should `play()`.
This could also be fixed in `PlaybackSupport` (and/or `StartSupport`), but doing it in
`togglePlayback` is a more general solution that fixes all present (and future) callsites.
2022-05-02 Youenn Fablet <youenn@apple.com>
Cancel response stream if load is being cancelled by the web page
https://bugs.webkit.org/show_bug.cgi?id=239968
Reviewed by Chris Dumez.
Add a cancel callback and use it to get the fetch client cancelling notification
to cancel the response body stream or response body load.
Covered by rebased test.
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::cancelStream):
* Modules/fetch/FetchResponse.h:
* bindings/js/ReadableStream.cpp:
(WebCore::ReadableStream::cancel):
* bindings/js/ReadableStream.h:
* workers/service/context/ServiceWorkerFetch.cpp:
(WebCore::ServiceWorkerFetch::processResponse):
* workers/service/context/ServiceWorkerFetch.h:
2022-05-02 Youenn Fablet <youenn@apple.com>
PWA in iOS use old assets after publish new servicerWorker/assets
https://bugs.webkit.org/show_bug.cgi?id=199110
<rdar://problem/51992077>
Reviewed by Chris Dumez.
In case a service worker is updated, its state will be waiting until activated.
In case we suspend clients and network process, the newly installed service worker wil remain waiting.
We will wait for the service worker to get activated when network process gets unsuspended, which might not happen if the network process gets stopped by the OS.
To prevent this, we now update the service worker registration as soon as the service worker install job is finished.
The migration from waiting to activated upon network process crash is not ideal: in theory we should fire an activate event on the waiting service worker.
That said, this is still somehow allowed, as failing to activate (say if service worker process is crashing when handling the event) is allowed.
Covered by new API test.
* workers/service/server/SWServer.cpp:
2022-05-02 Ziran Sun <zsun@igalia.com>
[selection] Set correct selection range for TEXTAREA when updating default value
https://bugs.webkit.org/show_bug.cgi?id=237525
Reviewed by Chris Dumez.
Updating defaultValue should keep selectionStart/End. We need clamp them if the new value is shorter than the
selectionStart/End. This change is to be in line with [1] & [2].
[1] https://html.spec.whatwg.org/multipage/form-elements.html#the-textarea-element:dom-textarea-defaultvalue-2
[2] https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#textFieldSelection:concept-textarea/input-relevant-value
Part of this change is an import of Chromium CL at
https://github.com/chromium/chromium/commit/bb27a500d07f8b3c567e84857a40c3ce42fa454a
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::childrenChanged):
(WebCore::HTMLTextAreaElement::setValueCommon):
* html/HTMLTextFormControlElement.h:
2022-05-02 Fujii Hironori <Hironori.Fujii@sony.com>
HTML Parser: Wrong column number in CR-LF line ending style (DOS EOL style) HTML files
https://bugs.webkit.org/show_bug.cgi?id=239947
Reviewed by Myles C. Maxfield.
JS stack trace reported wrong column numbers in CR-LF line ending
HTML files. m_numberOfCharactersConsumedPriorToCurrentLine was the
number of characters included the preceding CR but the following
LF in those files.
In SegmentedString::advance, startNewLine() is called after
decrementing m_currentSubstring.length. In
SegmentedString::advancePastNewline, however, startNewLine() was
called before calling decrementAndCheckLength(). startNewLine()
should be called after decrementing.
Test: js/dom/line-column-numbers-cr-lf.html
* platform/text/SegmentedString.h:
(WebCore::SegmentedString::advancePastNewline):
Call startNewLine() after decrementAndCheckLength() is called.
2022-05-02 Oriol Brufau <obrufau@igalia.com>
[cssom] Enumerate all logical longhands in the computed style
https://bugs.webkit.org/show_bug.cgi?id=239910
Reviewed by Darin Adler.
Bug 210695 made computed styles enumerate most logical longhands, but
only the ones thefined in the css-logical spec were included. Other
specs, like css-scroll-snap, can also define logical longhands.
This patch fixes the logic, and instead of checking the spec, it checks
the "logical-property-group" field.
Tests: imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml.html
imported/w3c/web-platform-tests/css/css-cascade/all-prop-revert-layer.html
imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree.html
* css/makeprop.pl:
(isLogical):
2022-05-02 Youenn Fablet <youenn@apple.com>
Register shared workers as service worker clients
https://bugs.webkit.org/show_bug.cgi?id=239846
Reviewed by Chris Dumez.
Make sure to register shared workers as service worker clients at launch time or when recreating the network process connection.
Covered by rebased test.
* workers/shared/context/SharedWorkerThread.cpp:
* workers/shared/context/SharedWorkerThreadProxy.cpp:
* workers/shared/context/SharedWorkerThreadProxy.h:
2022-05-02 Youenn Fablet <youenn@apple.com>
VPIO requires the same sample rate for microphone and speaker formats
https://bugs.webkit.org/show_bug.cgi?id=239956
Reviewed by Eric Carlson.
VPIO requires the speaker sample rate and microphone sample rate to be the same.
This is not guaranteed to be true : getUserMedia/applyConstraints may set the microphone sample rate to different values.
If audio rendering already started at capture start time, we use the audio rendering sample rate.
This is not strictly compliant, given required constraints but they are not widely used.
Applications that want to make sure to use a specific sample rate would need to pause audio rendering when starting to capture.
We reset exposed settings when starting to capture to expose the actual sample rate to JavaScript through MediaStreamTrack.getSettings().
Manually tested.
* platform/mediastream/mac/BaseAudioSharedUnit.h:
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
2022-05-01 Philippe Normand <philn@igalia.com>
[GStreamer][Debug] media-recorder tests hitting an ASSERT
https://bugs.webkit.org/show_bug.cgi?id=239942
Reviewed by Xabier Rodriguez-Calvar.
Delay the track observing stopping until InternalSources are destroyed. Doing so during
PAUSED->READY was not safe in MediaRecording pipelines, because the transcoder changes its
state from a secondary thread.
* platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
(webkitMediaStreamSrcChangeState):
2022-05-01 Said Abou-Hallawa <said@apple.com>
REGRESSION(r282117): RemoteRenderingBackend::willDestroyImageBuffer() can crash if the RemoteRenderingBackend has already been destroyed
https://bugs.webkit.org/show_bug.cgi?id=239107
rdar://91608298
Reviewed by Darin Adler.
-- IOSurfacePool will be RefCounted.
-- ImageBufferIOSurfaceBackend::create() will pass the surfacePool
of the CreationContext to ImageBufferIOSurfaceBackend constructor.
-- ImageBufferIOSurfaceBackend will hold a RefPtr<IOSurfacePool>.
-- ImageBufferIOSurfaceBackend destructor will call IOSurface::moveToPool()
to return its surface to the IOSurfacePool if it was set.
* platform/graphics/ConcreteImageBuffer.h:
* platform/graphics/ImageBuffer.h:
* platform/graphics/ImageBufferBackend.h:
(WebCore::ImageBufferBackend::releaseGraphicsContext):
(WebCore::ImageBufferBackend::releaseBufferToPool): Deleted.
* platform/graphics/cg/IOSurfacePool.cpp:
(WebCore::IOSurfacePool::create):
* platform/graphics/cg/IOSurfacePool.h:
* platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp:
(WebCore::ImageBufferIOSurfaceBackend::create):
(WebCore::ImageBufferIOSurfaceBackend::ImageBufferIOSurfaceBackend):
(WebCore::ImageBufferIOSurfaceBackend::~ImageBufferIOSurfaceBackend):
(WebCore::ImageBufferIOSurfaceBackend::releaseBufferToPool): Deleted.
* platform/graphics/cg/ImageBufferIOSurfaceBackend.h:
2022-05-01 Devin Rousso <drousso@apple.com>
[Modern Media Controls] the overflow button sometimes flickers
https://bugs.webkit.org/show_bug.cgi?id=239921
<rdar://problem/91329468>
Reviewed by Eric Carlson.
There are two things that control the visibility of the `OverflowButton`:
1. whether any of the "default" actions (e.g. playback speed, chapters, etc.) are possible
2. if any other buttons that have `contextMenuOptions` are dropped (i.e. there's not enough
room for it because the `<video>` is narrow or there are already too many buttons)
(1) is recalculated for most JS media events (e.g. whenever tracks are changed, if
the `readyState` changes, etc.).
(2) is recalculated in `layout` of `MediaControls`, which is (relatively) less frequent.
In the case that the only contextmenu options are provided by (2) (i.e. none of the "default"
actions are possible), the frequent recalculation of (1) will combined with the fact that
`layout` uses a `requestAnimationFrame` to delay/batch work will cause there to be a short
period of time after the recalculation of (1) and before the recalculation of (2) where
there are no contextmenu options, resulting in the `OverflowButton` being hidden.
* Modules/modern-media-controls/controls/overflow-button.js:
(OverflowButton):
(OverflowButton.prototype.set visible):
(OverflowButton.prototype.set visible.isEmpty): Added.
(OverflowButton.prototype.get contextMenuOptions):
(OverflowButton.prototype.addExtraContextMenuOptions): Renamed from `addContextMenuOptions`.
(OverflowButton.prototype.clearExtraContextMenuOptions): Renamed from `clearContextMenuOptions`.
(OverflowButton.prototype.set defaultContextMenuOptions):
* Modules/modern-media-controls/controls/inline-media-controls.js:
(InlineMediaControls.prototype.layout):
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
(MacOSFullscreenMediaControls.prototype.layout):
Instead of having a single `_contextMenuOptions` that is modified by both (1) and (2), have
a separate member variable for each. This way, the recalculation of (1) doesn't also clear
the state left over from the last time (2) was calculated (which will be recalculated by (2)
shortly thereafter). Use both member variables to decide whether the `OverflowButton` should
be `visible`, allowing (1) and (2) to update independent of eachother.
2022-04-30 Andres Gonzalez <andresg_22@apple.com>
Code cleanup in preparation for refactoring of computing relationships between AXObjects.
https://bugs.webkit.org/show_bug.cgi?id=239848
<rdar://problem/92455544>
Reviewed by Chris Fleizach and Tyler Wilcock.
No new functionality.
AccessibilityObject::ariaElementsFromAttribute() and
ariaElementsReferencedByAttribute() are the methods that currently
compute the relationships between objects. These methods now return a
vector of the related objects instead of taking an out parameter.
In addition, all ariaXXXElements and ariaXXXReferencingElements methods
are renamed to better reflect the relationships they retrieve. Note that
the prefix aria is removed from all method names because ARIA is one way
of establishing relationships between objects, but not necessarily the
only way. These changes make the code more concise and clearer.
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::textUnderElement const):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::ariaTreeRows):
(WebCore::AccessibilityObject::ariaElementsFromAttribute const):
(WebCore::AccessibilityObject::ariaElementsReferencedByAttribute const):
(WebCore::AccessibilityObject::isActiveDescendantOfFocusedContainer const):
(WebCore::AccessibilityObject::activeDescendantOfObjects const):
(WebCore::AccessibilityObject::controlledObjects const):
(WebCore::AccessibilityObject::controllers const):
(WebCore::AccessibilityObject::describedByObjects const):
(WebCore::AccessibilityObject::descriptionForObjects const):
(WebCore::AccessibilityObject::detailedByObjects const):
(WebCore::AccessibilityObject::detailsForObjects const):
(WebCore::AccessibilityObject::errorMessageObjects const):
(WebCore::AccessibilityObject::errorMessageForObjects const):
(WebCore::AccessibilityObject::flowToObjects const):
(WebCore::AccessibilityObject::flowFromObjects const):
(WebCore::AccessibilityObject::labelledByObjects const):
(WebCore::AccessibilityObject::labelForObjects const):
(WebCore::AccessibilityObject::ownedObjects const):
(WebCore::AccessibilityObject::owners const):
(WebCore::AccessibilityObject::ariaActiveDescendantReferencingElements const): Deleted.
(WebCore::AccessibilityObject::ariaControlsElements const): Deleted.
(WebCore::AccessibilityObject::ariaControlsReferencingElements const): Deleted.
(WebCore::AccessibilityObject::ariaDescribedByElements const): Deleted.
(WebCore::AccessibilityObject::ariaDescribedByReferencingElements const): Deleted.
(WebCore::AccessibilityObject::ariaDetailsElements const): Deleted.
(WebCore::AccessibilityObject::ariaDetailsReferencingElements const): Deleted.
(WebCore::AccessibilityObject::ariaErrorMessageElements const): Deleted.
(WebCore::AccessibilityObject::ariaErrorMessageReferencingElements const): Deleted.
(WebCore::AccessibilityObject::ariaFlowToElements const): Deleted.
(WebCore::AccessibilityObject::ariaFlowToReferencingElements const): Deleted.
(WebCore::AccessibilityObject::ariaLabelledByElements const): Deleted.
(WebCore::AccessibilityObject::ariaLabelledByReferencingElements const): Deleted.
(WebCore::AccessibilityObject::ariaOwnsElements const): Deleted.
(WebCore::AccessibilityObject::ariaOwnsReferencingElements const): Deleted.
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityObjectInterface.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::linkedUIElements const):
(WebCore::AccessibilityRenderObject::targetElementForActiveDescendant const):
* accessibility/AccessibilityTableCell.cpp:
(WebCore::AccessibilityTableCell::columnHeaders):
(WebCore::AccessibilityTableCell::ariaOwnedByParent const):
* accessibility/AccessibilityTableRow.cpp:
(WebCore::AccessibilityTableRow::addChildren):
* accessibility/atspi/AccessibilityObjectAtspi.cpp:
(WebCore::AccessibilityObjectAtspi::relationMap const):
* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::initializeProperties):
(WebCore::AXIsolatedObject::activeDescendantOfObjects const):
(WebCore::AXIsolatedObject::controllers const):
(WebCore::AXIsolatedObject::describedByObjects const):
(WebCore::AXIsolatedObject::descriptionForObjects const):
(WebCore::AXIsolatedObject::detailsForObjects const):
(WebCore::AXIsolatedObject::errorMessageForObjects const):
(WebCore::AXIsolatedObject::flowFromObjects const):
(WebCore::AXIsolatedObject::labelledByObjects const):
(WebCore::AXIsolatedObject::labelForObjects const):
(WebCore::AXIsolatedObject::owners const):
(WebCore::AXIsolatedObject::ariaActiveDescendantReferencingElements const): Deleted.
(WebCore::AXIsolatedObject::ariaControlsReferencingElements const): Deleted.
(WebCore::AXIsolatedObject::ariaDescribedByElements const): Deleted.
(WebCore::AXIsolatedObject::ariaDescribedByReferencingElements const): Deleted.
(WebCore::AXIsolatedObject::ariaDetailsReferencingElements const): Deleted.
(WebCore::AXIsolatedObject::ariaErrorMessageReferencingElements const): Deleted.
(WebCore::AXIsolatedObject::ariaFlowToReferencingElements const): Deleted.
(WebCore::AXIsolatedObject::ariaLabelledByElements const): Deleted.
(WebCore::AXIsolatedObject::ariaLabelledByReferencingElements const): Deleted.
(WebCore::AXIsolatedObject::ariaOwnsReferencingElements const): Deleted.
* accessibility/isolatedtree/AXIsolatedObject.h:
* accessibility/isolatedtree/AXIsolatedTree.h:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2022-04-30 Philippe Normand <philn@igalia.com>
REGRESSION(r283437) a number of media tests fail/timeout on the test bots
https://bugs.webkit.org/show_bug.cgi?id=231811
<rdar://problem/84552871>
Reviewed by Michael Catanzaro.
Disable DBus MPRIS notifications when running the tests, these leak to the host when running
on desktop and trigger timeouts on under-powered bots.
* platform/audio/glib/MediaSessionGLib.cpp:
(WebCore::MediaSessionGLib::create):
(WebCore::MediaSessionGLib::MediaSessionGLib):
(WebCore::MediaSessionGLib::emitPositionChanged):
(WebCore::MediaSessionGLib::updateNowPlaying):
(WebCore::MediaSessionGLib::playbackStatusChanged):
* platform/audio/glib/MediaSessionManagerGLib.h:
(WebCore::MediaSessionManagerGLib::setDBusNotificationsEnabled):
(WebCore::MediaSessionManagerGLib::areDBusNotificationsEnabled const):
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
2022-04-30 Alan Bujtas <zalan@apple.com>
Only stretch the percent height <body> when it is the document element's child
https://bugs.webkit.org/show_bug.cgi?id=239932
<rdar://92257660>
Reviewed by Antti Koivisto.
This IE quirk should only be applied to when the body is actually the document element's child (stretching case).
* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeLogicalHeight const):
* rendering/RenderBox.h:
(WebCore::RenderBox::parentBox const):
2022-04-30 Alan Bujtas <zalan@apple.com>
ASSERTION FAILED: *trailingRunIndex >= overflowingRunIndex in WebCore::Layout::InlineContentBreaker::tryBreakingNextOverflowingRuns
https://bugs.webkit.org/show_bug.cgi?id=239838
<rdar://problem/92455051>
Reviewed by Antti Koivisto.
Take partial text overflow into account when computing intrinsic width.
Test: fast/inline/overflowing-content-inside-inline-box-crash.html
* layout/formattingContexts/inline/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthForConstraint const):
* layout/formattingContexts/inline/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::computedIntrinsicWidth):
* layout/formattingContexts/inline/InlineLineBuilder.h:
2022-04-30 Alan Bujtas <zalan@apple.com>
[LFC][IFC] Introduce LineBuilder::PartialContent
https://bugs.webkit.org/show_bug.cgi?id=239886
Reviewed by Antti Koivisto.
This patch is in preparation for adding partial content support for intrinsic width computation.
1. Use a dedicated PartialContent structure to store partial overflowing information (output of current line breaking, input to next line).
2. Decouple partial overflowing width (see above) and the "let's not measure the wrapped content again on the next line as leading content" cached value.
* layout/formattingContexts/inline/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::lineLayout):
* layout/formattingContexts/inline/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::layoutInlineContent):
(WebCore::Layout::LineBuilder::initialize):
* layout/formattingContexts/inline/InlineLineBuilder.h:
(WebCore::Layout::LineBuilder::PartialContent::PartialContent):
2022-04-30 Alan Bujtas <zalan@apple.com>
[LFC][IFC] Do not wrap </span> to the next line when it is preceded by overflowing text
https://bugs.webkit.org/show_bug.cgi?id=239879
<rdar://problem/92497176>
Reviewed by Antti Koivisto.
This patch makes sure that inline content run(s) ("X") followed by inline box end run(s) (</span></span>)
don't get separated when they overflow the line (e.g. width: 0px).
Test: fast/inline/overflowing-content-inside-inline-box.html
* layout/formattingContexts/inline/InlineContentBreaker.cpp:
(WebCore::Layout::InlineContentBreaker::processOverflowingContent const):
2022-04-29 Rob Buis <rbuis@igalia.com>
REGRESSION(r290770): element.scrollIntoViewIfNeeded() scrolls to top even when element is already in viewport
https://bugs.webkit.org/show_bug.cgi?id=238985
Reviewed by Simon Fraser.
This mostly reverts to the code as it was before r290770, but adds code to
treat non-intersections as hidden, including zero width/height rects.
Test: imported/w3c/web-platform-tests/css/cssom-view/scrollintoview-zero-height-item.html
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::getRectToExpose const):
2022-04-29 Don Olmstead <don.olmstead@sony.com>
The isYahooMail quirk is specific to PLATFORM(IOS_FAMILY)
https://bugs.webkit.org/show_bug.cgi?id=239914
Reviewed by Simon Fraser.
The isYahooMail check is incorrectly guarded by ENABLE(PUBLIC_SUFFIX_LIST) when the only
using this function is guarded by ENABLE(IOS_TOUCH_EVENTS) and PLATFORM(IOS_FAMILY). Use
PLATFORM(IOS_FAMILY) since ENABLE(IOS_TOUCH_EVENTS) implies that anyways.
Fixes an unused function warning for other ports.
* page/Quirks.cpp:
2022-04-29 Wenson Hsieh <wenson_hsieh@apple.com>
[Mail compose] Images with data URLs should be pasted or dropped as attachments
https://bugs.webkit.org/show_bug.cgi?id=239911
rdar://91658665
Reviewed by Tim Horton.
Effectively revert the changes in r226340, which prevented data-URL and http-family-URL images from being
converted into attachments when pasting or dropping into Mail compose. The original intent behind this change
may have been to save Mail storage space (in the server and in the on-disk cache) by excluding remote images,
but this was changed in r291261 due to being a regression in behavior compared to legacy WebKit compose
behavior, which creates attachments when pasting or dropping both data and remote images.
Furthermore, the space-saving rationale never really made sense for image data URLs, which are encoded in base
64, since this base 64 representation is always going to be larger than the raw binary representation that we
would otherwise use for a normal attachment.
Test: WKAttachmentTests.InsertDataURLImagesAsAttachments
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::shouldReplaceSubresourceURLWithBlobDuringSanitization):
Remove the argument flag enum altogether, and rename this method to clarify that it is just about blob URL
replacement for sanitizing pasted/dropped fragments (rather than attachment replacement).
(WebCore::replaceRichContentWithAttachments):
(WebCore::sanitizeMarkupWithArchive):
(WebCore::WebContentReader::readHTML):
(WebCore::WebContentMarkupReader::readHTML):
(WebCore::shouldReplaceSubresourceURL): Deleted.
2022-04-29 Devin Rousso <drousso@apple.com>
increase transient activation duration to 5s
https://bugs.webkit.org/show_bug.cgi?id=239832
Reviewed by Geoffrey Garen.
This matches other user agents and gives a bit more time for asynchronous work to be done.
Spec: <https://html.spec.whatwg.org/multipage/interaction.html#transient-activation-duration>
* page/DOMWindow.cpp:
2022-04-29 Oriol Brufau <obrufau@igalia.com>
[css-cascade] Sort shorthand properties at the end of CSSPropertyID enum
https://bugs.webkit.org/show_bug.cgi?id=238888
Reviewed by Darin Adler.
Only longhands should matter during the CSS Cascade, so by sorting
shorthands at the end, and ignoring them, we can save some memory and
avoid some iterations.
No test since now there should be no observable change in behavior.
* css/StylePropertyShorthand.cpp:
(WebCore::isShorthandCSSProperty): Deleted.
* css/StylePropertyShorthand.h:
(WebCore::isShorthandCSSProperty):
Turn function into a simple constexpr comparison.
* css/makeprop.pl:
(addProperty):
(sortByDescendingPriorityAndName):
Sort shorthand properties at the end.
* style/PropertyCascade.h:
Update comment.
2022-04-29 Jer Noble <jer.noble@apple.com>
[iOS] Video on twitch.tv shifts to top of screen when toggling playback in fullscreen
https://bugs.webkit.org/show_bug.cgi?id=239884
<rdar://92367060>
Reviewed by Eric Carlson.
Twitch will cause the HTMLMediaElement to recreate the MediaPlayer when resuming playback
after pausing. If this happens in fullscreen, VideoLayerManagerObjC::setVideoLayer() will
be called with the new video layer, however it will be laid out pinned to the top-left
corner of the screen (rather than centered), as setVideoLayer() will call -setFrame with
an explicit 0,0 position argument.
Rather than pin the layer to the top-left, use the full value of m_videoFullscreenFrame
when setting the video layer frame, both in setVideoLayer() as well as
setVideoFullscreenLayer().
Its currently impossible to write an test for this behavior, as TestWebKitAPI is not a UI
application, and therefore cannot enter fullscreen mode.
* platform/graphics/avfoundation/objc/VideoLayerManagerObjC.mm:
(WebCore::VideoLayerManagerObjC::setVideoLayer):
(WebCore::VideoLayerManagerObjC::setVideoFullscreenLayer):
2022-04-29 Tim Nguyen <ntim@apple.com>
Add background-clip: text to CSSProperties.json
Unreviewed fix.
* css/CSSProperties.json:
2022-04-29 Youenn Fablet <youenn@apple.com>
HTMLMediaElement can get multiple interruptions for invisible autoplay
https://bugs.webkit.org/show_bug.cgi?id=239842
<rdar://91809550>
Reviewed by Eric Carlson.
A media element may be interrupted for invisible autoplay.
In some cases, like by calling play on the media element, the media element will no longer be in interrupted state.
This will lead to multiple invisible autoplay interruptions to be added to the same media element.
There will be only one end of interruption for invisible autoplay, which will lead to the media element to not restart as expected.
To prevent this, we store a boolean in HTMLMediaElement that tells us whether the media element has an ongoing invisible autoplay interruption.
Based on that, we make sure to always balance invisible autoplay interruption begin and end.
Test: media/video-mediastream-restricted-invisible-autoplay-not-allowed.html
* html/HTMLMediaElement.cpp:
* html/HTMLMediaElement.h:
2022-04-29 Youenn Fablet <youenn@apple.com>
Make sure to fail importScripts as per https://w3c.github.io/ServiceWorker/#importscripts step 4
https://bugs.webkit.org/show_bug.cgi?id=239847
Reviewed by Chris Dumez.
Once a service worker is installed, the service worker should not be able to call importScript on new URLs.
Covered by updated test.
* workers/WorkerScriptLoader.cpp:
2022-04-28 Alex Christensen <achristensen@webkit.org>
afterprint event should be scheduled on event loop
https://bugs.webkit.org/show_bug.cgi?id=239883
Reviewed by Chris Dumez.
* page/Page.cpp:
(WebCore::dispatchPrintEvent):
(WebCore::Page::dispatchBeforePrintEvent):
(WebCore::Page::dispatchAfterPrintEvent):
2022-04-28 Brent Fulgham <bfulgham@apple.com>
Remove the AVFoundationNSURLSessionEnabled preference
https://bugs.webkit.org/show_bug.cgi?id=239632
Reviewed by Eric Carlson.
All supported operating systems have supported AVFoundationNSURLSession
for several years. Since we expect AVFoundation to always use WebKit
for network loading (and indeed, expect improper behavior if we do not)
we should remove this toggle to simplify the code and reduce the chance
for users to mistakenly activate it.
* page/DeprecatedGlobalSettings.cpp:
(WebCore::DeprecatedGlobalSettings::setAVFoundationEnabled):
(WebCore::DeprecatedGlobalSettings::setAVFoundationNSURLSessionEnabled): Deleted.
* page/DeprecatedGlobalSettings.h:
(WebCore::DeprecatedGlobalSettings::isAVFoundationEnabled):
(WebCore::DeprecatedGlobalSettings::isAVFoundationNSURLSessionEnabled): Deleted.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
(WebCore::MediaPlayerPrivateAVFoundationObjC::didPassCORSAccessCheck const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::wouldTaintOrigin const):
2022-04-28 Patrick Griffis <pgriffis@igalia.com>
CSP: Fix mixing strict-dynamic and unsafe-inline policies
https://bugs.webkit.org/show_bug.cgi?id=239862
Reviewed by Kate Cheney.
Test: http/tests/security/contentSecurityPolicy/script-src-strict-dynamic-and-unsafe-inline-policies.html
* page/csp/ContentSecurityPolicyDirectiveList.cpp:
(WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForNonParserInsertedScripts const):
2022-04-28 Oriol Brufau <obrufau@igalia.com>
[css-cascade] Mark properties sharing a computed value as related
https://bugs.webkit.org/show_bug.cgi?id=239579
Reviewed by Tim Nguyen.
Some longhand properties share a computed value with another property,
like a legacy -webkit- prefixed one.
In that case, when both properties are specified, the last one should
win. That is typically done by marking the properties as related, using
the "related-property" field. This defers the properties and makes
them cascade properly.
However, some properties weren't marked as related despite sharing a
computed value. So this patch marks these pairs:
- mask-clip and -webkit-mask-clip
- mask-composite and -webkit-mask-composite
- mask-mode and -webkit-mask-source-type
- text-combine-upright and -webkit-text-combine
Test: imported/w3c/web-platform-tests/css/css-cascade/all-prop-revert-layer.html
* css/CSSProperties.json:
2022-04-28 Yusuke Suzuki <ysuzuki@apple.com>
Support C files in Unified Builds
https://bugs.webkit.org/show_bug.cgi?id=239873
Reviewed by Mark Lam.
* Scripts/generate-unified-sources.sh:
2022-04-28 Philippe Normand <philn@igalia.com>
[GStreamer] Pipewire display capture broken
https://bugs.webkit.org/show_bug.cgi?id=239435
Reviewed by Xabier Rodriguez-Calvar.
The pipewiresrc GStreamer element now needs both the `fd` and `path` properties set in order
to open the right Pipewire stream, so we need to get the node ID from the portal Start
response and pass it to the GStreamer element.
* platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.h:
* platform/mediastream/gstreamer/GStreamerDisplayCaptureDeviceManager.cpp:
(WebCore::GStreamerDisplayCaptureDeviceManager::createDisplayCaptureSource):
(WebCore::GStreamerDisplayCaptureDeviceManager::waitResponseSignal):
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
(WebCore::GStreamerVideoCaptureSource::createPipewireSource):
(WebCore::GStreamerVideoCaptureSource::GStreamerVideoCaptureSource):
(WebCore::m_deviceType):
(WebCore::GStreamerVideoCaptureSource::~GStreamerVideoCaptureSource):
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
* platform/mediastream/gstreamer/GStreamerVideoCapturer.cpp:
(WebCore::GStreamerVideoCapturer::createSource):
(WebCore::GStreamerVideoCapturer::setSize):
(WebCore::GStreamerVideoCapturer::setFrameRate):
* platform/mediastream/gstreamer/GStreamerVideoCapturer.h:
2022-04-28 Simon Fraser <simon.fraser@apple.com>
DisplayList::Recorder should lazily create the DrawGlyphsRecorder
https://bugs.webkit.org/show_bug.cgi?id=239829
Reviewed by Myles C. Maxfield.
Creating a DrawGlyphsRecorder does a bit of work that calls into Core Graphics. We don't need
to do this work for a layer that has no text, so delay this work until the first drawGlyphs() call.
This is a few % perf gain on the Images MotionMark subtest.
* platform/graphics/DrawGlyphsRecorder.h:
* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::Recorder):
(WebCore::DisplayList::Recorder::drawGlyphs):
* platform/graphics/displaylists/DisplayListRecorder.h:
2022-04-28 Said Abou-Hallawa <said@apple.com>
[GPU Process] Make WebImage be backed by ImageBuffer
https://bugs.webkit.org/show_bug.cgi?id=239527
rdar://91113628
Reviewed by Tim Horton.
Before enabling GPU Process for DOM rendering there were two modes for
page snapshot: Local bitmap and ShareableBitmap. The ShareableBitmap is
shared between the WebProcess and the UIProcess. The image is drawn in
WebProcess and is consumed by the UIProcess.
After enabling GPU Process for DOM rendering, a new mode should be added:
Remote ShareableBitmap. In this mode, the graphics will be recorded in
WebProcess, the drawing will be committed in GPUProcess and the image will
be consumed by either the WebProcess or the UIProcess.
To add this new mode, the snapshot will be drawn to an ImageBuffer instead
of a ShareableBitmap. And WebImage will be backed by an ImageBuffer instead
of a ShareableBitmap.
* page/FrameSnapshotting.cpp:
(WebCore::snapshotFrameRectWithClip):
* page/FrameSnapshotting.h:
* platform/graphics/ConcreteImageBuffer.h:
(WebCore::ConcreteImageBuffer::create):
* platform/graphics/ImageBuffer.h:
(WebCore::ImageBuffer::createCairoSurface):
* platform/graphics/ImageBufferBackend.h:
(WebCore::ImageBufferBackend::createCairoSurface):
(WebCore::ImageBufferBackend::Parameters::encode const):
(WebCore::ImageBufferBackend::Parameters::decode):
* platform/graphics/RenderingMode.h:
* platform/graphics/cairo/ImageBufferCairoSurfaceBackend.cpp:
(WebCore::ImageBufferCairoSurfaceBackend::createCairoSurface):
* platform/graphics/cairo/ImageBufferCairoSurfaceBackend.h:
2022-04-28 Alex Christensen <achristensen@webkit.org>
Use more smart pointers in Element.cpp
https://bugs.webkit.org/show_bug.cgi?id=239836
Reviewed by Chris Dumez.
* dom/Element.cpp:
(WebCore::Element::setScrollLeft):
(WebCore::Element::setScrollTop):
2022-04-27 Tyler Wilcock <tyler_w@apple.com>
AXObjectCache::childrenChanged modifies m_deferred* member variables but doesn't start timer to process them
https://bugs.webkit.org/show_bug.cgi?id=239787
Reviewed by Chris Fleizach.
This patch fixes this a bug where AXObjectCache::childrenChanged
methods modify m_deferred* member variables, but doesn't start
the m_performCacheUpdateTimer.
This patch also renames m_deferredChildrenChangedNodeList to
m_deferredNodeAddedOrRemovedList, since this more accurately
captures what this list is for.
Finally, this refactors a few methods that modify m_deferred* member
variables to not start the cache timer unless the variable has
actually changed.
Fixes these tests in ITM:
- accessibility/mac/focus-moves-cursor.html
- accessibility/image-load-on-delay.html
- accessibility/legend-children-are-visible.html
- accessibility/text-alternative-calculation-hidden-nodes.html
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::remove):
(WebCore::AXObjectCache::childrenChanged):
(WebCore::AXObjectCache::deferMenuListValueChange):
(WebCore::AXObjectCache::deferModalChange):
(WebCore::AXObjectCache::deferNodeAddedOrRemoved): Added.
(WebCore::AXObjectCache::prepareForDocumentDestruction):
(WebCore::AXObjectCache::performDeferredCacheUpdate):
* accessibility/AXObjectCache.h:
2022-04-27 Patrick Angle <pangle@apple.com>
Web Inspector: [Flexbox] `<button>` and `<select>` elements are appearing in list of Flex containers
https://bugs.webkit.org/show_bug.cgi?id=239425
Reviewed by Devin Rousso.
Added test cases to inspector/css/nodeLayoutContextTypeChanged.html.
* inspector/agents/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::layoutContextTypeForRenderer):
2022-04-27 Sihui Liu <sihui_liu@apple.com>
Ensure completion handler is called in SWServer::clear
https://bugs.webkit.org/show_bug.cgi?id=239755
Reviewed by Youenn Fablet.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::clearAll):
(WebCore::SWServer::clear):
2022-04-27 Oriol Brufau <obrufau@igalia.com>
Reland "Fix CSS cascade regarding logical properties"
https://bugs.webkit.org/show_bug.cgi?id=236199
Reviewed by Antti Koivisto.
This is a reland of https://commits.webkit.org/r291546, which was
reverted due to a performance regression. This problem should have been
addressed by bug 238260.
Original summary:
> The CSS cascade was trying to resolve logical properties into physical
> ones too early. This failed if we still didn't know the direction or
> writing-mode, e.g. because they were set to a variable or to a CSS-wide
> keyword.
>
> This patch keeps logical properties as-is during the cascade. They are
> only resolved when finally applied. Also, both logical properties and
> their physical equivalents are now set to apply in parse order, since
> 'height: 0px; block-size: 1px' and 'block-size: 1px; height: 0px' can be
> different, the order matters.
Tests: imported/w3c/web-platform-tests/css/css-logical/animation-004.html
imported/w3c/web-platform-tests/css/css-logical/logicalprops-with-deferred-writing-mode.html
* css/makeprop.pl:
(addProperty):
(sortByDescendingPriorityAndName):
Defer properties that belong to a logical property group.
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseValueWithVariableReferences):
Logical properties no longer need special handling for variables.
* style/PropertyCascade.cpp:
(WebCore::Style::PropertyCascade::PropertyCascade):
Remove members no longer needed.
(WebCore::Style::PropertyCascade::set):
This method is no longer used for properties in a logical property
group. Remove dead code and add assert.
(WebCore::Style::PropertyCascade::setDeferred):
Remove assert, logical properties are now handled here.
(WebCore::Style::PropertyCascade::lastDeferredPropertyResolvingRelated const):
Take into account that properties in a logical property group are now
deferred.
(WebCore::Style::PropertyCascade::resolveDirectionAndWritingMode const): Deleted.
(WebCore::Style::PropertyCascade::direction const): Deleted.
Remove broken logic.
* style/PropertyCascade.h:
Remove members, struct and methods no longer needed.
Update method signatures.
* style/StyleBuilder.cpp:
(WebCore::Style::Builder::Builder):
Remove argument no longer needed.
(WebCore::Style::Builder::applyProperty):
Resolve logical properties using the direction and writing-mode from the
style.
(WebCore::Style::directionFromStyle): Deleted.
Remove function no longer needed.
2022-04-24 Philippe Normand <philn@igalia.com>
[GStreamer] Track handling fixes
https://bugs.webkit.org/show_bug.cgi?id=239702
Reviewed by Xabier Rodriguez-Calvar.
When the player is using playbin3 the audio/video/text tracks are associated to the
corresponding GstStream, itself part of a single GstStreamCollection. There is no need to
use a GRefPtr for GstStream in this case because those streams are not meant to be modified
and they remain valid as long as the parent collection is alive. So the player now keeps
track of the current stream collection and the private tracks handle GstStream pointers.
The stream collection handling was refactored, removing redundant logging, making use of
ScopeExit and removing the special case for text tracks creation.
This patch also changes the internal storage of tracks from HashMap<AtomString,RePtr<T>> to
HashMap<AtomString,Ref<T>>, bringing us a bit closer to the AVF implementation.
* platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
(WebCore::AudioTrackPrivateGStreamer::AudioTrackPrivateGStreamer):
(WebCore::AudioTrackPrivateGStreamer::updateConfigurationFromTags):
(WebCore::AudioTrackPrivateGStreamer::updateConfigurationFromCaps):
(WebCore::AudioTrackPrivateGStreamer::kind const):
(WebCore::AudioTrackPrivateGStreamer::disconnect):
* platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
* platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
(WebCore::InbandTextTrackPrivateGStreamer::InbandTextTrackPrivateGStreamer):
* platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
(WebCore::InbandTextTrackPrivateGStreamer::create):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfTrack):
(WebCore::MediaPlayerPrivateGStreamer::updateEnabledVideoTrack):
(WebCore::MediaPlayerPrivateGStreamer::updateEnabledAudioTrack):
(WebCore::MediaPlayerPrivateGStreamer::playbin3SendSelectStreamsIfAppropriate):
(WebCore::MediaPlayerPrivateGStreamer::updateTracks):
(WebCore::MediaPlayerPrivateGStreamer::handleStreamCollectionMessage):
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
(WebCore::TrackPrivateBaseGStreamer::TrackPrivateBaseGStreamer):
(WebCore::TrackPrivateBaseGStreamer::disconnect):
(WebCore::TrackPrivateBaseGStreamer::tagsChanged):
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
(WebCore::TrackPrivateBaseGStreamer::stream const):
(WebCore::TrackPrivateBaseGStreamer::stream): Deleted.
* platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
(WebCore::VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer):
(WebCore::VideoTrackPrivateGStreamer::updateConfigurationFromTags):
(WebCore::VideoTrackPrivateGStreamer::updateConfigurationFromCaps):
(WebCore::VideoTrackPrivateGStreamer::kind const):
(WebCore::VideoTrackPrivateGStreamer::disconnect):
* platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:
2022-04-27 Eric Carlson <eric.carlson@apple.com>
[iOS] unable to start playing audio when device is locked
https://bugs.webkit.org/show_bug.cgi?id=239812
<rdar://90642648>
Reviewed by Jer Noble.
Updated media/audio-session-category.html.
* platform/audio/cocoa/MediaSessionManagerCocoa.mm:
(WebCore::MediaSessionManagerCocoa::updateSessionState): Choose the appropriate
route sharing policy after choosing the audio session category because
setting MediaPlayback+Default makes a process ineligible for NowPlaying, and starting
playback in the background will be blocked.
* platform/audio/mac/AudioSessionMac.h:
* platform/audio/mac/AudioSessionMac.mm:
(WebCore::AudioSessionMac::setCategory): Updated for testing.
* testing/Internals.cpp:
(WebCore::Internals::routeSharingPolicy const): Added accessor for testing.
* testing/Internals.h:
* testing/Internals.idl:
2022-04-27 Tim Nguyen <ntim@apple.com>
Make -webkit-transform-style an alias of transform-style
https://bugs.webkit.org/show_bug.cgi?id=239808
Reviewed by Antti Koivisto.
Fixes cascade issues when applying both -webkit-transform-style and transform-style (see bug 239579), and removes
unnecessary code as well given the FIXME was never addressed.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
* css/CSSProperties.json:
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
* rendering/style/WillChangeData.cpp:
(WebCore::WillChangeData::propertyCreatesStackingContext):
2022-04-27 Simon Fraser <simon.fraser@apple.com>
Avoid sending a flush IPC to the GPU process when destroying a RemoteImageBuffer
https://bugs.webkit.org/show_bug.cgi?id=239799
Reviewed by Said Abou-Hallawa.
After r280652, destroying a RemoteImageBufferProxy would always send a flush to the GPU
process, even if there had be no drawing since the previous flush.
Fix to only send a flush and wait when necessary.
Roughly 8% progression on MotionMark Images subtest on iPhone.
* platform/graphics/ImageBuffer.h:
(WebCore::ImageBuffer::flushDrawingContextAsync):
2022-04-27 Tim Nguyen <ntim@apple.com>
[css-text] Make word-wrap CSS property an alias of overflow-wrap
https://bugs.webkit.org/show_bug.cgi?id=166782
Reviewed by Antti Koivisto.
This follows the spec, and fixes cascade issues when applying both properties (see bug 239579).
Relevant WPT expectations updated to pass.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
* css/CSSProperties.json:
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
* editing/Editor.cpp:
(WebCore::Editor::applyEditingStyleToBodyElement const):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::collectPresentationalHintsForAttribute):
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::collectPresentationalHintsForAttribute):
2022-04-27 Youenn Fablet <youenn@apple.com>
[Mac] http/tests/media/user-gesture-preserved-across-xmlhttprequest.html is a flaky fail/crash/timeout
https://bugs.webkit.org/show_bug.cgi?id=229588
<rdar://problem/82408723>
Reviewed by Chris Dumez.
I removed the user gesture in fetch by mistake so let's add it back.
Test is no longer crashing on bots and is timing out on debug bots because it is a slow test.
Mark test as slow and remove flakiness expectations.
Covered by unflaked test.
* Modules/fetch/WindowOrWorkerGlobalScopeFetch.cpp:
(WebCore::doFetch):
2022-04-27 Ziran Sun <zsun@igalia.com>
[css-ui] Remove some unimplemented -webkit-appearance keywords
https://bugs.webkit.org/show_bug.cgi?id=238930
Reviewed by Aditya Keerthi.
Remove the following unimplmented --webkit-appearance keyworkds:
button-bevel
media-controls-background
media-controls-fullscreen-background
media-current-time-display
media-enter-fullscreen-button
media-exit-fullscreen-button
media-mute-button
media-overlay-play-button
media-return-to-realtime-button
media-rewind-button
media-seek-back-button
media-seek-forward-button
media-time-remaining-display
media-toggle-closed-captions-button
media-volume-slider-container
menulist-textfield
menulist-text
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
* css/CSSProperties.json:
* css/CSSValueKeywords.in:
* platform/ThemeTypes.cpp:
(WebCore::operator<<):
* platform/ThemeTypes.h:
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::adjustStyle):
(WebCore::RenderTheme::paint):
* rendering/RenderTheme.h:
(WebCore::RenderTheme::paintMediaPlayButton):
(WebCore::RenderTheme::paintMediaMuteButton):
(WebCore::RenderTheme::paintMediaSliderThumb):
(WebCore::RenderTheme::paintMediaVolumeSliderThumb):
(WebCore::RenderTheme::paintMediaFullscreenButton): Deleted.
(WebCore::RenderTheme::paintMediaOverlayPlayButton): Deleted.
(WebCore::RenderTheme::paintMediaSeekBackButton): Deleted.
(WebCore::RenderTheme::paintMediaSeekForwardButton): Deleted.
(WebCore::RenderTheme::paintMediaVolumeSliderContainer): Deleted.
(WebCore::RenderTheme::paintMediaRewindButton): Deleted.
(WebCore::RenderTheme::paintMediaReturnToRealtimeButton): Deleted.
(WebCore::RenderTheme::paintMediaToggleClosedCaptionsButton): Deleted.
(WebCore::RenderTheme::paintMediaControlsBackground): Deleted.
(WebCore::RenderTheme::paintMediaCurrentTime): Deleted.
(WebCore::RenderTheme::paintMediaTimeRemaining): Deleted.
2022-04-27 Youenn Fablet <youenn@apple.com>
service worker update should refresh imported scripts in addition to the main script
https://bugs.webkit.org/show_bug.cgi?id=239657
Reviewed by Chris Dumez.
After checking main script, if matching, we refreach each identified imported script.
If matching, we reuse the same worker, otherwise we install a new one.
We reuse the soft update loader to fetch scripts in case of soft update.
Otherwise, we load scripts through the job's client.
Covered by rebased test.
* workers/service/SWClientConnection.cpp:
* workers/service/SWClientConnection.h:
* workers/service/ServiceWorkerContainer.cpp:
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerJob.cpp:
* workers/service/ServiceWorkerJob.h:
* workers/service/ServiceWorkerJobClient.h:
* workers/service/server/SWServer.cpp:
* workers/service/server/SWServer.h:
* workers/service/server/SWServerJobQueue.cpp:
* workers/service/server/SWServerJobQueue.h:
* workers/service/server/SWServerWorker.cpp:
* workers/service/server/SWServerWorker.h:
2022-04-27 Nikolas Zimmermann <nzimmermann@igalia.com>
[LBSE] Fix origin of transformations in SVG
https://bugs.webkit.org/show_bug.cgi?id=239717
Reviewed by Rob Buis.
Fix the majority of SVG transform issues in LBSE. webkit.org/b/237711 laid the groundwork for SVG
transforms in LBSE, however there are still issues:
- SVG transforms specified alone on SVG elements, w/o any additional style/perspective related property
such as transform-box / transform-origin / ... do not trigger layer creation, fix by adapting StyleAdjuster.
- Switching on/off transforms for a SVG element, was not tracking updates to both 'HasSVGTransform' and
'HasTransformRelatedProperty' flags correctly, fix that by introducing an 'updateHasSVGTransformFlags' helper.
- Modify SVGContainerLayout to avoid a dependency on the children transformations when computing container
boundaries. In the legacy engine, we always have to mark the whole ancestor chain as 'need to recompute boundaries'
and invoking a re-layout, to perform the recomputation. This change avoids the invalidation of the whole ancestor
chain, when an elements transform changes in a non-accelerated way (e.g. SVGTransformList manipulation, SMIL
<animateTransform> / <animate> / <set>). In CSS transformations do not affect layout, only hit-testing and painting.
-> SVG/CSS transforms applied on SVG elements is conceptually equivalent to CSS transformations on CSS boxes now.
Transformation changes no longer affect the 'internal geometry' (objectBoundingBoxWithoutTransformations()).
currentSVGLayoutLocation() / nominalSVGLayoutLocation() are computed using the 'internal geometry' and used
throughout layout.
This avoids most of the RenderLayer / RenderLayerBacking specific changes that were present in the downstream
LBSE implementation, while also solving an important design issue: no back-splash from children to parents.
Large, deep nested documents -- as seen in the wild -- will benefit the most, avoiding the frequent ancestor
walks to mark the containing block / parent hierachy for re-layout.
Covered by existing tests, no change in behaviour. (However testability for LBSE is ready soon!).
* rendering/RenderElement.cpp:
(WebCore::RenderElement::referenceBoxRect const):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::RenderLayer):
(WebCore::canCreateStackingContext):
(WebCore::RenderLayer::paintLayerByApplyingTransform):
* rendering/RenderLayer.h:
(WebCore::RenderLayer::rendererLocation const):
* rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::styleDidChange):
(WebCore::RenderLayerModelObject::computeVisibleRectInSVGContainer const):
(WebCore::RenderLayerModelObject::updateHasSVGTransformFlags):
* rendering/RenderLayerModelObject.h:
(WebCore::RenderLayerModelObject::nominalSVGLayoutLocation const):
(WebCore::RenderLayerModelObject::currentSVGLayoutLocation const):
(WebCore::RenderLayerModelObject::setCurrentSVGLayoutLocation):
* rendering/RenderObject.h:
(WebCore::RenderObject::objectBoundingBoxWithoutTransformations const):
* rendering/svg/RenderSVGBlock.h:
* rendering/svg/RenderSVGContainer.cpp:
(WebCore::RenderSVGContainer::layoutChildren):
(WebCore::RenderSVGContainer::paint):
(WebCore::RenderSVGContainer::nodeAtPoint):
(WebCore::RenderSVGContainer::styleDidChange): Deleted.
* rendering/svg/RenderSVGContainer.h:
* rendering/svg/RenderSVGInline.h:
* rendering/svg/RenderSVGModelObject.cpp:
(WebCore::RenderSVGModelObject::updateFromStyle):
(WebCore::RenderSVGModelObject::absoluteRects const):
* rendering/svg/RenderSVGModelObject.h:
(WebCore::RenderSVGModelObject::currentSVGLayoutRect const):
(WebCore::RenderSVGModelObject::setCurrentSVGLayoutRect):
(WebCore::RenderSVGModelObject::frameRectEquivalent const):
(WebCore::RenderSVGModelObject::applyTopLeftLocationOffsetEquivalent const):
(WebCore::RenderSVGModelObject::layoutRect const): Deleted.
(WebCore::RenderSVGModelObject::setLayoutRect): Deleted.
(WebCore::RenderSVGModelObject::setLayoutLocation): Deleted.
(WebCore::RenderSVGModelObject::paintingLocation const): Deleted.
(WebCore::RenderSVGModelObject::layoutLocation const): Deleted.
(WebCore::RenderSVGModelObject::layoutLocationOffset const): Deleted.
(WebCore::RenderSVGModelObject::layoutSize const): Deleted.
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::layout):
(WebCore::RenderSVGRoot::updateFromStyle):
* rendering/svg/RenderSVGRoot.h:
* rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::layout):
(WebCore::RenderSVGShape::paint):
(WebCore::RenderSVGShape::nodeAtPoint):
* rendering/svg/RenderSVGTransformableContainer.cpp:
(WebCore::RenderSVGTransformableContainer::updateFromStyle):
* rendering/svg/SVGBoundingBoxComputation.cpp:
(WebCore::SVGBoundingBoxComputation::handleRootOrContainer const):
* rendering/svg/SVGBoundingBoxComputation.h:
(WebCore::SVGBoundingBoxComputation::computeVisualOverflowRect):
* rendering/svg/SVGContainerLayout.cpp:
(WebCore::SVGContainerLayout::positionChildrenRelativeToContainer):
(WebCore::SVGContainerLayout::verifyLayoutLocationConsistency):
(WebCore::layoutLocationFromRenderer): Deleted.
(WebCore::setLayoutLocationForRenderer): Deleted.
* rendering/svg/SVGContainerLayout.h:
* style/StyleAdjuster.cpp:
(WebCore::Style::Adjuster::adjust const):
2022-04-27 Youenn Fablet <youenn@apple.com>
<link rel=preconnect> always sends credentials to different-origin, ignoring crossorigin=anonymous
https://bugs.webkit.org/show_bug.cgi?id=239119
<rdar://problem/91643534>
Reviewed by John Wilander.
Update the check as per spec, step 5 of
https://html.spec.whatwg.org/multipage/links.html#link-type-preconnect
This is difficult to test as preconnect can only expose TLS credentials.
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::preconnectIfNeeded):
2022-04-27 Youenn Fablet <youenn@apple.com>
Add testRunner API to clear memory cache
https://bugs.webkit.org/show_bug.cgi?id=239804
rdar://92033309
Reviewed by Chris Dumez.
* testing/Internals.cpp:
(WebCore::Internals::clearMemoryCache):
Beef up clearMemoryCache to be on par with testRunner counterpart.
2022-04-27 Youenn Fablet <youenn@apple.com>
Shared workers should match service worker registrations
https://bugs.webkit.org/show_bug.cgi?id=239122
Reviewed by Chris Dumez.
Update SharedWorkerScriptLoader to set correctly client ID and service worker data.
Ditto for SharedWorkerThread and SharedWorkerThreadProxy.
Add support to get a SharedWorkerThreadProxy from a client ID.
Use this in SWClientConnection to add support for controller change and post messaging.
Given we create the shared worker identifier in one web process but we might spawn the actual worker in another process,
we need to unregister the identifier with the old process identifier and register the identifier with the new process identifier.
This is done at shared worker launch time.
Covered by updated tests.
Test: http/wpt/service-workers/controlled-sharedworker.https.html
* Headers.cmake:
* workers/Worker.cpp:
* workers/Worker.h:
* workers/WorkerGlobalScope.cpp:
* workers/WorkerInitializationData.h:
* workers/WorkerScriptLoader.cpp:
* workers/WorkerScriptLoader.h:
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::gatherClientData):
* workers/service/server/SWServer.h:
* workers/service/SWClientConnection.cpp:
* workers/service/ServiceWorkerContainer.cpp:
* workers/shared/SharedWorkerObjectConnection.cpp:
* workers/shared/SharedWorkerObjectConnection.h:
* workers/shared/SharedWorkerScriptLoader.cpp:
* workers/shared/SharedWorkerScriptLoader.h:
* workers/shared/context/SharedWorkerThread.cpp:
* workers/shared/context/SharedWorkerThreadProxy.cpp:
* workers/shared/context/SharedWorkerThreadProxy.h:
2022-04-26 Antti Koivisto <antti@apple.com>
::first-letter does not work if used only in shadow content
https://bugs.webkit.org/show_bug.cgi?id=220650
<rdar://problem/73477161>
Reviewed by Alan Bujtas.
Test: fast/shadow-dom/shadow-first-line-and-letter.html
We were not setting usesFirstLetter/LinesRules bits if those pseudo-elements were used
only in shadow trees.
Fix by removing the bits. They don't seem to allow any valuable optimizations.
* rendering/LegacyRootInlineBox.cpp:
(WebCore::LegacyRootInlineBox::verticalPositionForBox):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::lineHeight const):
(WebCore::RenderBlock::getFirstLetter):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::mayAffectLayout const):
(WebCore::RenderInline::lineHeight const):
* rendering/RenderLineBreak.cpp:
(WebCore::RenderLineBreak::lineHeight const):
* rendering/RenderView.h:
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::createAnimatedElementUpdate):
(WebCore::Style::TreeResolver::resolve):
2022-04-26 Oriol Brufau <obrufau@igalia.com>
[css-logical] Side border shorthands should not be logical/physical
https://bugs.webkit.org/show_bug.cgi?id=239734
Reviewed by Tim Nguyen.
No test since now there should be no observable change in behavior.
However, this refactoring will be needed for bug 236199.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
Mark logical side border shorthands as animatable.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
Add code for serializing logical side border shorthands.
* css/CSSProperties.json:
Stop side border shorthands from being in a logical property group.
They will just expand into logical or physical longhands, but the
shorthands themselves will be normal.
* css/makeprop.pl:
(addProperty):
Assert that no shorthand belongs to a logical property group.
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseValueWithVariableReferences):
Remove dead code.
2022-04-26 Jean-Yves Avenard <jya@apple.com>
MediaSession.setPositionState() does not work.
https://bugs.webkit.org/show_bug.cgi?id=237196
Reviewed by Eric Carlson.
Use MediaSession's positionState if present when constructing NowPlaying
MediaRemote data.
We emulate what the media-session position would have been had the
time progressed according to the playback rate.
As such, we need to tell the media-session when no action handlers are
set that the media was paused or played again.
When seeking, we update the new time position and continue according to
the set playback rate.
Tested manually with the following scenarios:
- Set a page only defining the media-session's position state once
- Let the media element play by default, check the Now Playing position
- Pause/Play using Now Playing control and checks that the time doesn't
jump around.
- Seek using Now Playing and check that the media seeks properly and that
the Now Playing positon progress from the seek point according to the
media-session's playback rate.
- Seek using default media control and check the same as above.
- Seek using default media control, then pause in Now Playing: check that
the playback position doesn't jump around.
We don't have a way to properly test the MediaRemote
external framework and with existing MediaSession API tests currently
disabled following bug 221514.
* Modules/mediasession/MediaSession.cpp:
(WebCore::MediaSession::setPlaybackState):
(WebCore::MediaSession::updateReportedPosition):
(WebCore::MediaSession::willBeginPlayback):
(WebCore::MediaSession::willPausePlayback):
(WebCore::MediaSession::positionOverridden):
* Modules/mediasession/MediaSession.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute):
(WebCore::HTMLMediaElement::removedFromAncestor):
(WebCore::HTMLMediaElement::mediaLoadingFailed):
(WebCore::HTMLMediaElement::setReadyState):
(WebCore::HTMLMediaElement::finishSeek):
(WebCore::HTMLMediaElement::clearMediaPlayer):
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::clientWillBeginPlayback):
(WebCore::MediaElementSession::clientWillPausePlayback):
(WebCore::MediaElementSession::nowPlayingInfo const):
(WebCore::MediaElementSession::metadataChanged):
(WebCore::MediaElementSession::positionStateChanged):
(WebCore::MediaElementSession::clientCharacteristicsChanged):
* html/MediaElementSession.h:
* platform/audio/NowPlayingInfo.h:
(WebCore::NowPlayingInfo::operator== const):
(WebCore::NowPlayingInfo::encode const):
(WebCore::NowPlayingInfo::decode):
* platform/audio/PlatformMediaSession.cpp:
(WebCore::PlatformMediaSession::clientCharacteristicsChanged):
* platform/audio/PlatformMediaSession.h:
* platform/audio/PlatformMediaSessionManager.h:
(WebCore::PlatformMediaSessionManager::clientCharacteristicsChanged):
* platform/audio/cocoa/MediaSessionManagerCocoa.h:
* platform/audio/cocoa/MediaSessionManagerCocoa.mm:
(WebCore::MediaSessionManagerCocoa::clientCharacteristicsChanged):
(WebCore::MediaSessionManagerCocoa::setNowPlayingInfo):
2022-04-26 Elliott Williams <emw@apple.com>
Unreviewed, reverting "[Xcode] Compute PGO profdata paths instead of searching for them at build time"
https://bugs.webkit.org/show_bug.cgi?id=239681
* Configurations/WebCore.xcconfig:
* WebCore.xcodeproj/project.pbxproj:
2022-04-26 Oriol Brufau <obrufau@igalia.com>
[css-cascade] Fix cascade rollback for deferred properties
https://bugs.webkit.org/show_bug.cgi?id=238125
Reviewed by Antti Koivisto.
When a deferred property was set to 'revert' or 'revert-layer', it used
to roll back to a declaration of the same exact property (or behave as
'unset' if none).
This patch lets deferred properties roll back to their related property,
e.g. '-webkit-box-shadow: revert-layer' can roll back to a 'box-shadow'
declaration in the previous layer.
This is consistent with logical and physical properties, where the
rollback happens after resolving logical properties.
Test: imported/w3c/web-platform-tests/css/css-cascade/all-prop-revert-layer.html
* style/PropertyCascade.cpp:
(WebCore::Style::PropertyCascade::lastDeferredPropertyResolvingRelated const):
* style/PropertyCascade.h:
* style/StyleBuilder.cpp:
(WebCore::Style::Builder::applyProperty):
2022-04-26 Elliott Williams <emw@apple.com>
Fix build error: "cp: JavaScriptCore.profdata is not a directory"
https://bugs.webkit.org/show_bug.cgi?id=239681
Unreviewed build fix.
* WebCore.xcodeproj/project.pbxproj:
2022-04-26 Manuel Rego Casasnovas <rego@igalia.com>
Remove AriaReflectionEnabled runtime flag
https://bugs.webkit.org/show_bug.cgi?id=239532
Reviewed by Chris Fleizach.
ARIA reflection shipped in Safari 12.1 (July 2019)
so it looks the runtime flag is not needed anymore.
* accessibility/AccessibilityRole.idl:
* accessibility/AriaAttributes.idl:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setAriaReflectionEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::ariaReflectionEnabled const): Deleted.
2022-04-26 Ziran Sun <zsun@igalia.com>
Constructed FormData object should not contain an entry for the submit button that was used to submit the form
https://bugs.webkit.org/show_bug.cgi?id=239070
Reviewed by Chris Dumez.
When the activedSubmit flag is set for a submit button, its value is appended to a FormData. In the case of form
submission called in submit event handler, we include submit button when build FormData. The submit button should
not be included though. This patch correct it by calling set the activatedSubmit flag just before or after building
FormData.
Part of the patch is an import of Chromium CL at
https://codereview.chromium.org/2340213002
* html/DOMFormData.cpp:
(WebCore::DOMFormData::create):
* html/HTMLButtonElement.cpp:
(WebCore::HTMLButtonElement::defaultEventHandler):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::submit):
(WebCore::HTMLFormElement::constructEntryList):
* html/HTMLFormElement.h:
* html/SubmitInputType.cpp:
(WebCore::SubmitInputType::handleDOMActivateEvent):
* loader/FormSubmission.cpp:
(WebCore::FormSubmission::create):
2022-04-26 Simon Fraser <simon.fraser@apple.com>
Save a few drawing operations when painting layer contents
https://bugs.webkit.org/show_bug.cgi?id=239756
Reviewed by Tim Horton.
Remove an extra save/restore, and a translate(0,0) when painting layers and there's just one
dirty rect.
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::paintGraphicsLayerContents):
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(WebCore::PlatformCALayer::drawLayerContents): The caller sets the clip when there's just one
dirty rect.
2022-04-22 Elliott Williams <emw@apple.com>
[Xcode] Compute PGO profdata paths instead of searching for them at build time
https://bugs.webkit.org/show_bug.cgi?id=239681
Reviewed by Alexey Proskuryakov.
* Configurations/WebCore.xcconfig:
* WebCore.xcodeproj/project.pbxproj:
2022-04-26 Xi Ruoyao <xry111@mengyan1223.wang>
[GTK] Initialize m_eglDisplay in PlatformDisplay::PlatformDisplay(GdkDisplay*)
https://bugs.webkit.org/show_bug.cgi?id=239760
Reviewed by Michael Catanzaro.
No new tests because there is no behavior change.
* platform/graphics/PlatformDisplay.cpp:
(WebCore::PlatformDisplay::PlatformDisplay):
initialize m_eglDisplay to EGL_NO_DISPLAY.
2022-04-26 J Pascoe <j_pascoe@apple.com>
[WebAuthn] Remove misspelled constant "LocalAuthenticatiorAccessGroup"
https://bugs.webkit.org/show_bug.cgi?id=235894
rdar://88104045
Reviewed by Brent Fulgham.
This change removes a constant with a misspelled variable name after all
downstream usage is removed.
* Modules/webauthn/WebAuthenticationConstants.h:
2022-04-26 Kate Cheney <katherine_cheney@apple.com>
Remove WebArchiveDebugMode
https://bugs.webkit.org/show_bug.cgi?id=239738
<rdar://problem/88406961>
Reviewed by Tim Horton.
Remove use case of WebArchiveDebugMode and deprecate it now that it
is no longer in use. Add a new temporary flag WebArchiveTestMode
that is more aptly named and will maintain existing behavior for
internal tests temporarily.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::commitData):
(WebCore::DocumentLoader::scheduleArchiveLoad):
2022-04-26 Claudio Saavedra <csaavedra@igalia.com>
[DatabaseTracker] Use PRIu64 for logging for portability
https://bugs.webkit.org/show_bug.cgi?id=239765
Reviewed by Adrian Perez de Castro.
Use PRIu64 when logging to avoid warnings.
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::setQuota):
2022-04-26 Claudio Saavedra <csaavedra@igalia.com>
[GStreamer] Mark unused variable
https://bugs.webkit.org/show_bug.cgi?id=239766
Reviewed by Adrian Perez de Castro.
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
2022-04-26 Youenn Fablet <youenn@apple.com>
Service Worker loads should not expose some ResourceTiming information
https://bugs.webkit.org/show_bug.cgi?id=239608
Reviewed by Alex Christensen.
Filter out some resource timing info when the load is served from a service worker.
While we could do the filtering on service worker side, it is best to do it within PerformanceResourceTiming
as native clients might still want to use non filtered data in case the service worker is returning a network load
as the response.
Covered by rebased test.
* loader/ResourceTiming.cpp:
(WebCore::ResourceTiming::ResourceTiming):
* loader/ResourceTiming.h:
(WebCore::ResourceTiming::isLoadedFromServiceWorker const):
* page/PerformanceResourceTiming.cpp:
(WebCore::PerformanceResourceTiming::nextHopProtocol const):
(WebCore::PerformanceResourceTiming::redirectStart const):
(WebCore::PerformanceResourceTiming::redirectEnd const):
(WebCore::PerformanceResourceTiming::domainLookupStart const):
(WebCore::PerformanceResourceTiming::domainLookupEnd const):
(WebCore::PerformanceResourceTiming::connectStart const):
(WebCore::PerformanceResourceTiming::connectEnd const):
* page/PerformanceResourceTiming.h:
(WebCore::PerformanceResourceTiming::isLoadedFromServiceWorker const):
2022-04-25 Youenn Fablet <youenn@apple.com>
Service workers should not intercept embed/object related loads
https://bugs.webkit.org/show_bug.cgi?id=239642
Reviewed by Chris Dumez.
In case document loader or image loader are triggered by embed/object elements,
set service worker mode to none.
Covered by rebased test.
* loader/DocumentLoader.cpp:
* loader/DocumentLoader.h:
* loader/ImageLoader.cpp:
2022-04-25 Devin Rousso <drousso@apple.com>
Web Inspector: add UI for blocking requests
https://bugs.webkit.org/show_bug.cgi?id=239674
Reviewed by Patrick Angle.
Test: http/tests/inspector/network/intercept-request-with-error.html
* inspector/agents/InspectorNetworkAgent.h:
(WebCore::InspectorNetworkAgent::errorDomain): Added.
* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::toResourceErrorType): Added.
(WebCore::InspectorNetworkAgent::interceptRequestWithError):
Unify the resource error message for consistency.
Mark the resource error as coming from Web Inspector so that it can identified (see below).
* inspector/agents/WebConsoleAgent.cpp:
(WebCore::WebConsoleAgent::didFailLoading):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::logErrorAndFail):
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didFail):
Don't add console messages for requests that were blocked by Web Inspector.
* inspector/agents/page/PageNetworkAgent.h:
* inspector/agents/page/PageNetworkAgent.cpp:
(WebCore::PageNetworkAgent::addConsoleMessage): Added.
* inspector/agents/worker/WorkerNetworkAgent.h:
* inspector/agents/worker/WorkerNetworkAgent.cpp:
(WebCore::WorkerNetworkAgent::addConsoleMessage): Added.
Add a `virtual` method so that `InspectorNetworkAgent` can log to the console (`PageNetworkAgent`
uses the `Page`, `WorkerNetworkAgent` uses the `WorkerOrWorkletGlobalScope`, etc.).
2022-04-25 Devin Rousso <drousso@apple.com>
Web Inspector: request interception should not be guarded based on service workers
https://bugs.webkit.org/show_bug.cgi?id=239677
Reviewed by Patrick Angle.
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::shouldInterceptRequest):
(WebCore::InspectorInstrumentation::interceptRequest):
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::shouldInterceptRequestImpl):
* inspector/InspectorInstrumentationWebKit.h:
(WebCore::InspectorInstrumentationWebKit::shouldInterceptRequest):
(WebCore::InspectorInstrumentationWebKit::interceptRequest):
* inspector/InspectorInstrumentationWebKit.cpp:
(WebCore::InspectorInstrumentationWebKit::shouldInterceptRequestInternal):
Pass along `ResourceLoader` instead of `ResourceRequest` so that `InspectorNetworkAgent::shouldInterceptRequest`
can look at the configuration of the load (e.g. `serviceWorkerRegistrationIdentifier`), not
just the request configuration.
* inspector/agents/InspectorNetworkAgent.h:
* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::shouldInterceptRequest):
Move the `#if ENABLE(SERVICE_WORKER)` here.
2022-04-25 Devin Rousso <drousso@apple.com>
Web Inspector: crash when a subresource is intercepted by a skip network local override with an error status code
https://bugs.webkit.org/show_bug.cgi?id=239675
Reviewed by Patrick Angle.
Test: http/tests/inspector/network/intercept-request-subresource-with-response-error-status-code.html
* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::interceptRequestWithResponse):
`SubresourceLoader::didReceiveResponse` will eventually cause `releaseResources` (via `cancel`),
which will clear the `m_resource`, which is needed in order to provide the response content.
We should only provide the response content if we're still processing the load.
2022-04-25 Chris Fleizach <cfleizach@apple.com>
AX: Don't expose aria-roledescription value on "generic" elements (e.g. div and span) unless explicit role value is also defined
https://bugs.webkit.org/show_bug.cgi?id=174248
<rdar://problem/33178050>
Reviewed by Andres Gonzalez.
ARIA spec states to not expose the role description on "generic" elements.
https://www.w3.org/TR/wai-aria/#aria-roledescription
Test: accessibility/ignored-aria-role-description.html
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::supportsARIARoleDescription const):
(WebCore::AccessibilityObject::roleDescription const):
* accessibility/AccessibilityObject.h:
2022-04-25 Tim Nguyen <ntim@apple.com>
Unprefix html.css, fullscreen.css and pdfjs-extras
https://bugs.webkit.org/show_bug.cgi?id=239725
Reviewed by Brent Fulgham.
Use unprefixed versions of CSS values & properties.
Excluded text-align: -webkit-center which has different behavior than text-align: center.
* Modules/pdfjs-extras/adwaita/style.css:
(.dropdownToolbarButton > select):
* css/fullscreen.css:
(:-webkit-full-screen-ancestor:not(iframe)):
* css/html.css:
(input, textarea, select, button, meter, progress):
(#if defined(ENABLE_DATE_AND_TIME_INPUT_TYPES) && ENABLE_DATE_AND_TIME_INPUT_TYPES):
(input::-webkit-credentials-auto-fill-button):
(input::-webkit-contacts-auto-fill-button):
(input::-webkit-credit-card-auto-fill-button):
(::-webkit-validation-bubble-message):
(::-webkit-validation-bubble-arrow):
2022-04-25 Antti Koivisto <antti@apple.com>
[CSS Typed OM] Fix AttributeStyleMap.get for list values
https://bugs.webkit.org/show_bug.cgi?id=239716
Reviewed by Alan Bujtas.
Test: css-typedom/typed-om-perspective-value.html
* css/typedom/CSSStyleValueFactory.cpp:
(WebCore::CSSStyleValueFactory::reifyValue):
The list here hasn't been deep copied. Don't move away a member.
* css/typedom/CSSStyleValueFactory.h:
Passing Ref<>&& instead of Ref<> here is a bug-prone over-optimization.
2022-04-25 Tim Nguyen <ntim@apple.com>
Unprefix modern-media-controls CSS properties
https://bugs.webkit.org/show_bug.cgi?id=239726
Reviewed by Eric Carlson.
* Modules/modern-media-controls/controls/button.css:
(button):
(button > picture):
* Modules/modern-media-controls/controls/button.js:
(Button.prototype.commitProperty):
* Modules/modern-media-controls/controls/media-controls.css:
(.media-controls > *):
* Modules/modern-media-controls/controls/slider.css:
(.slider > input):
(.ios .slider > input):
(.slider > input::-webkit-slider-thumb):
* Modules/modern-media-controls/controls/text-tracks.css:
(video::-webkit-media-text-track-container):
* Modules/modern-media-controls/controls/watchos-activity-indicator.css:
(button.watchos-activity-indicator > picture):
2022-04-25 Claudio Saavedra <csaavedra@igalia.com>
[GStreamer] Remove unused rtc variable
https://bugs.webkit.org/show_bug.cgi?id=239727
Reviewed by Philippe Normand.
* Modules/mediastream/gstreamer/GStreamerMediaEndpoint.cpp:
(WebCore::GStreamerMediaEndpoint::addTrack):
2022-04-25 Ziran Sun <zsun@igalia.com>
UA stylesheet should include table { text-indent: initial } to conform with HTML standard
https://bugs.webkit.org/show_bug.cgi?id=201297
Reviewed by Tim Nguyen.
As per [1], text-indent for table should be initial.
[1] https://html.spec.whatwg.org/multipage/rendering.html#tables-2
* css/html.css:
(table):
2022-04-24 Philippe Normand <philn@igalia.com>
[GStreamer] Disable new demuxers based on adaptivedemux2
https://bugs.webkit.org/show_bug.cgi?id=239701
Reviewed by Xabier Rodriguez-Calvar.
The new demuxers based on adaptivedemux2 cannot be used in WebKit yet because this new base
class does not abstract away network access. They can't work in a sandboxed media process,
so demote their rank in order to prevent decodebin3 from auto-plugging them.
* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::registerWebKitGStreamerElements):
2022-04-24 Youenn Fablet <youenn@apple.com>
TextTrackLoader should use SameOrigin mode by default
https://bugs.webkit.org/show_bug.cgi?id=239381
Reviewed by Eric Carlson.
Covered by updated test.
* loader/TextTrackLoader.cpp:
2022-04-24 Diego Pino Garcia <dpino@igalia.com>
Unreviewed, non-unified build fixes after r293285
* html/track/TextTrack.cpp:
2022-04-24 Fujii Hironori <Hironori.Fujii@sony.com>
[Win][WinCairo] Unreviewed build fix
https://bugs.webkit.org/show_bug.cgi?id=239692
<rdar://problem/92222456>
* Headers.cmake: Added necessary headers of WebCore/layout.
2022-04-24 Alan Bujtas <zalan@apple.com>
Fix a typo (r293297)
https://bugs.webkit.org/show_bug.cgi?id=239704
Unreviewed.
* layout/formattingContexts/flex/FlexFormattingContext.cpp:
(WebCore::Layout::FlexFormattingContext::layoutInFlowContentForIntegration):
(WebCore::Layout::FlexFormattingContext::layoutInFlowContentForIntergration): Deleted.
* layout/formattingContexts/flex/FlexFormattingContext.h:
* layout/formattingContexts/inline/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layoutInFlowContentForIntegration):
(WebCore::Layout::InlineFormattingContext::layoutInFlowContentForIntergration): Deleted.
* layout/formattingContexts/inline/InlineFormattingContext.h:
* layout/integration/flex/LayoutIntegrationFlexLayout.cpp:
(WebCore::LayoutIntegration::FlexLayout::layout):
* layout/integration/inline/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::layout):
2022-04-23 Chris Dumez <cdumez@apple.com>
Unreviewed build fix after r293301.
* bindings/js/JSDOMConvertStrings.h:
(WebCore::Converter<IDLAtomStringAdaptor<IDLByteString>>::convert):
2022-04-23 Alan Bujtas <zalan@apple.com>
[Win] Unreviewed build fix.
* Headers.cmake:
2022-04-23 Wenson Hsieh <wenson_hsieh@apple.com>
Remove the `PreferInlineTextSelectionInImages` internal feature flag
https://bugs.webkit.org/show_bug.cgi?id=234849
Reviewed by Sam Weinig.
See WebKit/ChangeLog for more details.
* en.lproj/Localizable.strings:
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::contextMenuItemSelected):
(WebCore::ContextMenuController::populate):
(WebCore::ContextMenuController::checkOrEnableIfNeeded const):
* page/EventHandler.cpp:
(WebCore::EventHandler::updateMouseEventTargetNode):
* platform/ContextMenuItem.cpp:
(WebCore::isValidContextMenuAction):
* platform/ContextMenuItem.h:
* platform/LocalizedStrings.h:
* platform/cocoa/LocalizedStringsCocoa.mm:
(WebCore::contextMenuItemTagQuickLookImage): Deleted.
(WebCore::contextMenuItemTagQuickLookImageForTextSelection): Deleted.
(WebCore::contextMenuItemTagQuickLookImageForVisualSearch): Deleted.
2022-04-23 Andres Gonzalez <andresg_22@apple.com>
Code cleanup in preparation for optimizing use of AccessibilityObject::elementsFromAttribute.
https://bugs.webkit.org/show_bug.cgi?id=239664
<rdar://problem/92180286>
Reviewed by Chris Fleizach.
No new functionality.
AccessibilityObject::elementsFromAttribute now returns a vector as
opposed to taking an out parameter. This makes the code more concise
and possibly more efficient.
Removed this method from the AXCoreObject interface, since this method
should not be exposed to an AT client. The Inspector is an exception
that accesses AccessibilityObjects directly and not through the
AXCoreObject interface.
All these changes are entirely code cleanup and modernization, no change
in functionality.
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::ariaLabeledByText const):
(WebCore::AccessibilityNodeObject::textUnderElement const):
(WebCore::AccessibilityNodeObject::descriptionForElements const):
(WebCore::AccessibilityNodeObject::ariaDescribedByAttribute const):
(WebCore::AccessibilityNodeObject::ariaLabeledByAttribute const):
(WebCore::AccessibilityNodeObject::accessibilityDescriptionForElements const): Renamed.
(WebCore::AccessibilityNodeObject::ariaLabeledByElements const): Deleted.
* accessibility/AccessibilityNodeObject.h:
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::ariaElementsFromAttribute const):
(WebCore::AccessibilityObject::elementsFromAttribute const):
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityObjectInterface.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::isTabItemSelected const):
* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::elementsFromAttribute const): Deleted.
* accessibility/isolatedtree/AXIsolatedObject.h:
* inspector/InspectorAuditAccessibilityObject.cpp:
(WebCore::accessiblityObjectForNode):
(WebCore::InspectorAuditAccessibilityObject::getControlledNodes):
(WebCore::InspectorAuditAccessibilityObject::getFlowedNodes):
(WebCore::InspectorAuditAccessibilityObject::getMouseEventNode):
(WebCore::InspectorAuditAccessibilityObject::getOwnedNodes):
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
2022-04-23 Alan Bujtas <zalan@apple.com>
[FFC][Integration] Add integration API to FlexFormattingContext
https://bugs.webkit.org/show_bug.cgi?id=239692
Reviewed by Antti Koivisto.
The integration codepath needs dedicated (and temporary)APIs on the formatting contexts.
(This is exactly how inline layout has been integrated.)
* layout/formattingContexts/flex/FlexFormattingContext.cpp:
(WebCore::Layout::FlexFormattingContext::layoutInFlowContentForIntergration):
(WebCore::Layout::FlexFormattingContext::computedIntrinsicWidthConstraintsForIntegration):
* layout/formattingContexts/flex/FlexFormattingContext.h:
* layout/formattingContexts/inline/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layoutInFlowContentForIntergration):
(WebCore::Layout::InlineFormattingContext::lineLayoutForIntergration): Deleted.
* layout/formattingContexts/inline/InlineFormattingContext.h:
* layout/integration/flex/LayoutIntegrationFlexLayout.cpp:
(WebCore::LayoutIntegration::FlexLayout::FlexLayout):
(WebCore::LayoutIntegration::FlexLayout::computeIntrinsicWidthConstraints):
(WebCore::LayoutIntegration::FlexLayout::layout):
* layout/integration/flex/LayoutIntegrationFlexLayout.h:
(WebCore::LayoutIntegration::FlexLayout::rootLayoutBox const):
(WebCore::LayoutIntegration::FlexLayout::rootLayoutBox):
* layout/integration/inline/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::layout):
2022-04-23 Brady Eidson <beidson@apple.com>
Add WKNotification and WKWebsiteDataStore SPI for handling click/close of persistent notifications
https://bugs.webkit.org/show_bug.cgi
Reviewed by Chris Dumez.
Covered by existing tests with WKTR changes.
In Cocoa, expose the dictionary representation of a notification as an NSDictionary,
as it is meant to be used as an NSUserNotification userInfo value.
* Modules/notifications/NotificationData.h:
* Modules/notifications/NotificationDataCocoa.mm: Added.
(WebCore::NotificationData::fromDictionary):
(WebCore::NotificationData::dictionaryRepresentation const):
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::processNotificationEvent):
* workers/service/server/SWServer.h:
2022-04-23 Justin Michaud <justin_michaud@apple.com>
Fix build error caused by LTO + Unified Sources
https://bugs.webkit.org/show_bug.cgi?id=239679
Reviewed by Alex Christensen.
This hopefully fixes the following build error:
Undefined symbols for architecture x86_64:
"JSC::GenericTypedArrayView<JSC::Uint8ClampedAdaptor>::tryCreateUninitialized(unsigned long)", referenced from:
WebCore::FEGaussianBlurSoftwareApplier::apply(WebCore::Filter const&, WTF::Vector<WTF::Ref<WebCore::FilterImage, WTF::RawPtrTraits<WebCore::FilterImage> >, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc> const&, WebCore::FilterImage&) const in lto.o
ld: symbol(s) not found for architecture x86_64
* platform/graphics/filters/software/FEGaussianBlurSoftwareApplier.cpp:
2022-04-23 Alan Bujtas <zalan@apple.com>
[FFC][Integration] Construct and update the layout tree for the flex items
https://bugs.webkit.org/show_bug.cgi?id=239684
Reviewed by Antti Koivisto.
This patch implements the usual flow of preparing a subtree for integration layout.
1. Take the direct children of a RenderFlexibleBox (flex items) and construct Layout::ContainerBox objects.
2. Run layout on the direct children (RenderBlocks) first and update the associated Layout::ContainerBoxes' geometries.
3. Call LayoutIntegration::FlexLayout::layout (not yet implemented) to run flex layout on the flex items.
* layout/integration/LayoutIntegrationBoxTree.cpp:
(WebCore::LayoutIntegration::BoxTree::buildTreeForFlexContent):
* layout/integration/LayoutIntegrationBoxTree.h:
* layout/integration/flex/LayoutIntegrationFlexLayout.cpp:
(WebCore::LayoutIntegration::FlexLayout::FlexLayout):
(WebCore::LayoutIntegration::FlexLayout::updateFlexItemDimensions):
* layout/integration/flex/LayoutIntegrationFlexLayout.h:
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::layoutUsingFlexFormattingContext):
* rendering/RenderFlexibleBox.h:
2022-04-23 Andres Gonzalez <andresg_22@apple.com>
AX ITM: Table row objects should return a non-null unignored parent even when a table object is not found in its ancestry.
https://bugs.webkit.org/show_bug.cgi?id=239606
<rdar://problem/92094205>
Reviewed by Chris Fleizach.
Test: accessibility/aria-expanded-supported-roles.html.
In addition, fixed test accessibility/mac/heading-clickpoint.html.
AccessibilityARIAGridRow::parentObjectUnignored was returning nullptr
if there was no table ancestor. This caused problems in isolated tree
mode where only the root object should have a null parent. With this
patch this method will return the table ancestor if one exists, its
parent in the AX tree otherwise.
Changed all classes in the AXObject hierarchy to return an AXObject for
the parentObjectUnignored method instead of an AXCoreObject.
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::focusedObjectForPage):
Removed unnecessary downcast.
* accessibility/AccessibilityARIAGridRow.cpp:
(WebCore::AccessibilityARIAGridRow::parentObjectUnignored const):
(WebCore::AccessibilityARIAGridRow::parentTable const):
Rewrote this method using Accessibility::findAncestor.
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::parentObjectUnignored const):
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::parentObjectUnignored const):
* accessibility/AccessibilityRenderObject.h:
* accessibility/AccessibilityTableCell.cpp:
(WebCore::AccessibilityTableCell::parentObjectUnignored const):
* accessibility/AccessibilityTableCell.h:
2022-04-23 Devin Rousso <drousso@apple.com>
fix a few ObjC memory management issues after r291361
https://bugs.webkit.org/show_bug.cgi?id=239686
<rdar://problem/91008058>
Reviewed by Eric Carlson.
* platform/ios/PlaybackSessionInterfaceAVKit.mm:
(WebCore::mediaSelectionOptions):
* platform/ios/WebAVPlayerController.h:
* platform/ios/WebAVPlayerController.mm:
(-[WebAVMediaSelectionOption localizedDisplayName]): Added.
(-[WebAVMediaSelectionOption dealloc]): Deleted.
2022-04-22 Cathie Chen <cathiechen@igalia.com>
The layout is not updated when style.contain is changed from "size"/"inline-size" to empty string
https://bugs.webkit.org/show_bug.cgi?id=239489
Reviewed by Rob Buis.
Unlike "layout", "paint" and "style" containment, being a "size" and "inline-size" containment or not affects the layout size of the element.
So it should require layout when a normal element becomes a "size"/"inline-size" containment, vice versa.
Tests: imported/w3c/web-platform-tests/css/css-contain/contain-inline-size-removed.html
imported/w3c/web-platform-tests/css/css-contain/contain-size-removed.html
* rendering/style/RenderStyle.cpp:
(WebCore::rareNonInheritedDataChangeRequiresLayout):
(WebCore::RenderStyle::effectiveContainment const): Deleted. Moved to StyleRareNonInheritedData.
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::effectiveContainment const):
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::effectiveContainment const):
* rendering/style/StyleRareNonInheritedData.h:
2022-04-22 Rob Buis <rbuis@igalia.com>
Should never be reached failure in WebCore::RenderElement::visibleInViewportStateChanged
https://bugs.webkit.org/show_bug.cgi?id=191824
Reviewed by Eric Carlson.
Provide an empty visibleInViewportStateChanged implementation
for RenderMedia to prevent hitting the ASSERT.
Test: media/audio-viewport-state-change-crash.html
* rendering/RenderMedia.h:
2022-04-22 Simon Fraser <simon.fraser@apple.com>
Crash under AsyncScrollingCoordinator::scrollingThreadAddedPendingUpdate()
https://bugs.webkit.org/show_bug.cgi?id=239683
<rdar://92198272>
Reviewed by Alan Bujtas.
Crash data suggest that m_page can be null in
AsyncScrollingCoordinator::scheduleRenderingUpdate(), which does seem possible because
scheduleRenderingUpdate() is a dispatch from the scrolling thread, and
ScrollingCoordinator::pageDestroyed() may have run before it runs.
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::scheduleRenderingUpdate):
2022-04-22 Chris Dumez <cdumez@apple.com>
Move global AtomStrings to a common header to promote reuse
https://bugs.webkit.org/show_bug.cgi?id=239585
Reviewed by Geoff Garen and Darin Adler.
* Headers.cmake:
* Modules/async-clipboard/Clipboard.cpp:
(WebCore::Clipboard::getType):
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::contentHint const):
(WebCore::MediaStreamTrack::setContentHint):
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* animation/AnimationEffect.cpp:
(WebCore::AnimationEffect::getTiming const):
(WebCore::AnimationEffect::updateTiming):
* animation/EffectTiming.h:
* contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::isValidCSSSelector):
* css/CSSStyleSheet.h:
* css/FontFace.cpp:
(WebCore::FontFace::display const):
* css/MediaFeatureNames.cpp:
(WebCore::MediaFeatureNames::init):
* dom/DataTransfer.cpp:
(WebCore::normalizeType):
(WebCore::DataTransfer::setDataFromItemList):
(WebCore::DataTransfer::createForInputEvent):
(WebCore::DataTransfer::dropEffect const):
* dom/Document.cpp:
(WebCore::Document::designMode const):
* dom/InlineStyleSheetOwner.cpp:
(WebCore::isValidCSSContentType):
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::checkStyleSheet):
* dom/mac/ImageControlsMac.cpp:
* editing/FontShadow.cpp:
(WebCore::serializationForCSS):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
* editing/cocoa/DataDetection.mm:
* editing/cocoa/HTMLConverter.mm:
(HTMLConverterCaches::propertyValueForNode):
(HTMLConverter::computedAttributesForElement):
(HTMLConverter::_enterElement):
(HTMLConverter::_processElement):
* editing/markup.cpp:
(WebCore::createFragmentForTransformToFragment):
* html/Autocapitalize.cpp:
(WebCore::stringForAutocapitalizeType):
* html/Autofill.cpp:
(WebCore::AutofillData::createFromHTMLFormControlElement):
* html/BaseCheckableInputType.cpp:
(WebCore::BaseCheckableInputType::saveFormControlState const):
(WebCore::BaseCheckableInputType::restoreFormControlState):
(WebCore::BaseCheckableInputType::fallbackValue const):
* html/EnterKeyHint.cpp:
(WebCore::attributeValueForEnterKeyHint):
* html/HTMLAudioElement.cpp:
(WebCore::HTMLAudioElement::createForLegacyFactoryFunction):
* html/HTMLButtonElement.cpp:
(WebCore::HTMLButtonElement::formControlType const):
* html/HTMLElement.cpp:
(WebCore::toValidDirValue):
(WebCore::HTMLElement::contentEditable const):
(WebCore::HTMLElement::setContentEditable):
(WebCore::HTMLElement::setAutocorrect):
(WebCore::plaintextOnlyName): Deleted.
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::autocomplete const):
* html/HTMLIFrameElement.cpp:
(WebCore::HTMLIFrameElement::loadingForBindings const):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::decoding const):
(WebCore::HTMLImageElement::loadingForBindings const):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::preload const):
* html/HTMLTextFormControlElement.cpp:
(WebCore::directionString):
* html/InputMode.cpp:
(WebCore::InputModeNames::none):
(WebCore::InputModeNames::text):
(WebCore::InputModeNames::tel):
(WebCore::InputModeNames::url):
(WebCore::InputModeNames::email):
(WebCore::InputModeNames::search):
* html/InputTypeNames.cpp:
(WebCore::InputTypeNames::email):
(WebCore::InputTypeNames::reset):
(WebCore::InputTypeNames::search):
(WebCore::InputTypeNames::submit):
(WebCore::InputTypeNames::telephone):
(WebCore::InputTypeNames::text):
(WebCore::InputTypeNames::url):
* html/shadow/TextControlInnerElements.cpp:
(WebCore::TextControlInnerTextElement::updateInnerTextElementEditabilityImpl):
* html/track/AudioTrack.cpp:
(WebCore::AudioTrack::isValidKind const):
(WebCore::AudioTrack::updateKindFromPrivate):
(WebCore::AudioTrack::alternativeKeyword): Deleted.
(WebCore::AudioTrack::mainKeyword): Deleted.
(WebCore::AudioTrack::commentaryKeyword): Deleted.
* html/track/AudioTrack.h:
* html/track/TextTrack.cpp:
(WebCore::TextTrack::TextTrack):
(WebCore::TextTrack::isValidKindKeyword):
(WebCore::TextTrack::kindKeyword const):
(WebCore::TextTrack::subtitlesKeyword): Deleted.
(WebCore::captionsKeyword): Deleted.
* html/track/TextTrack.h:
* html/track/VTTCue.cpp:
(WebCore::VTTCue::positionAlign const):
(WebCore::VTTCue::setPositionAlign):
(WebCore::VTTCue::toJSON const):
(WebCore::autoKeyword): Deleted.
* html/track/VideoTrack.cpp:
(WebCore::VideoTrack::isValidKind const):
(WebCore::VideoTrack::updateKindFromPrivate):
(WebCore::VideoTrack::alternativeKeyword): Deleted.
(WebCore::VideoTrack::captionsKeyword): Deleted.
(WebCore::VideoTrack::mainKeyword): Deleted.
(WebCore::VideoTrack::subtitlesKeyword): Deleted.
(WebCore::VideoTrack::commentaryKeyword): Deleted.
* html/track/VideoTrack.h:
* html/track/WebVTTParser.cpp:
(WebCore::WebVTTParser::WebVTTParser):
* inspector/agents/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::createInspectorStyleSheetForDocument):
* loader/FormSubmission.cpp:
(WebCore::FormSubmission::Attributes::parseEncodingType):
* loader/NavigationScheduler.cpp:
* loader/TextResourceDecoder.cpp:
(WebCore::TextResourceDecoder::textFromUTF8):
* loader/archive/mhtml/MHTMLParser.cpp:
(WebCore::MHTMLParser::addResourceToArchive):
* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet):
* mathml/MathMLPresentationElement.cpp:
* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::addAudioTrackKindDisplayNameIfNeeded):
* page/EventSource.cpp:
(WebCore::EventSource::EventSource):
* page/Page.cpp:
(WebCore::Page::userStyleSheet const):
* page/PageSerializer.cpp:
(WebCore::PageSerializer::serializeCSSStyleSheet):
* page/PrintContext.cpp:
(WebCore::PrintContext::pageProperty):
* page/ProcessWarming.cpp:
(WebCore::ProcessWarming::initializeNames):
* platform/CommonAtomStrings.cpp: Added.
(WebCore::initializeCommonAtomStrings):
* platform/CommonAtomStrings.h: Added.
(WebCore::alternativeAtom):
(WebCore::autoAtom):
(WebCore::captionsAtom):
(WebCore::commentaryAtom):
(WebCore::cssContentTypeAtom):
(WebCore::eagerAtom):
(WebCore::emailAtom):
(WebCore::falseAtom):
(WebCore::lazyAtom):
(WebCore::mainAtom):
(WebCore::noneAtom):
(WebCore::offAtom):
(WebCore::onAtom):
(WebCore::plaintextOnlyAtom):
(WebCore::resetAtom):
(WebCore::searchAtom):
(WebCore::submitAtom):
(WebCore::subtitlesAtom):
(WebCore::telAtom):
(WebCore::textAtom):
(WebCore::textPlainContentTypeAtom):
(WebCore::trueAtom):
(WebCore::urlAtom):
* platform/Pasteboard.cpp:
(WebCore::Pasteboard::isSafeTypeForDOMToReadAndWrite):
* platform/StaticPasteboard.cpp:
(WebCore::StaticPasteboard::writePlainText):
* platform/animation/Animation.cpp:
(WebCore::Animation::initialName const):
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::load):
(WebCore::textPlain): Deleted.
* platform/ios/wak/WebCoreThread.mm:
(StartWebThread):
* platform/network/HTTPParsers.cpp:
* platform/network/ios/WebCoreURLResponseIOS.h:
(WebCore::shouldUseQuickLookForMIMEType):
* style/Styleable.cpp:
(WebCore::Styleable::animationListContainsNewlyValidAnimation const):
(WebCore::Styleable::updateCSSAnimations const):
* svg/SVGAnimateMotionElement.cpp:
(WebCore::SVGAnimateMotionElement::rotateMode const):
* svg/SVGAnimationElement.cpp:
(WebCore::sumAtom):
(WebCore::SVGAnimationElement::isAdditive const):
(WebCore::SVGAnimationElement::isAccumulated const):
* svg/SVGFEConvolveMatrixElement.cpp:
* svg/SVGFEConvolveMatrixElement.h:
(WebCore::SVGPropertyTraits<EdgeModeType>::toString):
(WebCore::SVGPropertyTraits<EdgeModeType>::fromString):
* svg/SVGMarkerTypes.h:
(WebCore::SVGPropertyTraits<SVGMarkerOrientType>::fromString):
(WebCore::SVGPropertyTraits<SVGMarkerOrientType>::toString):
(WebCore::SVGPropertyTraits<SVGMarkerOrientType>::autoString): Deleted.
* svg/SVGStyleElement.cpp:
(WebCore::SVGStyleElement::type const):
* svg/SVGTextPathElement.h:
(WebCore::SVGPropertyTraits<SVGTextPathSpacingType>::toString):
(WebCore::SVGPropertyTraits<SVGTextPathSpacingType>::fromString):
* svg/animation/SVGSMILElement.cpp:
(WebCore::indefiniteAtom):
(WebCore::SVGSMILElement::parseClockValue):
(WebCore::SVGSMILElement::repeatCount const):
* svg/properties/SVGPropertyTraits.h:
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::m_notificationClient):
* xml/XPathValue.cpp:
2022-04-22 Diego Pino Garcia <dpino@igalia.com>
Unreviewed, non-unified build fixes after r293203
* page/PageConfiguration.h:
2022-04-22 Alex Christensen <achristensen@webkit.org>
Reduce sizeof(CSSNumericType)
https://bugs.webkit.org/show_bug.cgi?id=239680
Reviewed by Yusuke Suzuki.
* bindings/IDLTypes.h:
(WebCore::IDLType::nullValue):
(WebCore::IDLType::isNullType):
(WebCore::IDLType::extractValueFromNullable):
* css/typedom/numeric/CSSMathProduct.cpp:
(WebCore::multiplyTypes):
* css/typedom/numeric/CSSNumericType.h:
(WebCore::CSSNumericType::valueForType):
(WebCore::CSSNumericType::valueForType const):
2022-04-22 Patrick Angle <pangle@apple.com>
Web Inspector: Regression(r287684) Resources from the memory cache show empty content in Network, Sources, and Search tabs
https://bugs.webkit.org/show_bug.cgi?id=239667
Reviewed by Devin Rousso.
Updated tests:
- http/tests/inspector/network/resource-response-source-disk-cache.html
- http/tests/inspector/network/resource-response-source-memory-cache.html
r287684 introduced a subtle bug when calling InspectorInstrumentation::didReceiveData. We rely
on there being a difference between real, but empty, data buffer and not having a data buffer,
but after r287684 an empty SharedBuffer would be passed in the later case. Instead, we should
continue to pass nullptr if there is no buffer so that InspectorNetworkAgent::didReceiveData
can distiguish between the two.
The bug is the result of having a non-nullptr `data` in `InspectorNetworkAgent::didReceiveData`,
which causes us to call `maybeAddResourceData`, which means by the time
`InspectorNetworkAgent::getResponseBody` is called, the ResourceData for the request will have
an empty, not non-existant, `content()`, which means we will return the empty content instead,
since we believe the response had actual content.
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didReceiveDataImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didReceiveData):
* loader/ResourceLoadNotifier.cpp:
(WebCore::ResourceLoadNotifier::dispatchDidReceiveData):
2022-04-22 Simon Fraser <simon.fraser@apple.com>
Focusing scroll container before scrolling breaks smooth scrolling
https://bugs.webkit.org/show_bug.cgi?id=239605
Reviewed by Wenson Hsieh.
If script calls focus() and then scrollTo({ behavior: smooth }) in the same runloop, the
scrollToFocusedElementInternal() that happens on a zero-delay timer in FrameView will stop
the animated scroll.
Fix by having programmatic scrolls on Element and DOMWindow cancel any pending focus-related
scroll.
Test: fast/scrolling/programmatic-smooth-scroll-after-focus.html
* dom/Element.cpp:
(WebCore::Element::scrollTo):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::scrollTo const):
* page/FrameView.cpp:
(WebCore::FrameView::maintainScrollPositionAtAnchor):
(WebCore::FrameView::setScrollPosition):
(WebCore::FrameView::cancelScheduledScrollToFocusedElement):
(WebCore::FrameView::scrollToAnchor):
(WebCore::FrameView::setWasScrolledByUser):
* page/FrameView.h:
2022-04-22 Alan Bujtas <zalan@apple.com>
[LFC][Integration] Add blank LayoutIntegration::FlexLayout
https://bugs.webkit.org/show_bug.cgi?id=239663
Reviewed by Antti Koivisto.
This is in preparation for adding flex formatting context integration.
* CMakeLists.txt:
* Headers.cmake:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/integration/flex/LayoutIntegrationFlexLayout.cpp: Added.
(WebCore::LayoutIntegration::FlexLayout::FlexLayout):
(WebCore::LayoutIntegration::FlexLayout::updateFormattingRootGeometryAndInvalidate):
(WebCore::LayoutIntegration::FlexLayout::updateFlexItemDimensions):
(WebCore::LayoutIntegration::FlexLayout::updateStyle):
(WebCore::LayoutIntegration::FlexLayout::computeIntrinsicWidthConstraints):
(WebCore::LayoutIntegration::FlexLayout::layout):
(WebCore::LayoutIntegration::FlexLayout::paint):
(WebCore::LayoutIntegration::FlexLayout::hitTest):
(WebCore::LayoutIntegration::FlexLayout::collectOverflow):
(WebCore::LayoutIntegration::FlexLayout::contentLogicalHeight const):
* layout/integration/flex/LayoutIntegrationFlexLayout.h: Added.
2022-04-22 Alan Bujtas <zalan@apple.com>
[LFC][Integration] Add FlexFormattingContextIntegrationEnabled setting
https://bugs.webkit.org/show_bug.cgi?id=239654
Reviewed by Antti Koivisto.
This is in preparation for supporting flex formatting context through integration.
* layout/integration/LayoutIntegrationCoverage.cpp:
(WebCore::LayoutIntegration::canUseForFlexLayout):
* layout/integration/LayoutIntegrationCoverage.h:
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::layoutFlexItems):
(WebCore::RenderFlexibleBox::layoutUsingFlexFormattingContext):
* rendering/RenderFlexibleBox.h:
2022-04-22 Brandon Stewart <brandonstewart@apple.com>
Store StyleScope during CSSStyleSheet Creation
https://bugs.webkit.org/show_bug.cgi?id=239659
Reviewed by Antti Koivisto.
To ensure that we can always access the style scope, we shall ensure we store the style scope
at CSSStyleSheet creation time. It was possible before that a style sheet could become disconnected
and then a rule would later be mutated. This resulted in the unfortunate side effect of being unable to find
the style scope.
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::CSSStyleSheet):
(WebCore::CSSStyleSheet::styleScope):
* css/CSSStyleSheet.h:
* style/StyleScope.cpp:
(WebCore::Style::Scope::collectResolverScopes):
* style/StyleScope.h:
2022-04-22 Alan Bujtas <zalan@apple.com>
[LFC][Integration] BoxTree should be able to build non-inline content tree
https://bugs.webkit.org/show_bug.cgi?id=239653
Reviewed by Antti Koivisto.
This is in preparation for supporting non-IFC content (e.g. flex).
* layout/integration/LayoutIntegrationBoxTree.cpp:
(WebCore::LayoutIntegration::rootBoxFirstLineStyle):
(WebCore::LayoutIntegration::BoxTree::BoxTree):
(WebCore::LayoutIntegration::BoxTree::buildTreeForInlineContent):
(WebCore::LayoutIntegration::BoxTree::layoutBoxForRenderer):
(WebCore::LayoutIntegration::BoxTree::rendererForLayoutBox):
(WebCore::LayoutIntegration::BoxTree::buildTree): Deleted.
* layout/integration/LayoutIntegrationBoxTree.h:
(WebCore::LayoutIntegration::BoxTree::rootRenderer const):
(WebCore::LayoutIntegration::BoxTree::rootRenderer):
(WebCore::LayoutIntegration::BoxTree::flow const): Deleted.
(WebCore::LayoutIntegration::BoxTree::flow): Deleted.
* layout/integration/inline/LayoutIntegrationLineLayout.h:
(WebCore::LayoutIntegration::LineLayout::flow const):
(WebCore::LayoutIntegration::LineLayout::flow):
2022-04-22 Mark Lam <mark.lam@apple.com>
Apply purifyNaN in more places.
https://bugs.webkit.org/show_bug.cgi?id=239619
<rdar://problem/91924480>
Reviewed by Yusuke Suzuki.
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::toJS):
* bindings/js/JSDOMConvertWebGL.cpp:
(WebCore::convertToJSValue):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneDeserializer::readTerminal):
* bridge/objc/objc_utility.mm:
(JSC::Bindings::convertObjcValueToValue):
2022-04-22 Andres Gonzalez <andresg_22@apple.com>
Fix for accessibility/aria-grid-with-aria-owns-rows.html in isolated tree mode.
https://bugs.webkit.org/show_bug.cgi?id=239498
<rdar://problem/91961398>
Reviewed by Chris Fleizach and Tyler Wilcock.
Test: accessibility/aria-grid-with-aria-owns-rows.html.
When creating AXIsolatedObjects, we were passing the object ID of the
parent to the constructor in a parent to child traversal, and storing
that parent ID in the object. This assumed that all AX objects have a
parent-child reflexive relationship, i.e., if A is a child of B, B is
the parent of A. But that is not true in several cases in the
accessibility hierarchy.
One example where the parent-child relationship is not reflexive is for table cells, where a cell can be the child of an object with role column, but its parent is an object with role row.
Another case is when aria-owns is used.
This patch fixes the problem by letting the live object determine its
own parent, instead of having the traversal algorithm pass the parent ID
to the AXIsolatedObject constructor.
A previous attempt to fix this problem was made in
https://bugs.webkit.org/show_bug.cgi?id=236156.
* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::AXIsolatedObject):
(WebCore::AXIsolatedObject::create):
(WebCore::AXIsolatedObject::initializeProperties):
(WebCore::AXIsolatedObject::initializeAttributeData): Renamed.
* accessibility/isolatedtree/AXIsolatedObject.h:
* accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::create):
(WebCore::AXIsolatedTree::generateSubtree):
(WebCore::AXIsolatedTree::nodeChangeForObject):
(WebCore::AXIsolatedTree::queueRemovalsAndUnresolvedChanges):
(WebCore::AXIsolatedTree::collectNodeChangesForSubtree):
(WebCore::AXIsolatedTree::updateNode):
(WebCore::AXIsolatedTree::updateChildren):
(WebCore::AXIsolatedTree::parentIDForObject): Deleted.
* accessibility/isolatedtree/AXIsolatedTree.h:
* accessibility/isolatedtree/mac/AXIsolatedObjectMac.mm:
(WebCore::AXIsolatedObject::initializePlatformProperties):
2022-04-22 Alan Bujtas <zalan@apple.com>
Book content is clipped at page boundary when displaying list with bullet points
https://bugs.webkit.org/show_bug.cgi?id=239638
<rdar://89257768>
Reviewed by Antti Koivisto.
Table cell content needs special handling when does not fit the page.
When a table cell's first line does not fit the page, instead of the normal, "let's add a flow level pagination strut"
we have to handle it as a line level strut (not sure why it is implemted this way but this is the expected behavior).
-also implment LineBoxIteratorModernPath::isFirstAfterPageBreak.
Test: fast/multicol/pagination/table-cell-one-line-pagination.html
* layout/integration/inline/InlineIteratorLineBoxModernPath.h:
(WebCore::InlineIterator::LineBoxIteratorModernPath::isFirstAfterPageBreak const):
* layout/integration/inline/LayoutIntegrationLine.h:
(WebCore::LayoutIntegration::Line::Line):
(WebCore::LayoutIntegration::Line::isFirstAfterPageBreak const):
* layout/integration/inline/LayoutIntegrationPagination.cpp:
(WebCore::LayoutIntegration::setPageBreakForLine): According to RenderBlockFlow::adjustLinePositionForPagination, we
have to call setPageBreak, even when the first line does not fit.
(WebCore::LayoutIntegration::makeAdjustedContent):
(WebCore::LayoutIntegration::adjustLinePositionsForPagination):
2022-04-22 Antti Koivisto <antti@apple.com>
Bail out from text decoration computation if none is requested
https://bugs.webkit.org/show_bug.cgi?id=239641
Reviewed by Tim Nguyen.
* rendering/TextDecorationPainter.cpp:
(WebCore::collectStylesForRenderer):
Also avoid resolving colors unnecessarily.
(WebCore::TextDecorationPainter::stylesForRenderer):
* rendering/style/RenderStyleConstants.cpp:
(WebCore::operator<<):
* rendering/style/RenderStyleConstants.h:
Remove unused 'None' value.
2022-04-22 Enrique Ocaña González <eocanha@igalia.com>
[MSE] Improve SourceBuffer memory cost reporting
https://bugs.webkit.org/show_bug.cgi?id=238948
Reviewed by Xabier Rodriguez-Calvar.
Properly implementing the memoryCost() API in SourceBuffer would improve memory
awareness when garbage collecting.
This patch extends the SourceBuffer interface with the ReportExtraMemoryCost
attribute, implements memoryCost() method for the interface and fixes
calculations for removed buffers. It distinguishes the amount of memory
increases reported (extraMemoryCostDelta, what was reported until now, can
only grow) from the total amount of memory reported (can grow and shrink).
This patch is co-authored by Andrzej Surdej (https://github.com/asurdej-comcast)
See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/827
* Modules/mediasource/SourceBuffer.cpp: Implement memoryCost() interface and hold the absolute memory consumed as m_extraMemoryCost, keeping the original m_reportedExtraMemoryCost behaviour.
* Modules/mediasource/SourceBuffer.h: Added memoryCost() and m_extraMemoryCost.
* Modules/mediasource/SourceBuffer.idl: Require the ReportExtraMemoryCost feature.
* platform/graphics/SourceBufferPrivate.cpp: Also report the memory change to SourceBuffer when evicting frames (memory reduction).
2022-04-22 Tyler Wilcock <tyler_w@apple.com>
AX: The isolated tree is not updated after role changes in AccessibilityRenderObject::updateRoleAfterChildrenCreation()
https://bugs.webkit.org/show_bug.cgi?id=239549
Reviewed by Chris Fleizach and Andres Gonzalez.
In AccessibilityRenderObject::updateRoleAfterChildrenCreation(), if the objects role changes,
we need to inform the cache via AXObjectCache::handleRoleChange which in turn will
update the isolated tree.
Fixes accessibility/mac/invalid-menu-role-does-not-send-notification.html in isolated tree mode.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::updateRoleAfterChildrenCreation):
2022-04-21 John Cunningham <johncunningham@apple.com>
Use GCGLSpanTuple to pass buffer parameters to multidraw calls.
https://bugs.webkit.org/show_bug.cgi?id=239154
Reviewed by Kimmo Kinnunen.
* html/canvas/WebGLMultiDraw.cpp:
(WebCore::WebGLMultiDraw::multiDrawArraysWEBGL):
(WebCore::WebGLMultiDraw::multiDrawArraysInstancedWEBGL):
(WebCore::WebGLMultiDraw::multiDrawElementsWEBGL):
(WebCore::WebGLMultiDraw::multiDrawElementsInstancedWEBGL):
(WebCore::makeSpanWithOffset): Deleted.
* platform/graphics/GraphicsContextGL.h:
* platform/graphics/GraphicsTypesGL.h:
* platform/graphics/angle/GraphicsContextGLANGLE.cpp:
(WebCore::GraphicsContextGLANGLE::multiDrawArraysANGLE):
(WebCore::GraphicsContextGLANGLE::multiDrawArraysInstancedANGLE):
(WebCore::GraphicsContextGLANGLE::multiDrawElementsANGLE):
(WebCore::GraphicsContextGLANGLE::multiDrawElementsInstancedANGLE):
* platform/graphics/angle/GraphicsContextGLANGLE.h:
* platform/graphics/opengl/GraphicsContextGLOpenGL.h:
2022-04-21 Rob Buis <rbuis@igalia.com>
`contain: layout` on the html element should change position:fixed behavior
https://bugs.webkit.org/show_bug.cgi?id=238560
Reviewed by Simon Fraser.
The mapLocalToContainer/mapAbsoluteToLocalPoint methods need to not only consider boxes
having transforms but need to include all checks in canContainFixedPositionObjects to
determine if the box acts as a fixed position containing block.
Tests: imported/w3c/web-platform-tests/css/css-contain/contain-layout-021.html
imported/w3c/web-platform-tests/css/css-contain/reference/contain-layout-021-ref.html
* rendering/RenderBox.cpp:
(WebCore::RenderBox::mapLocalToContainer const):
(WebCore::RenderBox::mapAbsoluteToLocalPoint const):
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::mapLocalToContainer const):
2022-04-21 Chris Dumez <cdumez@apple.com>
No-op, instead of throwing, on dataTransfer.items.remove()
https://bugs.webkit.org/show_bug.cgi?id=239618
Reviewed by Wenson Hsieh.
Calling dataTransfer.items.remove() with an out-of-range index should be a no-op instead of
throwing as per the latest HTML specification:
- https://github.com/whatwg/html/pull/7844
We were the only browser behaving this way so this was a compatibility risk.
Test: imported/w3c/web-platform-tests/html/editing/dnd/datastore/datatransferitemlist-remove.html
* dom/DataTransferItemList.cpp:
(WebCore::DataTransferItemList::remove):
2022-04-20 Yusuke Suzuki <ysuzuki@apple.com>
[WTF] Add string concatenate adapter for UUID
https://bugs.webkit.org/show_bug.cgi?id=239590
Reviewed by Chris Dumez and Darin Adler.
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::generateDatabaseFileName):
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::copyPropertiesFromSource):
(WebCore::KeyframeEffect::updateBlendingKeyframes):
(WebCore::KeyframeEffect::computeCSSTransitionBlendingKeyframes):
* dom/Document.cpp:
(WebCore::Document::originIdentifierForPasteboard const):
* fileapi/BlobURL.cpp:
(WebCore::BlobURL::createBlobURL):
* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::writeDataToUniqueFileInDirectory):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::updateAnimations):
2022-04-21 Chris Dumez <cdumez@apple.com>
Simplify FrameSelection::textWasReplaced() and callers
https://bugs.webkit.org/show_bug.cgi?id=239620
Reviewed by Geoffrey Garen.
* dom/CharacterData.cpp:
(WebCore::CharacterData::setData):
- Cache document().frame()
- Call textWasReplaced() with *this instead of this
- Use modern template deduction for Ref<>.
(WebCore::CharacterData::setDataAndUpdate):
- Use WTFMove() for m_data to avoid ref-counting churn. We're about to overwrite
m_data anyway.
- Use `else if` for the ProcessingInstruction branch instead of `if` to avoid this
check in the common case where |this| is a Text node. A Text node cannot be a
ProcessingInstruction node.
- Cache document().frame()
- Call textWasReplaced() with *this instead of this
* editing/FrameSelection.cpp:
(WebCore::updatePositionAfterAdoptingTextReplacement):
- Pass node by reference now that the caller now has a reference instead of a pointer
- Drop !position.anchorNode() check. It is not necessary as the position.anchorNode() != &node
check would already be true if the anchorNode were null.
(WebCore::FrameSelection::textWasReplaced):
- Drop outdated comment about a fragment check since there is no such check anymore
- Pass node by reference instead of pointer as all call sites have a non-null pointer
- Drop null check for node that is no longer necessary
* editing/FrameSelection.h:
2022-04-21 Chris Dumez <cdumez@apple.com>
Adopt RobinHoodHashMap / RobinHoodHashSet more broadly in WebCore
https://bugs.webkit.org/show_bug.cgi?id=239576
Reviewed by Yusuke Suzuki.
Adopt RobinHoodHashMap / RobinHoodHashSet more broadly in WebCore to avoid wasting memory in hash tables.
RobinHoodHashMap / RobinHoodHashSet have more restrictions on what key types they work with and may result
in slightly lower performance but they have a much higher load factor that the regular HashMap / HashSet,
thus reducing memory usage. This patch adopts RobinHoodHashMap / RobinHoodHashSet on non performance
sensitive maps / sets in WebCore that have compatible keys (String / AtomString / URL because they cache
their hash).
This is perf-neutral on all our benchmarks according to A/B testing.
* Modules/encryptedmedia/InitDataRegistry.h:
* Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.h:
* Modules/indexeddb/server/SQLiteIDBTransaction.h:
* Modules/mediasource/MediaSourceRegistry.h:
* Modules/mediastream/MediaDevices.h:
* Modules/mediastream/MediaStream.h:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* Modules/web-locks/WebLockRegistry.cpp:
* Modules/webaudio/AudioWorkletGlobalScope.h:
* Modules/webaudio/AudioWorkletNode.h:
* Modules/webaudio/AudioWorkletProcessor.cpp:
(WebCore::constructFrozenKeyValueObject):
(WebCore::copyDataFromParameterMapToJSObject):
(WebCore::AudioWorkletProcessor::buildJSArguments):
(WebCore::AudioWorkletProcessor::process):
* Modules/webaudio/AudioWorkletProcessor.h:
* Modules/webaudio/BaseAudioContext.h:
(WebCore::BaseAudioContext::parameterDescriptorMap const):
* Modules/webdatabase/Database.cpp:
(WebCore::WTF_REQUIRES_LOCK):
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::recordDeletingDatabase):
* Modules/webdatabase/DatabaseTracker.h:
* bindings/js/JSCustomElementInterface.h:
* bindings/js/ScriptModuleLoader.h:
* dom/CustomElementRegistry.h:
(WebCore::CustomElementRegistry::promiseMap):
* dom/ExtensionStyleSheets.h:
* dom/MutationObserver.cpp:
(WebCore::MutationObserver::observe):
* dom/MutationObserverRegistration.cpp:
(WebCore::MutationObserverRegistration::MutationObserverRegistration):
(WebCore::MutationObserverRegistration::resetObservation):
* dom/MutationObserverRegistration.h:
* dom/Node.cpp:
(WebCore::Node::registerMutationObserver):
* dom/Node.h:
* dom/WindowEventLoop.cpp:
* editing/Editor.h:
* inspector/InspectorAuditResourcesObject.h:
* inspector/NetworkResourcesData.cpp:
(WebCore::NetworkResourcesData::clear):
* inspector/NetworkResourcesData.h:
* inspector/agents/InspectorAnimationAgent.h:
* inspector/agents/InspectorCanvasAgent.h:
* inspector/agents/InspectorDOMDebuggerAgent.h:
* inspector/agents/InspectorDatabaseAgent.h:
* inspector/agents/InspectorNetworkAgent.h:
* inspector/agents/InspectorPageAgent.h:
* inspector/agents/InspectorWorkerAgent.h:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::setActiveContentRuleListActionPatterns):
* loader/DocumentLoader.h:
* loader/cache/CachedResourceLoader.h:
* page/Page.h:
* page/PageConfiguration.h:
* page/csp/ContentSecurityPolicyMediaListDirective.h:
* page/csp/ContentSecurityPolicySourceList.h:
* platform/LegacySchemeRegistry.cpp:
(WebCore::WTF_REQUIRES_LOCK):
* platform/StaticPasteboard.h:
* platform/graphics/SourceBufferPrivate.h:
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::updateTracksOfKind):
* platform/graphics/cg/UTIRegistry.cpp:
(WebCore::additionalSupportedImageTypes):
* platform/graphics/cg/UTIRegistry.h:
* platform/graphics/cocoa/FontCacheCoreText.cpp:
* platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
(WebCore::genericFamily):
* platform/graphics/cocoa/SystemFontDatabaseCoreText.h:
* platform/mac/ThreadCheck.mm:
(WebCoreReportThreadViolation):
* platform/mediastream/MediaStreamPrivate.h:
* platform/network/BlobRegistryImpl.h:
* platform/network/CredentialStorage.h:
* platform/network/NetworkStorageSession.h:
* rendering/ReferencedSVGResources.h:
* svg/SVGDocumentExtensions.h:
* workers/Worker.h:
* workers/WorkerGlobalScope.h:
* workers/service/ServiceWorkerContextData.h:
(WebCore::ServiceWorkerContextData::decode):
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::stripScriptSources):
(WebCore::populateScriptSourcesFromDisk):
(WebCore::RegistrationDatabase::doPushChanges):
(WebCore::RegistrationDatabase::importRecords):
* workers/service/server/RegistrationStore.cpp:
(WebCore::RegistrationStore::didSaveWorkerScriptsToDisk):
* workers/service/server/RegistrationStore.h:
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::didSaveWorkerScriptsToDisk):
(WebCore::SWServer::updateWorker):
(WebCore::SWServer::installContextData):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerToContextConnection.h:
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::SWServerWorker):
(WebCore::SWServerWorker::didSaveScriptsToDisk):
* workers/service/server/SWServerWorker.h:
2022-04-21 Tyler Wilcock <tyler_w@apple.com>
Only AXIsolatedTree::update{Children,Node} once when processing notifications in AXObjectCache::updateIsolatedTree
https://bugs.webkit.org/show_bug.cgi?id=239499
Reviewed by Andres Gonzalez.
Currently, we do try to prevent performing duplicate updates, but we do so only
if we have an exact match for a previous notification for any given object.
However, multiple notifications trigger AXIsolatedTree::updateNode and children,
so we'll still duplicate work if we get multiple notifications in the same group.
For example, before this patch, if the same object got both an AXValueChanged and
AXTextChanged notification, we'd call AXIsolatedTree::updateNode twice.
With this patch, we instead keep track of whether or not we've
performed a node or children update for each object to prevent
duplicate work.
No new tests because there is no behavior change.
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::updateIsolatedTree):
(WebCore::appendIfNotContainsMatching): Deleted.
2022-04-21 Philippe Normand <philn@igalia.com>
[GBM] Debug build broken
https://bugs.webkit.org/show_bug.cgi?id=239609
Reviewed by Adrian Perez de Castro.
* platform/graphics/gbm/GraphicsContextGLGBM.cpp: Include Logging.h enabling use of logging facilities.
2022-04-21 Eric Carlson <eric.carlson@apple.com>
AVSampleBufferRenderSynchronizer timeline sometimes goes backwards when playback begins
https://bugs.webkit.org/show_bug.cgi?id=239471
rdar://91117803
Reviewed by Jer Noble.
Test: media/media-source/media-source-current-time.html
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerTimeChanged): Log current time and requested
playback rate.
(WebCore::HTMLMediaElement::setPausedInternal): Log.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
If time has gone backward, clamp to the most recent seek time.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::playInternal): INFO_LOG -> ALWAYS_LOG
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pauseInternal): Ditto.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::currentMediaTime const): Use clampTimeToLastSeekTime.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::clampTimeToLastSeekTime const): New,
clamp time value to the most recent seek time.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCurrentTimeDidChangeCallback):
Use clampTimeToLastSeekTime.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance): INFO_LOG -> ALWAYS_LOG
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal): INFO_LOG -> ALWAYS_LOG
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::updateLastPixelBuffer): INFO_LOG -> ALWAYS_LOG
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableVideoFrame): INFO_LOG -> ALWAYS_LOG
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationChanged): INFO_LOG -> ALWAYS_LOG
2022-04-21 Antti Koivisto <antti@apple.com>
[LFC][Integration] Add direct style accessor to inline iterator
https://bugs.webkit.org/show_bug.cgi?id=239593
Reviewed by Alan Bujtas.
The current implementation fetches the line and the renderer and is pretty expensive.
* layout/integration/inline/InlineIteratorBox.cpp:
(WebCore::InlineIterator::Box::style const): Deleted.
* layout/integration/inline/InlineIteratorBox.h:
(WebCore::InlineIterator::Box::style const):
* layout/integration/inline/InlineIteratorBoxLegacyPath.h:
(WebCore::InlineIterator::BoxLegacyPath::style const):
* layout/integration/inline/InlineIteratorBoxModernPath.h:
(WebCore::InlineIterator::BoxModernPath::style const):
2022-04-21 Tim Nguyen <ntim@apple.com>
Small cleanups to StyleBuilderCustom.cpp
https://bugs.webkit.org/show_bug.cgi?id=239595
Reviewed by Antti Koivisto.
- Make use of DECLARE_PROPERTY_CUSTOM_HANDLERS more often
- Make code style for the containIntrinsic*Size methods consistent with
applyInitialContainIntrinsicBlockSize (use auto and better variable name)
- A bit of extra sorting
* style/StyleBuilderCustom.h:
(WebCore::Style::BuilderCustom::applyValueContainIntrinsicBlockSize):
(WebCore::Style::BuilderCustom::applyInitialContainIntrinsicInlineSize):
(WebCore::Style::BuilderCustom::applyValueContainIntrinsicInlineSize):
2022-04-21 Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
[GTK][WPE] Update libwebrtc API usage for video encoder factory
https://bugs.webkit.org/show_bug.cgi?id=239558
Reviewed by Philippe Normand.
Update GstreamerVideoEncoderFactory with current libwebrtc API.
No new tests required.
* platform/mediastream/libwebrtc/gstreamer/GStreamerVideoEncoderFactory.cpp:
(WebCore::GStreamerVideoEncoder::GStreamerVideoEncoder): Chain main constructor rather to
copy its initializations.
Update InitEncode method signature.
Remove deprecated attributes of EncoderInfo.
Fix code-style.
(WebCore::GStreamerH264Encoder::GStreamerH264Encoder): Remove unused class attribute and fix
a memleak.
* platform/mediastream/libwebrtc/gstreamer/GStreamerVideoEncoderFactory.h: Remove deprecated
method.
2022-04-21 Rob Buis <rbuis@igalia.com>
Skip release assert during container query resolution
https://bugs.webkit.org/show_bug.cgi?id=239537
Reviewed by Antti Koivisto.
Skip release assert during container query resolution
since resolveStyle will be a no-op as the container
query resolution was started in resolveStyle, so calling
resolveStyle the second time will bail right away.
* dom/Document.cpp:
(WebCore::Document::updateStyleIfNeeded):
2022-04-20 Chris Dumez <cdumez@apple.com>
Unreviewed follow-up to r293123 to address review feedback from Sam & Darin
* css/SelectorFilter.cpp:
(WebCore::localNameIsKnownToBeLowercase):
(WebCore::SelectorFilter::collectElementIdentifierHashes):
2022-04-20 Wenson Hsieh <wenson_hsieh@apple.com>
Avoid falling back to snapshots for transparent images when triggering batch text recognition
https://bugs.webkit.org/show_bug.cgi?id=239555
rdar://91622151
Reviewed by Aditya Keerthi.
For normal Live Text, our existing heuristics fall back to analyzing a snapshot rather than the image data
itself for transparent image elements (e.g. on Twitter). However, when installing block-style image overlay
content using `ImageAnalysisQueue`, it doesn't make sense to use this compatibility hack, since this flavor of
image overlay content is directly visible to the user, and would still show up underneath fully transparent
image elements, as long as we're able to analyze the other (non-fully-transparent) image element underneath.
* Headers.cmake:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/AXImage.cpp:
* page/ChromeClient.h:
Plumb the new `TextRecognitionOptions` struct through this client method.
(WebCore::ChromeClient::requestTextRecognition):
* page/EventHandler.cpp:
(WebCore::EventHandler::textRecognitionHoverTimerFired):
* page/ImageAnalysisQueue.cpp:
(WebCore::ImageAnalysisQueue::resumeProcessing):
Use the presence of an identifier as a cue to determine whether or not we should opt into the snapshotting
fallback behavior, for the time being. I also considered just keying this behavior off of the `identifier` in
`WebPage::requestTextRecognition`, but chose this approach because it seems fragile to couple those two
behaviors.
* platform/TextRecognitionOptions.h: Added.
* testing/Internals.cpp:
2022-04-20 Chris Dumez <cdumez@apple.com>
Move true / false AtomStrings to a central location and reuse them
https://bugs.webkit.org/show_bug.cgi?id=239530
Reviewed by Sam Weinig.
* dom/mac/ImageControlsMac.cpp:
(WebCore::ImageControlsMac::createImageControls):
* editing/cocoa/DataDetection.mm:
(WebCore::DataDetection::detectContentInRange):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::contentEditable const):
(WebCore::HTMLElement::setContentEditable):
(WebCore::trueName): Deleted.
(WebCore::falseName): Deleted.
* html/shadow/TextControlInnerElements.cpp:
(WebCore::TextControlInnerTextElement::updateInnerTextElementEditabilityImpl):
* mathml/MathMLPresentationElement.cpp:
(WebCore::MathMLPresentationElement::cachedBooleanAttribute):
* platform/network/HTTPParsers.cpp:
(WebCore::parseStructuredFieldValue):
* svg/SVGFEConvolveMatrixElement.cpp:
(WebCore::SVGFEConvolveMatrixElement::parseAttribute):
* svg/properties/SVGPropertyTraits.h:
(WebCore::SVGPropertyTraits<bool>::toString):
* xml/XPathValue.cpp:
(WebCore::XPath::Value::toString const):
2022-04-20 Simon Fraser <simon.fraser@apple.com>
REGRESSION (r281913): Map toolbar flickers when dragging the map on https://gis.ee/
https://bugs.webkit.org/show_bug.cgi?id=238589
<rdar://90483049>
Reviewed by Alan Bujtas.
If a layer has negative z-order descendants, and one of those descendants becomes
composited, then that layer also has to composite, because its foreground needs to render in
front of those descendants. But this is tricky, because the compositing toggle is
out-of-order; we only know that the layer has to get composited after processing
descendants.
In particular, this created a problem with the overlap map, which tracks sets of rectangles
in "compositing scopes" via LayerOverlapMap. The delayed compositing toggle of the layer
with negative z-order descendants meant that any layers processed up to that point had their
bounds added in the wrong overlap scope. This resulted in subsequent bad overlap testing,
and a failure to make later layers composited.
The previous fix in this area (r281913) was incorrect. Revert it, and do a better fix, which
is to speculatively push an overlap map entry for the layer with negative z-order
descendants, if necessary. If this layer ends up not getting composited, we unwind the
speculative push, which will merge that scope with its parent scope.
In addition give OverlapMapContainer (an "overlap scope") a RenderLayer& which we can use
for logging, and to assert on correct behavior; it is not otherwise used in release builds.
Tests: compositing/layer-creation/overlap-with-negative-z-layers.html
compositing/layer-creation/subtree-div-overlaps-multiple-negative-z-divs.html
* rendering/LayerOverlapMap.cpp:
(WebCore::OverlapMapContainer::OverlapMapContainer):
(WebCore::OverlapMapContainer::scopeLayer const):
(WebCore::OverlapMapContainer::dump const):
(WebCore::LayerOverlapMap::LayerOverlapMap):
(WebCore::LayerOverlapMap::add):
(WebCore::LayerOverlapMap::pushCompositingContainer):
(WebCore::LayerOverlapMap::popCompositingContainer):
* rendering/LayerOverlapMap.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
(WebCore::RenderLayerCompositor::updateOverlapMap const):
2022-04-20 Chris Dumez <cdumez@apple.com>
Simplify type checking / casting in JSEventListener::handleEvent()
https://bugs.webkit.org/show_bug.cgi?id=239559
Reviewed by Sam Weinig.
* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::handleEvent):
2022-04-20 Chris Dumez <cdumez@apple.com>
Avoid call to convertToASCIILowercase() in SelectorFilter::collectElementIdentifierHashes() in the common case
https://bugs.webkit.org/show_bug.cgi?id=239545
Reviewed by Sam Weinig.
The call to convertToASCIILowercase() in SelectorFilter::collectElementIdentifierHashes() shows in Speedometer profiles
even though input tags are already lowercase, simply because the function needs to iterate over the string to determine
that it is all lowercase. In the common case though, we can leverage the fact that all known HTML element tags are
lowercase to avoid the call to convertToASCIILowercase(). This is because HTMLElement::localName() returns one of the
tags defined in HTMLNames.h (for known HTML elements), all of which are lowercase.
* css/SelectorFilter.cpp:
(WebCore::SelectorFilter::collectElementIdentifierHashes):
2022-04-20 Chris Dumez <cdumez@apple.com>
Add missing WTFMove() in MIMETypeRegistryThreadGlobalData()
https://bugs.webkit.org/show_bug.cgi?id=239565
Reviewed by Sam Weinig.
* platform/MIMETypeRegistry.h:
(WebCore::MIMETypeRegistryThreadGlobalData::MIMETypeRegistryThreadGlobalData):
2022-04-20 Alan Bujtas <zalan@apple.com>
[IFC][Integration] Do not call WebPreferences::simpleLineLayoutEnabled in canUseForLineLayoutWithReason
https://bugs.webkit.org/show_bug.cgi?id=239540
Reviewed by Antti Koivisto.
1. Use RuntimeEnabledFeatures::sharedFeatures() instead of Page::Settings.
2. Remove simpleLineLayoutEnabled setting.
3. Rename LayoutFormattingContextIntegrationEnabled -> InlineFormattingContextIntegrationEnabled (in preparation for adding more of these FCs).
* display/DisplayView.cpp:
(WebCore::Display::View::prepareForDisplay):
* layout/LayoutState.cpp:
(WebCore::Layout::LayoutState::formattingStateForFormattingContext const):
(WebCore::Layout::LayoutState::formattingStateForInlineFormattingContext const):
(WebCore::Layout::LayoutState::ensureInlineFormattingState):
(WebCore::Layout::LayoutState::setViewportSize):
(WebCore::Layout::LayoutState::viewportSize const):
(WebCore::Layout::LayoutState::setIsIntegratedRootBoxFirstChild):
(WebCore::Layout::LayoutState::shouldIgnoreTrailingLetterSpacing const):
(WebCore::Layout::LayoutState::shouldNotSynthesizeInlineBlockBaseline const):
* layout/formattingContexts/inline/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::close):
* layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp:
(WebCore::Layout::InlineDisplayContentBuilder::appendTextDisplayBox):
* layout/integration/LayoutIntegrationCoverage.cpp:
(WebCore::LayoutIntegration::canUseForLineLayoutWithReason):
* layout/integration/inline/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::isEnabled):
(WebCore::LayoutIntegration::LineLayout::releaseCaches):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setInlineFormattingContextIntegrationEnabled):
(WebCore::RuntimeEnabledFeatures::inlineFormattingContextIntegrationEnabled const):
(WebCore::RuntimeEnabledFeatures::setLayoutFormattingContextIntegrationEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::layoutFormattingContextIntegrationEnabled const): Deleted.
* rendering/TextPainter.cpp:
(WebCore::TextPainter::clearGlyphDisplayLists):
2022-04-20 Chris Dumez <cdumez@apple.com>
Avoid repeated calls to eventNames() in a few more places
https://bugs.webkit.org/show_bug.cgi?id=239548
Reviewed by Yusuke Suzuki.
Avoid repeated calls to eventNames() in a few more places given that it accesses threadGlobalData().
* dom/MouseEvent.cpp:
(WebCore::MouseEvent::create):
* dom/SimulatedClick.cpp:
(WebCore::simulateClick):
* dom/ios/PointerEventIOS.cpp:
(WebCore::buttonsForType):
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::eventListenersDidChange):
* page/EventHandler.cpp:
(WebCore::EventHandler::dispatchDragEvent):
* page/PointerCaptureController.cpp:
(WebCore::PointerCaptureController::cancelPointer):
2022-04-20 Oriol Brufau <obrufau@igalia.com>
[css-cascade] Optimize code for deferred properties
https://bugs.webkit.org/show_bug.cgi?id=238260
Reviewed by Darin Adler.
CSS declarations for deferred properties were just appended to a vector,
which could grow huge. Then StyleBuilder would apply them one by one,
doing useless work if a property appeared multiple times.
The point of deferred properties is that they should be applied in
relative order. But if a property appears multiple times, we should only
care about the last occurrence.
So this patch removes the vector and instead stores the Property in the
same array as non-deferred properties. To track the indices, it uses an
array instead of a HashMap.
When applying the properties, the property IDs are placed in a vector,
which is then sorted according to the corresponding indices. This can
have some overhead, but the size of the vector will be limited by the
number of deferred properties. Currently there are only 8 of these (in
bug 236199 I plan to add 96 more, but 104 is still not that big).
No new tests since there should be no change in behavior.
* style/PropertyCascade.cpp:
(WebCore::Style::PropertyCascade::buildCascade):
Call sortDeferredPropertyIDs().
(WebCore::Style::initializeCSSValue):
Move a low-level idiom into its own function.
(WebCore::Style::PropertyCascade::set):
Use the new initializeCSSValue().
(WebCore::Style::PropertyCascade::setDeferred):
Use the new data structures for deferred properties.
(WebCore::Style::PropertyCascade::sortDeferredPropertyIDs):
New private method to sort the deferred property IDs according to their
index.
* style/PropertyCascade.h:
(WebCore::Style::PropertyCascade::deferredPropertyIndex const):
New private method to get the index of the deferred property.
(WebCore::Style::PropertyCascade::setDeferredPropertyIndex):
New private method to set the index of a deferred property.
(WebCore::Style::PropertyCascade::hasDeferredProperty const):
Use the new data structures for deferred properties.
(WebCore::Style::PropertyCascade::deferredProperty const):
Use the new data structures for deferred properties.
(WebCore::Style::PropertyCascade::deferredPropertyIDs const):
New method to get the deferred property IDs sorted by their index.
(WebCore::Style::PropertyCascade::deferredProperties const): Deleted.
* style/StyleBuilder.cpp:
(WebCore::Style::Builder::applyDeferredProperties):
Use the new data structures for deferred properties.
2022-04-20 Simon Fraser <simon.fraser@apple.com>
Some AutoscrollController cleanup
https://bugs.webkit.org/show_bug.cgi?id=239512
Reviewed by Alan Bujtas.
Have AutoscrollController store a WeakPtr to the render object. Address an apparent
null de-ref in AutoscrollController::stopAutoscrollTimer() where the Frame can null.
Refactor updateDragAndDrop() with a lambda so that all the code paths that exit early
clearly call stopAutoscrollTimer() which nulls out the renderer.
* page/AutoscrollController.cpp:
(WebCore::AutoscrollController::autoscrollRenderer const):
(WebCore::AutoscrollController::startAutoscrollForSelection):
(WebCore::AutoscrollController::stopAutoscrollTimer):
(WebCore::AutoscrollController::updateAutoscrollRenderer):
(WebCore::AutoscrollController::updateDragAndDrop):
(WebCore::AutoscrollController::startPanScrolling):
* page/AutoscrollController.h:
* page/EventHandler.cpp:
(WebCore::EventHandler::startPanScrolling):
2022-04-20 Yacine Bandou <yacine.bandou@softathome.com>
[GStreamer] REGRESSION(r285586): we never end the playback of some videos
https://bugs.webkit.org/show_bug.cgi?id=239387
Reviewed by Philippe Normand.
If the sinks have the EOS flag, we shouldn't ignore the EOS message.
Without this commit we never end the playback of some videos,
because we ignore the EOS message, like this one:
https://www.tv5mondeplus.com/bumpers/tv5_bumper.mp4
Test: media/video-inaccurate-duration-ended.html
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
2022-04-20 Cathie Chen <cathiechen@igalia.com>
Parsing of contain-intrinsic-size and adding a runtime flag for it
https://bugs.webkit.org/show_bug.cgi?id=238181
Reviewed by Simon Fraser.
Parsing of contain-intrinsic-size according to [1]. In order to parse the shorthand properly,
the latest draft has been updated to "none | <length> | auto <length>". ContainIntrinsicSizeType
in RenderStyle, indicates the type of value. containIntrinsicWidth/Height indicates the length
value for Length and AutoAndLength type.
Thanks to Rob Buis for helping with this patch.
[1] https://www.w3.org/TR/css-sizing-4/#intrinsic-size-override
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::valueForContainIntrinsicSize):
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
* css/CSSProperties.json:
* css/StyleProperties.cpp:
(WebCore::StyleProperties::getPropertyValue const):
(WebCore::StyleProperties::asTextInternal const):
* css/parser/CSSParserContext.cpp:
(WebCore::operator==):
(WebCore::add):
(WebCore::CSSParserContext::isPropertyRuntimeDisabled const):
* css/parser/CSSParserContext.h:
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeContainIntrinsicSize):
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::CSSPropertyParser::consumeContainIntrinsicSizeShorthand):
(WebCore::CSSPropertyParser::parseShorthand):
* css/parser/CSSPropertyParser.h:
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::containIntrinsicWidthType const):
(WebCore::RenderStyle::containIntrinsicHeightType const):
(WebCore::RenderStyle::containIntrinsicWidth const):
(WebCore::RenderStyle::containIntrinsicHeight const):
(WebCore::RenderStyle::setContainIntrinsicWidthType):
(WebCore::RenderStyle::setContainIntrinsicHeightType):
(WebCore::RenderStyle::setContainIntrinsicWidth):
(WebCore::RenderStyle::setContainIntrinsicHeight):
(WebCore::RenderStyle::initialContainIntrinsicWidthType):
(WebCore::RenderStyle::initialContainIntrinsicHeightType):
(WebCore::RenderStyle::initialContainIntrinsicWidth):
(WebCore::RenderStyle::initialContainIntrinsicHeight):
* rendering/style/RenderStyleConstants.cpp:
(WebCore::operator<<):
* rendering/style/RenderStyleConstants.h:
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator== const):
* rendering/style/StyleRareNonInheritedData.h:
* style/StyleBuilderCustom.h:
(WebCore::Style::BuilderCustom::applyInitialContainIntrinsicWidth):
(WebCore::Style::BuilderCustom::applyInheritContainIntrinsicWidth):
(WebCore::Style::BuilderCustom::applyValueContainIntrinsicWidth):
(WebCore::Style::BuilderCustom::applyInitialContainIntrinsicHeight):
(WebCore::Style::BuilderCustom::applyInheritContainIntrinsicHeight):
(WebCore::Style::BuilderCustom::applyValueContainIntrinsicHeight):
(WebCore::Style::BuilderCustom::applyInitialContainIntrinsicBlockSize):
(WebCore::Style::BuilderCustom::applyInheritContainIntrinsicBlockSize):
(WebCore::Style::BuilderCustom::applyValueContainIntrinsicBlockSize):
(WebCore::Style::BuilderCustom::applyInitialContainIntrinsicInlineSize):
(WebCore::Style::BuilderCustom::applyInheritContainIntrinsicInlineSize):
(WebCore::Style::BuilderCustom::applyValueContainIntrinsicInlineSize):
2022-04-20 Tim Nguyen <ntim@apple.com>
Unprefix -webkit-user-select CSS property
https://bugs.webkit.org/show_bug.cgi?id=208677
Reviewed by Simon Fraser.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
* css/CSSProperties.json:
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
* css/html.css:
(#if defined(WTF_PLATFORM_IOS_FAMILY) && WTF_PLATFORM_IOS_FAMILY):
(input::-webkit-inner-spin-button):
(input::-webkit-strong-password-auto-fill-button):
(input::-webkit-credentials-auto-fill-button):
(input::-webkit-contacts-auto-fill-button):
(input::-webkit-credit-card-auto-fill-button):
(input::-webkit-caps-lock-indicator):
(#if defined(ENABLE_DATALIST_ELEMENT) && ENABLE_DATALIST_ELEMENT):
(textarea):
(input:-webkit-autofill-strong-password):
* css/mediaControls.css:
(audio::-webkit-media-controls-panel, video::-webkit-media-controls-panel):
(audio::-webkit-media-controls-timeline-container, video::-webkit-media-controls-timeline-container):
(video::-webkit-media-text-track-container):
* css/plugIns.css:
(embed::-webkit-snapshotted-plugin-content > .snapshot-overlay > .snapshot-label,):
* dom/ImageOverlay.cpp:
(WebCore::ImageOverlay::updateSubtree):
(WebCore::ImageOverlay::updateWithTextRecognitionResult):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::collectPresentationalHintsForAttribute):
2022-04-20 Diego Pino Garcia <dpino@igalia.com>
Unreviewed, non-unified build fixes after r293052
* css/typedom/numeric/CSSMathMin.cpp:
* css/typedom/numeric/CSSMathNegate.cpp:
* css/typedom/numeric/CSSMathProduct.cpp:
* css/typedom/numeric/CSSMathSum.cpp:
* css/typedom/transform/CSSSkew.cpp:
* dom/CustomElementRegistry.cpp:
* html/InputTypeNames.cpp:
* inspector/agents/InspectorCSSAgent.cpp:
* page/FocusController.cpp:
* style/AttributeChangeInvalidation.cpp:
* style/ClassChangeInvalidation.cpp:
* style/ElementRuleCollector.cpp:
* style/IdChangeInvalidation.cpp:
* style/StyleSharingResolver.cpp:
2022-04-20 Tim Nguyen <ntim@apple.com>
REGRESSION(r293044): Extraneous border around AutoFill buttons in `active` and `hover` states
https://bugs.webkit.org/show_bug.cgi?id=239531
Unreviewed fix.
Used "Convert to Outlines" tool in Sketch for outlines, then cleaned up SVGs, instead of stroke atttributes.
* css/html.css:
(input::-webkit-credentials-auto-fill-button:hover):
(input::-webkit-credentials-auto-fill-button:active):
2022-04-19 Alex Christensen <achristensen@webkit.org>
Remove unnecessary String allocations in CSSPrimitiveValue::unitTypeString
https://bugs.webkit.org/show_bug.cgi?id=239529
Reviewed by Chris Dumez.
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::unitTypeString):
* css/CSSPrimitiveValue.h:
* css/typedom/CSSUnitValue.cpp:
(WebCore::CSSUnitValue::unit const):
(WebCore::CSSUnitValue::unitSerialization const):
* css/typedom/CSSUnitValue.h:
2022-04-19 Ben Nham <nham@apple.com>
Handle public token updates in webpushd
https://bugs.webkit.org/show_bug.cgi?id=239042
Reviewed by Brady Eidson.
When the public token associated with our push service changes, we have to invalidate all
push subscriptions, since they all derive from the public token. This is only expected to
happen in very rare cases, e.g. keychain corruption.
To implement this, we now listen for public token updates from our push service, and pass
that on to PushDatabase. PushDatabase persists the token and deletes all subscriptions on
token change if necessary.
I had to change the schema to allow for this. openAndMigrateDatabaseImpl now migrates
existing data on schema change rather than nuking the whole database so users won't lose
their existing subscriptions.
* Modules/push-api/PushDatabase.cpp:
(WebCore::openAndMigrateDatabaseImpl):
(WebCore::PushDatabase::updatePublicToken):
(WebCore::PushDatabase::getPublicToken):
2022-04-19 Chris Dumez <cdumez@apple.com>
Use more r-value references for Text / CharacterData classes
https://bugs.webkit.org/show_bug.cgi?id=239481
Reviewed by Sam Weinig.
Use more r-value references for Text / CharacterData classes, which infected
a lot of the surrounding code. This avoids some ref-counting churn.
* dom/CDATASection.cpp:
(WebCore::CDATASection::CDATASection):
(WebCore::CDATASection::create):
(WebCore::CDATASection::cloneNodeInternal):
(WebCore::CDATASection::virtualCreate):
* dom/CDATASection.h:
* dom/CharacterData.h:
(WebCore::CharacterData::CharacterData):
* dom/Comment.cpp:
(WebCore::Comment::Comment):
(WebCore::Comment::create):
(WebCore::Comment::cloneNodeInternal):
* dom/Comment.h:
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::stringReplaceAll):
* dom/ContainerNode.h:
* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createHTMLDocument):
* dom/DOMImplementation.h:
* dom/Document.cpp:
(WebCore::Document::createTextNode):
(WebCore::Document::createComment):
(WebCore::Document::createCDATASection):
(WebCore::Document::createProcessingInstruction):
(WebCore::Document::createEditingTextNode):
(WebCore::Document::setTitle):
* dom/Document.h:
* dom/Element.cpp:
(WebCore::Element::insertAdjacentText):
* dom/Element.h:
* dom/ImageOverlay.cpp:
(WebCore::ImageOverlay::installImageOverlayStyleSheet):
(WebCore::ImageOverlay::updateSubtree):
* dom/Node.cpp:
(WebCore::Node::convertNodesOrStringsIntoNode):
(WebCore::Node::setTextContent):
* dom/Node.h:
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::ProcessingInstruction):
(WebCore::ProcessingInstruction::create):
(WebCore::ProcessingInstruction::cloneNodeInternal):
* dom/ProcessingInstruction.h:
* dom/Text.cpp:
(WebCore::Text::create):
(WebCore::Text::createEditingText):
(WebCore::Text::cloneNodeInternal):
(WebCore::Text::virtualCreate):
(WebCore::Text::createWithLengthLimit):
* dom/Text.h:
(WebCore::Text::Text):
* dom/mac/ImageControlsMac.cpp:
(WebCore::ImageControlsMac::createImageControls):
* editing/CreateLinkCommand.cpp:
(WebCore::CreateLinkCommand::doApply):
* editing/Editing.cpp:
(WebCore::createTabSpanElement):
* editing/Editing.h:
* editing/Editor.cpp:
(WebCore::Editor::styleForSelectionStart):
* editing/InsertLineBreakCommand.cpp:
(WebCore::InsertLineBreakCommand::doApply):
* editing/InsertTextCommand.cpp:
(WebCore::InsertTextCommand::positionInsideTextNode):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::addSpacesForSmartReplace):
* editing/TextManipulationController.cpp:
(WebCore::TextManipulationController::replace):
* editing/markup.cpp:
(WebCore::createFragmentFromText):
(WebCore::createFragmentForTransformToFragment):
* editing/markup.h:
* html/BaseDateAndTimeInputType.cpp:
(WebCore::BaseDateAndTimeInputType::updateInnerTextValue):
* html/BaseDateAndTimeInputType.h:
* html/FTPDirectoryDocument.cpp:
(WebCore::FTPDirectoryDocumentParser::appendEntry):
(WebCore::FTPDirectoryDocumentParser::createTDForFilename):
(WebCore::FTPDirectoryDocumentParser::parseAndAppendOneLine):
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::setText):
* html/HTMLAnchorElement.h:
* html/HTMLElement.cpp:
(WebCore::HTMLElement::setInnerText):
(WebCore::HTMLElement::setOuterText):
* html/HTMLElement.h:
* html/HTMLMeterElement.cpp:
(WebCore::HTMLMeterElement::didAddUserAgentShadowRoot):
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::createForLegacyFactoryFunction):
(WebCore::HTMLOptionElement::setText):
* html/HTMLOptionElement.h:
* html/HTMLOutputElement.cpp:
(WebCore::HTMLOutputElement::setValue):
(WebCore::HTMLOutputElement::setDefaultValue):
* html/HTMLOutputElement.h:
* html/HTMLScriptElement.cpp:
(WebCore::HTMLScriptElement::setText):
* html/HTMLScriptElement.h:
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::setValueCommon):
(WebCore::HTMLTextAreaElement::setDefaultValue):
(WebCore::HTMLTextAreaElement::updatePlaceholderText):
* html/HTMLTextAreaElement.h:
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::setInnerTextValue):
* html/HTMLTextFormControlElement.h:
* html/HTMLTitleElement.cpp:
(WebCore::HTMLTitleElement::setText):
* html/HTMLTitleElement.h:
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::updatePlaceholderText):
* html/parser/AtomHTMLToken.h:
(WebCore::AtomHTMLToken::comment):
* html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::insertComment):
(WebCore::HTMLConstructionSite::insertCommentOnDocument):
(WebCore::HTMLConstructionSite::insertCommentOnHTMLHtmlElement):
(WebCore::HTMLConstructionSite::insertTextNode):
* html/shadow/DateTimeEditElement.cpp:
(WebCore::DateTimeEditBuilder::visitLiteral):
* html/shadow/DateTimeFieldElement.cpp:
(WebCore::DateTimeFieldElement::updateVisibleValue):
* html/track/TextTrackCue.cpp:
(WebCore::TextTrackCue::rebuildDisplayTree):
* html/track/VTTCue.cpp:
(WebCore::VTTCue::getDisplayTree):
* html/track/WebVTTParser.cpp:
(WebCore::WebVTTTreeBuilder::buildFromString):
(WebCore::WebVTTTreeBuilder::constructTreeFromToken):
* page/DragController.cpp:
(WebCore::documentFragmentFromDragData):
* platform/text/DateTimeFormat.h:
* platform/text/PlatformLocale.cpp:
(WebCore::DateTimeStringBuilder::visitLiteral):
* svg/SVGTRefElement.cpp:
(WebCore::SVGTRefElement::updateReferencedText):
(WebCore::SVGTRefElement::detachTarget):
* xml/XMLErrors.cpp:
(WebCore::createXHTMLParserErrorHeader):
(WebCore::XMLErrors::insertErrorMessageBlock):
* xml/XMLTreeViewer.cpp:
(WebCore::XMLTreeViewer::transformDocumentToTreeView):
* xml/XSLTProcessor.cpp:
(WebCore::XSLTProcessor::transformToFragment):
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::createLeafTextNode):
(WebCore::XMLDocumentParser::parseDocumentFragment):
2022-04-19 Chris Dumez <cdumez@apple.com>
Replace String::replaceWithLiteral() with a String::replace() overload that takes in an ASCIILiteral
https://bugs.webkit.org/show_bug.cgi?id=239500
Reviewed by Darin Adler.
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::encodeDatabaseName):
* display/css/DisplayTextBox.cpp:
(WebCore::Display::TextBox::debugDescription const):
* dom/Node.cpp:
(WebCore::Node::showNode const):
* dom/Text.cpp:
(WebCore::appendTextRepresentation):
* editing/EditingStyle.cpp:
(WebCore::StyleChange::extractTextStyles):
* editing/Editor.cpp:
(WebCore::Editor::selectedText const):
* editing/MarkupAccumulator.cpp:
(WebCore::MarkupAccumulator::appendQuotedURLAttributeValue):
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::takeResults):
* html/URLDecomposition.cpp:
(WebCore::URLDecomposition::setSearch):
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::outputLayoutBox):
* loader/FormSubmission.cpp:
(WebCore::appendMailtoPostFormDataToURL):
* rendering/LegacyInlineTextBox.cpp:
(WebCore::LegacyInlineTextBox::outputLineBox const):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::outputRenderObject const):
* xml/XSLTProcessor.cpp:
(WebCore::transformTextStringToXHTMLDocumentString):
2022-04-19 Simon Fraser <simon.fraser@apple.com>
EventHandler should use a WeakPtr for m_resizeLayer
https://bugs.webkit.org/show_bug.cgi?id=239515
Reviewed by Wenson Hsieh.
Use a WeakPtr for m_resizeLayer.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
* page/EventHandler.h:
2022-04-19 Alex Christensen <achristensen@webkit.org>
Implement most of CSS typed OM object stringifiers
https://bugs.webkit.org/show_bug.cgi?id=239483
Reviewed by Simon Fraser.
This is an off-by-default experimental feature.
Covered by web platform tests.
* css/typedom/CSSKeywordValue.cpp:
(WebCore::CSSKeywordValue::serialize const):
* css/typedom/CSSKeywordValue.h:
* css/typedom/CSSOMVariableReferenceValue.cpp:
(WebCore::CSSOMVariableReferenceValue::toString const):
(WebCore::CSSOMVariableReferenceValue::serialize const):
* css/typedom/CSSOMVariableReferenceValue.h:
* css/typedom/CSSStyleImageValue.cpp:
(WebCore::CSSStyleImageValue::serialize const):
(WebCore::CSSStyleImageValue::document const):
* css/typedom/CSSStyleImageValue.h:
* css/typedom/CSSStyleValue.cpp:
(WebCore::CSSStyleValue::toString const):
(WebCore::CSSStyleValue::serialize const):
* css/typedom/CSSStyleValue.h:
* css/typedom/CSSUnitValue.cpp:
(WebCore::CSSUnitValue::serialize const):
* css/typedom/CSSUnitValue.h:
* css/typedom/CSSUnparsedValue.cpp:
(WebCore::CSSUnparsedValue::serialize const):
(WebCore::CSSUnparsedValue::toString const): Deleted.
* css/typedom/CSSUnparsedValue.h:
* css/typedom/numeric/CSSMathInvert.cpp:
(WebCore::CSSMathInvert::serialize const):
* css/typedom/numeric/CSSMathInvert.h:
* css/typedom/numeric/CSSMathMax.cpp:
(WebCore::CSSMathMax::serialize const):
* css/typedom/numeric/CSSMathMax.h:
* css/typedom/numeric/CSSMathMin.cpp:
(WebCore::CSSMathMin::serialize const):
* css/typedom/numeric/CSSMathMin.h:
* css/typedom/numeric/CSSMathNegate.cpp:
(WebCore::CSSMathNegate::serialize const):
* css/typedom/numeric/CSSMathNegate.h:
* css/typedom/numeric/CSSMathProduct.cpp:
(WebCore::CSSMathProduct::serialize const):
* css/typedom/numeric/CSSMathProduct.h:
* css/typedom/numeric/CSSMathSum.cpp:
(WebCore::CSSMathSum::serialize const):
* css/typedom/numeric/CSSMathSum.h:
* css/typedom/numeric/CSSNumericArray.cpp:
(WebCore::CSSNumericArray::forEach):
* css/typedom/numeric/CSSNumericArray.h:
* css/typedom/transform/CSSMatrixComponent.cpp:
(WebCore::CSSMatrixComponent::serialize const):
(WebCore::CSSMatrixComponent::toMatrix):
(WebCore::CSSMatrixComponent::toString const): Deleted.
* css/typedom/transform/CSSMatrixComponent.h:
* css/typedom/transform/CSSPerspective.cpp:
(WebCore::CSSPerspective::serialize const):
(WebCore::CSSPerspective::toMatrix):
(WebCore::CSSPerspective::toString const): Deleted.
* css/typedom/transform/CSSPerspective.h:
* css/typedom/transform/CSSRotate.cpp:
(WebCore::CSSRotate::serialize const):
(WebCore::CSSRotate::toMatrix):
(WebCore::CSSRotate::toString const): Deleted.
* css/typedom/transform/CSSRotate.h:
* css/typedom/transform/CSSScale.cpp:
(WebCore::CSSScale::serialize const):
(WebCore::CSSScale::toMatrix):
(WebCore::CSSScale::toString const): Deleted.
* css/typedom/transform/CSSScale.h:
* css/typedom/transform/CSSSkew.cpp:
(WebCore::CSSSkew::serialize const):
(WebCore::CSSSkew::toMatrix):
(WebCore::CSSSkew::toString const): Deleted.
* css/typedom/transform/CSSSkew.h:
* css/typedom/transform/CSSSkewX.cpp:
(WebCore::CSSSkewX::serialize const):
(WebCore::CSSSkewX::toMatrix):
(WebCore::CSSSkewX::toString const): Deleted.
* css/typedom/transform/CSSSkewX.h:
* css/typedom/transform/CSSSkewY.cpp:
(WebCore::CSSSkewY::serialize const):
(WebCore::CSSSkewY::toMatrix):
(WebCore::CSSSkewY::toString const): Deleted.
* css/typedom/transform/CSSSkewY.h:
* css/typedom/transform/CSSTransformComponent.cpp:
(WebCore::CSSTransformComponent::toString const):
* css/typedom/transform/CSSTransformComponent.h:
* css/typedom/transform/CSSTransformValue.cpp:
(WebCore::CSSTransformValue::serialize const):
* css/typedom/transform/CSSTransformValue.h:
* css/typedom/transform/CSSTranslate.cpp:
(WebCore::CSSTranslate::serialize const):
(WebCore::CSSTranslate::toMatrix):
(WebCore::CSSTranslate::toString const): Deleted.
* css/typedom/transform/CSSTranslate.h:
2022-04-19 Chris Dumez <cdumez@apple.com>
Use SortedArrayMap in parseEnumeration<>() in the JS bindings
https://bugs.webkit.org/show_bug.cgi?id=239503
Reviewed by Darin Adler.
Use SortedArrayMap in parseEnumeration<>() in the JS bindings, which should be slightly
better for performance.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateEnumerationImplementationContent):
* bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
(WebCore::parseEnumeration<TestCallbackInterface::Enum>):
* bindings/scripts/test/JS/JSTestDefaultToJSONEnum.cpp:
(WebCore::parseEnumeration<TestDefaultToJSONEnum>):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::parseEnumeration<TestObj::EnumType>):
(WebCore::parseEnumeration<TestObj::EnumTrailingComma>):
(WebCore::parseEnumeration<TestObj::Optional>):
(WebCore::parseEnumeration<AlternateEnumName>):
(WebCore::parseEnumeration<TestObj::EnumA>):
(WebCore::parseEnumeration<TestObj::EnumB>):
(WebCore::parseEnumeration<TestObj::EnumC>):
(WebCore::parseEnumeration<TestObj::Kind>):
(WebCore::parseEnumeration<TestObj::Size>):
(WebCore::parseEnumeration<TestObj::Confidence>):
* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
(WebCore::parseEnumeration<TestStandaloneDictionary::EnumInStandaloneDictionaryFile>):
* bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp:
(WebCore::parseEnumeration<TestStandaloneEnumeration>):
2022-04-19 Tim Nguyen <ntim@apple.com>
Clean up SVGs added by r293038
https://bugs.webkit.org/show_bug.cgi?id=239522
Reviewed by Wenson Hsieh.
The old SVGs apply clip-paths on rectangles (corresponding to the shapes), then fill those clipped rectangles.
Instead fill/stroke the shapes directly and remove the rectangles.
Also remove version="1.1" from other SVGs which is unnecessary.
* css/html.css:
(input::-webkit-credentials-auto-fill-button):
(input::-webkit-credentials-auto-fill-button:hover):
(input::-webkit-credentials-auto-fill-button:active):
(input::-webkit-contacts-auto-fill-button):
(input::-webkit-credit-card-auto-fill-button):
2022-04-19 Chris Dumez <cdumez@apple.com>
Inline Element::shadowRoot()
https://bugs.webkit.org/show_bug.cgi?id=239460
Reviewed by Darin Adler.
Inline Element::shadowRoot() given that it is small and shows up in Speedometer profiles.
* bindings/js/JSCustomElementInterface.cpp:
* css/CSSComputedStyleDeclaration.cpp:
* css/SelectorChecker.cpp:
* dom/ComposedTreeAncestorIterator.h:
* dom/ComposedTreeIterator.cpp:
* dom/ComposedTreeIterator.h:
* dom/ContainerNode.cpp:
* dom/ContainerNodeAlgorithms.cpp:
* dom/Document.cpp:
* dom/Element.cpp:
(WebCore::Element::elementRareData const): Deleted.
(WebCore::Element::shadowRoot const): Deleted.
* dom/Element.h:
* dom/ElementInlines.h:
* dom/ElementRareData.h:
(WebCore::Element::elementRareData const):
(WebCore::Element::shadowRoot const):
* dom/EventPath.cpp:
* dom/ImageOverlay.cpp:
* dom/mac/ImageControlsMac.cpp:
* editing/TextIterator.cpp:
* editing/cocoa/DataDetection.h:
* editing/cocoa/DataDetection.mm:
(WebCore::DataDetection::findDataDetectionResultElementInImageOverlay):
* editing/cocoa/HTMLConverter.mm:
* editing/markup.cpp:
* html/HTMLDetailsElement.cpp:
* html/HTMLImageElement.cpp:
* page/ios/FrameIOS.mm:
* rendering/RenderFileUploadControl.cpp:
* style/PseudoClassChangeInvalidation.cpp:
* style/StyleInvalidator.cpp:
* style/StyleScope.cpp:
* svg/SVGTRefElement.cpp:
* testing/Internals.cpp:
2022-04-19 Commit Queue <commit-queue@webkit.org>
Unreviewed, reverting r292947.
https://bugs.webkit.org/show_bug.cgi?id=239520
Introduced new assertion failures
Reverted changeset:
"Make release assertion in Document::updateLayout more precise
for FrameSelection::setSelection"
https://bugs.webkit.org/show_bug.cgi?id=239431
https://commits.webkit.org/r292947
2022-04-19 Ricky Mondello <rmondello@apple.com>
Update in-field icons for credential fields
https://bugs.webkit.org/show_bug.cgi?id=239336
Reviewed by Wenson Hsieh.
This new styling is only appropriate for Cocoa platforms.
* css/html.css:
(input::-webkit-credentials-auto-fill-button):
(input::-webkit-credentials-auto-fill-button:hover):
(input::-webkit-credentials-auto-fill-button:active):
2022-04-19 Ada Chan <adachan@apple.com>
[WebXR] Update Device::initializeTrackingAndRendering() to take in more parameters regarding the session setup
https://bugs.webkit.org/show_bug.cgi?id=239476
Reviewed by Dean Jackson.
Pass in document's origin and session features to Device::initializeTrackingAndRendering().
* Modules/webxr/WebXRSession.cpp:
(WebCore::WebXRSession::WebXRSession):
* Modules/webxr/WebXRSystem.h:
* platform/xr/PlatformXR.h:
* platform/xr/openxr/PlatformXROpenXR.cpp:
(PlatformXR::OpenXRDevice::initializeTrackingAndRendering):
* platform/xr/openxr/PlatformXROpenXR.h:
* testing/WebFakeXRDevice.cpp:
(WebCore::SimulatedXRDevice::initializeTrackingAndRendering):
* testing/WebFakeXRDevice.h:
2022-04-19 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Add explanatory comments in fillVectorWithVerticalGlyphPositions() and simplify it somewhat
https://bugs.webkit.org/show_bug.cgi?id=239480
Reviewed by Alan Bujtas.
This adds a lot of explanatory text in fillVectorWithVerticalGlyphPositions(). It also rewrites some of it to
call shared functions (computeOverallTextMatrixInternal() and computeVerticalTextMatrixInternal()) instead of
reimplementing the contents of those functions.
The last thing this patch does is it stops adding in CTFontGetMatrix() to the text matrix, because:
1. It's always the identity, because we never create a font with one of these things
2. Even if it wasn't the identity, Core Text already applies it itself, so if we apply it, it would be double
applied.
No new tests because there is no behavior change.
* platform/graphics/FontCascade.h:
* platform/graphics/coretext/FontCascadeCoreText.cpp:
(WebCore::computeBaseOverallTextMatrix):
(WebCore::computeOverallTextMatrix):
(WebCore::computeBaseVerticalTextMatrix):
(WebCore::computeVerticalTextMatrix):
(WebCore::fillVectorWithVerticalGlyphPositions):
(WebCore::showGlyphsWithAdvances):
2022-04-19 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Text selection flickers when inserting text using dictation
https://bugs.webkit.org/show_bug.cgi?id=239467
rdar://91895659
Reviewed by Aditya Keerthi.
Add a method to invalidate `TemporarySelectionChange` and `IgnoreSelectionChangeForScope`, which immediately
reverts `Editor::ignoreSelectionChanges()` state to `false` without triggering an appearance update, and also
ensures that the RAII object's destructor is a noop.
See WebKit/ChangeLog for more details.
* editing/Editor.cpp:
(WebCore::TemporarySelectionChange::invalidate):
(WebCore::TemporarySelectionChange::~TemporarySelectionChange):
Make the destructor robust in the case where `m_document` has been cleared out already due to invalidating the
temporary selection change.
* editing/Editor.h:
Also mark these as non-copyable and fast-allocated, while we're here. Since these are RAII objects, we never
expect them to be copied, and the `WTF_MAKE_FAST_ALLOCATED` allows us to use `WTF::makeUnique` when creating
unique pointers to these helper objects.
(WebCore::IgnoreSelectionChangeForScope::invalidate):
2022-04-19 Tim Nguyen <ntim@apple.com>
user-select: none shouldn't affect editability
https://bugs.webkit.org/show_bug.cgi?id=118009
Reviewed by Antti Koivisto.
Tests: editing/selection/user-select-js-property.html
imported/w3c/web-platform-tests/css/css-ui/user-select-none-in-editable.html
imported/w3c/web-platform-tests/css/css-ui/user-select-none-on-input.html
Change `effectiveUserSelect` to take in account `-webkit-user-modify`.
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::effectiveUserSelect const):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::effectiveUserSelect const): Deleted.
2022-04-19 Antti Koivisto <antti@apple.com>
[LFC][Integration] Use WeakPtr for InlineContent in iterator
https://bugs.webkit.org/show_bug.cgi?id=239492
Reviewed by Alan Bujtas.
Simplify the logic and increase robustness.
* layout/integration/inline/InlineIteratorBoxModernPath.h:
(WebCore::InlineIterator::BoxModernPath::atEnd const):
If the layout goes away we are "at end", avoiding hitting null pointers.
* layout/integration/inline/InlineIteratorLineBoxModernPath.h:
(WebCore::InlineIterator::LineBoxIteratorModernPath::atEnd const):
* layout/integration/inline/LayoutIntegrationInlineContent.cpp:
(WebCore::LayoutIntegration::InlineContent::~InlineContent):
(WebCore::LayoutIntegration::InlineContent::clearAndDetach): Deleted.
No need for "detached" state, InlineContent is simply deleted.
* layout/integration/inline/LayoutIntegrationInlineContent.h:
RefCounted -> CanMakeWeakPtr
(WebCore::LayoutIntegration::InlineContent::create): Deleted.
* layout/integration/inline/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::adjustForPagination):
(WebCore::LayoutIntegration::LineLayout::ensureInlineContent):
(WebCore::LayoutIntegration::LineLayout::clearInlineContent):
* layout/integration/inline/LayoutIntegrationLineLayout.h:
* layout/integration/inline/LayoutIntegrationPagination.cpp:
(WebCore::LayoutIntegration::makeAdjustedContent):
(WebCore::LayoutIntegration::adjustLinePositionsForPagination):
* layout/integration/inline/LayoutIntegrationPagination.h:
2022-04-19 Chris Dumez <cdumez@apple.com>
Introduce makeAtomString()
https://bugs.webkit.org/show_bug.cgi?id=239464
Reviewed by Sam Weinig.
Adopt makeAtomString() in a few places where it is useful.
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::insertPhoneNumberLink):
* page/FrameTree.cpp:
(WebCore::FrameTree::generateUniqueName const):
* svg/SVGLengthValue.cpp:
(WebCore::SVGLengthValue::valueAsAtomString const):
2022-04-19 Joseph Griego <jgriego@igalia.com>
Fix runtime expose scope check for shadow realms
https://bugs.webkit.org/show_bug.cgi?id=238381
Reviewed by Darin Adler.
Because shadow realms re-use their incubating realm's execution context
it doesn't make sense to check the `is${expose_scope}GlobalScope`
methods on `ScriptExecutionContext` anymore--instead, we'll use the type
information on the `JSGlobalScope` wrapper
This is at least justified in part by the fact that
`JSDOMGlobalObject#scriptExecutionContext` already does this internally
today to actually fetch the execution context, so, we can at least be
assured that this behaves the same way.
Some global scopes (notably, here, `AudioWorklet`) do not have distinct
wrapper types so we need to add a side condition to the generated code,
which we do after the type check.
Also removes `ScriptExecutionContext::isShadowRealmGlobalScope` as it's
now dead code and was never overridden anyways (a mistake left over
from the initial integration)
Tests: idlharness tests, including fixed visibility of
`AbortController.timeout`
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateRuntimeEnableConditionalStringForExposeScope):
* bindings/scripts/test/JS/JSExposedStar.cpp:
(WebCore::JSExposedStarPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestDefaultToJSONFilteredByExposed.cpp:
(WebCore::JSTestDefaultToJSONFilteredByExposedPrototype::finishCreation):
(WebCore::jsTestDefaultToJSONFilteredByExposedPrototypeFunction_toJSONBody):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjPrototype::finishCreation):
* dom/ScriptExecutionContext.h:
(WebCore::ScriptExecutionContext::isServiceWorkerGlobalScope const):
(WebCore::ScriptExecutionContext::isShadowRealmGlobalScope const): Deleted.
2022-04-16 Philippe Normand <pnormand@igalia.com>
[GStreamer][WebRTC] Minor cleanup in IncomingSourceGStreamer
https://bugs.webkit.org/show_bug.cgi?id=239417
Reviewed by Xabier Rodriguez-Calvar.
* platform/mediastream/gstreamer/RealtimeIncomingSourceGStreamer.cpp: Remove un-needed include.
(WebCore::RealtimeIncomingSourceGStreamer::registerClient): Minor optimization, create
string only for GStreamer builds enabling debug support.
2022-04-19 Philippe Normand <pnormand@igalia.com>
[GStreamer] Runtime warning when the player configures the avdec AV1 decoder
https://bugs.webkit.org/show_bug.cgi?id=238991
Reviewed by Xabier Rodriguez-Calvar.
Not all libav GStreamer decoders have a max-threads property, the AV1 decoder for instance
does not. So we need to check the property is present before attempting to set it, in order
to avoid runtime warnings.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::configureVideoDecoder):
2022-04-19 Tim Nguyen <ntim@apple.com>
Clean up Element::isFocusableWithoutResolvingFullStyle()
https://bugs.webkit.org/show_bug.cgi?id=239028
Reviewed by Antti Koivisto.
* dom/Element.cpp:
(WebCore::Element::isFocusableWithoutResolvingFullStyle const):
2022-04-18 Zan Dobersek <zdobersek@igalia.com>
Remove the PlatformMediaEngineClassName macro
https://bugs.webkit.org/show_bug.cgi?id=239384
Reviewed by Philippe Normand.
Remove the PlatformMediaEngineClassName macro used in the MediaPlayer
implementation file. It's only used for two media engines.
For GStreamer, the code can be simplified and grouped under a single
if-block. For USE_MEDIA_FOUNDATION, the relevant call can similarly be
guarded by the corresponding build guards.
* platform/graphics/MediaPlayer.cpp:
(WebCore::WTF_REQUIRES_LOCK):
2022-04-18 Tyler Wilcock <tyler_w@apple.com>
AX: Update the isolated tree in response to AXElementBusyChanged and AXTextChanged notifications
https://bugs.webkit.org/show_bug.cgi?id=239434
Reviewed by Chris Fleizach.
We need to update the isolated tree in response to these notifications.
This patch also makes AccessibilityNodeObjects (e.g. for display:contents elements)
properly report AXCoreObject::isBusy by moving AccessibilityRenderObject's implementation
to AccessibilityNodeObject. This also required AccessibilityRenderObject::elementAttributeValue
to move as well.
Tests: accessibility/text-updates-after-dynamic-change.html
accessibility/aria-busy-updates-after-dynamic-change.html
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::updateIsolatedTree):
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::isBusy const):
Moved from AccessibilityRenderObject.
(WebCore::AccessibilityNodeObject::elementAttributeValue const):
Moved from AccessibilityRenderObject.
* accessibility/AccessibilityNodeObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::setElementAttributeValue):
Delete this method as it was unused.
(WebCore::AccessibilityRenderObject::elementAttributeValue const):
Moved to AccessibilityNodeObject.
(WebCore::AccessibilityRenderObject::isBusy const):
Moved to AccessibilityNodeObject.
* accessibility/AccessibilityRenderObject.h:
2022-04-18 Alex Christensen <achristensen@webkit.org>
Implement CSSTransformValue.is2D
https://bugs.webkit.org/show_bug.cgi?id=239462
Reviewed by Simon Fraser.
This is an off-by-default feature.
Covered by WPT tests.
* bindings/js/JSCSSTransformComponentCustom.cpp:
(WebCore::toJSNewlyCreated):
* css/typedom/CSSNumericValue.cpp:
(WebCore::CSSNumericValue::rectifyNumberish):
* css/typedom/CSSNumericValue.h:
* css/typedom/numeric/CSSNumericType.h:
(WebCore::CSSNumericType::valueForType const):
(WebCore::CSSNumericType::nonZeroEntryCount const):
(WebCore::CSSNumericType::matches const):
(WebCore::CSSNumericType::matchesNumber const):
* css/typedom/transform/CSSMatrixComponent.cpp:
(WebCore::CSSMatrixComponent::create):
(WebCore::CSSMatrixComponent::CSSMatrixComponent):
* css/typedom/transform/CSSMatrixComponent.h:
(WebCore::CSSMatrixComponent::create): Deleted.
* css/typedom/transform/CSSMatrixComponent.idl:
* css/typedom/transform/CSSRotate.cpp:
(WebCore::CSSRotate::create):
(WebCore::CSSRotate::CSSRotate):
(WebCore::CSSRotate::setX):
(WebCore::CSSRotate::setY):
(WebCore::CSSRotate::setZ):
(WebCore::CSSRotate::setAngle):
* css/typedom/transform/CSSRotate.h:
(WebCore::CSSRotate::x):
(WebCore::CSSRotate::y):
(WebCore::CSSRotate::z):
(WebCore::CSSRotate::setX): Deleted.
(WebCore::CSSRotate::setY): Deleted.
(WebCore::CSSRotate::setZ): Deleted.
(WebCore::CSSRotate::setAngle): Deleted.
* css/typedom/transform/CSSScale.cpp:
(WebCore::CSSScale::create):
(WebCore::CSSScale::CSSScale):
* css/typedom/transform/CSSScale.h:
(WebCore::CSSScale::x const):
(WebCore::CSSScale::y const):
(WebCore::CSSScale::z const):
(WebCore::CSSScale::x): Deleted.
(WebCore::CSSScale::y): Deleted.
(WebCore::CSSScale::z): Deleted.
* css/typedom/transform/CSSTransformComponent.cpp:
(WebCore::CSSTransformComponent::toString const):
(WebCore::CSSTransformComponent::toMatrix): Deleted.
* css/typedom/transform/CSSTransformComponent.h:
(WebCore::CSSTransformComponent::CSSTransformComponent):
(WebCore::CSSTransformComponent::getType const): Deleted.
* css/typedom/transform/CSSTransformValue.cpp:
(WebCore::CSSTransformValue::create):
(WebCore::CSSTransformValue::setItem):
(WebCore::CSSTransformValue::is2D const):
(WebCore::CSSTransformValue::setIs2D): Deleted.
* css/typedom/transform/CSSTransformValue.h:
* css/typedom/transform/CSSTranslate.h:
2022-04-18 Chris Dumez <cdumez@apple.com>
Use convertToASCIILowercase() less and more SortedArrayMap / SortedArraySet
https://bugs.webkit.org/show_bug.cgi?id=239453
Reviewed by Darin Adler.
* Modules/applicationmanifest/ApplicationManifestParser.cpp:
(WebCore::ApplicationManifestParser::parseDisplay):
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::supportsType):
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::isUnsupportedMIMEType):
* platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm:
(WebCore::AVAssetMIMETypeCache::isUnsupportedContainerType):
2022-04-18 Matt Woodrow <mattwoodrow@apple.com>
Implement support for aligning baselines through subgrids
https://bugs.webkit.org/show_bug.cgi?id=238643
Reviewed by Javier Fernandez.
Implement baseline sharing recursion into subgrids
Tests: imported/w3c/web-platform-tests/css/css-grid/subgrid/baseline-002.html
imported/w3c/web-platform-tests/css/css-grid/subgrid/baseline-003.html
imported/w3c/web-platform-tests/css/css-grid/subgrid/baseline-004.html
imported/w3c/web-platform-tests/css/css-grid/subgrid/baseline-005.html
* rendering/GridBaselineAlignment.cpp:
(WebCore::GridBaselineAlignment::ascentForChild const):
(WebCore::GridBaselineAlignment::descentForChild const):
(WebCore::GridBaselineAlignment::updateBaselineAlignmentContext):
(WebCore::BaselineGroup::BaselineGroup):
(WebCore::BaselineGroup::update):
(WebCore::BaselineContext::BaselineContext):
(WebCore::BaselineContext::updateSharedGroup):
* rendering/GridBaselineAlignment.h:
(WebCore::BaselineGroup::maxAscent const):
(WebCore::BaselineGroup::maxDescent const): Deleted.
* rendering/GridLayoutFunctions.h:
* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrackSizingAlgorithm::canParticipateInBaselineAlignment const):
(WebCore::GridTrackSizingAlgorithm::updateBaselineAlignmentContext):
(WebCore::GridTrackSizingAlgorithm::baselineOffsetForChild const):
(WebCore::GridTrackSizingAlgorithm::cacheBaselineAlignedItem):
* rendering/GridTrackSizingAlgorithm.h:
* rendering/RenderGrid.cpp:
(WebCore::cacheBaselineAlignedChildren):
(WebCore::RenderGrid::computeIntrinsicLogicalWidths const):
(WebCore::RenderGrid::performGridItemsPreLayout const):
(WebCore::RenderGrid::alignSelfForChild const):
(WebCore::RenderGrid::justifySelfForChild const):
(WebCore::RenderGrid::columnAxisBaselineOffsetForChild const):
(WebCore::RenderGrid::rowAxisBaselineOffsetForChild const):
Moves the code for collecting baseline aligned children into a shared helper function, and adds
support for recursing into subgrid children (restricted to the axes that subgrid was applied).
Fixes align/justifySelfForChild to check if the child is a subgrid and overrides the result to 'stretch', so
that we're correctly stretching subgrids, not the children of subgrids (covered by new tests).
2022-04-18 Tyler Wilcock <tyler_w@apple.com>
Node changes created by AXIsolatedTree::updateNode are overwritten when performed during AXIsolatedTree::collectNodeChangesForSubtree
https://bugs.webkit.org/show_bug.cgi?id=239398
Reviewed by Andres Gonzalez.
We currently do the wrong thing in this scenario:
1. A dynamic page change causes an element to be included on the page, so we
create a node change for it and its subtree by calling collectNodeChangesForSubtree.
This causes a call to children() on the live object.
2. In the process of (or after) updating the children of the live object, we perform some
operation that triggers AXIsolatedTree::updateNode on said object. AccessibilityRenderObject::updateRoleAfterChildrenCreation
would be an example of this if it were properly coded to update the isolated tree if
the object's role changes (I'll address that in a separate patch). updateNode results
in a node change with the correct properties being added to m_pendingAppends.
3. collectNodeChangesForSubtree (started in step 1) finishes, and queues a node change
for the same object, but with the wrong properties (because it was created before step 2).
Because it comes after the node change added in step 2 to m_pendingAppends, it wins,
and we add an object with the wrong properties to the tree.
This patch fixes this with a new AXIsolatedTree::m_unresolvedPendingAppends member
variable. This is a HashMap with an AXID key, representing the object to create a node
change for. Now, both collectNodeChangesForSubtree and updateNode will add an entry
to this HashMap, allowing it to be resolved it (i.e. by creating the node change) at a later time.
This is both more correct (as it prevents any ordering bugs entirely), and more
efficient, because we now never create multiple node changes for the same object.
This patch also necessitated other code cleanup items:
- m_unresolvedPendingAppends allows us to remove the `idsBeingChanged` parameter
we passed to several functions since this member variable does the same thing.
- m_pendingNodeRemovals has been deleted. The only thing adding to this was
AXIsolatedTree::updateNode, and it did so unnecessarily, since we already handle
the case where we are replacing an existing object when proessing m_pendingAppends.
This patch also fixes an issue found by Andres Gonzalez in https://bugs.webkit.org/show_bug.cgi?id=239402.
AXIsolatedTree::updateNode should not immediately attach the wrapper to the new object on the main thread
since it could be in use on the AX thread. To make this more clear, the `attachWrapper` parameter has been
changed from a bool to an enum called AttachWrapper with values `OnMainThread` and `OnAXThread`.
Fixes six tests in isolated tree mode:
- accessibility/aria-labelledby-overrides-label.html
- accessibility/aria-role-on-label.html
- accessibility/mac/label-element-all-text-string-value.html
- accessibility/mac/label-element-with-hidden-control.html
- accessibility/mac/label-element-all-text-string-value.html
- accessibility/mac/slider-allows-title-ui-element.html
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::treeData):
* accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::create):
(WebCore::AXIsolatedTree::generateSubtree):
(WebCore::AXIsolatedTree::nodeChangeForObject):
(WebCore::AXIsolatedTree::queueRemovals):
Added. Allows you to queue objects for removal from contexts where you
don't already hold a lock.
(WebCore::AXIsolatedTree::queueRemovalsLocked):
Added. Allows you to queue objects for removal from contexts where you
already hold a lock.
(WebCore::AXIsolatedTree::queueRemovalsAndUnresolvedChanges):
Added. Replaces AXIsolatedTree::queueChangesAndRemovals.
(WebCore::AXIsolatedTree::collectNodeChangesForSubtree):
(WebCore::AXIsolatedTree::updateNode):
(WebCore::AXIsolatedTree::updateChildren):
(WebCore::AXIsolatedTree::removeNode):
(WebCore::AXIsolatedTree::removeSubtreeFromNodeMap):
(WebCore::AXIsolatedTree::applyPendingChanges):
Change local variable name from object to existingObject as this makes
the code much more clear.
* accessibility/isolatedtree/AXIsolatedTree.h:
(WebCore::AXIsolatedTree::queueChangesAndRemovals): Deleted.
2022-04-18 Chris Dumez <cdumez@apple.com>
Optimize nodeHasRole()
https://bugs.webkit.org/show_bug.cgi?id=239430
<rdar://problem/91857547>
Reviewed by Darin Adler.
Optimize nodeHasRole() by calling spaceSplitStringContainsValue() instead of constructing a
SpaceSplitString (which is expensive simply for looking for a single value). Also take a
StringView in parameter to avoid constructing a String unnecessarily (most call sites pass
an ASCIILiteral).
* accessibility/AXObjectCache.cpp:
(WebCore::nodeHasRole):
* accessibility/AXObjectCache.h:
(WebCore::nodeHasRole):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::elementsFromAttribute const):
(WebCore::AccessibilityObject::ariaElementsReferencedByAttribute const):
* dom/ClassCollection.h:
(WebCore::ClassCollection::ClassCollection):
* dom/Element.cpp:
(WebCore::Element::classAttributeChanged):
(WebCore::Element::partAttributeChanged):
* dom/SpaceSplitString.cpp:
(WebCore::SpaceSplitString::set):
(WebCore::SpaceSplitString::spaceSplitStringContainsValue):
* dom/SpaceSplitString.h:
(WebCore::SpaceSplitString::SpaceSplitString):
* html/Autofill.cpp:
(WebCore::AutofillData::createFromHTMLFormControlElement):
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::parseAttribute):
(WebCore::HTMLAnchorElement::sendPings):
* inspector/InspectorAuditAccessibilityObject.cpp:
(WebCore::InspectorAuditAccessibilityObject::getComputedProperties):
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
* page/EventHandler.cpp:
(WebCore::findDropZone):
2022-04-18 Chris Dumez <cdumez@apple.com>
Use AtomString as early as possible when string will eventually get atomized
https://bugs.webkit.org/show_bug.cgi?id=239427
Reviewed by Darin Adler.
* css/StyleProperties.cpp:
(WebCore::StyleProperties::asText const):
(WebCore::StyleProperties::asTextAtom const):
(WebCore::StyleProperties::asTextInternal const):
* css/StyleProperties.h:
* dom/DOMStringMap.idl:
* dom/DatasetDOMStringMap.cpp:
(WebCore::DatasetDOMStringMap::setNamedItem):
* dom/DatasetDOMStringMap.h:
* dom/Document.cpp:
(WebCore::Document::createAttribute):
(WebCore::Document::createAttributeNS):
* dom/ElementContentEditable.idl:
* dom/StyledElement.cpp:
(WebCore::StyledElement::synchronizeStyleAttributeInternalImpl):
(WebCore::StyledElement::invalidateStyleAttribute):
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
(WebCore::ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock):
(WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
(WebCore::ApplyStyleCommand::removeCSSStyle):
(WebCore::ApplyStyleCommand::applyInlineStyleToPushDown):
(WebCore::ApplyStyleCommand::applyInlineStyleChange):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplacementFragment::ReplacementFragment):
(WebCore::ReplaceSelectionCommand::inverseTransformColor):
(WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
(WebCore::ReplaceSelectionCommand::handleStyleSpans):
* html/DOMTokenList.cpp:
(WebCore::tokenContainsHTMLSpace):
(WebCore::DOMTokenList::validateToken):
(WebCore::DOMTokenList::validateTokens):
(WebCore::DOMTokenList::addInternal):
(WebCore::DOMTokenList::add):
(WebCore::DOMTokenList::removeInternal):
(WebCore::DOMTokenList::remove):
(WebCore::DOMTokenList::setValue):
* html/DOMTokenList.h:
* html/DOMTokenList.idl:
* html/FileInputType.cpp:
(WebCore::UploadButtonElement::createInternal):
* html/HTMLButtonElement.cpp:
(WebCore::HTMLButtonElement::formControlType const):
* html/HTMLButtonElement.idl:
* html/HTMLElement.cpp:
(WebCore::HTMLElement::setEnterKeyHint):
* html/HTMLElement.h:
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::setFormEnctype):
(WebCore::HTMLFormControlElement::setFormMethod):
(WebCore::HTMLFormControlElement::setAutocomplete):
* html/HTMLFormControlElement.h:
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::setAction):
(WebCore::HTMLFormElement::setEnctype):
(WebCore::HTMLFormElement::setMethod):
* html/HTMLFormElement.h:
* html/HTMLFormElement.idl:
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setSrc):
(WebCore::HTMLImageElement::setDecoding):
* html/HTMLImageElement.h:
* html/HTMLImageElement.idl:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::defaultValue const):
(WebCore::HTMLInputElement::setDefaultValue):
* html/HTMLInputElement.h:
* html/HTMLInputElement.idl:
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::createForLegacyFactoryFunction):
(WebCore::HTMLOptionElement::setValue):
(WebCore::HTMLOptionElement::setLabel):
* html/HTMLOptionElement.h:
* html/HTMLOptionElement.idl:
* html/InputTypeNames.cpp:
(WebCore::InputTypeNames::button):
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::createAutoFillButton):
* html/shadow/TextControlInnerElements.cpp:
(WebCore::SearchFieldCancelButtonElement::create):
* page/Frame.h:
* page/ios/FrameIOS.mm:
(WebCore::Frame::initWithSimpleHTMLDocument):
* svg/SVGLengthValue.cpp:
(WebCore::SVGLengthValue::valueAsAtomString const):
* svg/SVGLengthValue.h:
* svg/SVGMarkerElement.cpp:
(WebCore::SVGMarkerElement::orient const):
(WebCore::SVGMarkerElement::setOrient):
* svg/SVGMarkerElement.h:
* svg/SVGMarkerElement.idl:
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::transferSizeAttributesToTargetClone const):
2022-04-18 Elliott Williams <emw@apple.com>
[XCBuild] Use XCBuild for all command-line and project builds
https://bugs.webkit.org/show_bug.cgi?id=238916
Reviewed by Alexey Proskuryakov.
* WebCore.xcodeproj/project.pbxproj:
2022-04-18 Alan Bujtas <zalan@apple.com>
[IFC][Integration] Move inline integration under layout/integration/inline
https://bugs.webkit.org/show_bug.cgi?id=239441
Reviewed by Antti Koivisto.
This is in preparation for implementing additional integrated FCs.
* CMakeLists.txt:
* Headers.cmake:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/integration/inline/InlineIteratorBox.cpp: Renamed from Source/WebCore/layout/integration/InlineIteratorBox.cpp.
(WebCore::InlineIterator::BoxIterator::BoxIterator):
(WebCore::InlineIterator::BoxIterator::operator== const):
(WebCore::InlineIterator::BoxIterator::atEnd const):
(WebCore::InlineIterator::Box::nextOnLine const):
(WebCore::InlineIterator::Box::previousOnLine const):
(WebCore::InlineIterator::Box::nextOnLineIgnoringLineBreak const):
(WebCore::InlineIterator::Box::previousOnLineIgnoringLineBreak const):
(WebCore::InlineIterator::Box::lineBox const):
(WebCore::InlineIterator::Box::style const):
(WebCore::InlineIterator::Box::selectionState const):
(WebCore::InlineIterator::LeafBoxIterator::LeafBoxIterator):
(WebCore::InlineIterator::LeafBoxIterator::traverseNextOnLine):
(WebCore::InlineIterator::LeafBoxIterator::traversePreviousOnLine):
(WebCore::InlineIterator::LeafBoxIterator::traverseNextOnLineIgnoringLineBreak):
(WebCore::InlineIterator::LeafBoxIterator::traversePreviousOnLineIgnoringLineBreak):
(WebCore::InlineIterator::boxFor):
(WebCore::InlineIterator::Box::modernPath const):
(WebCore::InlineIterator::Box::legacyPath const):
* layout/integration/inline/InlineIteratorBox.h: Renamed from Source/WebCore/layout/integration/InlineIteratorBox.h.
(WebCore::InlineIterator::Box::logicalTop const):
(WebCore::InlineIterator::Box::logicalBottom const):
(WebCore::InlineIterator::Box::logicalLeft const):
(WebCore::InlineIterator::Box::logicalRight const):
(WebCore::InlineIterator::Box::logicalWidth const):
(WebCore::InlineIterator::Box::logicalHeight const):
(WebCore::InlineIterator::Box::leftmostCaretOffset const):
(WebCore::InlineIterator::Box::rightmostCaretOffset const):
(WebCore::InlineIterator::Box::direction const):
(WebCore::InlineIterator::Box::isLeftToRightDirection const):
(WebCore::InlineIterator::BoxIterator::operator bool const):
(WebCore::InlineIterator::BoxIterator::operator!= const):
(WebCore::InlineIterator::BoxIterator::operator== const):
(WebCore::InlineIterator::BoxIterator::operator* const):
(WebCore::InlineIterator::BoxIterator::operator-> const):
(WebCore::InlineIterator::BoxIterator::BoxIterator):
(WebCore::InlineIterator::Box::Box):
(WebCore::InlineIterator::Box::isText const):
(WebCore::InlineIterator::Box::isInlineBox const):
(WebCore::InlineIterator::Box::isRootInlineBox const):
(WebCore::InlineIterator::Box::visualRect const):
(WebCore::InlineIterator::Box::visualRectIgnoringBlockDirection const):
(WebCore::InlineIterator::Box::isHorizontal const):
(WebCore::InlineIterator::Box::isLineBreak const):
(WebCore::InlineIterator::Box::minimumCaretOffset const):
(WebCore::InlineIterator::Box::maximumCaretOffset const):
(WebCore::InlineIterator::Box::bidiLevel const):
(WebCore::InlineIterator::Box::renderer const):
(WebCore::InlineIterator::Box::legacyInlineBox const):
(WebCore::InlineIterator::Box::inlineBox const):
* layout/integration/inline/InlineIteratorBoxLegacyPath.h: Renamed from Source/WebCore/layout/integration/InlineIteratorBoxLegacyPath.h.
(WebCore::InlineIterator::BoxLegacyPath::BoxLegacyPath):
(WebCore::InlineIterator::BoxLegacyPath::isText const):
(WebCore::InlineIterator::BoxLegacyPath::isInlineBox const):
(WebCore::InlineIterator::BoxLegacyPath::isRootInlineBox const):
(WebCore::InlineIterator::BoxLegacyPath::visualRectIgnoringBlockDirection const):
(WebCore::InlineIterator::BoxLegacyPath::isHorizontal const):
(WebCore::InlineIterator::BoxLegacyPath::isLineBreak const):
(WebCore::InlineIterator::BoxLegacyPath::minimumCaretOffset const):
(WebCore::InlineIterator::BoxLegacyPath::maximumCaretOffset const):
(WebCore::InlineIterator::BoxLegacyPath::bidiLevel const):
(WebCore::InlineIterator::BoxLegacyPath::hasHyphen const):
(WebCore::InlineIterator::BoxLegacyPath::text const):
(WebCore::InlineIterator::BoxLegacyPath::start const):
(WebCore::InlineIterator::BoxLegacyPath::end const):
(WebCore::InlineIterator::BoxLegacyPath::length const):
(WebCore::InlineIterator::BoxLegacyPath::selectableRange const):
(WebCore::InlineIterator::BoxLegacyPath::createTextRun const):
(WebCore::InlineIterator::BoxLegacyPath::renderer const):
(WebCore::InlineIterator::BoxLegacyPath::traverseNextTextBox):
(WebCore::InlineIterator::BoxLegacyPath::traverseNextOnLine):
(WebCore::InlineIterator::BoxLegacyPath::traversePreviousOnLine):
(WebCore::InlineIterator::BoxLegacyPath::traverseNextInlineBox):
(WebCore::InlineIterator::BoxLegacyPath::traversePreviousInlineBox):
(WebCore::InlineIterator::BoxLegacyPath::firstLeafBoxForInlineBox const):
(WebCore::InlineIterator::BoxLegacyPath::lastLeafBoxForInlineBox const):
(WebCore::InlineIterator::BoxLegacyPath::operator== const):
(WebCore::InlineIterator::BoxLegacyPath::atEnd const):
(WebCore::InlineIterator::BoxLegacyPath::legacyInlineBox const):
(WebCore::InlineIterator::BoxLegacyPath::rootInlineBox const):
(WebCore::InlineIterator::BoxLegacyPath::inlineTextBox const):
(WebCore::InlineIterator::BoxLegacyPath::inlineFlowBox const):
* layout/integration/inline/InlineIteratorBoxModernPath.h: Renamed from Source/WebCore/layout/integration/InlineIteratorBoxModernPath.h.
(WebCore::InlineIterator::BoxModernPath::BoxModernPath):
(WebCore::InlineIterator::BoxModernPath::isText const):
(WebCore::InlineIterator::BoxModernPath::isInlineBox const):
(WebCore::InlineIterator::BoxModernPath::isRootInlineBox const):
(WebCore::InlineIterator::BoxModernPath::visualRectIgnoringBlockDirection const):
(WebCore::InlineIterator::BoxModernPath::isHorizontal const):
(WebCore::InlineIterator::BoxModernPath::isLineBreak const):
(WebCore::InlineIterator::BoxModernPath::minimumCaretOffset const):
(WebCore::InlineIterator::BoxModernPath::maximumCaretOffset const):
(WebCore::InlineIterator::BoxModernPath::bidiLevel const):
(WebCore::InlineIterator::BoxModernPath::hasHyphen const):
(WebCore::InlineIterator::BoxModernPath::text const):
(WebCore::InlineIterator::BoxModernPath::start const):
(WebCore::InlineIterator::BoxModernPath::end const):
(WebCore::InlineIterator::BoxModernPath::length const):
(WebCore::InlineIterator::BoxModernPath::selectableRange const):
(WebCore::InlineIterator::BoxModernPath::createTextRun const):
(WebCore::InlineIterator::BoxModernPath::renderer const):
(WebCore::InlineIterator::BoxModernPath::traverseNextTextBox):
(WebCore::InlineIterator::BoxModernPath::traverseNextOnLine):
(WebCore::InlineIterator::BoxModernPath::traversePreviousOnLine):
(WebCore::InlineIterator::BoxModernPath::traverseNextInlineBox):
(WebCore::InlineIterator::BoxModernPath::traversePreviousInlineBox):
(WebCore::InlineIterator::BoxModernPath::firstLeafBoxForInlineBox const):
(WebCore::InlineIterator::BoxModernPath::lastLeafBoxForInlineBox const):
(WebCore::InlineIterator::BoxModernPath::operator== const):
(WebCore::InlineIterator::BoxModernPath::atEnd const):
(WebCore::InlineIterator::BoxModernPath::box const):
(WebCore::InlineIterator::BoxModernPath::inlineContent const):
(WebCore::InlineIterator::BoxModernPath::isWithinInlineBox):
(WebCore::InlineIterator::BoxModernPath::traverseNextBox):
(WebCore::InlineIterator::BoxModernPath::traversePreviousBox):
(WebCore::InlineIterator::BoxModernPath::traverseNextLeaf):
(WebCore::InlineIterator::BoxModernPath::traversePreviousLeaf):
(WebCore::InlineIterator::BoxModernPath::traverseNextWithSameLayoutBox):
(WebCore::InlineIterator::BoxModernPath::traversePreviousWithSameLayoutBox):
(WebCore::InlineIterator::BoxModernPath::setAtEnd):
(WebCore::InlineIterator::BoxModernPath::boxes const):
(WebCore::InlineIterator::BoxModernPath::line const):
(WebCore::InlineIterator::BoxModernPath::renderText const):
(WebCore::InlineIterator::BoxModernPath::direction const):
* layout/integration/inline/InlineIteratorInlineBox.cpp: Renamed from Source/WebCore/layout/integration/InlineIteratorInlineBox.cpp.
(WebCore::InlineIterator::InlineBox::InlineBox):
(WebCore::InlineIterator::InlineBox::hasClosedLeftAndRightEdge const):
(WebCore::InlineIterator::InlineBox::nextInlineBox const):
(WebCore::InlineIterator::InlineBox::previousInlineBox const):
(WebCore::InlineIterator::InlineBox::firstLeafBox const):
(WebCore::InlineIterator::InlineBox::lastLeafBox const):
(WebCore::InlineIterator::InlineBox::endLeafBox const):
(WebCore::InlineIterator::InlineBoxIterator::InlineBoxIterator):
(WebCore::InlineIterator::InlineBoxIterator::traverseNextInlineBox):
(WebCore::InlineIterator::InlineBoxIterator::traversePreviousInlineBox):
(WebCore::InlineIterator::firstInlineBoxFor):
(WebCore::InlineIterator::firstRootInlineBoxFor):
(WebCore::InlineIterator::inlineBoxFor):
* layout/integration/inline/InlineIteratorInlineBox.h: Renamed from Source/WebCore/layout/integration/InlineIteratorInlineBox.h.
(WebCore::InlineIterator::InlineBox::renderer const):
(WebCore::InlineIterator::InlineBox::legacyInlineBox const):
(WebCore::InlineIterator::InlineBoxIterator::InlineBoxIterator):
(WebCore::InlineIterator::InlineBoxIterator::operator* const):
(WebCore::InlineIterator::InlineBoxIterator::operator-> const):
(WebCore::InlineIterator::InlineBoxIterator::get const):
(WebCore::InlineIterator::InlineBox::iterator const):
(isType):
* layout/integration/inline/InlineIteratorLineBox.cpp: Renamed from Source/WebCore/layout/integration/InlineIteratorLineBox.cpp.
(WebCore::InlineIterator::LineBoxIterator::LineBoxIterator):
(WebCore::InlineIterator::LineBoxIterator::atEnd const):
(WebCore::InlineIterator::LineBoxIterator::traverseNext):
(WebCore::InlineIterator::LineBoxIterator::traversePrevious):
(WebCore::InlineIterator::LineBoxIterator::operator== const):
(WebCore::InlineIterator::firstLineBoxFor):
(WebCore::InlineIterator::lastLineBoxFor):
(WebCore::InlineIterator::LineBox::next const):
(WebCore::InlineIterator::LineBox::previous const):
(WebCore::InlineIterator::LineBox::firstLeafBox const):
(WebCore::InlineIterator::LineBox::lastLeafBox const):
(WebCore::InlineIterator::closestBoxForHorizontalPosition):
* layout/integration/inline/InlineIteratorLineBox.h: Renamed from Source/WebCore/layout/integration/InlineIteratorLineBox.h.
(WebCore::InlineIterator::LineBox::height const):
(WebCore::InlineIterator::LineBoxIterator::LineBoxIterator):
(WebCore::InlineIterator::LineBoxIterator::operator++):
(WebCore::InlineIterator::LineBoxIterator::operator bool const):
(WebCore::InlineIterator::LineBoxIterator::operator!= const):
(WebCore::InlineIterator::LineBoxIterator::operator== const):
(WebCore::InlineIterator::LineBoxIterator::operator* const):
(WebCore::InlineIterator::LineBoxIterator::operator-> const):
(WebCore::InlineIterator::previousLineBoxContentBottomOrBorderAndPadding):
(WebCore::InlineIterator::contentStartInBlockDirection):
(WebCore::InlineIterator::LineBox::LineBox):
(WebCore::InlineIterator::LineBox::contentLogicalTop const):
(WebCore::InlineIterator::LineBox::contentLogicalBottom const):
(WebCore::InlineIterator::LineBox::contentLogicalTopAdjustedForPrecedingLineBox const):
(WebCore::InlineIterator::LineBox::contentLogicalBottomAdjustedForFollowingLineBox const):
(WebCore::InlineIterator::LineBox::top const):
(WebCore::InlineIterator::LineBox::bottom const):
(WebCore::InlineIterator::LineBox::inkOverflowTop const):
(WebCore::InlineIterator::LineBox::inkOverflowBottom const):
(WebCore::InlineIterator::LineBox::contentLogicalLeft const):
(WebCore::InlineIterator::LineBox::contentLogicalRight const):
(WebCore::InlineIterator::LineBox::contentLogicalWidth const):
(WebCore::InlineIterator::LineBox::isHorizontal const):
(WebCore::InlineIterator::LineBox::baselineType const):
(WebCore::InlineIterator::LineBox::containingBlock const):
(WebCore::InlineIterator::LineBox::containingFragment const):
(WebCore::InlineIterator::LineBox::isFirstAfterPageBreak const):
(WebCore::InlineIterator::LineBox::isFirst const):
* layout/integration/inline/InlineIteratorLineBoxLegacyPath.h: Renamed from Source/WebCore/layout/integration/InlineIteratorLineBoxLegacyPath.h.
(WebCore::InlineIterator::LineBoxIteratorLegacyPath::LineBoxIteratorLegacyPath):
(WebCore::InlineIterator::LineBoxIteratorLegacyPath::contentLogicalTop const):
(WebCore::InlineIterator::LineBoxIteratorLegacyPath::contentLogicalBottom const):
(WebCore::InlineIterator::LineBoxIteratorLegacyPath::contentLogicalTopAdjustedForPrecedingLineBox const):
(WebCore::InlineIterator::LineBoxIteratorLegacyPath::contentLogicalBottomAdjustedForFollowingLineBox const):
(WebCore::InlineIterator::LineBoxIteratorLegacyPath::top const):
(WebCore::InlineIterator::LineBoxIteratorLegacyPath::bottom const):
(WebCore::InlineIterator::LineBoxIteratorLegacyPath::inkOverflowTop const):
(WebCore::InlineIterator::LineBoxIteratorLegacyPath::inkOverflowBottom const):
(WebCore::InlineIterator::LineBoxIteratorLegacyPath::contentLogicalLeft const):
(WebCore::InlineIterator::LineBoxIteratorLegacyPath::contentLogicalRight const):
(WebCore::InlineIterator::LineBoxIteratorLegacyPath::isHorizontal const):
(WebCore::InlineIterator::LineBoxIteratorLegacyPath::baselineType const):
(WebCore::InlineIterator::LineBoxIteratorLegacyPath::containingBlock const):
(WebCore::InlineIterator::LineBoxIteratorLegacyPath::containingFragment const):
(WebCore::InlineIterator::LineBoxIteratorLegacyPath::isFirstAfterPageBreak const):
(WebCore::InlineIterator::LineBoxIteratorLegacyPath::traverseNext):
(WebCore::InlineIterator::LineBoxIteratorLegacyPath::traversePrevious):
(WebCore::InlineIterator::LineBoxIteratorLegacyPath::operator== const):
(WebCore::InlineIterator::LineBoxIteratorLegacyPath::atEnd const):
(WebCore::InlineIterator::LineBoxIteratorLegacyPath::firstLeafBox const):
(WebCore::InlineIterator::LineBoxIteratorLegacyPath::lastLeafBox const):
* layout/integration/inline/InlineIteratorLineBoxModernPath.h: Renamed from Source/WebCore/layout/integration/InlineIteratorLineBoxModernPath.h.
(WebCore::InlineIterator::LineBoxIteratorModernPath::LineBoxIteratorModernPath):
(WebCore::InlineIterator::LineBoxIteratorModernPath::contentLogicalTop const):
(WebCore::InlineIterator::LineBoxIteratorModernPath::contentLogicalBottom const):
(WebCore::InlineIterator::LineBoxIteratorModernPath::top const):
(WebCore::InlineIterator::LineBoxIteratorModernPath::bottom const):
(WebCore::InlineIterator::LineBoxIteratorModernPath::inkOverflowTop const):
(WebCore::InlineIterator::LineBoxIteratorModernPath::inkOverflowBottom const):
(WebCore::InlineIterator::LineBoxIteratorModernPath::contentLogicalTopAdjustedForPrecedingLineBox const):
(WebCore::InlineIterator::LineBoxIteratorModernPath::contentLogicalBottomAdjustedForFollowingLineBox const):
(WebCore::InlineIterator::LineBoxIteratorModernPath::contentLogicalLeft const):
(WebCore::InlineIterator::LineBoxIteratorModernPath::contentLogicalRight const):
(WebCore::InlineIterator::LineBoxIteratorModernPath::isHorizontal const):
(WebCore::InlineIterator::LineBoxIteratorModernPath::baselineType const):
(WebCore::InlineIterator::LineBoxIteratorModernPath::containingBlock const):
(WebCore::InlineIterator::LineBoxIteratorModernPath::containingFragment const):
(WebCore::InlineIterator::LineBoxIteratorModernPath::isFirstAfterPageBreak const):
(WebCore::InlineIterator::LineBoxIteratorModernPath::traverseNext):
(WebCore::InlineIterator::LineBoxIteratorModernPath::traversePrevious):
(WebCore::InlineIterator::LineBoxIteratorModernPath::operator== const):
(WebCore::InlineIterator::LineBoxIteratorModernPath::atEnd const):
(WebCore::InlineIterator::LineBoxIteratorModernPath::firstLeafBox const):
(WebCore::InlineIterator::LineBoxIteratorModernPath::lastLeafBox const):
(WebCore::InlineIterator::LineBoxIteratorModernPath::setAtEnd):
(WebCore::InlineIterator::LineBoxIteratorModernPath::lines const):
(WebCore::InlineIterator::LineBoxIteratorModernPath::line const):
* layout/integration/inline/InlineIteratorLogicalOrderTraversal.cpp: Renamed from Source/WebCore/layout/integration/InlineIteratorLogicalOrderTraversal.cpp.
(WebCore::InlineIterator::makeTextLogicalOrderCacheIfNeeded):
(WebCore::InlineIterator::updateTextLogicalOrderCacheIfNeeded):
(WebCore::InlineIterator::firstTextBoxInLogicalOrderFor):
(WebCore::InlineIterator::nextTextBoxInLogicalOrder):
(WebCore::InlineIterator::makeLineLogicalOrderCache):
(WebCore::InlineIterator::updateLineLogicalOrderCacheIfNeeded):
(WebCore::InlineIterator::firstLeafOnLineInLogicalOrder):
(WebCore::InlineIterator::lastLeafOnLineInLogicalOrder):
(WebCore::InlineIterator::nextLeafOnLineInLogicalOrder):
(WebCore::InlineIterator::previousLeafOnLineInLogicalOrder):
(WebCore::InlineIterator::firstLeafOnLineInLogicalOrderWithNode):
(WebCore::InlineIterator::lastLeafOnLineInLogicalOrderWithNode):
* layout/integration/inline/InlineIteratorLogicalOrderTraversal.h: Renamed from Source/WebCore/layout/integration/InlineIteratorLogicalOrderTraversal.h.
(WebCore::InlineIterator::leafBoxesInLogicalOrder):
* layout/integration/inline/InlineIteratorTextBox.cpp: Renamed from Source/WebCore/layout/integration/InlineIteratorTextBox.cpp.
(WebCore::InlineIterator::TextBox::nextTextBox const):
(WebCore::InlineIterator::TextBox::selectionRect const):
(WebCore::InlineIterator::TextBox::offsetForPosition const):
(WebCore::InlineIterator::TextBox::positionForOffset const):
(WebCore::InlineIterator::TextBox::isCombinedText const):
(WebCore::InlineIterator::TextBox::fontCascade const):
(WebCore::InlineIterator::TextBoxIterator::TextBoxIterator):
(WebCore::InlineIterator::TextBoxIterator::traverseNextTextBox):
(WebCore::InlineIterator::firstTextBoxFor):
(WebCore::InlineIterator::textBoxFor):
(WebCore::InlineIterator::textBoxesFor):
* layout/integration/inline/InlineIteratorTextBox.h: Renamed from Source/WebCore/layout/integration/InlineIteratorTextBox.h.
(WebCore::InlineIterator::TextBox::renderer const):
(WebCore::InlineIterator::TextBox::legacyInlineBox const):
(WebCore::InlineIterator::TextBoxIterator::TextBoxIterator):
(WebCore::InlineIterator::TextBoxIterator::operator++):
(WebCore::InlineIterator::TextBoxIterator::operator* const):
(WebCore::InlineIterator::TextBoxIterator::operator-> const):
(WebCore::InlineIterator::TextBoxIterator::get const):
(WebCore::InlineIterator::TextBoxRange::TextBoxRange):
(WebCore::InlineIterator::TextBoxRange::begin const):
(WebCore::InlineIterator::TextBoxRange::end const):
(WebCore::InlineIterator::TextBox::hasHyphen const):
(WebCore::InlineIterator::TextBox::TextBox):
(WebCore::InlineIterator::TextBox::text const):
(WebCore::InlineIterator::TextBox::start const):
(WebCore::InlineIterator::TextBox::end const):
(WebCore::InlineIterator::TextBox::length const):
(WebCore::InlineIterator::TextBox::selectableRange const):
(WebCore::InlineIterator::TextBox::createTextRun const):
(isType):
* layout/integration/inline/LayoutIntegrationInlineContent.cpp: Renamed from Source/WebCore/layout/integration/LayoutIntegrationInlineContent.cpp.
(WebCore::LayoutIntegration::InlineContent::InlineContent):
(WebCore::LayoutIntegration::InlineContent::hasContent const):
(WebCore::LayoutIntegration:: const):
(WebCore::LayoutIntegration::InlineContent::~InlineContent):
(WebCore::LayoutIntegration::InlineContent::rendererForLayoutBox const):
(WebCore::LayoutIntegration::InlineContent::containingBlock const):
(WebCore::LayoutIntegration::InlineContent::indexForBox const):
(WebCore::LayoutIntegration::InlineContent::firstBoxForLayoutBox const):
(WebCore::LayoutIntegration::InlineContent::firstBoxIndexForLayoutBox const):
(WebCore::LayoutIntegration::InlineContent::nonRootInlineBoxIndexesForLayoutBox const):
(WebCore::LayoutIntegration::InlineContent::clearAndDetach):
(WebCore::LayoutIntegration::InlineContent::releaseCaches):
(WebCore::LayoutIntegration::InlineContent::shrinkToFit):
* layout/integration/inline/LayoutIntegrationInlineContent.h: Renamed from Source/WebCore/layout/integration/LayoutIntegrationInlineContent.h.
(WebCore::LayoutIntegration::InlineContent::create):
(WebCore::LayoutIntegration::InlineContent::hasVisualOverflow const):
(WebCore::LayoutIntegration::InlineContent::setHasVisualOverflow):
(WebCore::LayoutIntegration::InlineContent::lineForBox const):
(WebCore::LayoutIntegration::InlineContent::lineLayout const):
(WebCore::LayoutIntegration::InlineContent::traverseNonRootInlineBoxes):
* layout/integration/inline/LayoutIntegrationInlineContentBuilder.cpp: Renamed from Source/WebCore/layout/integration/LayoutIntegrationInlineContentBuilder.cpp.
(WebCore::LayoutIntegration::operator+):
(WebCore::LayoutIntegration::lineOverflowLogicalWidth):
(WebCore::LayoutIntegration::InlineContentBuilder::InlineContentBuilder):
(WebCore::LayoutIntegration::InlineContentBuilder::build const):
(WebCore::LayoutIntegration::InlineContentBuilder::createDisplayLines const):
* layout/integration/inline/LayoutIntegrationInlineContentBuilder.h: Renamed from Source/WebCore/layout/integration/LayoutIntegrationInlineContentBuilder.h.
* layout/integration/inline/LayoutIntegrationLine.h: Renamed from Source/WebCore/layout/integration/LayoutIntegrationLine.h.
(WebCore::LayoutIntegration::Line::Line):
(WebCore::LayoutIntegration::Line::firstBoxIndex const):
(WebCore::LayoutIntegration::Line::boxCount const):
(WebCore::LayoutIntegration::Line::lineBoxTop const):
(WebCore::LayoutIntegration::Line::lineBoxBottom const):
(WebCore::LayoutIntegration::Line::lineBoxLeft const):
(WebCore::LayoutIntegration::Line::lineBoxRight const):
(WebCore::LayoutIntegration::Line::lineBoxHeight const):
(WebCore::LayoutIntegration::Line::lineBoxWidth const):
(WebCore::LayoutIntegration::Line::enclosingContentTop const):
(WebCore::LayoutIntegration::Line::enclosingContentBottom const):
(WebCore::LayoutIntegration::Line::scrollableOverflow const):
(WebCore::LayoutIntegration::Line::inkOverflow const):
(WebCore::LayoutIntegration::Line::baseline const):
(WebCore::LayoutIntegration::Line::baselineType const):
(WebCore::LayoutIntegration::Line::isHorizontal const):
(WebCore::LayoutIntegration::Line::contentLogicalOffset const):
(WebCore::LayoutIntegration::Line::contentLogicalWidth const):
* layout/integration/inline/LayoutIntegrationLineLayout.cpp: Renamed from Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp.
(WebCore::LayoutIntegration::LineLayout::LineLayout):
(WebCore::LayoutIntegration::LineLayout::~LineLayout):
(WebCore::LayoutIntegration::LineLayout::blockContainer):
(WebCore::LayoutIntegration::LineLayout::containing):
(WebCore::LayoutIntegration::LineLayout::isEnabled):
(WebCore::LayoutIntegration::LineLayout::canUseFor):
(WebCore::LayoutIntegration::LineLayout::canUseForAfterStyleChange):
(WebCore::LayoutIntegration::LineLayout::canUseForAfterInlineBoxStyleChange):
(WebCore::LayoutIntegration::LineLayout::shouldSwitchToLegacyOnInvalidation const):
(WebCore::LayoutIntegration::LineLayout::updateReplacedDimensions):
(WebCore::LayoutIntegration::LineLayout::updateInlineBlockDimensions):
(WebCore::LayoutIntegration::LineLayout::updateInlineTableDimensions):
(WebCore::LayoutIntegration::LineLayout::updateListItemDimensions):
(WebCore::LayoutIntegration::LineLayout::updateListMarkerDimensions):
(WebCore::LayoutIntegration::contentLogicalWidthForRenderer):
(WebCore::LayoutIntegration::contentLogicalHeightForRenderer):
(WebCore::LayoutIntegration::horizontalLogicalMargin):
(WebCore::LayoutIntegration::verticalLogicalMargin):
(WebCore::LayoutIntegration::logicalBorder):
(WebCore::LayoutIntegration::logicalPadding):
(WebCore::LayoutIntegration::LineLayout::updateLayoutBoxDimensions):
(WebCore::LayoutIntegration::LineLayout::updateLineBreakBoxDimensions):
(WebCore::LayoutIntegration::LineLayout::updateInlineBoxDimensions):
(WebCore::LayoutIntegration::LineLayout::updateStyle):
(WebCore::LayoutIntegration::LineLayout::computeIntrinsicWidthConstraints):
(WebCore::LayoutIntegration::LineLayout::layout):
(WebCore::LayoutIntegration::LineLayout::constructContent):
(WebCore::LayoutIntegration::LineLayout::updateFormattingRootGeometryAndInvalidate):
(WebCore::LayoutIntegration::LineLayout::prepareLayoutState):
(WebCore::LayoutIntegration::LineLayout::prepareFloatingState):
(WebCore::LayoutIntegration::LineLayout::contentLogicalHeight const):
(WebCore::LayoutIntegration::LineLayout::lineCount const):
(WebCore::LayoutIntegration::LineLayout::hasVisualOverflow const):
(WebCore::LayoutIntegration::LineLayout::firstLinePhysicalBaseline const):
(WebCore::LayoutIntegration::LineLayout::lastLineLogicalBaseline const):
(WebCore::LayoutIntegration::LineLayout::adjustForPagination):
(WebCore::LayoutIntegration::LineLayout::collectOverflow):
(WebCore::LayoutIntegration::LineLayout::ensureInlineContent):
(WebCore::LayoutIntegration::LineLayout::textBoxesFor const):
(WebCore::LayoutIntegration::LineLayout::boxFor const):
(WebCore::LayoutIntegration::LineLayout::firstInlineBoxFor const):
(WebCore::LayoutIntegration::LineLayout::firstRootInlineBox const):
(WebCore::LayoutIntegration::LineLayout::firstLineBox const):
(WebCore::LayoutIntegration::LineLayout::lastLineBox const):
(WebCore::LayoutIntegration::LineLayout::firstInlineBoxRect const):
(WebCore::LayoutIntegration::LineLayout::enclosingBorderBoxRectFor const):
(WebCore::LayoutIntegration::LineLayout::visualOverflowBoundingBoxRectFor const):
(WebCore::LayoutIntegration::LineLayout::collectInlineBoxRects const):
(WebCore::LayoutIntegration::LineLayout::rendererForLayoutBox const):
(WebCore::LayoutIntegration::LineLayout::rootLayoutBox const):
(WebCore::LayoutIntegration::LineLayout::rootLayoutBox):
(WebCore::LayoutIntegration::flippedContentOffsetIfNeeded):
(WebCore::LayoutIntegration::LineLayout::paint):
(WebCore::LayoutIntegration::flippedRectForWritingMode):
(WebCore::LayoutIntegration::LineLayout::hitTest):
(WebCore::LayoutIntegration::LineLayout::releaseCaches):
(WebCore::LayoutIntegration::LineLayout::clearInlineContent):
(WebCore::LayoutIntegration::LineLayout::ensureLineDamage):
(WebCore::LayoutIntegration::LineLayout::outputLineTree const):
* layout/integration/inline/LayoutIntegrationLineLayout.h: Renamed from Source/WebCore/layout/integration/LayoutIntegrationLineLayout.h.
(WebCore::LayoutIntegration::LineLayout::isPaginated const):
(WebCore::LayoutIntegration::LineLayout::flow const):
(WebCore::LayoutIntegration::LineLayout::flow):
* layout/integration/inline/LayoutIntegrationPagination.cpp: Renamed from Source/WebCore/layout/integration/LayoutIntegrationPagination.cpp.
(WebCore::LayoutIntegration::computeLineTopAndBottomWithOverflow):
(WebCore::LayoutIntegration::computeLineBreakIndex):
(WebCore::LayoutIntegration::computeOffsetAfterLineBreak):
(WebCore::LayoutIntegration::setPageBreakForLine):
(WebCore::LayoutIntegration::updateMinimumPageHeight):
(WebCore::LayoutIntegration::makeAdjustedContent):
(WebCore::LayoutIntegration::adjustLinePositionsForPagination):
* layout/integration/inline/LayoutIntegrationPagination.h: Renamed from Source/WebCore/layout/integration/LayoutIntegrationPagination.h.
* layout/integration/inline/LineSelection.h: Renamed from Source/WebCore/layout/integration/LineSelection.h.
(WebCore::LineSelection::logicalTop):
(WebCore::LineSelection::logicalBottom):
(WebCore::LineSelection::logicalRect):
(WebCore::LineSelection::physicalRect):
(WebCore::LineSelection::logicalTopAdjustedForPrecedingBlock):
(WebCore::LineSelection::selectionState):
2022-04-18 Carlos Alberto Lopez Perez <clopez@igalia.com>
[GTK][WPE] Build fix after r292951
https://bugs.webkit.org/show_bug.cgi?id=239426
Debug build was broken on GTK and WPE after r292951. Fix it.
Unreviewed build-fix.
No new tests, no change in behaviour.
* platform/network/MIMEHeader.cpp:
(WebCore::MIMEHeader::parseContentTransferEncoding):
2022-04-17 Chris Dumez <cdumez@apple.com>
Leverage StringView in more places
https://bugs.webkit.org/show_bug.cgi?id=239426
Reviewed by Sam Weinig.
Leverage StringView in more places, to reduce the number of String allocations.
* Modules/applicationmanifest/ApplicationManifestParser.cpp:
(WebCore::ApplicationManifestParser::parseDisplay):
(WebCore::ApplicationManifestParser::parseIcons):
* Modules/indexeddb/server/SQLiteIDBCursor.cpp:
(WebCore::IDBServer::SQLiteIDBCursor::createSQLiteStatement):
* Modules/indexeddb/server/SQLiteIDBCursor.h:
* Modules/webdatabase/Database.cpp:
(WebCore::setTextValueInDatabase):
(WebCore::retrieveTextResultFromDatabase):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
(appendStringToResult): Deleted.
(accessibleElementsForObjects): Deleted.
(rendererForView): Deleted.
* css/parser/MediaQueryParser.h:
(WebCore::MediaQueryParser::MediaQueryData::setMediaType):
* editing/Editor.cpp:
(WebCore::Editor::transpose):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::debugRenderer const):
* html/MediaFragmentURIParser.cpp:
(WebCore::collectFraction):
(WebCore::MediaFragmentURIParser::parseNPTTime):
* html/StepRange.cpp:
(WebCore::StepRange::parseStep):
* html/StepRange.h:
* html/parser/HTMLParserIdioms.cpp:
(WebCore::parseToDecimalForNumberType):
(WebCore::parseToDoubleForNumberType):
* html/parser/HTMLParserIdioms.h:
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::setAttributesAsText):
* layout/formattingContexts/inline/InlineItemsBuilder.cpp:
(WebCore::Layout::replaceNonPreservedNewLineCharactersAndAppend):
* layout/integration/LayoutIntegrationCoverage.cpp:
(WebCore::LayoutIntegration::printTextForSubtree):
* page/TextIndicator.cpp:
(WebCore::containsOnlyWhiteSpaceText):
* platform/Decimal.cpp:
(WebCore::Decimal::fromString):
* platform/Decimal.h:
* platform/network/CacheValidation.cpp:
(WebCore::parseCacheHeader):
(WebCore::parseCacheControlDirectives):
* platform/network/HTTPParsers.cpp:
(WebCore::filenameFromHTTPContentDisposition):
* platform/network/HTTPParsers.h:
* platform/network/MIMEHeader.cpp:
(WebCore::retrieveKeyValuePairs):
(WebCore::MIMEHeader::parseContentTransferEncoding):
* platform/network/MIMEHeader.h:
* platform/network/ParsedContentType.cpp:
(WebCore::ParsedContentType::setContentType):
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::isAttachment const):
(WebCore::ResourceResponseBase::isAttachmentWithFilename const):
* platform/network/curl/ResourceResponseCurl.cpp:
(WebCore::ResourceResponse::platformSuggestedFilename const):
* platform/sql/SQLiteDatabase.cpp:
(WebCore::SQLiteDatabase::executeCommandSlow):
(WebCore::SQLiteDatabase::clearAllTables):
(WebCore::SQLiteDatabase::prepareStatementSlow):
(WebCore::SQLiteDatabase::prepareHeapStatementSlow):
* platform/sql/SQLiteDatabase.h:
* platform/xr/PlatformXR.h:
(PlatformXR::parseSessionFeatureDescriptor):
* svg/SVGAnimationElement.cpp:
(WebCore::parseKeyTimes):
(WebCore::SVGAnimationElement::parseAttribute):
2022-04-17 Lauro Moura <lmoura@igalia.com>
Unreviewed, non-unified build fixes after 249632@main
https://bugs.webkit.org/show_bug.cgi?id=239436
* workers/DedicatedWorkerThread.cpp:
* workers/WorkerGlobalScope.cpp:
* workers/WorkerScriptLoader.cpp:
* workers/service/ServiceWorkerClientData.cpp:
2022-04-17 Alan Bujtas <zalan@apple.com>
RenderDeprecatedFlexibleBox::applyLineClamp should use size_t
https://bugs.webkit.org/show_bug.cgi?id=239389
Reviewed by Darin Adler.
Use size_t consistently in applyLineClamp.
While LineClampValue is int based, it can also be a percent type which expands the clamping range to size_t.
getHeightForLineCount -> use size_t and drop the magic -1.
heightForLineCount -> return LayoutUnit instead of int.
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::getHeightForLineCount):
(WebCore::heightForLineCount):
(WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
2022-04-16 Ryosuke Niwa <rniwa@webkit.org>
Make release assertion in Document::updateLayout more precise for FrameSelection::setSelection
https://bugs.webkit.org/show_bug.cgi?id=239431
Reviewed by Alan Bujtas.
Avoid the assertion failure by allowing no-op layout updates within FrameSelection::setSelection.
To do this, this patch introduces a new RAII object, UpToDateLayoutScope, which denotes when when the layout
is up-to-date and therefore does not require a new layout update. When this scope exists in the stack frame,
we allow calls to Document::updateLayout even inside ScriptDisallowedScope. We also assert that nobody attempts
to schedule a new style resolution or layout when this object exists.
Test: fast/forms/textarea-selection-update-during-DOMNodeRemoved-crash.html
* WebCore.xcodeproj/project.pbxproj:
* dom/Document.cpp:
(WebCore::Document::scheduleStyleRecalc):
(WebCore::Document::updateLayout):
* dom/Document.h:
(WebCore::Document::upToDateLayoutScopeCount const):
(WebCore::Document::incrementUpToDateLayoutScopeCount):
(WebCore::Document::decrementUpToDateLayoutScopeCount):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::setSelection):
* page/FrameViewLayoutContext.cpp:
(WebCore::FrameViewLayoutContext::scheduleLayout):
* rendering/RenderObject.h:
(WebCore::RenderObject::isSetNeedsLayoutForbidden const):
* rendering/UpToDateLayoutScope.h: Added.
(WebCore::UpToDateLayoutScope::UpToDateLayoutScope):
(WebCore::UpToDateLayoutScope::~UpToDateLayoutScope):
(WebCore::UpToDateLayoutScope::scopeIfLayoutIsUpToUpdate):
(WebCore::UpToDateLayoutScope::needsLayout):
2022-04-16 Chris Dumez <cdumez@apple.com>
Drop String::truncate() and use String::left() instead
https://bugs.webkit.org/show_bug.cgi?id=239412
Reviewed by Darin Adler.
* Modules/highlight/AppHighlightStorage.cpp:
(WebCore::createAppHighlightRangeData):
* dom/FragmentDirectiveParser.cpp:
(WebCore::FragmentDirectiveParser::parseFragmentDirective):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::handleBeforeTextInsertedEvent):
* loader/FTPDirectoryParser.h:
(WebCore::ListResult::clear):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::didBeginDocument):
* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::languageIdentifier):
* platform/graphics/avfoundation/objc/AVAssetTrackUtilities.mm:
(WebCore::contentTypesToCodecs):
* platform/text/hyphen/HyphenationLibHyphen.cpp:
(WebCore::scanDirectoryForDictionaries):
* platform/win/ClipboardUtilitiesWin.cpp:
(WebCore::extractURL):
2022-04-16 Wenson Hsieh <wenson_hsieh@apple.com>
[macOS] Image controls are editable and prevent drops in editable web views
https://bugs.webkit.org/show_bug.cgi?id=239423
rdar://81027082
Reviewed by Darin Adler.
Adjust the UA stylesheet for image controls (i.e., the services dropdown menu button) such that:
1. The container for image controls is non-editable, and:
2. The container above the button (which encompasses the bounds of the host image) ignores hit-testing.
This ensures that we're able to handle a drop over an image with image controls in an editable web view, by
inserting the dropped content before or after the image element (as opposed to either inserting it inside the
shadow root of the image, or not handling the drop via editing at all).
Test: WKAttachmentTestsMac.DropImageOverImageWithControls
* dom/mac/ImageControlsMac.cpp:
(WebCore::ImageControlsMac::createImageControls):
* html/shadow/mac/imageControlsMac.css:
(#if defined(ENABLE_SERVICE_CONTROLS) && ENABLE_SERVICE_CONTROLS):
(button#image-controls-button):
Make the contents of the image controls container non-selectable, and also avoid hit-testing over the container.
(:host(:hover) button#image-controls-button):
(div#image-controls button#image-controls-button): Deleted.
Ensure that the services menu button itself can still be activated by setting `pointer-events: auto;` when the
host element (i.e. the `img`) is hovered. It's important that we use the host element's `hover` state instead of
the containing `#image-controls`, since this container now has `pointer-events: none;`.
These changes make it still possible to reveal and interact with the services menu button, but allows
drag-and-drop to avoid hit-testing into shadow root content for an image with controls.
(div#image-controls:hover button#image-controls-button): Deleted.
2022-04-16 Chris Dumez <cdumez@apple.com>
Optimize id matching in AccessibilityObject::ariaElementsReferencedByAttribute()
https://bugs.webkit.org/show_bug.cgi?id=239406
<rdar://problem/91829358>
Reviewed by Darin Adler.
For every element in the DOM tree, the function would get the value of ones of its attributes,
then construct a SpaceSplitString (which would tokenize and atomize every space-separated
component in the value), and finally see if the SpaceSplitString contains the id we're looking
for. This was unnecessarily expensive.
This patch revives SpaceSplitString::spaceSplitStringContainsValue() which was unused and makes
it work with a StringView input instead of only a const char*/LChar*. We now use this function
inside AccessibilityObject::ariaElementsReferencedByAttribute() to avoid the construction of
a SpaceSplitString. spaceSplitStringContainsValue() simply iterates the string until it finds
an HTML space, then compare the chunk of characters with the provided StringView. If it matches,
it returns early, otherwise, it keeps searching till the end of the String.
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::ariaElementsReferencedByAttribute const):
* dom/SpaceSplitString.cpp:
(WebCore::tokenizeSpaceSplitString):
(WebCore::TokenIsEqualToCharactersTokenProcessor::TokenIsEqualToCharactersTokenProcessor):
(WebCore::TokenIsEqualToCharactersTokenProcessor::processToken):
(WebCore::spaceSplitStringContainsValueInternal):
(WebCore::SpaceSplitString::spaceSplitStringContainsValue):
(WebCore::TokenIsEqualToCStringTokenProcessor::TokenIsEqualToCStringTokenProcessor): Deleted.
(WebCore::TokenIsEqualToCStringTokenProcessor::processToken): Deleted.
(WebCore::TokenIsEqualToCStringTokenProcessor::referenceStringWasFound const): Deleted.
* dom/SpaceSplitString.h:
(WebCore::SpaceSplitString::spaceSplitStringContainsValue): Deleted.
2022-04-16 Chris Dumez <cdumez@apple.com>
Replace complex String::insert() with a simplified makeStringByInserting() free function
https://bugs.webkit.org/show_bug.cgi?id=239370
Reviewed by Darin Adler.
* Modules/mediasource/MediaSource.cpp:
(WebCore::addVP9FullRangeVideoFlagToContentType):
* dom/CharacterData.cpp:
(WebCore::CharacterData::insertData):
(WebCore::CharacterData::replaceData):
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::setRangeText):
* platform/network/DataURLDecoder.cpp:
(WebCore::DataURLDecoder::DecodeTask::process):
* platform/win/PasteboardWin.cpp:
(WebCore::createGlobalImageFileDescriptor):
2022-04-15 Chris Dumez <cdumez@apple.com>
Leverage StringView in more places to avoid some String allocations
https://bugs.webkit.org/show_bug.cgi?id=239356
Reviewed by Darin Adler.
* Modules/fetch/FetchBodyConsumer.cpp:
(WebCore::FetchBodyConsumer::packageFormData):
* Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp:
(WebCore::toRtpCodecCapability):
* Modules/model-element/scenekit/SceneKitModelLoader.mm:
(WebCore::mimeTypeUtilizingFileExtensionOverridingForLocalFiles):
* Modules/plugins/PluginReplacement.h:
(WebCore::ReplacementPlugin::supportsFileExtension const):
* Modules/plugins/YouTubePluginReplacement.cpp:
(WebCore::YouTubePluginReplacement::supportsFileExtension):
* Modules/plugins/YouTubePluginReplacement.h:
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::setPseudoElement):
* css/ContainerQueryParser.cpp:
(WebCore::ContainerQueryParser::consumePlainSizeFeature):
* css/parser/CSSSelectorParser.cpp:
(WebCore::consumeANPlusB):
* dom/SecurityContext.cpp:
(WebCore::SecurityContext::parseSandboxPolicy):
* dom/SecurityContext.h:
* fileapi/ThreadableBlobRegistry.cpp:
(WebCore::isBlobURLContainsNullOrigin):
* html/DOMTokenList.cpp:
(WebCore::DOMTokenList::updateTokensFromAttributeValue):
* html/DOMTokenList.h:
* html/HTMLMapElement.cpp:
(WebCore::HTMLMapElement::parseAttribute):
* html/HTMLPlugInElement.cpp:
(WebCore::pluginReplacementForType):
* html/track/WebVTTParser.cpp:
(WebCore::WebVTTParser::checkAndCreateRegion):
(WebCore::WebVTTParser::checkAndStoreRegion):
(WebCore::WebVTTParser::checkStyleSheet):
(WebCore::WebVTTParser::checkAndStoreStyleSheet):
* html/track/WebVTTParser.h:
* inspector/InspectorStyleSheet.cpp:
(WebCore::StyleSheetHandler::observeProperty):
(WebCore::StyleSheetHandler::observeComment):
* layout/formattingContexts/inline/InlineLineBuilder.cpp:
(WebCore::Layout::toString):
* layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp:
(WebCore::Layout::InlineDisplayContentBuilder::appendTextDisplayBox):
* layout/layouttree/LayoutInlineTextBox.h:
(WebCore::Layout::InlineTextBox::content const):
* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::store):
(WebCore::ApplicationCacheStorage::writeDataToUniqueFileInDirectory):
* loader/appcache/ApplicationCacheStorage.h:
* loader/cache/CachedSVGFont.cpp:
(WebCore::CachedSVGFont::getSVGFontById const):
(WebCore::CachedSVGFont::maybeInitializeExternalSVGFontElement):
* loader/cache/CachedSVGFont.h:
* page/Location.cpp:
(WebCore::Location::setHash):
* page/Page.cpp:
(WebCore::Page::userStyleSheetLocationChanged):
* page/UserContentURLPattern.cpp:
(WebCore::UserContentURLPattern::parse):
* page/UserContentURLPattern.h:
(WebCore::UserContentURLPattern::UserContentURLPattern):
* platform/MIMETypeRegistry.cpp:
(WebCore::typesForCommonExtension):
(WebCore::MIMETypeRegistry::mediaMIMETypeForExtension):
* platform/MIMETypeRegistry.h:
* platform/cocoa/DragImageCocoa.mm:
(WebCore::createDragImageIconForCachedImageFilename):
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::load):
* platform/graphics/angle/GraphicsContextGLANGLE.cpp:
(WebCore::GraphicsContextGLANGLE::getUnmangledInfoLog):
* platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
(WebCore::InbandTextTrackPrivateAVF::processCueAttributes):
* platform/graphics/opengl/GraphicsContextGLOpenGL.cpp:
(WebCore::GraphicsContextGLOpenGL::getUnmangledInfoLog):
* platform/network/HTTPParsers.cpp:
(WebCore::parseStructuredFieldValue):
(WebCore::parseRange):
* platform/network/HTTPParsers.h:
* platform/network/MIMEHeader.cpp:
(WebCore::retrieveKeyValuePairs):
* platform/network/ParsedContentType.cpp:
(WebCore::ParsedContentType::setContentType):
* platform/network/ParsedContentType.h:
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::textRun const):
2022-04-15 Chris Dumez <cdumez@apple.com>
Rename WebCore::webCoreBuiltinNames() to WebCore::builtinNames()
https://bugs.webkit.org/show_bug.cgi?id=239408
Reviewed by Darin Adler.
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::addBuiltinGlobals):
* bindings/js/JSDOMMapLike.cpp:
(WebCore::getBackingMap):
* bindings/js/JSDOMSetLike.cpp:
(WebCore::getBackingSet):
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::initStaticGlobals):
(WebCore::JSDOMWindowBase::finishCreation):
(WebCore::JSDOMWindowBase::updateDocument):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
(WebCore::JSDOMWindow::getOwnPropertySlot):
(WebCore::JSDOMWindow::put):
(WebCore::addCrossOriginPropertyNames):
(WebCore::JSDOMWindow::defineOwnProperty):
(WebCore::JSDOMWindow::setOpener):
(WebCore::JSDOMWindow::openDatabase const):
(WebCore::JSDOMWindow::setOpenDatabase):
* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::handleEvent):
* bindings/js/JSLocationCustom.cpp:
(WebCore::getOwnPropertySlotCommon):
(WebCore::JSLocation::put):
* bindings/js/JSRemoteDOMWindowCustom.cpp:
(WebCore::JSRemoteDOMWindow::put):
* bindings/js/ReadableStream.cpp:
(WebCore::ReadableStream::create):
(WebCore::ReadableStream::lock):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::setupModuleScriptHandlers):
* bindings/js/ScriptModuleLoader.cpp:
(WebCore::rejectToPropagateNetworkError):
(WebCore::rejectWithFetchError):
* bindings/js/WebCoreJSClientData.h:
(WebCore::builtinNames):
(WebCore::webCoreBuiltinNames): Deleted.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSDOMWindow.cpp:
(WebCore::JSDOMWindow::finishCreation):
* bindings/scripts/test/JS/JSTestConditionallyReadWrite.cpp:
(WebCore::JSTestConditionallyReadWritePrototype::finishCreation):
(WebCore::JSTestConditionallyReadWrite::finishCreation):
* bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
(WebCore::JSTestEnabledBySetting::finishCreation):
* bindings/scripts/test/JS/JSTestEnabledForContext.cpp:
(WebCore::JSTestEnabledForContext::finishCreation):
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
(WebCore::JSTestGlobalObject::finishCreation):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjPrototype::finishCreation):
* html/HTMLMediaElement.cpp:
(WebCore::controllerJSValue):
(WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
* testing/Internals.cpp:
(WebCore::Internals::cloneArrayBuffer):
* workers/WorkerOrWorkletScriptController.cpp:
(WebCore::WorkerOrWorkletScriptController::loadModuleSynchronously):
(WebCore::WorkerOrWorkletScriptController::loadAndEvaluateModule):
2022-04-15 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Remove VM& parameter from structure related code including jsDyamicCast
https://bugs.webkit.org/show_bug.cgi?id=239362
Reviewed by Darin Adler.
* Modules/webaudio/AudioWorkletGlobalScope.cpp:
(WebCore::AudioWorkletGlobalScope::registerProcessor):
(WebCore::AudioWorkletGlobalScope::createProcessor):
* Modules/webaudio/AudioWorkletProcessor.cpp:
(WebCore::copyDataFromBusesToJSArray):
(WebCore::copyDataFromParameterMapToJSObject):
(WebCore::zeroJSArray):
(WebCore::AudioWorkletProcessor::buildJSArguments):
* bindings/js/CommonVM.cpp:
(WebCore::lexicalFrameFromCommonVM):
* bindings/js/DOMGCOutputConstraint.cpp:
(WebCore::DOMGCOutputConstraint::executeImplImpl):
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::get):
(WebCore::createIDBKeyFromValue):
* bindings/js/InternalWritableStream.cpp:
(WebCore::invokeWritableStreamFunction):
* bindings/js/JSCSSRuleListCustom.cpp:
(WebCore::JSCSSRuleListOwner::isReachableFromOpaqueRoots):
* bindings/js/JSCallbackData.cpp:
(WebCore::JSCallbackData::invokeCallback):
* bindings/js/JSCustomElementInterface.cpp:
(WebCore::constructCustomElementSynchronously):
(WebCore::JSCustomElementInterface::upgradeElement):
(WebCore::JSCustomElementInterface::invokeCallback):
* bindings/js/JSCustomElementRegistryCustom.cpp:
(WebCore::getCustomElementCallback):
(WebCore::JSCustomElementRegistry::define):
* bindings/js/JSDOMAbstractOperations.h:
(WebCore::isVisibleNamedProperty):
(WebCore::accessVisibleNamedProperty):
* bindings/js/JSDOMAsyncIterator.h:
(WebCore::JSIterator>::next):
(WebCore::JSIterator>::runNextSteps):
(WebCore::JSIterator>::finishCreation):
* bindings/js/JSDOMBuiltinConstructor.h:
(WebCore::JSDOMBuiltinConstructor<JSClass>::finishCreation):
* bindings/js/JSDOMCastThisValue.h:
(WebCore::castThisValue):
* bindings/js/JSDOMConstructor.h:
(WebCore::JSDOMConstructor<JSClass>::finishCreation):
* bindings/js/JSDOMConstructorNotCallable.h:
(WebCore::JSDOMConstructorNotCallable<JSClass>::finishCreation):
* bindings/js/JSDOMConstructorNotConstructable.h:
(WebCore::JSDOMConstructorNotConstructable<JSClass>::finishCreation):
* bindings/js/JSDOMConvertBufferSource.h:
(WebCore::toPossiblySharedArrayBufferView):
* bindings/js/JSDOMConvertCallbacks.h:
(WebCore::Converter<IDLCallbackFunction<T>>::convert):
* bindings/js/JSDOMConvertDate.cpp:
(WebCore::valueToDate):
* bindings/js/JSDOMConvertPromise.h:
(WebCore::Converter<IDLPromise<T>>::convert):
* bindings/js/JSDOMConvertRecord.h:
* bindings/js/JSDOMConvertScheduledAction.h:
(WebCore::Converter<IDLScheduledAction>::convert):
* bindings/js/JSDOMConvertXPathNSResolver.h:
(WebCore::Converter<IDLInterface<XPathNSResolver>>::convert):
* bindings/js/JSDOMExceptionHandling.cpp:
(WebCore::reportException):
(WebCore::retrieveErrorMessageWithoutName):
(WebCore::retrieveErrorMessage):
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSC_DEFINE_HOST_FUNCTION):
(WebCore::JSDOMGlobalObject::finishCreation):
(WebCore::JSDOMGlobalObject::scriptExecutionContext const):
(WebCore::scriptModuleLoader):
* bindings/js/JSDOMGlobalObject.h:
(WebCore::toJSDOMGlobalObject):
* bindings/js/JSDOMGuardedObject.h:
(WebCore::DOMGuarded::guarded const):
* bindings/js/JSDOMIterator.h:
(WebCore::iteratorForEach):
(WebCore::IteratorTraits>::next):
(WebCore::IteratorTraits>::finishCreation):
* bindings/js/JSDOMLegacyFactoryFunction.h:
(WebCore::JSDOMLegacyFactoryFunction<JSClass>::finishCreation):
* bindings/js/JSDOMMapLike.cpp:
(WebCore::clearBackingMap):
(WebCore::setToBackingMap):
(WebCore::forwardFunctionCallToBackingMap):
(WebCore::forwardForEachCallToBackingMap):
* bindings/js/JSDOMMicrotask.cpp:
(WebCore::JSDOMMicrotask::run):
* bindings/js/JSDOMPromise.cpp:
(WebCore::DOMPromise::whenPromiseIsSettled):
* bindings/js/JSDOMPromiseDeferred.cpp:
(WebCore::createRejectedPromiseWithTypeError):
* bindings/js/JSDOMPromiseDeferred.h:
(WebCore::callPromiseFunction):
* bindings/js/JSDOMSetLike.cpp:
(WebCore::clearBackingSet):
(WebCore::addToBackingSet):
(WebCore::forwardFunctionCallToBackingSet):
(WebCore::forwardForEachCallToBackingSet):
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::finishCreation):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::queueMicrotask):
(WebCore::JSDOMWindow::toWrapped):
* bindings/js/JSDOMWindowProperties.cpp:
(WebCore::JSDOMWindowProperties::finishCreation):
(WebCore::JSDOMWindowProperties::getOwnPropertySlot):
* bindings/js/JSDOMWrapper.cpp:
(WebCore::JSDOMObject::JSDOMObject):
* bindings/js/JSDeprecatedCSSOMValueCustom.cpp:
(WebCore::JSDeprecatedCSSOMValueOwner::isReachableFromOpaqueRoots):
* bindings/js/JSDocumentCustom.h:
(JSC::JSCastingHelpers::InheritsTraits<WebCore::JSDocument>::inherits):
* bindings/js/JSElementCustom.h:
(JSC::JSCastingHelpers::InheritsTraits<WebCore::JSElement>::inherits):
* bindings/js/JSErrorHandler.cpp:
(WebCore::JSErrorHandler::handleEvent):
* bindings/js/JSEventCustom.h:
(JSC::JSCastingHelpers::InheritsTraits<WebCore::JSEvent>::inherits):
* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::handleEvent):
(WebCore::JSEventListener::functionName const):
* bindings/js/JSEventTargetCustom.cpp:
(WebCore::JSEventTarget::toWrapped):
(WebCore::jsEventTargetCast):
* bindings/js/JSExecState.cpp:
(WebCore::executionContext):
* bindings/js/JSNavigatorCustom.cpp:
(WebCore::JSNavigator::getUserMedia):
* bindings/js/JSNodeCustom.cpp:
(WebCore::JSNode::pushEventHandlerScope const):
* bindings/js/JSNodeCustom.h:
(JSC::JSCastingHelpers::InheritsTraits<WebCore::JSNode>::inherits):
* bindings/js/JSNodeListCustom.cpp:
(WebCore::JSNodeListOwner::isReachableFromOpaqueRoots):
* bindings/js/JSPluginElementFunctions.cpp:
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::pluginElementCustomGetOwnPropertySlot):
(WebCore::pluginElementCustomPut):
(WebCore::JSC_DEFINE_HOST_FUNCTION):
* bindings/js/JSReadableStreamSourceCustom.cpp:
(WebCore::JSReadableStreamSource::start):
* bindings/js/JSShadowRealmGlobalScopeBase.cpp:
(WebCore::JSShadowRealmGlobalScopeBase::finishCreation):
* bindings/js/JSWindowProxy.cpp:
(WebCore::JSWindowProxy::finishCreation):
(WebCore::JSWindowProxy::setWindow):
(WebCore::JSWindowProxy::wrapped const):
(WebCore::JSWindowProxy::toWrapped):
* bindings/js/JSWorkerGlobalScopeBase.cpp:
(WebCore::JSWorkerGlobalScopeBase::finishCreation):
* bindings/js/JSWorkerGlobalScopeCustom.cpp:
(WebCore::JSWorkerGlobalScope::queueMicrotask):
* bindings/js/JSWorkletGlobalScopeBase.cpp:
(WebCore::JSWorkletGlobalScopeBase::finishCreation):
* bindings/js/ReadableStream.cpp:
(WebCore::invokeReadableStreamFunction):
(WebCore::checkReadableStream):
(WebCore::ReadableStream::isDisturbed):
* bindings/js/ReadableStream.h:
(WebCore::JSReadableStreamWrapperConverter::toWrapped):
* bindings/js/ReadableStreamDefaultController.cpp:
(WebCore::invokeReadableStreamDefaultControllerFunction):
* bindings/js/ScheduledAction.cpp:
(WebCore::ScheduledAction::executeFunctionInContext):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::evaluateModule):
(WebCore::ScriptController::callInWorld):
(WebCore::ScriptController::executeAsynchronousUserAgentScriptInWorld):
* bindings/js/ScriptModuleLoader.cpp:
(WebCore::ScriptModuleLoader::fetch):
(WebCore::ScriptModuleLoader::evaluate):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::isArray):
(WebCore::CloneSerializer::isMap):
(WebCore::CloneSerializer::isSet):
(WebCore::CloneSerializer::getProperty):
(WebCore::CloneSerializer::toJSArrayBuffer):
(WebCore::CloneSerializer::dumpArrayBufferView):
(WebCore::CloneSerializer::dumpDOMPoint):
(WebCore::CloneSerializer::dumpDOMRect):
(WebCore::CloneSerializer::dumpDOMMatrix):
(WebCore::CloneSerializer::dumpIfTerminal):
(WebCore::CloneSerializer::serialize):
(WebCore::CloneDeserializer::CloneDeserializer):
(WebCore::CloneDeserializer::readArrayBufferViewImpl):
(WebCore::CloneDeserializer::readTerminal):
* bindings/js/StructuredClone.cpp:
(WebCore::JSC_DEFINE_HOST_FUNCTION):
* bindings/js/WindowProxy.cpp:
(WebCore::WindowProxy::clearJSWindowProxiesNotMatchingDOMWindow):
* bindings/scripts/CodeGeneratorJS.pm:
(GeneratePut):
(GeneratePutByIndex):
(GenerateOverloadDispatcher):
(GenerateImplementation):
(GenerateAttributeSetterBodyDefinition):
(GenerateCallbackImplementationContent):
(GenerateConstructorHelperMethods):
* bindings/scripts/test/JS/JSDOMWindow.cpp:
(WebCore::JSDOMWindowDOMConstructor::initializeProperties):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSDOMWindow::toWrapped):
* bindings/scripts/test/JS/JSDedicatedWorkerGlobalScope.cpp:
(WebCore::JSDedicatedWorkerGlobalScopeDOMConstructor::initializeProperties):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
* bindings/scripts/test/JS/JSExposedStar.cpp:
(WebCore::JSExposedStar::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSExposedStar::toWrapped):
* bindings/scripts/test/JS/JSExposedToWorkerAndWindow.cpp:
(WebCore::JSExposedToWorkerAndWindow::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSExposedToWorkerAndWindow::toWrapped):
* bindings/scripts/test/JS/JSPaintWorkletGlobalScope.cpp:
(WebCore::JSPaintWorkletGlobalScopeDOMConstructor::initializeProperties):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
* bindings/scripts/test/JS/JSServiceWorkerGlobalScope.cpp:
(WebCore::JSServiceWorkerGlobalScopeDOMConstructor::initializeProperties):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
* bindings/scripts/test/JS/JSShadowRealmGlobalScope.cpp:
(WebCore::JSShadowRealmGlobalScopeDOMConstructor::initializeProperties):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSShadowRealmGlobalScope::toWrapped):
* bindings/scripts/test/JS/JSSharedWorkerGlobalScope.cpp:
(WebCore::JSSharedWorkerGlobalScopeDOMConstructor::initializeProperties):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
* bindings/scripts/test/JS/JSTestCEReactions.cpp:
(WebCore::JSTestCEReactions::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::setJSTestCEReactions_stringifierAttributeSetter):
(WebCore::setJSTestCEReactions_stringifierAttributeNotNeededSetter):
(WebCore::JSTestCEReactions::toWrapped):
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
(WebCore::JSTestCEReactionsStringifier::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestCEReactionsStringifier::toWrapped):
* bindings/scripts/test/JS/JSTestCallTracer.cpp:
(WebCore::JSTestCallTracer::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestCallTracer::toWrapped):
* bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
(WebCore::JSTestCallbackFunction::JSTestCallbackFunction):
* bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp:
(WebCore::JSTestCallbackFunctionRethrow::JSTestCallbackFunctionRethrow):
* bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.cpp:
(WebCore::JSTestCallbackFunctionWithThisObject::JSTestCallbackFunctionWithThisObject):
* bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp:
(WebCore::JSTestCallbackFunctionWithTypedefs::JSTestCallbackFunctionWithTypedefs):
* bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
(WebCore::JSTestCallbackInterface::JSTestCallbackInterface):
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
(WebCore::JSTestClassWithJSBuiltinConstructor::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestClassWithJSBuiltinConstructor::toWrapped):
* bindings/scripts/test/JS/JSTestConditionalIncludes.cpp:
(WebCore::JSTestConditionalIncludes::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestConditionalIncludes::toWrapped):
* bindings/scripts/test/JS/JSTestConditionallyReadWrite.cpp:
(WebCore::JSTestConditionallyReadWrite::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestConditionallyReadWrite::toWrapped):
* bindings/scripts/test/JS/JSTestDOMJIT.cpp:
(WebCore::JSTestDOMJIT::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
* bindings/scripts/test/JS/JSTestDefaultToJSON.cpp:
(WebCore::JSTestDefaultToJSON::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestDefaultToJSON::toWrapped):
* bindings/scripts/test/JS/JSTestDefaultToJSONFilteredByExposed.cpp:
(WebCore::JSTestDefaultToJSONFilteredByExposed::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestDefaultToJSONFilteredByExposed::toWrapped):
* bindings/scripts/test/JS/JSTestDefaultToJSONIndirectInheritance.cpp:
(WebCore::JSTestDefaultToJSONIndirectInheritance::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
* bindings/scripts/test/JS/JSTestDefaultToJSONInherit.cpp:
(WebCore::JSTestDefaultToJSONInherit::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
* bindings/scripts/test/JS/JSTestDefaultToJSONInheritFinal.cpp:
(WebCore::JSTestDefaultToJSONInheritFinal::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
* bindings/scripts/test/JS/JSTestDelegateToSharedSyntheticAttribute.cpp:
(WebCore::JSTestDelegateToSharedSyntheticAttribute::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestDelegateToSharedSyntheticAttribute::toWrapped):
* bindings/scripts/test/JS/JSTestDomainSecurity.cpp:
(WebCore::JSTestDomainSecurity::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestDomainSecurity::toWrapped):
* bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
(WebCore::JSTestEnabledBySetting::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestEnabledBySetting::toWrapped):
* bindings/scripts/test/JS/JSTestEnabledForContext.cpp:
(WebCore::JSTestEnabledForContext::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestEnabledForContext::toWrapped):
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::JSTestEventConstructor::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::JSTestEventTarget::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestEventTarget::toWrapped):
* bindings/scripts/test/JS/JSTestException.cpp:
(WebCore::JSTestException::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestException::toWrapped):
* bindings/scripts/test/JS/JSTestGenerateAddOpaqueRoot.cpp:
(WebCore::JSTestGenerateAddOpaqueRoot::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestGenerateAddOpaqueRoot::toWrapped):
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
(WebCore::JSTestGenerateIsReachable::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestGenerateIsReachable::toWrapped):
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
(WebCore::JSTestGlobalObjectDOMConstructor::initializeProperties):
(WebCore::JSTestGlobalObject::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestGlobalObject::toWrapped):
* bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
(WebCore::JSTestIndexedSetterNoIdentifier::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestIndexedSetterNoIdentifier::toWrapped):
* bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
(WebCore::JSTestIndexedSetterThrowingException::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestIndexedSetterThrowingException::toWrapped):
* bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
(WebCore::JSTestIndexedSetterWithIdentifier::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestIndexedSetterWithIdentifier::toWrapped):
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::JSTestInterface::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestInterface::toWrapped):
* bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
(WebCore::JSTestInterfaceLeadingUnderscore::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestInterfaceLeadingUnderscore::toWrapped):
* bindings/scripts/test/JS/JSTestIterable.cpp:
(WebCore::JSTestIterable::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestIterable::toWrapped):
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
(WebCore::JSTestJSBuiltinConstructor::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
* bindings/scripts/test/JS/JSTestLegacyFactoryFunction.cpp:
(WebCore::JSTestLegacyFactoryFunction::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestLegacyFactoryFunction::toWrapped):
* bindings/scripts/test/JS/JSTestLegacyNoInterfaceObject.cpp:
(WebCore::JSTestLegacyNoInterfaceObject::finishCreation):
(WebCore::JSTestLegacyNoInterfaceObject::toWrapped):
* bindings/scripts/test/JS/JSTestLegacyOverrideBuiltIns.cpp:
(WebCore::JSTestLegacyOverrideBuiltIns::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestLegacyOverrideBuiltIns::toWrapped):
* bindings/scripts/test/JS/JSTestMapLike.cpp:
(WebCore::JSTestMapLike::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestMapLike::toWrapped):
* bindings/scripts/test/JS/JSTestMapLikeWithOverriddenOperations.cpp:
(WebCore::JSTestMapLikeWithOverriddenOperations::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestMapLikeWithOverriddenOperations::toWrapped):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
(WebCore::JSTestNamedAndIndexedSetterNoIdentifier::finishCreation):
(WebCore::JSTestNamedAndIndexedSetterNoIdentifier::put):
(WebCore::JSTestNamedAndIndexedSetterNoIdentifier::putByIndex):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestNamedAndIndexedSetterNoIdentifier::toWrapped):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
(WebCore::JSTestNamedAndIndexedSetterThrowingException::finishCreation):
(WebCore::JSTestNamedAndIndexedSetterThrowingException::put):
(WebCore::JSTestNamedAndIndexedSetterThrowingException::putByIndex):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestNamedAndIndexedSetterThrowingException::toWrapped):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
(WebCore::JSTestNamedAndIndexedSetterWithIdentifier::finishCreation):
(WebCore::JSTestNamedAndIndexedSetterWithIdentifier::put):
(WebCore::JSTestNamedAndIndexedSetterWithIdentifier::putByIndex):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestNamedAndIndexedSetterWithIdentifier::toWrapped):
* bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
(WebCore::JSTestNamedDeleterNoIdentifier::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestNamedDeleterNoIdentifier::toWrapped):
* bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
(WebCore::JSTestNamedDeleterThrowingException::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestNamedDeleterThrowingException::toWrapped):
* bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
(WebCore::JSTestNamedDeleterWithIdentifier::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestNamedDeleterWithIdentifier::toWrapped):
* bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
(WebCore::JSTestNamedDeleterWithIndexedGetter::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestNamedDeleterWithIndexedGetter::toWrapped):
* bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
(WebCore::JSTestNamedGetterCallWith::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestNamedGetterCallWith::toWrapped):
* bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
(WebCore::JSTestNamedGetterNoIdentifier::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestNamedGetterNoIdentifier::toWrapped):
* bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
(WebCore::JSTestNamedGetterWithIdentifier::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestNamedGetterWithIdentifier::toWrapped):
* bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
(WebCore::JSTestNamedSetterNoIdentifier::finishCreation):
(WebCore::JSTestNamedSetterNoIdentifier::put):
(WebCore::JSTestNamedSetterNoIdentifier::putByIndex):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestNamedSetterNoIdentifier::toWrapped):
* bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
(WebCore::JSTestNamedSetterThrowingException::finishCreation):
(WebCore::JSTestNamedSetterThrowingException::put):
(WebCore::JSTestNamedSetterThrowingException::putByIndex):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestNamedSetterThrowingException::toWrapped):
* bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
(WebCore::JSTestNamedSetterWithIdentifier::finishCreation):
(WebCore::JSTestNamedSetterWithIdentifier::put):
(WebCore::JSTestNamedSetterWithIdentifier::putByIndex):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestNamedSetterWithIdentifier::toWrapped):
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
(WebCore::JSTestNamedSetterWithIndexedGetter::finishCreation):
(WebCore::JSTestNamedSetterWithIndexedGetter::put):
(WebCore::JSTestNamedSetterWithIndexedGetter::putByIndex):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestNamedSetterWithIndexedGetter::toWrapped):
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
(WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::finishCreation):
(WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::put):
(WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::putByIndex):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::toWrapped):
* bindings/scripts/test/JS/JSTestNamedSetterWithLegacyOverrideBuiltIns.cpp:
(WebCore::JSTestNamedSetterWithLegacyOverrideBuiltIns::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestNamedSetterWithLegacyOverrideBuiltIns::toWrapped):
* bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeableProperties.cpp:
(WebCore::JSTestNamedSetterWithLegacyUnforgeableProperties::finishCreation):
(WebCore::JSTestNamedSetterWithLegacyUnforgeableProperties::put):
(WebCore::JSTestNamedSetterWithLegacyUnforgeableProperties::putByIndex):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestNamedSetterWithLegacyUnforgeableProperties::toWrapped):
* bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltIns.cpp:
(WebCore::JSTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltIns::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltIns::toWrapped):
* bindings/scripts/test/JS/JSTestNamespaceConst.cpp:
(WebCore::JSTestNamespaceConst::finishCreation):
* bindings/scripts/test/JS/JSTestNamespaceObject.cpp:
(WebCore::JSTestNamespaceObject::finishCreation):
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::JSTestNode::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObj::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::setJSTestObj_putForwardsAttributeSetter):
(WebCore::setJSTestObj_putForwardsNullableAttributeSetter):
(WebCore::jsTestObjPrototypeFunction_overloadedMethodOverloadDispatcher):
(WebCore::jsTestObjPrototypeFunction_overloadedMethodWithOptionalParameterOverloadDispatcher):
(WebCore::jsTestObjPrototypeFunction_overloadedMethodWithDistinguishingUnionOverloadDispatcher):
(WebCore::jsTestObjPrototypeFunction_overloadedMethodWith2DistinguishingUnionsOverloadDispatcher):
(WebCore::jsTestObjPrototypeFunction_overloadedMethodWithNonDistinguishingUnionOverloadDispatcher):
(WebCore::jsTestObjPrototypeFunction_overloadWithNullableUnionOverloadDispatcher):
(WebCore::jsTestObjPrototypeFunction_overloadWithNullableNonDistinguishingParameterOverloadDispatcher):
(WebCore::jsTestObjPrototypeFunction_testPromiseOverloadedFunctionOverloadDispatcher):
(WebCore::JSTestObj::toWrapped):
* bindings/scripts/test/JS/JSTestOperationConditional.cpp:
(WebCore::JSTestOperationConditional::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestOperationConditional::toWrapped):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::JSTestOverloadedConstructorsDOMConstructor::construct):
(WebCore::JSTestOverloadedConstructors::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestOverloadedConstructors::toWrapped):
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
(WebCore::JSTestOverloadedConstructorsWithSequence::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestOverloadedConstructorsWithSequence::toWrapped):
* bindings/scripts/test/JS/JSTestPluginInterface.cpp:
(WebCore::JSTestPluginInterface::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestPluginInterface::toWrapped):
* bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
(WebCore::JSTestPromiseRejectionEvent::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
* bindings/scripts/test/JS/JSTestReadOnlyMapLike.cpp:
(WebCore::JSTestReadOnlyMapLike::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestReadOnlyMapLike::toWrapped):
* bindings/scripts/test/JS/JSTestReadOnlySetLike.cpp:
(WebCore::JSTestReadOnlySetLike::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestReadOnlySetLike::toWrapped):
* bindings/scripts/test/JS/JSTestReportExtraMemoryCost.cpp:
(WebCore::JSTestReportExtraMemoryCost::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestReportExtraMemoryCost::toWrapped):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::JSTestSerializedScriptValueInterface::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestSerializedScriptValueInterface::toWrapped):
* bindings/scripts/test/JS/JSTestSetLike.cpp:
(WebCore::JSTestSetLike::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestSetLike::toWrapped):
* bindings/scripts/test/JS/JSTestSetLikeWithOverriddenOperations.cpp:
(WebCore::JSTestSetLikeWithOverriddenOperations::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestSetLikeWithOverriddenOperations::toWrapped):
* bindings/scripts/test/JS/JSTestStringifier.cpp:
(WebCore::JSTestStringifier::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestStringifier::toWrapped):
* bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
(WebCore::JSTestStringifierAnonymousOperation::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestStringifierAnonymousOperation::toWrapped):
* bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
(WebCore::JSTestStringifierNamedOperation::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestStringifierNamedOperation::toWrapped):
* bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
(WebCore::JSTestStringifierOperationImplementedAs::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestStringifierOperationImplementedAs::toWrapped):
* bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
(WebCore::JSTestStringifierOperationNamedToString::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestStringifierOperationNamedToString::toWrapped):
* bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
(WebCore::JSTestStringifierReadOnlyAttribute::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestStringifierReadOnlyAttribute::toWrapped):
* bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
(WebCore::JSTestStringifierReadWriteAttribute::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestStringifierReadWriteAttribute::toWrapped):
* bindings/scripts/test/JS/JSTestTaggedWrapper.cpp:
(WebCore::JSTestTaggedWrapper::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestTaggedWrapper::toWrapped):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::JSTestTypedefs::finishCreation):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSTestTypedefs::toWrapped):
* bindings/scripts/test/JS/JSTestVoidCallbackFunction.cpp:
(WebCore::JSTestVoidCallbackFunction::JSTestVoidCallbackFunction):
* bindings/scripts/test/JS/JSWorkerGlobalScope.cpp:
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSWorkerGlobalScope::toWrapped):
* bindings/scripts/test/JS/JSWorkletGlobalScope.cpp:
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::JSWorkletGlobalScope::toWrapped):
* bridge/objc/ObjCRuntimeObject.mm:
(JSC::Bindings::ObjCRuntimeObject::finishCreation):
* bridge/objc/WebScriptObject.mm:
(-[WebScriptObject _isSafeScript]):
(-[WebScriptObject callWebScriptMethod:withArguments:]):
(-[WebScriptObject setValue:forKey:]):
(-[WebScriptObject setWebScriptValueAtIndex:value:]):
(+[WebScriptObject _convertValueToObjcValue:originRootObject:rootObject:]):
* bridge/objc/objc_instance.mm:
(JSC::Bindings::ObjcInstance::getMethod):
(JSC::Bindings::ObjcInstance::invokeMethod):
* bridge/objc/objc_runtime.mm:
(JSC::Bindings::ObjcFallbackObjectImp::finishCreation):
(JSC::Bindings::JSC_DEFINE_HOST_FUNCTION):
* bridge/runtime_array.cpp:
(JSC::RuntimeArray::finishCreation):
(JSC::JSC_DEFINE_CUSTOM_GETTER):
* bridge/runtime_method.cpp:
(JSC::RuntimeMethod::finishCreation):
(JSC::JSC_DEFINE_CUSTOM_GETTER):
(JSC::JSC_DEFINE_HOST_FUNCTION):
* bridge/runtime_object.cpp:
(JSC::Bindings::RuntimeObject::finishCreation):
(JSC::Bindings::JSC_DEFINE_HOST_FUNCTION):
* html/HTMLMediaElement.cpp:
(WebCore::controllerJSValue):
(WebCore::HTMLMediaElement::updateCaptionContainer):
(WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
(WebCore::HTMLMediaElement::setControllerJSProperty):
(WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
(WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange):
(WebCore::HTMLMediaElement::getCurrentMediaControlsStatus):
* html/PDFDocument.cpp:
(WebCore::PDFDocument::sendPDFArrayBuffer):
* inspector/InspectorController.cpp:
(WebCore::InspectorController::canAccessInspectedScriptState const):
* inspector/InspectorFrontendAPIDispatcher.cpp:
(WebCore::InspectorFrontendAPIDispatcher::evaluateOrQueueExpression):
* inspector/WebInjectedScriptHost.cpp:
(WebCore::WebInjectedScriptHost::subtype):
(WebCore::WebInjectedScriptHost::isHTMLAllCollection):
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForEventListener):
* page/Frame.cpp:
(WebCore::Frame::fromJSContext):
(WebCore::Frame::contentFrameFromWindowOrFrameElement):
* page/WindowOrWorkerGlobalScope.cpp:
(WebCore::WindowOrWorkerGlobalScope::reportError):
* testing/Internals.cpp:
(WebCore::Internals::parserMetaData):
(WebCore::Internals::cloneArrayBuffer):
* workers/WorkerOrWorkletScriptController.cpp:
(WebCore::WorkerOrWorkletScriptController::loadAndEvaluateModule):
(WebCore::WorkerOrWorkletScriptController::initScriptWithSubclass):
* worklets/PaintWorkletGlobalScope.cpp:
(WebCore::PaintWorkletGlobalScope::registerPaint):
2022-04-15 Antoine Quint <graouts@apple.com>
WKWebView false positive when testing a.relList.supports("ar"), fails to open USDZ in AR QuickLook
https://bugs.webkit.org/show_bug.cgi?id=239135
<rdar://problem/91798041>
Reviewed by Tim Horton.
Only return "true" for a.relList.supports("ar") when the SystemPreviewEnabled setting is "true".
Tests: system-preview/rel-ar-setting-disabled.html
system-preview/rel-ar-setting-enabled.html
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::relList):
2022-04-15 Tim Horton <timothy_horton@apple.com>
Non-fatal fault under RenderThemeIOS::paintAttachment due to use of dynamic UIColors
https://bugs.webkit.org/show_bug.cgi?id=239376
<rdar://88141235>
Reviewed by Wenson Hsieh.
No new tests; not observable except for the lack of os_log_fault,
which we currently don't capture.
* rendering/RenderThemeIOS.mm:
(WebCore::attachmentTitleColor):
(WebCore::attachmentSubtitleColor):
(WebCore::RenderAttachmentInfo::RenderAttachmentInfo):
Make use of RenderThemeIOS's cache of system colors, instead of
retrieving them from UIColor directly, for <attachment> text colors.
This is important because we must avoid using dynamic UIColors in the
Web Content process directly (see r254373); this is just repairing
a small missing piece of that patch.
2022-04-15 Tim Horton <timothy_horton@apple.com>
Make it possible to adjust the final trait collection applied by LocalCurrentTraitCollection
https://bugs.webkit.org/show_bug.cgi?id=239375
rdar://problem/87115393
Reviewed by Wenson Hsieh.
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/ios/LocalCurrentTraitCollection.mm:
(WebCore::adjustedTraitCollection):
(WebCore::LocalCurrentTraitCollection::LocalCurrentTraitCollection):
* platform/ios/WebCoreUIColorExtras.h: Removed.
* platform/ios/WebCoreUIColorExtras.mm: Removed.
* rendering/RenderThemeIOS.mm:
(WebCore::cssValueSystemColorInformationList):
(WebCore::systemColorFromCSSValueSystemColorInformation):
(WebCore::CSSValueSystemColorInformation::function): Deleted.
Partially revert r291564, and add an addition point for LocalCurrentTraitCollection instead.
2022-04-15 J Pascoe <j_pascoe@apple.com>
[WebAuthn] Implement getTransports() and getAuthenticatorData() on AuthenticatorAttestationResponse
https://bugs.webkit.org/show_bug.cgi?id=238966
rdar://problem/91449906
This change implements the getTransports() and getAuthenticatorData() functions
on AuthenticatorAttestationResponse. For security keys, the supported transports of
the key are parsed from authenticatorGetInfo. For the local authenticator, the supported
transports are specified according to which features are available. getAuthenticatorData()
is a convenience method for RPs who want to avoid parsing CBOR.
Reviewed by Brent Fulgham.
* Modules/webauthn/AuthenticatorAttestationResponse.cpp:
(WebCore::AuthenticatorAttestationResponse::create):
(WebCore::AuthenticatorAttestationResponse::AuthenticatorAttestationResponse):
(WebCore::AuthenticatorAttestationResponse::data const):
(WebCore::AuthenticatorAttestationResponse::getTransports const):
(WebCore::AuthenticatorAttestationResponse::getAuthenticatorData const):
* Modules/webauthn/AuthenticatorAttestationResponse.h:
* Modules/webauthn/AuthenticatorAttestationResponse.idl:
* Modules/webauthn/AuthenticatorResponse.cpp:
(WebCore::AuthenticatorResponse::tryCreate):
* Modules/webauthn/AuthenticatorResponse.h:
* Modules/webauthn/AuthenticatorResponseData.h:
(WebCore::AuthenticatorResponseData::encode const):
(WebCore::AuthenticatorResponseData::decode):
* Modules/webauthn/AuthenticatorTransport.h:
* Modules/webauthn/AuthenticatorTransport.idl:
* Modules/webauthn/WebAuthenticationConstants.h:
* Modules/webauthn/WebAuthenticationUtils.cpp:
(WebCore::convertArrayBufferToVector):
* Modules/webauthn/WebAuthenticationUtils.h:
* Modules/webauthn/fido/AuthenticatorGetInfoResponse.cpp:
(fido::AuthenticatorGetInfoResponse::setTransports):
(fido::toStringVector):
(fido::encodeAsCBOR):
* Modules/webauthn/fido/AuthenticatorGetInfoResponse.h:
* Modules/webauthn/fido/DeviceResponseConverter.cpp:
(fido::convertStringToAuthenticatorTransport):
(fido::readCTAPMakeCredentialResponse):
(fido::readCTAPGetInfoResponse):
* Modules/webauthn/fido/DeviceResponseConverter.h:
* Modules/webauthn/fido/U2fResponseConverter.cpp:
(fido::readU2fRegisterResponse):
* Modules/webauthn/fido/U2fResponseConverter.h:
(fido::readU2fRegisterResponse):
2022-04-15 Brandon Stewart <brandonstewart@apple.com>
Parent Mismatch
https://bugs.webkit.org/show_bug.cgi?id=239390
Reviewed by Simon Fraser.
The oldParent and layer->parent() may be different under certain circumstances.
To account for this, we can just use the layer->parent() and remove the use
of oldParent. This also has the benefit of simplifying the moveLayers() function.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::moveLayers):
* rendering/RenderElement.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::insertOnlyThisLayer):
2022-04-15 Youenn Fablet <youenn@apple.com>
Sandboxed iframe loads should match a service worker registration based on sandbox flags
https://bugs.webkit.org/show_bug.cgi?id=239379
Reviewed by Chris Dumez.
Coverdd by updated tests.
* loader/DocumentLoader.cpp:
Sandboxed iframes have a null origin and should not be intercepted by service workers.
2022-04-15 Youenn Fablet <youenn@apple.com>
ServiceWorker.postMessage() doesn't work from inside iframe
https://bugs.webkit.org/show_bug.cgi?id=213984
<rdar://problem/65203340>
Reviewed by Chris Dumez.
postMessage was not working as we do not postMessage to a service worker if the source is not registered.
We now register service worker clients more aggresively and pass the client origin to better handle blob and about:blank clients.
We also add support for registering/unregistering worker clients when they get suspended/resumed.
To make sure a worker client is removed in failure case, WorkerScriptLoader is unregistering the service worker client if
the service worker data was not taken by its Worker.
Test: http/wpt/service-workers/about-blank-iframe.html
* dom/Document.cpp:
* loader/DocumentLoader.cpp:
* workers/DedicatedWorkerThread.cpp:
* workers/WorkerGlobalScope.cpp:
* workers/WorkerGlobalScope.h:
* workers/WorkerScriptLoader.cpp:
* workers/service/SWClientConnection.h:
* workers/service/WorkerSWClientConnection.cpp:
* workers/service/WorkerSWClientConnection.h:
2022-04-14 Antoine Quint <graouts@apple.com>
[model] ASVInlinePreview objects don't get cleared when the model source changes
https://bugs.webkit.org/show_bug.cgi?id=239064
<rdar://problem/90391037>
Reviewed by Dean Jackson.
Expose two new window.internals methods for tests to be able to query the list of UUIDs
currently loaded in the UI process and get the UUID for a given <model> element.
Test: model-element/model-element-inline-preview-deletion-upon-source-change.html
* Modules/model-element/HTMLModelElement.cpp:
(WebCore::HTMLModelElement::inlinePreviewUUIDForTesting const):
* Modules/model-element/HTMLModelElement.h:
* Modules/model-element/HTMLModelElement.idl:
* Modules/model-element/ModelPlayer.cpp:
(WebCore::ModelPlayer::inlinePreviewUUIDForTesting const):
* Modules/model-element/ModelPlayer.h:
* loader/FrameLoaderClient.h:
* testing/Internals.cpp:
(WebCore::Internals::modelInlinePreviewUUIDs const):
(WebCore::Internals::modelInlinePreviewUUIDForModelElement const):
* testing/Internals.h:
* testing/Internals.idl:
2022-04-14 Martin Robinson <mrobinson@webkit.org>
[GTK] AddressSanitizer: heap-buffer-overflow in WebCore::Length::ref()
https://bugs.webkit.org/show_bug.cgi?id=237389
Reviewed by Žan Doberšek.
* platform/graphics/nicosia/NicosiaAnimation.cpp:
(Nicosia::createThreadsafeKeyFrames): Convert Length members of transform functions to
the fixed variety before they are moved to separate threads.
(Nicosia::Animation::Animation): Use the new helper.
* platform/graphics/transforms/TranslateTransformOperation.h: Added setters.
2022-04-14 Zan Dobersek <zdobersek@igalia.com>
Unreviewed build fix for GTK and WPE.
* platform/graphics/gbm/DMABufFormat.h: Add a missing <array> header include.
2022-04-14 Chris Dumez <cdumez@apple.com>
Use WebCoreBuiltinNames when possible
https://bugs.webkit.org/show_bug.cgi?id=239361
Reviewed by Yusuke Suzuki.
Use WebCoreBuiltinNames when possible to avoid unnecessary calls to Identifier::fromString().
This is more efficient.
* Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
(WebCore::CDMSessionClearKey::update):
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::addBuiltinGlobals):
* bindings/js/JSDOMMapLike.cpp:
(WebCore::getBackingMap):
* bindings/js/JSDOMSetLike.cpp:
(WebCore::getBackingSet):
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::initStaticGlobals):
(WebCore::JSDOMWindowBase::finishCreation):
(WebCore::JSDOMWindowBase::updateDocument):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
(WebCore::JSDOMWindow::getOwnPropertySlot):
(WebCore::JSDOMWindow::put):
(WebCore::addCrossOriginPropertyNames):
(WebCore::JSDOMWindow::defineOwnProperty):
(WebCore::JSDOMWindow::setOpener):
(WebCore::JSDOMWindow::openDatabase const):
(WebCore::JSDOMWindow::setOpenDatabase):
* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::handleEvent):
* bindings/js/JSLocationCustom.cpp:
(WebCore::getOwnPropertySlotCommon):
(WebCore::JSLocation::put):
* bindings/js/JSRemoteDOMWindowCustom.cpp:
(WebCore::JSRemoteDOMWindow::put):
* bindings/js/ReadableStream.cpp:
(WebCore::ReadableStream::create):
(WebCore::ReadableStream::lock):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::setupModuleScriptHandlers):
* bindings/js/ScriptModuleLoader.cpp:
(WebCore::rejectToPropagateNetworkError):
(WebCore::rejectWithFetchError):
* bindings/js/WebCoreBuiltinNames.h:
* bindings/js/WebCoreJSClientData.h:
(WebCore::webCoreBuiltinNames):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSDOMWindow.cpp:
(WebCore::JSDOMWindow::finishCreation):
* bindings/scripts/test/JS/JSTestConditionallyReadWrite.cpp:
(WebCore::JSTestConditionallyReadWritePrototype::finishCreation):
(WebCore::JSTestConditionallyReadWrite::finishCreation):
* bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
(WebCore::JSTestEnabledBySetting::finishCreation):
* bindings/scripts/test/JS/JSTestEnabledForContext.cpp:
(WebCore::JSTestEnabledForContext::finishCreation):
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
(WebCore::JSTestGlobalObject::finishCreation):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjPrototype::finishCreation):
* html/HTMLMediaElement.cpp:
(WebCore::controllerJSValue):
(WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
* testing/Internals.cpp:
(WebCore::Internals::cloneArrayBuffer):
* workers/WorkerOrWorkletScriptController.cpp:
(WebCore::WorkerOrWorkletScriptController::loadModuleSynchronously):
(WebCore::WorkerOrWorkletScriptController::loadAndEvaluateModule):
2022-04-14 Wenson Hsieh <wenson_hsieh@apple.com>
Undo option after invoking "Markup Image" says "Undo Paste"
https://bugs.webkit.org/show_bug.cgi?id=239351
rdar://91647863
Reviewed by Darin Adler.
Add plumbing to allow a caller of `Editor::replaceNodeFromPasteboard` to specify an `EditAction` for the editing
command that is not just `EditAction::Paste`, and use it to supply a more specific edit action type of
`MarkupImage` in the case where "Markup Image" is used to replace an image element with other image data. This
allows the undo/redo title to be more accurate than simply "Undo/Redo Paste".
Test: ImageAnalysisTests.PerformImageAnalysisMarkup
* dom/TextEvent.cpp:
(WebCore::TextEvent::createForPlainTextPaste):
(WebCore::TextEvent::createForFragmentPaste):
(WebCore::TextEvent::TextEvent):
* dom/TextEvent.h:
* dom/TextEventInputType.h:
Introduce TextEventInputMarkup. This is used to preserve the fact that a `TextEvent` was triggered via
"Markup Image" as opposed to a regular "Paste" command, when plumbing this event object through DOM event
propagation code. Once it reenters editing code, we consult this type to re-map this event to
`EditAction::MarkupImage` if appropriate.
I opted for this (slightly more roundabout) approach to prevent a potential layering violation, due to TextEvent
otherwise knowing about `EditAction`.
* editing/EditAction.cpp:
(WebCore::undoRedoLabel):
* editing/EditAction.h:
Introduce EditAction::MarkupImage. Additionally, alphabetically sort these enum types.
* editing/Editor.cpp:
(WebCore::Editor::handleTextEvent):
(WebCore::Editor::pasteAsFragment):
(WebCore::Editor::replaceSelectionWithFragment):
* editing/Editor.h:
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::replaceNodeFromPasteboard):
Add an `EditAction` argument; by default, this is `EditAction::Paste`.
* en.lproj/Localizable.strings:
Add a new localized string to represent the name of the "Markup Image" item, for the purposes of setting the
Redo/Undo action title.
2022-04-14 Caitlin Potter <caitp@igalia.com>
[JSC] ShadowRealm global object has a mutable prototype
https://bugs.webkit.org/show_bug.cgi?id=239332
Reviewed by Yusuke Suzuki.
Hack: The IDL code generator now special cases ShadowRealmGlobalObject to remove the
ImmutablePrototypeExoticObject bit from the inherited JSGlobalObject structure flags.
As a result, this enables the assignment of a ShadowRealm's globalThis.__proto__, or
overwriting the prototype with [Object / Reflect].setPrototypeOf().
Test: js/ShadowRealm-globalThis.html
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
* bindings/scripts/test/JS/JSShadowRealmGlobalScope.h:
2022-04-14 Nikolaos Mouchtaris <nmouchtaris@apple.com>
calc(): Serialize top level min/max/hypot as calc()
https://bugs.webkit.org/show_bug.cgi?id=239019
Reviewed by Darin Adler.
For functions that would have no effect on the top level value, serialize as calc() rather
than the function.
* css/calc/CSSCalcOperationNode.cpp:
(WebCore::CSSCalcOperationNode::simplifyNode):
* css/calc/CSSCalcOperationNode.h:
2022-04-14 Gabriel Nava Marino <gnavamarino@apple.com>
WebCore::WorkerStorageConnection::fileSystemGetDirectory could have invalid storageConnection()
https://bugs.webkit.org/show_bug.cgi?id=239355
Reviewed by Sihui Liu.
Add a check since storageConnection() can be invalid at this point.
* Modules/storage/WorkerStorageConnection.cpp:
(WebCore::WorkerStorageConnection::fileSystemGetDirectory):
2022-04-14 Chris Dumez <cdumez@apple.com>
Require an existing AtomString for HTMLFormElement's named getter parameter
https://bugs.webkit.org/show_bug.cgi?id=239335
Reviewed by Darin Adler.
Require an existing AtomString for HTMLFormElement's named getter parameter. There is no point
in allocating a new AtomString as the AtomString should already exist if there is any element
with this name / id.
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::namedElements):
* html/HTMLFormElement.idl:
2022-04-14 Chris Dumez <cdumez@apple.com>
Require an existing AtomString for HTMLDocument's named getter parameter
https://bugs.webkit.org/show_bug.cgi?id=239334
Reviewed by Alexey Shvayka.
Require an existing AtomString for HTMLDocument's named getter parameter. There is no point
in allocating a new AtomString as the AtomString should already exist if there is any element
with this name.
* html/HTMLDocument.idl:
2022-04-14 J Pascoe <j_pascoe@apple.com>
[WebAuthn] Clean up WebAuthenticationModern and WebAuthnProcess
https://bugs.webkit.org/show_bug.cgi?id=239073
rdar://problem/91571030
The WebAuthenticationModern flag and WebAuthnProcess are no longer used
and can be removed. This patch removes all references to both the flag
and the process.
Reviewed by Brent Fulgham.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setWebAuthenticationModernEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::webAuthenticationModernEnabled const): Deleted.
* platform/RuntimeApplicationChecks.cpp:
(WebCore::processTypeDescription):
* platform/RuntimeApplicationChecks.h:
2022-04-14 Chris Dumez <cdumez@apple.com>
Drop inefficient String::append() overloads
https://bugs.webkit.org/show_bug.cgi?id=239289
Reviewed by Sam Weinig.
* Modules/indexeddb/IDBKeyData.cpp:
(WebCore::IDBKeyData::loggingString const):
* Modules/indexeddb/IDBKeyRangeData.cpp:
(WebCore::IDBKeyRangeData::loggingString const):
* Modules/indexeddb/shared/IDBIndexInfo.cpp:
(WebCore::IDBIndexInfo::loggingString const):
* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::trimInputSample):
* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::initializeAttributeData):
* dom/CharacterData.cpp:
(WebCore::CharacterData::parserAppendData):
* dom/Text.cpp:
(WebCore::appendTextRepresentation):
* dom/ViewportArguments.cpp:
(WebCore::viewportErrorMessage):
* editing/markup.cpp:
(WebCore::fillContainerFromString):
* html/FTPDirectoryDocument.cpp:
(WebCore::FTPDirectoryDocumentParser::parseAndAppendOneLine):
(WebCore::FTPDirectoryDocumentParser::append):
(WebCore::FTPDirectoryDocumentParser::finish):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::getActiveUniform):
* html/track/WebVTTParser.cpp:
(WebCore::WebVTTParser::checkAndStoreStyleSheet):
* html/track/WebVTTParser.h:
* inspector/InspectorOverlay.cpp:
(WebCore::truncateWithEllipsis):
* inspector/InspectorOverlayLabel.cpp:
(WebCore::InspectorOverlayLabel::draw):
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForNode):
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::scrollingStateTreeAsText const):
* platform/graphics/HEVCUtilities.cpp:
(WebCore::createHEVCCodecParametersString):
* platform/network/HTTPParsers.cpp:
(WebCore::trimInputSample):
* platform/network/curl/CurlCacheEntry.cpp:
(WebCore::CurlCacheEntry::CurlCacheEntry):
(WebCore::CurlCacheEntry::saveResponseHeaders):
* platform/network/curl/CurlCacheManager.cpp:
(WebCore::CurlCacheManager::setCacheDirectory):
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::addExtraNetworkLoadMetrics):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
2022-04-14 Gabriel Nava Marino <gnavamarino@apple.com>
ScriptDisallowedScope::isEventAllowedInMainThread assert failure when activating AudioSession
https://bugs.webkit.org/show_bug.cgi?id=239343
Reviewed by Eric Carlson.
As part of HTMLMediaElement::clearMediaPlayer we call PlatformMediaSession::canProduceAudioChanged
which can result in activating the AudioSession when the page is capturing audio.
This sends a synchronous IPC message to the GPU process. As part of IPC::Connection::waitForSyncReply,
we also end up dispatching enqueued messages, including a WebPage_EndPrinting message that
fires an event listener on the main thread.
This patch will instead queue the PlatformMediaSession::canProduceAudioChanged as a task to avoid
firing the event listener on the main thread, which results in assertion failure.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::clearMediaPlayer):
2022-04-14 Chris Dumez <cdumez@apple.com>
Update ContainerNode::getElementsByName() to take in an AtomString
https://bugs.webkit.org/show_bug.cgi?id=239333
Reviewed by Alexey Shvayka.
Update ContainerNode::getElementsByName() to take in an AtomString instead of a String.
Its implementation ends up atomizing the name anyway.
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::getElementsByName):
* dom/ContainerNode.h:
2022-04-14 Youenn Fablet <youenn@apple.com>
Add logging for persistent notification event handler failure
https://bugs.webkit.org/show_bug.cgi?id=239131
Reviewed by Chris Dumez.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::processNotificationEvent):
2022-04-14 Justin Michaud <justin_michaud@apple.com>
[PGO] We should be able to build WebKit to collect PGO profiles easily
https://bugs.webkit.org/show_bug.cgi?id=238776
Reviewed by Wenson Hsieh.
* Configurations/WebCore.xcconfig:
* Configurations/WebCoreTestSupport.xcconfig:
* page/Frame.cpp:
(WebCore::Frame::Frame):
2022-04-14 Kate Cheney <katherine_cheney@apple.com>
WKWebView: navigator.serviceWorker.register method fails for a new version of an already registered service worker.
https://bugs.webkit.org/show_bug.cgi?id=229554
<rdar://problem/82388593>
Reviewed by Brent Fulgham.
Check to see if a domain has already been registered when validating
a service worker registration domain. In this case, we allow an
updated registration.
There are a couple of other changes that are key for testing this.
First, this adds a way to override the max registration count for
tests. This is because we can only use 127.0.0.1 and localhost in
tests, but would need 3 domains in order to test the max count.
overrideServiceWorkerRegistrationCountTestingValue lets us lower that
number.
Second, we also want a way to override the loopback IP address check
to make sure we don't get a false positive test result for localhost
and 127.0.0.1 in API tests.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::addRegistrationFromStore):
(WebCore::SWServer::addRegistration):
(WebCore::SWServer::SWServer):
(WebCore::SWServer::maxRegistrationCount):
(WebCore::SWServer::allowLoopbackIPAddress):
(WebCore::SWServer::validateRegistrationDomain):
(WebCore::SWServer::scheduleJob):
(WebCore::SWServer::removeFromScopeToRegistrationMap):
* workers/service/server/SWServer.h:
2022-04-14 Zan Dobersek <zdobersek@igalia.com>
[GTK][WPE] Provide WK2 IPC encoding, decoding methods for the DMABufObject type
https://bugs.webkit.org/show_bug.cgi?id=239038
Reviewed by Adrian Perez de Castro.
Provide encoding and decoding methods on the DMABufObject class,
enabling transport over IPC channels.
There are two separate ref-qualified encoding methods. When encoding
an object that's managed through an lvalue reference, we duplicate the
file descriptor objects since the DMABufObject will live on. When
managed through an rvalue object, we know the object's lifetime is
intended to be limited to this encoding process, so we can avoid the
file descriptor duplication and move the fd values into the encoder.
* platform/graphics/gbm/DMABufObject.h:
(WebCore::DMABufObject::encode const):
(WebCore::DMABufObject::encode):
(WebCore::DMABufObject::decode):
2022-04-14 Youenn Fablet <youenn@apple.com>
Expose workers as service worker clients and implement registration matching for dedicated workers
https://bugs.webkit.org/show_bug.cgi?id=239066
Reviewed by Chris Dumez.
Add support for exposing workers (dedicated and shared) as service worker clients.
Add support for setting the controlling registration for dedicated workers
(a follow-up patch should handle shared workers).
To properly handle loads coming from a worker, we properly set clientIdentifier and registration identifier
from the worker context, instead of from the worker's document.
Small refactoring to pass additional data to worker through WorkerInitializationData.
This is used to set the context ID and context controlling service worker.
Adding a specific check in CachedResourceLoader to not reuse the cache in case the service worker modes are different.
A potential issue is that the service workers are the same (0) as one request is the main request
and the second request is the request triggered by service worker to answer the first request.
Properly support blob URL matching directly in WorkerScriptLoader for workers.
Test: http/wpt/service-workers/controlled-dedicatedworker.https.html
* WebCore.xcodeproj/project.pbxproj:
* dom/Document.h:
* dom/ScriptExecutionContext.h:
* loader/DocumentLoader.cpp:
* loader/FetchOptions.h:
* loader/ThreadableLoader.cpp:
* loader/WorkerThreadableLoader.cpp:
* loader/cache/CachedResourceLoader.cpp:
* workers/DedicatedWorkerThread.cpp:
* workers/Worker.cpp:
* workers/Worker.h:
* workers/WorkerGlobalScope.cpp:
* workers/WorkerGlobalScope.h:
* workers/WorkerGlobalScopeProxy.h:
* workers/WorkerInitializationData.h: Added.
* workers/WorkerMessagingProxy.cpp:
* workers/WorkerMessagingProxy.h:
* workers/WorkerOrWorkletGlobalScope.cpp:
* workers/WorkerOrWorkletGlobalScope.h:
* workers/WorkerScriptLoader.cpp:
* workers/WorkerScriptLoader.h:
* workers/WorkerThread.cpp:
* workers/WorkerThread.h:
* workers/service/SWClientConnection.cpp:
* workers/service/ServiceWorker.h:
* workers/service/ServiceWorkerClientData.cpp:
* workers/service/ServiceWorkerClientType.h:
* workers/service/ServiceWorkerContainer.cpp:
* workers/service/context/ServiceWorkerThread.cpp:
* workers/shared/SharedWorkerScriptLoader.h:
* workers/shared/context/SharedWorkerThreadProxy.cpp:
2022-04-14 Youenn Fablet <youenn@apple.com>
A shared worker in a cached page should not allow the remote shared worker to continue executing
https://bugs.webkit.org/show_bug.cgi?id=239286
Reviewed by Chris Dumez.
SharedWorker need to react to resume/suspend in case of page cache so that the corresponding
remote shared worker might get suspended if all its shared worker objects are suspended.
Test: http/tests/navigation/page-cache-shared-worker.html
* workers/shared/SharedWorker.cpp:
* workers/shared/SharedWorker.h:
* workers/shared/SharedWorkerObjectConnection.h:
* workers/shared/context/SharedWorkerContextManager.cpp:
* workers/shared/context/SharedWorkerContextManager.h:
2022-04-13 Myles C. Maxfield <mmaxfield@apple.com>
Revert r291846 because it caused a 3% performance regression
https://bugs.webkit.org/show_bug.cgi?id=239323
<rdar://problem/91046238>
Rubber-stamped by Stephanie Lewis.
I'm having trouble figuring out why this caused a regression, so I'm reverting the patch
wholesale while I can do more investigation.
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::normalizeWeight):
(WebCore::denormalizeWeight):
(WebCore::preparePlatformFont):
(WebCore::fontCacheRegisteredFontsChangedNotificationCallback):
(WebCore::FontCache::platformInit):
(WebCore::variationCapabilitiesForFontDescriptor):
(WebCore::normalizeGXWeight): Deleted.
(WebCore::normalizeCTWeight): Deleted.
(WebCore::denormalizeGXWeight): Deleted.
(WebCore::denormalizeCTWeight): Deleted.
(WebCore::overrideEnhanceTextLegibility): Deleted.
(WebCore::setOverrideEnhanceTextLegibility): Deleted.
(WebCore::shouldEnhanceTextLegibility): Deleted.
* platform/graphics/cocoa/FontCacheCoreText.h:
* testing/Internals.cpp:
(WebCore::Internals::setOverrideEnhanceTextLegibility): Deleted.
* testing/Internals.h:
* testing/Internals.idl:
2022-04-13 Antoine Quint <graouts@apple.com>
[web-animations] REGRESSION(r291527): assertion hit during teardown of document with CSS Animations
https://bugs.webkit.org/show_bug.cgi?id=239291
rdar://90699078
Reviewed by Dean Jackson.
When a CSS Animation is not considered to be relevant anymore, it is removed from both AnimationTimeline::m_animations
and Styleable::animations(). However, if that animation becomes relevant again, it will be added back to the associated
effect stack as well as AnimationTimeline::m_animations but not to Styleable::animations().
This causes a problem because when eventually that CSS Animation's target is removed from the tree, such as during
document teardown, Styleable::cancelDeclarativeAnimations() will be called an iterate over Styleable::animations()
to find declarative animations to cancel. Since the CSS animation was not added to Styleable::animations(), it will
not be canceled and the associated effect will not be removed from the effect stack.
Later in Styleable::cancelDeclarativeAnimations(), the list of associated CSS Animation names is cleared.
If during that teardown an animation resolution is performed, such as within a "beforeunload" event listener as
shown in the new test, we will get into a state where there are effects left in the effect stack of the element
being torn down but no associated CSS Animation names and we will hit the RELEASE_ASSERT_NOT_REACHED() at the
end of compareCSSAnimations().
To fix this, we simply ensure that we add animations back to Styleable::animations() within
AnimationTimeline::animationTimingDidChange() the same way we add the animations back to
AnimationTimeline::m_animations.
Test: webanimations/css-animation-resolution-during-teardown.html
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::animationTimingDidChange):
2022-04-13 Chris Dumez <cdumez@apple.com>
Replace calls to substring(0, x) with the more concise left(x)
https://bugs.webkit.org/show_bug.cgi?id=239306
Reviewed by Darin Adler.
Replace calls to substring(0, x) with the more concise left(x). Also use StringView in more cases
for performance.
* Modules/fetch/FetchBodyConsumer.cpp:
(WebCore::parseMIMEType):
* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::setGetResult):
* Modules/indexeddb/IDBKeyPath.cpp:
(WebCore::IDBKeyPathLexer::lexIdentifier):
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::shouldIgnoreIceCandidate):
* Modules/mediastream/RTCDTMFSender.cpp:
(WebCore::RTCDTMFSender::playNextTone):
* Modules/mediastream/gstreamer/GStreamerMediaEndpoint.cpp:
(WebCore::GStreamerMediaEndpoint::addRemoteStream):
* Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp:
(WebCore::toRtpCodecCapability):
* Modules/plugins/YouTubePluginReplacement.cpp:
(WebCore::processAndCreateYouTubeURL):
(WebCore::YouTubePluginReplacement::youTubeURLFromAbsoluteURL):
* display/css/DisplayTextBox.cpp:
(WebCore::Display::TextBox::debugDescription const):
* dom/Document.cpp:
(WebCore::Document::parseQualifiedName):
* dom/Text.cpp:
(WebCore::Text::splitText):
* editing/TextCheckingHelper.cpp:
(WebCore::checkTextOfParagraph):
* editing/TextIterator.cpp:
(WebCore::SearchBuffer::prependContext):
* editing/VisibleUnits.cpp:
(WebCore::suffixLengthForRange):
(WebCore::startWordBoundary):
(WebCore::previousWordPositionBoundary):
* editing/cocoa/DataDetection.mm:
(WebCore::DataDetection::detectContentInRange):
* editing/markup.cpp:
(WebCore::shouldPreserveMSOLists):
* html/FeaturePolicy.cpp:
(WebCore::updateList):
* html/HTMLMediaElement.cpp:
(WTF::LogArgument<URL>::toString):
* html/HTMLTrackElement.cpp:
(WebCore::urlForLoggingTrack):
* html/URLDecomposition.cpp:
(WebCore::URLDecomposition::setHost):
* html/parser/HTMLParserIdioms.cpp:
(WebCore::parseHTTPRefreshInternal):
* html/parser/HTMLSrcsetParser.cpp:
(WebCore::parseDescriptors):
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::characterPredicate):
* inspector/InspectorStyleSheet.cpp:
(WebCore::StyleSheetHandler::observeComment):
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::outputLayoutBox):
* loader/appcache/ApplicationCacheManifestParser.cpp:
(WebCore::manifestPath):
* mathml/MathMLPresentationElement.cpp:
(WebCore::MathMLPresentationElement::parseNumberAndUnit):
* page/Frame.cpp:
(WebCore::createRegExpForLabels):
* page/SecurityOriginData.cpp:
(WebCore::SecurityOriginData::fromDatabaseIdentifier):
* platform/SharedStringHash.cpp:
(WebCore::computeSharedStringHashInline):
* platform/graphics/StringTruncator.cpp:
(WebCore::centerTruncateToBuffer):
(WebCore::rightTruncateToBuffer):
(WebCore::rightClipToCharacterBuffer):
(WebCore::rightClipToWordBuffer):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL):
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
(WebCore::SourceBufferPrivateGStreamer::platformMaximumBufferSize const):
* platform/graphics/win/FontCacheWin.cpp:
(WebCore::createGDIFont):
(WebCore::FontCache::getFontSelectionCapabilitiesInFamily):
* platform/ios/UserAgentIOS.mm:
(WebCore::deviceNameForUserAgent):
* platform/network/CacheValidation.cpp:
(WebCore::trimToNextSeparator):
(WebCore::parseCacheHeader):
* platform/network/CredentialStorage.cpp:
(WebCore::protectionSpaceMapKeyFromURL):
(WebCore::CredentialStorage::findDefaultProtectionSpaceForURL):
* platform/network/DataURLDecoder.cpp:
(WebCore::DataURLDecoder::DecodeTask::process):
* platform/network/HTTPParsers.cpp:
(WebCore::parseStructuredFieldValue):
* platform/network/MIMEHeader.cpp:
(WebCore::retrieveKeyValuePairs):
* platform/network/curl/CookieUtil.cpp:
(WebCore::CookieUtil::parseCookieAttributes):
(WebCore::CookieUtil::parseCookieHeader):
(WebCore::CookieUtil::defaultPathForURL):
* platform/text/LocaleToScriptMapping.cpp:
(WebCore::localeToScriptCodeForFontSelection):
* platform/win/PasteboardWin.cpp:
(WebCore::fileSystemPathFromURLOrTitle):
(WebCore::Pasteboard::writeURLToDataObject):
(WebCore::createGlobalImageFileDescriptor):
* platform/win/WebCoreTextRenderer.cpp:
(WebCore::doDrawTextAtPoint):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::outputRenderObject const):
* rendering/style/GridPositionsResolver.cpp:
(WebCore::NamedLineCollectionBase::NamedLineCollectionBase):
* svg/SVGTests.cpp:
(WebCore::SVGTests::isValid const):
* svg/SVGURIReference.cpp:
(WebCore::SVGURIReference::fragmentIdentifierFromIRIString):
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::parseClockValue):
* workers/service/ServiceWorkerJob.cpp:
(WebCore::ServiceWorkerJob::validateServiceWorkerResponse):
* workers/service/ServiceWorkerRegistrationKey.cpp:
(WebCore::ServiceWorkerRegistrationKey::fromDatabaseKey):
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::canHandleScheme const):
2022-04-13 Alan Bujtas <zalan@apple.com>
REGRESSION (r292043): [ Mac ] fast/block/positioning/fixed-container-with-relative-parent.html is a flaky image failure
https://bugs.webkit.org/show_bug.cgi?id=239101
<rdar://problem/91603539>
Reviewed by Antti Koivisto.
1. Out of flow boxes are laid out independently from each other as the last step of their containing block layout.
2. However their static positions are computed during regular in-flow layout (as if their positions were static).
In order to do #1, we maintain a ListHashSet for the out-of-flow boxes and insert them at #2 (and we also have
a corresponding HashMap<ContainingBlock, ListHasSet>).
Normally this is a very simple list of descendant positioned boxes and since out-of-flow boxes don't interact with each
other, their position in the list is not important.
e.g.
<div id=A style="position: relative">
<div>
<div id=B style="position: absolute"></div>
<div id=C style="position: absolute"></div>
</div>
</div>
At in-flow layout (#2), we insert B and C to "ListHashSet of A" as we come across them in DOM order and compute their static positions.
Later in the layout flow when we get to the "let's layout the out-of-flow boxes" phase (#1) we simply walk
the ListHashSet and lay out B and C (but "C and B" order would also work just fine).
However the ICB (RenderView) is a special containing block as it can hold different types of out-of-flow boxes (absolute and fixed)
and those out-of-flow boxes may have layout dependencies.
e.g.
<body><div id=A class=absolute><div id=B class=fixed></div></div></body>
ICB's ListHasSet has both A and B, but in this case there's (static)layout dependency between these boxes.
In order to figure out the static position of B, we have to have A laid out first. In order to lay out A before B,
B has to be preceded by A in ICB's ListHasSet.
Now full layout always guarantees the correct order.
However in case of partial layout since we don't run a full #2, the ListHasSet may end up having an unexpected order.
e.g.
<body><div id=A class=absolute><div id=B><div id=C class=fixed></div></div></div></body>
1. The initial (full) layout produces the following (correct) order for the ICB's ListHasSet -> AC.
2. A subsequent partial layout (e.g. triggered by A's position change) runs an in-flow layout on the <body> which
(re-)appends A to the ListHasSet (CA <- incorrect order). Now at this point we assume that the in-flow layout picks up B
which eventually (re-)appends C to the ListHashSet (AC <- correct order). However since B does not need layout, we just
stop at <body> which leaves us with an unexpected ListHashSet.
3. As part of the ICB's out-of-flow layout, we pick C as the first box to lay out followed by A. However since C's static
position depends on A's position, we end up using stale geometry when computing C's static position.
This patch fixes this issue by ensuring the absolute positioned boxes always come first in the ICB's ListHasSet (note
that their order is not really important -see above. What's important is that a potential (as-if-static) containing block always
comes before the fixed boxes).
Test: fast/block/fixed-inside-absolute-positioned.html
* rendering/RenderBlock.cpp:
(WebCore::PositionedDescendantsMap::addDescendant):
(WebCore::RenderBlock::insertPositionedObject):
2022-04-13 Chris Dumez <cdumez@apple.com>
Use [AtomString] where appropriate in IDL files for performance
https://bugs.webkit.org/show_bug.cgi?id=239314
Reviewed by Alexey Shvayka.
Use [AtomString] where appropriate in IDL files for performance. I added [AtomString] on the
IDL side whenever our C++ implementation uses AtomString.
Without this, the generated bindings code will generate a String, which will then get atomized
once passed to our implementation. This means we're doing unnecessary String allocations in
cases where the AtomString is already in the AtomStringTable.
* dom/Attr.idl:
* dom/Document+HTML.idl:
* dom/Document.cpp:
(WebCore::Document::createAttribute):
* dom/Document.h:
* dom/Document.idl:
* dom/Element.cpp:
(WebCore::Element::getAttribute const):
* dom/Element.idl:
* dom/ElementContentEditable.idl:
* dom/Event.idl:
* dom/FocusEvent.idl:
* dom/FormDataEvent.idl:
* dom/HashChangeEvent.idl:
* dom/InputEvent.idl:
* dom/KeyboardEvent.idl:
* dom/MessageEvent.idl:
* dom/MouseEvent.idl:
* dom/MutationEvent.idl:
* dom/NamedNodeMap.idl:
* dom/Node.idl:
* dom/OverflowEvent.idl:
* dom/PageTransitionEvent.idl:
* dom/PointerEvent.idl:
* dom/ProgressEvent.idl:
* dom/PromiseRejectionEvent.idl:
* dom/SecurityPolicyViolationEvent.idl:
* dom/TextEvent.idl:
* dom/TouchEvent.idl:
* dom/TransitionEvent.idl:
* dom/UIEvent.idl:
* dom/WheelEvent.idl:
* html/HTMLButtonElement.idl:
* html/HTMLDocument.idl:
* html/HTMLElement.idl:
* html/HTMLFormElement.idl:
* html/HTMLImageElement.idl:
* html/HTMLInputElement.idl:
* html/HTMLLinkElement.idl:
* html/HTMLMediaElement.idl:
* html/HTMLScriptElement.idl:
* html/HTMLTableCellElement.idl:
* html/HTMLTrackElement.idl:
* html/MediaEncryptedEvent.idl:
* html/SubmitEvent.idl:
* html/track/AudioTrack.idl:
* html/track/AudioTrackList.idl:
* html/track/TextTrack.idl:
* html/track/TextTrackList.idl:
* html/track/VTTRegion.idl:
* html/track/VideoTrack.idl:
* html/track/VideoTrackList.idl:
* page/DOMWindow.idl:
* page/UserMessageHandlersNamespace.idl:
* storage/StorageEvent.idl:
* svg/SVGAltGlyphElement.idl:
* svg/SVGStyleElement.idl:
* workers/service/ExtendableEvent.idl:
* workers/service/ExtendableMessageEvent.idl:
* workers/service/FetchEvent.idl:
2022-04-13 Elliott Williams <emw@apple.com>
[Xcode] Fix public watchOS workspace build by updating scheme and build settings
https://bugs.webkit.org/show_bug.cgi?id=239301
Reviewed by Alexey Proskuryakov.
* Configurations/Base.xcconfig:
* Configurations/WebCore.xcconfig:
* Configurations/WebCoreTestSupport.xcconfig:
2022-04-13 Michael Catanzaro <mcatanzaro@redhat.com>
Misc compiler warnings, April 2022 edition
https://bugs.webkit.org/show_bug.cgi?id=239290
Reviewed by Adrian Perez de Castro.
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::canAccessResource const):
* page/DebugPageOverlays.cpp:
* page/InteractionRegion.cpp:
(WebCore::regionForElement):
* platform/graphics/GraphicsContextState.cpp:
(WebCore::stateChangeName):
* rendering/style/RenderStyle.cpp:
(WebCore::getPathFromPathOperation):
* style/ContainerQueryEvaluator.cpp:
(WebCore::Style::ContainerQueryEvaluator::evaluateSizeFeature const):
* testing/Internals.cpp:
(WebCore::Internals::categoryAtMostRecentPlayback const):
2022-04-13 Diego Pino Garcia <dpino@igalia.com>
Unreviewed, fix non-unified build after r292810
* editing/HTMLInterchange.h:
2022-04-13 Sihui Liu <sihui_liu@apple.com>
StorageMap::importItems may update currentSize wrongly in release build
https://bugs.webkit.org/show_bug.cgi?id=239255
Reviewed by Chris Dumez.
StorageMap::importItems() has a debug assertion that keys of imported items do not exist in map, but that does
not prevent this from happening in release build. With our current implementation, if this happens in release
build, we increase currentSize without updating the map, which may lead to overflow.
To make StorageMap more safe to use, we can calculate the correct currentSize based on size of exsiting item, as
in StorageMap::setItem(), or we just don't update currentSize or map if key already exists. Since current users
of StorageMap should only call importItems() when the map is empty, we can add an early return if map is not
empty.
* storage/StorageMap.cpp:
(WebCore::StorageMap::importItems):
2022-04-13 Commit Queue <commit-queue@webkit.org>
Unreviewed, reverting r292817.
https://bugs.webkit.org/show_bug.cgi?id=239305
some dialog tests are asserting
Reverted changeset:
"REGRESSION (r292043): [ Mac ] fast/block/positioning/fixed-
container-with-relative-parent.html is a flaky image failure"
https://bugs.webkit.org/show_bug.cgi?id=239101
https://commits.webkit.org/r292817
2022-04-13 Andres Gonzalez <andresg_22@apple.com>
Fix for accessibility/table-add-remove-rows.html in isolated tree mode.
https://bugs.webkit.org/show_bug.cgi?id=239271
<rdar://problem/91663287>
Reviewed by Chris Fleizach.
Test: accessibility/table-add-remove-rows.html
Added AXIsolatedTree::updateTableProperties() to recalculate all cached
table properties when the children of a table object change.
AXIsolatedTree::updateChildren now calls updateRelatedProperties to
update properties that can change as the result of children changes for
specific types of objects like tables, trees and treeitems.
Moved and renamed idsForObjects as axIDs() so that it can be used across
the board.
* accessibility/AccessibilityObjectInterface.h:
(WebCore::axIDs):
(WebCore::AXCoreObject::childrenIDs):
* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::setObjectVectorProperty):
(WebCore::AXIsolatedObject::setSelectedChildren):
* accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::updateNodeProperty):
(WebCore::AXIsolatedTree::updateTableProperties):
(WebCore::AXIsolatedTree::updateTreeItemProperties):
(WebCore::AXIsolatedTree::updateRelatedProperties):
(WebCore::AXIsolatedTree::updateChildren):
(WebCore::AXIsolatedTree::idsForObjects const): Moved to AccessibilityObjectInterface.h as axIDs().
* accessibility/isolatedtree/AXIsolatedTree.h:
2022-04-13 Antti Koivisto <antti@apple.com>
[CSS Container Queries] Correct container selection for pseudo-elements
https://bugs.webkit.org/show_bug.cgi?id=239279
Reviewed by Simon Fraser.
The element itself may be the container for its pseudo-elements.
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::computeNonCalcLengthDouble):
* style/ContainerQueryEvaluator.cpp:
(WebCore::Style::ContainerQueryEvaluator::ContainerQueryEvaluator):
(WebCore::Style::ContainerQueryEvaluator::selectContainer const):
(WebCore::Style::ContainerQueryEvaluator::selectContainer):
* style/ContainerQueryEvaluator.h:
Instead of passing the pseudo-element being matched, pass a container selection mode flag. The exact pseudo-element type
doesn't matter.
* style/ElementRuleCollector.cpp:
(WebCore::Style::ElementRuleCollector::containerQueriesMatch):
We need to use the pseudo-element mode when matching a rule that matches a pseudo-element, even when we are not actually resolving
the pseudo element. This is because regular element rule matching sets the style bits that indicate what pseudo-elements the
element has.
2022-04-13 Alan Bujtas <zalan@apple.com>
REGRESSION (r292043): [ Mac ] fast/block/positioning/fixed-container-with-relative-parent.html is a flaky image failure
https://bugs.webkit.org/show_bug.cgi?id=239101
<rdar://problem/91603539>
Reviewed by Antti Koivisto.
1. Out of flow boxes are laid out independently from each other as the last step of their containing block layout.
2. However their static positions are computed during regular in-flow layout (as if their positions were static).
In order to do #1, we maintain a ListHashSet for the out-of-flow boxes and insert them at #2 (and we also have
a corresponding HashMap<ContainingBlock, ListHasSet>).
Normally this is a very simple list of descendant positioned boxes and since out-of-flow boxes don't interact with each
other, their position in the list is not important.
e.g.
<div id=A style="position: relative">
<div>
<div id=B style="position: absolute"></div>
<div id=C style="position: absolute"></div>
</div>
</div>
At in-flow layout (#2), we insert B and C to "ListHashSet of A" as we come across them in DOM order and compute their static positions.
Later in the layout flow when we get to the "let's layout the out-of-flow boxes" phase (#1) we simply walk
the ListHashSet and lay out B and C (but "C and B" order would also work just fine).
However the ICB (RenderView) is a special containing block as it can hold different types of out-of-flow boxes (absolute and fixed)
and those out-of-flow boxes may have layout dependencies.
e.g.
<body><div id=A class=absolute><div id=B class=fixed></div></div></body>
ICB's ListHasSet has both A and B, but in this case there's (static)layout dependency between these boxes.
In order to figure out the static position of B, we have to have A laid out first. In order to lay out A before B,
B has to be preceded by A in ICB's ListHasSet.
Now full layout always guarantees the correct order.
However in case of partial layout since we don't run a full #2, the ListHasSet may end up having an unexpected order.
e.g.
<body><div id=A class=absolute><div id=B><div id=C class=fixed></div></div></div></body>
1. The initial (full) layout produces the following (correct) order for the ICB's ListHasSet -> AC.
2. A subsequent partial layout (e.g. triggered by A's position change) runs an in-flow layout on the <body> which
(re-)appends A to the ListHasSet (CA <- incorrect order). Now at this point we assume that the in-flow layout picks up B
which eventually (re-)appends C to the ListHashSet (AC <- correct order). However since B does not need layout, we just
stop at <body> which leaves us with an unexpected ListHashSet.
3. As part of the ICB's out-of-flow layout, we pick C as the first box to lay out followed by A. However since C's static
position depends on A's position, we end up using stale geometry when computing C's static position.
This patch fixes this issue by ensuring the absolute positioned boxes always come first in the ICB's ListHasSet (note
that their order is not really important -see above. What's important is that a potential (as-if-static) containing block always
comes before the fixed boxes).
Test: fast/block/fixed-inside-absolute-positioned.html
* rendering/RenderBlock.cpp:
(WebCore::PositionedDescendantsMap::addDescendant):
(WebCore::RenderBlock::insertPositionedObject):
2022-04-13 Antti Koivisto <antti@apple.com>
[CSS Container Queries] Limit query range syntax
https://bugs.webkit.org/show_bug.cgi?id=239118
Reviewed by Simon Fraser.
The spec disallows things like (100px = width < 200px) and (100px < width > 200px).
https://www.w3.org/TR/mediaqueries-4/#mq-range-context
* css/ContainerQueryParser.cpp:
(WebCore::ContainerQueryParser::consumeContainerQuery):
Try as a condition first.
Return UnknownQuery on parse failure.
(WebCore::ContainerQueryParser::consumeRangeSizeFeature):
Validate the ranges so what ends up being allowed matches the spec productions.
2022-04-13 Simon Fraser <simon.fraser@apple.com>
[css-scroll-snap] scrollIntoView fails with scroll-snap-type on :root
https://bugs.webkit.org/show_bug.cgi?id=239063
<rdar://problem/91603363>
Reviewed by Dean Jackson.
Programmatic smooth scrolls on iframe documents were broken because
ScrollingTreeFrameScrollingNodeRemoteIOS was overlooked when adding support (easily done
since the main frame's scrolling is controlled via the WKWebView; some unification here
would be beneficial). Implementing startAnimatedScrollToPosition() and stopAnimatedScroll()
on ScrollingTreeFrameScrollingNodeRemoteIOS fixes this.
However, this revealed an additional bug; RenderLayer::scrollRectToVisible() failed to clamp
the target scroll position correctly, and nothing in the iOS-smooth scrolling code path
clamped, so the scroll would go too far.
Testing required getting UIHelper.waitForScrollCompletion() to work. This is based on the
uiController.didEndScrollingCallback, but that was only hooked up for the main scroller. So
make it work for all scrollers by plumbing ScrollingNodeIDs through
scrollingNodeScrollViewDidScroll() and friends so that everything ends up in -[WKWebViewIOS
_didFinishScrolling:] with a UIScrollView argument; to avoid any behavior change, this bails
for non-main scroll views, but TestRunnerWKWebView overrides it to make testing work.
Test: fast/scrolling/ios/constrain-scrollintoview-position.html
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollRectToVisible):
2022-04-13 Chris Dumez <cdumez@apple.com>
Replace AtomString(const char*) with AtomString::fromLatin1(const char*)
https://bugs.webkit.org/show_bug.cgi?id=239127
Reviewed by Darin Adler.
* Modules/encryptedmedia/InitDataRegistry.cpp:
(WebCore::InitDataRegistry::InitDataRegistry):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::setElementAttributeValue):
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::commitStyles):
* dom/DocumentInlines.h:
(WebCore::Document::encoding const):
* dom/Element.cpp:
(WebCore::Element::dispatchWebKitImageReadyEventForTesting):
* dom/PseudoElement.cpp:
(WebCore::pseudoElementTagName):
* editing/Editing.cpp:
(WebCore::createTabSpanElement):
* editing/Editor.cpp:
(WebCore::Editor::willUnapplyEditing const):
(WebCore::Editor::unappliedEditing):
(WebCore::Editor::willReapplyEditing const):
(WebCore::Editor::reappliedEditing):
(WebCore::Editor::quoteFragmentForPasting):
* editing/HTMLInterchange.h:
* editing/IndentOutdentCommand.cpp:
(WebCore::IndentOutdentCommand::IndentOutdentCommand):
* editing/markup.cpp:
(WebCore::createFragmentFromText):
* html/HTMLAudioElement.cpp:
(WebCore::HTMLAudioElement::createForLegacyFactoryFunction):
* html/HTMLDetailsElement.cpp:
(WebCore::summarySlotName):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::setTranslate):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updateShouldContinueAfterNeedKey):
(WebCore::HTMLMediaElement::mediaPlayerKeyNeeded):
(WebCore::HTMLMediaElement::layoutSizeChanged):
* html/HTMLMeterElement.cpp:
(WebCore::setValueClass):
(WebCore::HTMLMeterElement::didAddUserAgentShadowRoot):
* html/ImageDocument.cpp:
(WebCore::ImageDocument::createDocumentStructure):
* html/PDFDocument.cpp:
(WebCore::PDFDocument::createDocumentStructure):
(WebCore::PDFDocument::injectStyleAndContentScript):
* html/canvas/CanvasRenderingContext2DBase.cpp:
* html/canvas/CanvasRenderingContext2DBase.h:
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::createForeignAttributesMap):
* html/parser/TextDocumentParser.cpp:
(WebCore::TextDocumentParser::insertFakePreElement):
* html/track/TextTrack.cpp:
(WebCore::TextTrack::captionMenuOffItem):
(WebCore::TextTrack::captionMenuAutomaticItem):
* html/track/TextTrackCue.cpp:
(WebCore::cueAttributName):
(WebCore::cueBackgroundAttributName):
* html/track/WebVTTElement.cpp:
(WebCore::nodeTypeToTagName):
* html/track/WebVTTElement.h:
* inspector/InspectorAuditAccessibilityObject.cpp:
(WebCore::InspectorAuditAccessibilityObject::getComputedProperties):
* inspector/InspectorOverlayLabel.cpp:
(WebCore::systemFont):
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyleSheetForInlineStyle::InspectorStyleSheetForInlineStyle):
(WebCore::InspectorStyleSheetForInlineStyle::elementStyleText const):
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::preloadIfNeeded):
* mathml/MathMLPresentationElement.cpp:
(WebCore::MathMLPresentationElement::isFlowContent):
* page/DebugPageOverlays.cpp:
(WebCore::NonFastScrollableRegionOverlay::drawRect):
(WebCore::InteractionRegionOverlay::drawSettings):
* page/Quirks.cpp:
(WebCore::Quirks::shouldTooltipPreventFromProceedingWithClick const):
(WebCore::Quirks::simulatedMouseEventTypeForTarget const):
(WebCore::isKinjaLoginAvatarElement):
(WebCore::isStorageAccessQuirkDomainAndElement):
(WebCore::isBBCPopUpPlayerElement):
(WebCore::Quirks::triggerOptionalStorageAccessQuirk const):
* platform/cocoa/VideoFullscreenModelVideoElement.mm:
(WebCore::VideoFullscreenModelVideoElement::eventNameAll):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::processMetadataTrack):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack):
* platform/graphics/avfoundation/objc/SourceBufferParserAVFObjC.mm:
* platform/graphics/ca/PlatformCALayer.cpp:
(WebCore::PlatformCALayer::drawRepaintIndicator):
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::drawText):
* platform/network/BlobRegistryImpl.cpp:
(WebCore::registerBlobResourceHandleConstructor):
* rendering/RenderCounter.cpp:
(showCounterRendererTree):
* rendering/RenderLayerBacking.cpp:
(WebCore::patternForDescription):
* rendering/mathml/RenderMathMLFenced.cpp:
* style/StyleResolveForDocument.cpp:
(WebCore::Style::resolveForDocument):
* svg/SVGFontFaceUriElement.cpp:
(WebCore::SVGFontFaceUriElement::srcValue const):
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::transferSizeAttributesToTargetClone const):
* workers/service/FetchEvent.cpp:
(WebCore::FetchEvent::createForTesting):
* xml/XMLErrors.cpp:
(WebCore::createXHTMLParserErrorHeader):
(WebCore::XMLErrors::insertErrorMessageBlock):
* xml/XMLTreeViewer.cpp:
(WebCore::XMLTreeViewer::transformDocumentToTreeView):
2022-04-13 Youenn Fablet <youenn@apple.com>
Complement implementation of step 5.5 of https://fetch.spec.whatwg.org/#http-fetch
https://bugs.webkit.org/show_bug.cgi?id=239123
Reviewed by Darin Adler.
Covered by rebased test.
* workers/service/context/ServiceWorkerFetch.cpp:
(WebCore::ServiceWorkerFetch::validateResponse):
2022-04-12 Chris Dumez <cdumez@apple.com>
Crash under CachedResourceClientWalker<WebCore::CachedImageClient>::next()
https://bugs.webkit.org/show_bug.cgi?id=239253
<rdar://91346216>
Reviewed by Simon Fraser and Brent Fulgham.
I haven't been able to reproduce the issue or figure out why this is happening so I am doing
some hardening and adding assertions to help catch the underlying bug.
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::didUpdateCachedImage):
There is some speculation that r291141 could have caused this because of the timing of when
this patch landed and the fact that this patch modifies ImageLoader, which is a CachedImageClient.
I couldn't see anything wrong with the change. However, I did notice that we were calling
didUpdateCachedImage() twice with the same CachedImage now for lazy loading (once initially and then
another time when the image actually starts lazily). This was intentional. However, the registering
again as a client of the CachedImage (and then unregistering right away) was not. Technically, this
should be fine since CachedResource is using a HashCountedSet for m_clients locally. However, for
the sake of safety, I am now not doing this redundant registering/unregistering as a client of
the CachedImage when this image has not changed.
* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::checkNotify):
* loader/cache/CachedFont.cpp:
(WebCore::CachedFont::checkNotify):
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::load):
(WebCore::CachedImage::addClientWaitingForAsyncDecoding):
(WebCore::CachedImage::notifyObservers):
(WebCore::CachedImage::canDestroyDecodedData):
(WebCore::CachedImage::imageFrameAvailable):
(WebCore::CachedImage::scheduleRenderingUpdate):
(WebCore::CachedImage::isVisibleInViewport):
(WebCore::CachedImage::isVisibleInViewport const): Deleted.
* loader/cache/CachedImage.h:
* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::notifyClientsDataWasReceived):
(WebCore::iterateRedirects):
(WebCore::CachedRawResource::redirectReceived):
The new assertions found a bug here where we were capturing the CachedRawResourceClient by value in the lambda and thus
making a copy of it (even though this is a polymorphic class). I fixed the bug and marked CachedResourceClient as non
copyable to avoid issues like these.
(WebCore::CachedRawResource::responseReceived):
(WebCore::CachedRawResource::shouldCacheResponse):
(WebCore::CachedRawResource::didSendData):
(WebCore::CachedRawResource::finishedTimingForWorkerLoad):
(WebCore::CachedRawResource::previewResponseReceived):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::checkNotify):
(WebCore::CachedResource::didAddClient):
(WebCore::CachedResource::addClientToSet):
(WebCore::CachedResource::removeClient):
* loader/cache/CachedResource.h:
* loader/cache/CachedResourceClient.h:
(WebCore::CachedResourceClient::~CachedResourceClient):
(WebCore::CachedResourceClient::addAssociatedResource):
(WebCore::CachedResourceClient::removeAssociatedResource):
Add new assertions to make sure that a CachedResourceClient is no longer associated (i.e. marked as a client of) with
any CachedResource at the time it is destroyed. Hopefully, this will catch the issue right away and give us a useful
stack trace, instead of crashing later on when iterating over the clients of a CachedResource.
* loader/cache/CachedResourceClientWalker.h:
(WebCore::CachedResourceClientWalker::CachedResourceClientWalker):
(WebCore::CachedResourceClientWalker::next):
CachedResourceClientWalker is meant to be a safe way of iterating over the clients of a CachedResource, allowing clients
to unregister themselves as we iterate. However, when clients unregister themselves, it could in theory cause the
CachedResource itself to get destroyed. In such cases, the CachedResourceClientWalker would not be safe since its
m_clientSet data member would come from a dead CachedResource. To address the issue, the walker now keeps a handle to
the cached resource, instead of the reference to the CachedResource's clients set. The handle will ensure the cached
resource stays alive.
* loader/cache/CachedScript.cpp:
* loader/cache/CachedTextTrack.cpp:
(WebCore::CachedTextTrack::doUpdateBuffer):
* loader/cache/CachedXSLStyleSheet.cpp:
(WebCore::CachedXSLStyleSheet::checkNotify):
* rendering/RenderObject.cpp:
2022-04-12 Wenson Hsieh <wenson_hsieh@apple.com>
Remove support for drawing cropped image overlays when hovering over "Copy Cropped Image"
https://bugs.webkit.org/show_bug.cgi?id=239269
Reviewed by Darin Adler.
Revert <https://trac.webkit.org/r290211> -- the corresponding UI is no longer plan of record.
* dom/ImageOverlay.cpp:
(WebCore::ImageOverlay::installImageOverlayStyleSheet):
(WebCore::ImageOverlay::imageOverlayCroppedImageIdentifier): Deleted.
(WebCore::ImageOverlay::imageOverlayCroppedImageBackdropIdentifier): Deleted.
(WebCore::ImageOverlay::CroppedImage::install): Deleted.
(WebCore::ImageOverlay::CroppedImage::CroppedImage): Deleted.
(WebCore::ImageOverlay::CroppedImage::~CroppedImage): Deleted.
(WebCore::ImageOverlay::CroppedImage::setVisibility): Deleted.
* dom/ImageOverlay.h:
* html/shadow/imageOverlay.css:
(div.image-overlay-data-detector-result):
(img#image-overlay-cropped-image): Deleted.
(div#image-overlay-cropped-image-backdrop): Deleted.
* testing/Internals.cpp:
(WebCore::Internals::installCroppedImageOverlay): Deleted.
(WebCore::Internals::uninstallCroppedImageOverlay): Deleted.
* testing/Internals.h:
* testing/Internals.idl:
2022-04-12 Asumu Takikawa <asumu@igalia.com>
Allow Wasm import from a JS Worker module
https://bugs.webkit.org/show_bug.cgi?id=238291
Reviewed by Yusuke Suzuki.
Adds new source provider for Wasm module loading when imported via
a JS module running in a Worker. Also adjust how WorkerRunLoop
processes tasks for script module loading. In particular, during
the module parsing phase, Wasm modules schedule async tasks that
need to be run to produce a module record.
When a Wasm module is loaded (via the module loader's module parsing
step), the validation/compilation happens asynchronously and
completion callbacks are run via
DeferredWorkTimer::scheduleWorkSoon, which queues up microtasks
from the VM. These microtasks, however, don't get run in a Worker
run loop during module loading and therefore the Wasm module never
finishes loading.
This is because during non-default modes, the Worker run loop
does not install its set timer callback, and continues to wait for
a task to run (due to infinite timeout). This means the microtask
checkpoint is also not reached, so other microtasks cannot run.
In non-default modes, the run loop also ignores all tasks that were
not installed in that particular mode.
In addition, the Worker event loop cannot run either, as it posts
default mode tasks to the run loop to trigger its operation.
The current patch modifies the run loop to allow the run loop to time
out even in non-default modes if a `useTimeout` parameter is passed as
true (defaults to false). We set this to true for the Worker module
loading process. It also allows the timer notification callback to
post tasks to non-default run loops.
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/ScriptBufferSourceProvider.h:
(WebCore::AbstractScriptBufferHolder::~AbstractScriptBufferHolder):
* bindings/js/ScriptModuleLoader.cpp:
(WebCore::ScriptModuleLoader::notifyFinished):
* bindings/js/WebAssemblyScriptBufferSourceProvider.h: Added.
* bindings/js/WebAssemblyScriptSourceCode.h:
(WebCore::WebAssemblyScriptSourceCode::WebAssemblyScriptSourceCode):
* workers/ScriptBuffer.cpp:
(WebCore::ScriptBuffer::append):
* workers/ScriptBuffer.h:
* workers/WorkerEventLoop.cpp:
(WebCore::WorkerEventLoop::scheduleToRun):
(WebCore::WorkerEventLoop::taskMode):
* workers/WorkerEventLoop.h:
* workers/WorkerOrWorkletGlobalScope.cpp:
(WebCore::WorkerOrWorkletGlobalScope::postTaskForMode):
* workers/WorkerOrWorkletGlobalScope.h:
* workers/WorkerOrWorkletScriptController.cpp:
(WebCore::WorkerOrWorkletScriptController::loadModuleSynchronously):
* workers/WorkerRunLoop.cpp:
(WebCore::ModePredicate::ModePredicate):
(WebCore::ModePredicate::mode const):
(WebCore::ModePredicate::operator() const):
(WebCore::WorkerDedicatedRunLoop::run):
(WebCore::WorkerDedicatedRunLoop::runInDebuggerMode):
(WebCore::WorkerDedicatedRunLoop::runInMode):
(WebCore::WorkerMainRunLoop::runInMode):
* workers/WorkerRunLoop.h:
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::didReceiveData):
2022-04-12 Elliott Williams <emw@apple.com>
[Xcode] In open-source builds, disable bitcode in xcconfigs instead of build-webkit
https://bugs.webkit.org/show_bug.cgi?id=239262
Reviewed by Alexey Proskuryakov.
* Configurations/Base.xcconfig:
2022-04-12 Chris Dumez <cdumez@apple.com>
Use safer downcast<>() for CachedResourceClient subclasses
https://bugs.webkit.org/show_bug.cgi?id=239220
Reviewed by Simon Fraser.
* loader/LinkPreloadResourceClients.h:
(WebCore::LinkPreloadImageResourceClient::LinkPreloadImageResourceClient):
* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::didAddClient):
* loader/cache/CachedFont.cpp:
(WebCore::CachedFont::didAddClient):
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::didAddClient):
(WebCore::CachedImage::didRemoveClient):
* loader/cache/CachedImageClient.h:
* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::didAddClient):
* loader/cache/CachedRawResourceClient.h:
* loader/cache/CachedResourceClient.h:
* loader/cache/CachedResourceLoader.cpp:
(WebCore::createResource):
* loader/cache/CachedSVGDocumentClient.h:
* loader/cache/CachedStyleSheetClient.h:
* loader/cache/CachedXSLStyleSheet.cpp:
(WebCore::CachedXSLStyleSheet::didAddClient):
2022-04-12 Devin Rousso <drousso@apple.com>
[Modern Media Controls] allow skipping by durations other than 15s
https://bugs.webkit.org/show_bug.cgi?id=239260
<rdar://problem/91441576>
Reviewed by Eric Carlson.
* Modules/modern-media-controls/main.js:
* Modules/modern-media-controls/controls/ios-layout-traits.js:
(IOSLayoutTraits.prototype.skipDuration): Added.
* Modules/modern-media-controls/controls/layout-traits.js:
(LayoutTraits.prototype.skipDuration): Added.
* Modules/modern-media-controls/controls/macos-layout-traits.js:
(MacOSLayoutTraits.prototype.skipDuration): Added.
* Modules/modern-media-controls/controls/skip-back-button.js:
(SkipBackButton):
* Modules/modern-media-controls/controls/skip-forward-button.js:
(SkipForwardButton):
* Modules/modern-media-controls/controls/watchos-layout-traits.js:
(WatchOSLayoutTraits.prototype.skipDuration): Added.
* Modules/modern-media-controls/media/skip-back-support.js:
(SkipBackSupport.prototype.buttonWasPressed):
* Modules/modern-media-controls/media/skip-forward-support.js:
(SkipForwardSupport.prototype.buttonWasPressed):
Instead of hardcoding the `SkipDuration` to `15`, have the `LayoutTraits` to define it.
* Modules/modern-media-controls/controls/icon-service.js:
* Modules/modern-media-controls/images/iOS/SkipBack10.svg: Added.
* Modules/modern-media-controls/images/iOS/SkipBack15.svg:
* Modules/modern-media-controls/images/iOS/SkipForward10.svg: Added.
* Modules/modern-media-controls/images/iOS/SkipForward15.svg:
* Modules/modern-media-controls/images/macOS/SkipBack10.svg: Added.
* Modules/modern-media-controls/images/macOS/SkipBack15.svg:
* Modules/modern-media-controls/images/macOS/SkipForward10.svg: Added.
* Modules/modern-media-controls/images/macOS/SkipForward15.svg:
* en.lproj/modern-media-controls-localized-strings.js:
Add existing icons for other skip durations.
2022-04-12 Tim Horton <timothy_horton@apple.com>
Adopt "version set"-based linked-on-or-after checks instead of platform-specific ones
https://bugs.webkit.org/show_bug.cgi?id=239054
<rdar://problem/83436715>
Reviewed by Wenson Hsieh.
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::allowsLegacyExpandoIndexedProperties):
* bindings/js/JSWindowProxy.cpp:
(WebCore::JSWindowProxy::setWindow):
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::requiresFullscreenForVideoPlayback const):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
* page/Quirks.cpp:
(WebCore::Quirks::needsWeChatScrollingQuirk const):
(WebCore::Quirks::shouldOmitHTMLDocumentSupportedPropertyNames):
* page/SecurityOrigin.cpp:
(WebCore::shouldTreatAsUniqueOrigin):
* platform/Timer.cpp:
(WebCore::shouldSuppressThreadSafetyCheck):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::isDotPrefixedForbiddenFont):
* platform/network/DataURLDecoder.cpp:
(WebCore::DataURLDecoder::shouldRemoveFragmentIdentifier):
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::setLinkedOnOrAfterEverythingForTesting):
Adopt the new naming.
2022-04-12 Elliott Williams <emw@apple.com>
Reland "[XCBuild] Enable dependency validation by default"
https://bugs.webkit.org/show_bug.cgi?id=238901
<rdar://problem/91379968>
Reviewed by Alexey Proskuryakov.
* Configurations/DebugRelease.xcconfig: In open-source builds, disable
VALIDATE_DEPENDENCIES when there is no PRODUCT_TYPE (i.e. not building
a native target).
2022-04-12 Jer Noble <jer.noble@apple.com>
Leak of MediaSourcePrivateAVFObjC and RemoteMediaSourceProxy
https://bugs.webkit.org/show_bug.cgi?id=239088
<rdar://90693094>
Reviewed by Eric Carlson.
MediaSourcePrivateAVFObjC holds a strong reference to its MediaSourcePrivateClient, which is
a MediaSource when running in-process, but a RemoteMediaSourceProxy when running in multi-process.
In both cases, the MediaSourcePrivateClient holds a strong reference to its private object as well.
However, in the multi-process scenario, this cycle is never broken, causing a leak.
Rather than determine the correct point to break this retain-cycle, modify MediaSourcePrivateClient
to be a CanMakeWeakPtr abstract class (rather than a RefCounted one), and convert all cases where
that client's pointer is stored from a Ref/RefPtr to a WeakPtr. This means having to null-check
every time that pointer is used.
* Modules/mediasource/MediaSource.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::loadResource):
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::load):
(WebCore::MediaPlayer::loadWithNextMediaEngine):
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
* platform/graphics/MediaSourcePrivateClient.h:
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::load):
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::load):
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
(WebCore::MediaSourcePrivateAVFObjC::create):
(WebCore::MediaSourcePrivateAVFObjC::MediaSourcePrivateAVFObjC):
(WebCore::MediaSourcePrivateAVFObjC::duration const):
(WebCore::MediaSourcePrivateAVFObjC::buffered):
(WebCore::MediaSourcePrivateAVFObjC::seekToTime):
(WebCore::MediaSourcePrivateAVFObjC::failedToCreateRenderer):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::load):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::load):
(WebCore::MediaPlayerPrivateGStreamerMSE::unblockDurationChanges):
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
* platform/graphics/holepunch/MediaPlayerPrivateHolePunch.h:
* platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
(WebCore::MockMediaPlayerMediaSource::load):
* platform/mock/mediasource/MockMediaPlayerMediaSource.h:
* platform/mock/mediasource/MockMediaSourcePrivate.cpp:
(WebCore::MockMediaSourcePrivate::MockMediaSourcePrivate):
(WebCore::MockMediaSourcePrivate::duration):
(WebCore::MockMediaSourcePrivate::buffered):
(WebCore::MockMediaSourcePrivate::seekToTime):
* platform/mock/mediasource/MockMediaSourcePrivate.h:
2022-04-12 Ada Chan <adachan@apple.com>
[WebXR] Implement the WebXRFrame methods for getting joints' poses and radii
https://bugs.webkit.org/show_bug.cgi?id=238968
Reviewed by Dean Jackson.
Tests: http/wpt/webxr/xrFrame_fillJointRadii.html
http/wpt/webxr/xrFrame_fillJointRadii_missing_joint_pose.html
http/wpt/webxr/xrFrame_fillPoses.html
http/wpt/webxr/xrFrame_fillPoses_missing_joint_pose.html
http/wpt/webxr/xrFrame_getJointPose.html
http/wpt/webxr/xrFrame_getJointPose_missing_joint_pose.html
http/wpt/webxr/xrHand.html
- Implement the methods in WebXRFrame for getting joints' poses and radii.
- Add a new InputSourceHandJoint struct to represent joint data, and add
a vector of InputSourceHandJoint in PlatformXR::Device::FrameData::InputSource
to represent the joints data.
- Implement logic for managing a vector of WebXRJointSpaces in WebXRHand and
updating it with new hand joints data from PlatformXR::Device::FrameData::InputSource.
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Modules/webxr/WebXRFrame+HandInput.idl:
* Modules/webxr/WebXRFrame.cpp:
(WebCore::WebXRFrame::populatePose):
There are valid cases when the WebXRSpace's effective origin can be null,
for example, a joint pose from a hand that has other missing joint poses.
Just return null and not throw an exception in that case.
(WebCore::WebXRFrame::getJointPose):
Populate the joint's pose, and create a WebXRJointPose with the pose's
transform and the joint's radius.
(WebCore::WebXRFrame::fillJointRadii):
Validate the inputs and fill in the radii array. Fill in with NaN
if the hand has missing joint poses.
(WebCore::WebXRFrame::fillPoses):
Validate the inputs and fill in the transforms array. Fill in with NaN
if the hand has missing joint poses.
* Modules/webxr/WebXRFrame.h:
* Modules/webxr/WebXRHand.cpp:
(WebCore::WebXRHand::WebXRHand):
Initialize the m_joints array.
(WebCore::WebXRHand::get):
(WebCore::WebXRHand::Iterator::next):
(WebCore::WebXRHand::session):
(WebCore::WebXRHand::updateFromInputSource):
Update m_joints array based on the latest hands data from InputSource.
* Modules/webxr/WebXRHand.h:
(WebCore::WebXRHand::size):
(WebCore::WebXRHand::hasMissingPoses const):
* Modules/webxr/WebXRInputSource.cpp:
(WebCore::WebXRInputSource::update):
* Modules/webxr/WebXRJointPose.cpp:
(WebCore::WebXRJointPose::create):
(WebCore::WebXRJointPose::WebXRJointPose):
Handle joint radius.
* Modules/webxr/WebXRJointPose.h:
* Modules/webxr/WebXRJointPose.idl:
* Modules/webxr/WebXRJointSpace.cpp:
(WebCore::WebXRJointSpace::create):
(WebCore::WebXRJointSpace::WebXRJointSpace):
Handle joint name and the actual pose data. Keep a weak ptr to the WebXRHand.
(WebCore::WebXRJointSpace::updateFromJoint):
(WebCore::WebXRJointSpace::handHasMissingPoses const):
(WebCore::WebXRJointSpace::session const):
(WebCore::WebXRJointSpace::nativeOrigin const):
Return null pose transforms if there are missing joint poses.
* Modules/webxr/WebXRJointSpace.h:
(WebCore::WebXRJointSpace::jointName const):
(WebCore::WebXRJointSpace::radius const):
* Modules/webxr/WebXRJointSpace.idl:
* Modules/webxr/WebXRSession.cpp:
(WebCore::WebXRSession::isHandTrackingEnabled const):
* Modules/webxr/WebXRSession.h:
* WebCore.xcodeproj/project.pbxproj:
* platform/xr/PlatformXR.h:
(PlatformXR::Device::FrameData::InputSourceHandJoint::encode const):
(PlatformXR::Device::FrameData::InputSourceHandJoint::decode):
(PlatformXR::Device::FrameData::InputSource::encode const):
(PlatformXR::Device::FrameData::InputSource::decode):
* testing/FakeXRInputSourceInit.h:
* testing/FakeXRInputSourceInit.idl:
Allow test InputSource to be created with an array of joints.
* testing/FakeXRJointStateInit.h: Copied from Source/WebCore/Modules/webxr/WebXRJointPose.idl.
* testing/FakeXRJointStateInit.idl: Copied from Source/WebCore/Modules/webxr/WebXRJointPose.idl.
Define init dictionary for joint data.
* testing/WebFakeXRInputController.cpp:
(WebCore::WebFakeXRInputController::WebFakeXRInputController):
(WebCore::WebFakeXRInputController::getFrameData):
(WebCore::WebFakeXRInputController::updateHandJoints):
Update m_handJoints based on joint init dictionaries.
* testing/WebFakeXRInputController.h:
* testing/WebFakeXRInputController.idl:
* testing/WebXRTest.cpp:
(WebCore::parseFeatures):
(WebCore::WebXRTest::simulateDeviceConnection):
Allow test device to specify a list of enabled features that don't need
further explicit consent.
* testing/WebXRTest.h:
* testing/WebXRTest.idl:
2022-04-12 Gabriel Nava Marino <gnavamarino@apple.com>
RejectedPromiseTracker can be recreated if we are in a worker / worklet whose execution is terminating
https://bugs.webkit.org/show_bug.cgi?id=239130
Reviewed by Chris Dumez.
We update ScriptExecutionContext::ensureRejectedPromiseTrackerSlow so that we wont
recreate the promise tracker if we are in a worker / worklet whose execution is terminating.
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::promiseRejectionTracker):
* bindings/js/JSExecState.cpp:
(WebCore::JSExecState::didLeaveScriptContext):
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::ensureRejectedPromiseTrackerSlow):
* dom/ScriptExecutionContext.h:
(WebCore::ScriptExecutionContext::ensureRejectedPromiseTracker):
2022-04-12 Tyler Wilcock <tyler_w@apple.com>
AX: Incorrect role on dynamic lists
https://bugs.webkit.org/show_bug.cgi?id=238831
Reviewed by Andres Gonzalez.
AccessibilityList objects cache their role after running
AccessibilityNodeObject::determineAccessibilityRole, but we never
recomputed it when necessary.
With this patch, when the children of a list changes, we also
re-compute its role, since a list's role is dependent on its children.
Test: accessibility/list-with-dynamically-changing-content.html
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::handleChildrenChanged):
(WebCore::AXObjectCache::handleRoleChange):
(WebCore::AXObjectCache::handleAriaRoleChanged):
Renamed to handleRoleChange.
* accessibility/AXObjectCache.h:
(WebCore::AXObjectCache::handleRoleChange):
(WebCore::AXObjectCache::handleAriaRoleChanged):
Renamed to handleRoleChange.
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::updateRole):
(WebCore::AccessibilityNodeObject::updateAccessibilityRole):
Renamed to updateRole.
* accessibility/AccessibilityNodeObject.h:
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::updateRole):
(WebCore::AccessibilityObject::updateAccessibilityRole):
Renamed to updateRole.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::updateRoleAfterChildrenCreation):
* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::addChildren):
2022-04-12 Zan Dobersek <zdobersek@igalia.com>
[GTK][WPE] Move DMABuf-backed GraphicsContextGLANGLE functionality into a standalone derivation chain
https://bugs.webkit.org/show_bug.cgi?id=239037
Reviewed by Carlos Garcia Campos.
For the purposes of ANGLE-backed WebGL execution, the Linux-y ports are
for now leveraging DMABuf infrastructure through the libgbm dependency.
Right now this could be used for both the current in-WebProcess
execution as well as under-construction in-GPUProcess execution.
The former requires all the GBM bits and bolts that are then tied
together with a Nicosia::GCGLANGLELayer instance that takes care of
presenting the rendered-into DMABuf objects in TextureMapper. The latter
requires just the bits and bolts, but it runs those in the GPUProcess
and then takes the DMABuf objects and transports them over IPC to the
point of integration into the composition engine. At the moment that's
still the TextureMapper in WebProcess, but that can move in the future.
The GraphicsContextGLTextureMapperANGLE class has different parts of
GBM/DMABuf integration removed. Class is now additionally guarded with
the !USE(NICOSIA) flag so that it remains buildable on the Win port
which uses this class for ANGLE integration into the Nicosia-less
TextureMapper configuration.
These parts are now moved into the GraphicsContextGLGBM and
GraphicsContextGLGBMTextureMapper classes. The first one does all the
heavy work, and the second one just adds on top the TextureMapper
integration through the Nicosia::GCGLANGLELayer class.
In the GraphicsContextGLGBMTextureMapper implementation file, the
createWebProcessGraphicsContextGL() function returns an object of that
type, meaning it's the implementation that should be used on the
WebProcess side. The TextureMapper-less GraphicsContextGLGBM class is
the implementation that will be used inside the GPUProcess.
* SourcesGTK.txt:
* SourcesWPE.txt:
* platform/TextureMapper.cmake:
* platform/graphics/gbm/GraphicsContextGLGBM.cpp: Copied from Source/WebCore/platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.cpp.
(WebCore::GraphicsContextGLANGLE::GraphicsContextGLANGLE):
(WebCore::GraphicsContextGLANGLE::~GraphicsContextGLANGLE):
(WebCore::GraphicsContextGLANGLE::platformDisplay const):
(WebCore::GraphicsContextGLANGLE::platformConfig const):
(WebCore::GraphicsContextGLANGLE::makeContextCurrent):
(WebCore::GraphicsContextGLANGLE::checkGPUStatus):
(WebCore::GraphicsContextGLANGLE::platformReleaseThreadResources):
(WebCore::GraphicsContextGLANGLE::readCompositedResults):
(WebCore::GraphicsContextGLGBM::create):
(WebCore::GraphicsContextGLGBM::GraphicsContextGLGBM):
(WebCore::GraphicsContextGLGBM::platformInitializeContext):
(WebCore::GraphicsContextGLGBM::platformInitialize):
(WebCore::GraphicsContextGLGBM::prepareTexture):
(WebCore::GraphicsContextGLGBM::layerContentsDisplayDelegate):
(WebCore::GraphicsContextGLGBM::copyTextureFromMedia):
(WebCore::GraphicsContextGLGBM::paintCompositedResultsToVideoFrame):
(WebCore::GraphicsContextGLGBM::setContextVisibility):
(WebCore::GraphicsContextGLGBM::reshapeDisplayBufferBacking):
(WebCore::GraphicsContextGLGBM::prepareForDisplay):
(WebCore::GraphicsContextGLGBM::Swapchain::Swapchain):
(WebCore::GraphicsContextGLGBM::Swapchain::~Swapchain):
* platform/graphics/gbm/GraphicsContextGLGBM.h: Added.
(WebCore::GraphicsContextGLGBM::swapchain):
* platform/graphics/gbm/GraphicsContextGLGBMTextureMapper.cpp: Added.
(WebCore::createWebProcessGraphicsContextGL):
(WebCore::GraphicsContextGLGBMTextureMapper::create):
(WebCore::GraphicsContextGLGBMTextureMapper::GraphicsContextGLGBMTextureMapper):
(WebCore::GraphicsContextGLGBMTextureMapper::layerContentsDisplayDelegate):
(WebCore::GraphicsContextGLGBMTextureMapper::platformInitialize):
* platform/graphics/gbm/GraphicsContextGLGBMTextureMapper.h: Added.
* platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.cpp:
(Nicosia::GCGLANGLELayer::swapBuffersIfNeeded):
(Nicosia::GCGLANGLELayer::GCGLANGLELayer):
* platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.h:
* platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.cpp:
(WebCore::GraphicsContextGLANGLE::makeContextCurrent):
(WebCore::GraphicsContextGLTextureMapperANGLE::~GraphicsContextGLTextureMapperANGLE):
(WebCore::GraphicsContextGLTextureMapperANGLE::platformInitializeContext):
(WebCore::GraphicsContextGLTextureMapperANGLE::platformInitialize):
(WebCore::GraphicsContextGLTextureMapperANGLE::prepareTexture):
(WebCore::GraphicsContextGLTextureMapperANGLE::reshapeDisplayBufferBacking):
(WebCore::GraphicsContextGLTextureMapperANGLE::prepareForDisplay):
(WebCore::GraphicsContextGLTextureMapperANGLE::Swapchain::Swapchain): Deleted.
(WebCore::GraphicsContextGLTextureMapperANGLE::Swapchain::~Swapchain): Deleted.
* platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.h:
2022-04-11 Tyler Wilcock <tyler_w@apple.com>
AX: Update isolated tree in response to AXReadOnlyStatusChanged, AXRequiredStatusChanged, and AXPressedStateChanged notifications
https://bugs.webkit.org/show_bug.cgi?id=239047
Reviewed by Chris Fleizach.
When these notifications come in for a live object, we need to update the
cached properties of the corresponding isolated object.
Tests: accessibility/aria-readonly-updates-after-dynamic-change.html,
accessibility/aria-required-updates-after-dynamic-change.html,
accessibility/mac/aria-pressed-button-attributes.html
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::updateIsolatedTree):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityIsAttributeSettable:]):
(-[WebAccessibilityObjectWrapper accessibilityIsRequired]):
Added both of these methods so the tests added in this patch can run on iOS.
* accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::updateNodeProperty):
Handle updates to AXPropertyName::IsRequired, AXPropertyName::CanSetValueAttribute,
and AXPropertyName::ReadOnlyValue.
2022-04-11 Antti Koivisto <antti@apple.com>
[CSS Container Queries] Update container shorthand order
https://bugs.webkit.org/show_bug.cgi?id=239065
Reviewed by Alan Bujtas.
The format is now 'name / type' instead of 'type / name'.
https://drafts.csswg.org/css-contain-3/#container-shorthand
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
* css/StyleProperties.cpp:
(WebCore::isNoneValue):
(WebCore::isValueID):
(WebCore::StyleProperties::getPropertyValue const):
Also make "foo / none" serialize as "foo".
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeContainerName):
(WebCore::CSSPropertyParser::consumeContainerShorthand):
2022-04-11 Patrick Angle <pangle@apple.com>
Web Inspector: preserve DOM.NodeId if a node is removed and re-added
https://bugs.webkit.org/show_bug.cgi?id=189687
Reviewed by Devin Rousso.
Instead of unbinding and rebinding nodes upon removal/reinsertion to the DOM tree, we should only perform the
unbinding actions on a `Node` that is being destroyed.
This resolves an issue where console messages with DOM nodes would behave unexpectedly because the node for a
visible console message could have its children removed in `DOMManager.prototype._unbind`, even though the node
would still have its children when it is removed from the DOM tree (unless it is being destroyed, which is
handled by `DOMManager.prototype.willDestroyDOMNode`).
While not a cause of an issue here, it is worth noting (due to confusion it caused me while investigating) that
even after we stopped keeping `RefPtr<Node>` for nodes in r278785 the nodes themselves continued to be kept
alive as part of the `RemoteObject` mechanism because the inspector injected script holds on to nodes until the
`RemoteObject` is released.
* inspector/agents/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::nodeLayoutContextTypeChanged):
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::reset):
(WebCore::InspectorDOMAgent::bind):
(WebCore::InspectorDOMAgent::didCommitLoad):
(WebCore::InspectorDOMAgent::didInsertDOMNode):
(WebCore::InspectorDOMAgent::didRemoveDOMNode):
(WebCore::InspectorDOMAgent::pseudoElementDestroyed):
(WebCore::InspectorDOMAgent::unbind): Deleted.
- We should no longer be unbinding and rebinding nodes on insertion/removal, since nodes should keep the same ID
for their lifetime, and we will clean up the binding upon the Node's destruction.
(WebCore::InspectorDOMAgent::willDestroyDOMNode):
(WebCore::InspectorDOMAgent::destroyedNodesTimerFired):
- A Node in middle of being destroyed will no longer have a parent.
* inspector/agents/InspectorDOMAgent.h:
2022-04-11 Alan Bujtas <zalan@apple.com>
[IFC][Integration] LayoutIntegration::LineLayout should not expose InlineContent
https://bugs.webkit.org/show_bug.cgi?id=239059
Reviewed by Antti Koivisto.
Implement inkOverflowTop/inkOverflowBottom for inline iterator (LineBox) so that we can
keep InlineContent internal to LayoutIntegration::LineLayout.
* layout/integration/InlineIteratorLineBox.h:
(WebCore::InlineIterator::LineBox::inkOverflowTop const):
(WebCore::InlineIterator::LineBox::inkOverflowBottom const):
* layout/integration/InlineIteratorLineBoxLegacyPath.h:
(WebCore::InlineIterator::LineBoxIteratorLegacyPath::inkOverflowTop const):
(WebCore::InlineIterator::LineBoxIteratorLegacyPath::inkOverflowBottom const):
* layout/integration/InlineIteratorLineBoxModernPath.h:
(WebCore::InlineIterator::LineBoxIteratorModernPath::inkOverflowTop const):
(WebCore::InlineIterator::LineBoxIteratorModernPath::inkOverflowBottom const):
* layout/integration/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::hasVisualOverflow const):
* layout/integration/LayoutIntegrationLineLayout.h:
(WebCore::LayoutIntegration::LineLayout::isPaginated const):
(WebCore::LayoutIntegration::LineLayout::inlineContent const): Deleted.
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutModernLines):
2022-04-11 Myles C. Maxfield <mmaxfield@apple.com>
[WebGPU] Hook up device.queue to the IDL
https://bugs.webkit.org/show_bug.cgi?id=239043
Reviewed by Kimmo Kinnunen.
It seems when I imported the WebGPU IDLs, I somehow skipped GPUDevice.queue.
I was probably unsure about the ownership model. Now that the ownership model
is straightened out, this can be implemented.
This is needed to run any of the CTS tests.
* Modules/WebGPU/GPUDevice.cpp:
(WebCore::GPUDevice::queue const):
* Modules/WebGPU/GPUDevice.h:
(WebCore::GPUDevice::m_queue):
(WebCore::GPUDevice::m_backing): Deleted.
* Modules/WebGPU/GPUDevice.idl:
2022-04-11 Philippe Normand <pnormand@igalia.com>
[GStreamer] Debugs logs from VideoSinkCommon are missing
https://bugs.webkit.org/show_bug.cgi?id=239049
Reviewed by Adrian Perez de Castro.
When this new module was added, the logging support was lost due to missing logging category.
* platform/graphics/gstreamer/GStreamerVideoSinkCommon.cpp:
(webKitVideoSinkSetMediaPlayerPrivate):
2022-04-11 Nikolaos Mouchtaris <nmouchtaris@apple.com>
calc(): Propogate nan for min, max, clamp, and hypot
https://bugs.webkit.org/show_bug.cgi?id=238974
Reviewed by Darin Adler.
If min, max, clamp, and hypot have a NaN value we need to propagate the NaN. This has to
do with the "infectious" NaN behavior the spec mentions. This patch also removes some
unnecessary code in CSSCalcPrimitiveValueNode::invert() and has clamp() properly serialize.
May want to separate them and expand clamp() serialization testing so it would have caught
this issue.
* css/calc/CSSCalcOperationNode.cpp:
(WebCore::CSSCalcOperationNode::combineChildren):
(WebCore::CSSCalcOperationNode::simplifyNode):
(WebCore::CSSCalcOperationNode::evaluateOperator):
* css/calc/CSSCalcOperationNode.h:
* css/calc/CSSCalcPrimitiveValueNode.cpp:
(WebCore::CSSCalcPrimitiveValueNode::invert):
2022-04-11 Devin Rousso <drousso@apple.com>
[Modern Media Controls] remove unnecessary `LayoutTraits` methods
https://bugs.webkit.org/show_bug.cgi?id=239018
<rdar://problem/91324687>
Reviewed by Eric Carlson.
* Modules/modern-media-controls/controls/layout-traits.js:
(LayoutTraits.prototype.knobStyleForScrubber): Deleted.
(LayoutTraits.prototype.playPauseButtonScaleFactor): Deleted.
* Modules/modern-media-controls/controls/ios-layout-traits.js:
(IOSLayoutTraits.prototype.knobStyleForScrubber): Deleted.
(IOSLayoutTraits.prototype.playPauseButtonScaleFactor): Deleted.
* Modules/modern-media-controls/controls/macos-layout-traits.js:
(MacOSLayoutTraits.prototype.knobStyleForScrubber): Deleted.
(MacOSLayoutTraits.prototype.playPauseButtonScaleFactor): Deleted.
* Modules/modern-media-controls/controls/watchos-layout-traits.js:
(WatchOSLayoutTraits.prototype.knobStyleForScrubber): Deleted.
(WatchOSLayoutTraits.prototype.playPauseButtonScaleFactor): Deleted.
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
(MacOSFullscreenMediaControls):
* Modules/modern-media-controls/controls/macos-inline-media-controls.js:
(MacOSInlineMediaControls):
* Modules/modern-media-controls/controls/play-pause-button.js:
(PlayPauseButton):
* Modules/modern-media-controls/controls/time-control.js:
(TimeControl):
Remove these functions as they are much more controllable by having the `MediaControls`
subclass set the related property directly. Having them be on `LayoutTraits` also makes it
more difficult to handle situations where the state of the `MediaControls` influences the
value given to the property (e.g. whether to use the video or audio layout).
* Modules/modern-media-controls/controls/buttons-container.js:
(ButtonsContainer):
Expose the default value of `leftMargin`, `rightMargin`, and `buttonMargin` so that if the
`MediaControls` wants to reset one of the above overrides, it doesn't need a magic number.
* Modules/modern-media-controls/controls/slider.js:
(Slider.prototype.get knobStyle): Added.
(Slider.prototype.set knobStyle): Added.
Provide a way to change the `knobStyle` after construction in case the `MediaControls` state
changes.
2022-04-11 Matt Woodrow <mattwoodrow@apple.com>
Use unaccelerated rendering for ImageBitmapRenderingContext's placeholder image.
https://bugs.webkit.org/show_bug.cgi?id=238846
Reviewed by Simon Fraser.
This is a blank immutable image used a placeholder until a real ImageBitmap is provided, so there's
no need to allocate to allocate an accelerated IOSurface.
* html/canvas/ImageBitmapRenderingContext.cpp:
(WebCore::ImageBitmapRenderingContext::isAccelerated const):
(WebCore::ImageBitmapRenderingContext::setOutputBitmap):
2022-04-11 Jer Noble <jer.noble@apple.com>
REGRESSION(r292051-r292022): [ iOS ] media/video-object-fit.html is a constant image failure
https://bugs.webkit.org/show_bug.cgi?id=238634
<rdar://problem/91125776>
Reviewed by Eric Carlson.
Depending on whether setVideoFullscreenGravity() or updateVideoLayerGravity() is called first,
the wrong video gravity will be set. Rather than have two places where video gravity is set,
just have setVideoFullscreenGravity() set an ivar, and then call updateVideoLayerGravity(),
which will set the correct gravity based on whether fullscreen is active or not.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenGravity):
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoLayerGravity):
2022-04-11 Youenn Fablet <youenn@apple.com>
Expose more ServiceWorker interfaces to workers
https://bugs.webkit.org/show_bug.cgi?id=238992
Reviewed by Chris Dumez.
Expose ServiceWorker, ServiceWorkerContainer and ServiceWorkerRegistration interfaces.
Update task posting to support workers and shared workers.
Tests: http/wpt/service-workers/serviceworker-in-dedicatedworker.https.html
http/wpt/service-workers/serviceworker-in-sharedworker.https.html
* workers/Worker.cpp:
* workers/Worker.h:
* workers/service/SWClientConnection.cpp:
* workers/service/ServiceWorker.idl:
* workers/service/ServiceWorkerContainer.idl:
* workers/service/ServiceWorkerRegistration.idl:
* workers/service/context/SWContextManager.cpp:
* workers/service/context/SWContextManager.h:
* workers/shared/context/SharedWorkerContextManager.cpp:
* workers/shared/context/SharedWorkerContextManager.h:
2022-04-11 Sihui Liu <sihui_liu@apple.com>
Fix size computation in WebCore::StorageMap
https://bugs.webkit.org/show_bug.cgi?id=239024
rdar://88249235
Reviewed by Chris Dumez.
We use currentSize to track size for StorageMap. There are a few issues in current implementation that can make
currentSize incorrect and may lead to overflow:
1. When computing size of key, StorageMap uses parameter key instead of stored key. The problem is that
two Strings can be evaluated to equal while their sizeInBytes() value is different, when one String is 8-bit and
the other is 16-bit. That means removeItem() may decrease currentSize by wrong number (e.g setItem() with an
8-bit key, converting the key to 16-bit, removeItem() with the key). To fix this, StorageMap now always uses
stored key for computation.
2. When map.take(key) or map.get(key) returns null string, StorageMap takes it as the key does not exist and
will not correctly update currentSize, but user of WebCore::StorageMap may store null string as value. To fix
this, StorageMap now check if key exists with find() function.
3. StorageMap only uses CheckedUint32 in setItem(), but removeItem() and importItem() may cause overflow in
currentSize as mentioned above, and the error will not be caught until setItem() is called. To fix this,
StorageMap now uses CheckedUint32 in all places that update currentSize.
New test: WKWebView.LocalStorageNoSizeOverflow
* storage/StorageMap.cpp:
(WebCore::StorageMap::setItem):
(WebCore::StorageMap::removeItem):
(WebCore::StorageMap::importItems):
2022-04-11 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Reduce use of unnecessary cryptographicallyRandom numbers
https://bugs.webkit.org/show_bug.cgi?id=239026
Reviewed by Saam Barati.
We use createVersion4UUIDStringWeak since there is no need to use cryptographically random numbers for KeyframeEffect names.
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::copyPropertiesFromSource):
(WebCore::KeyframeEffect::updateBlendingKeyframes):
(WebCore::KeyframeEffect::computeCSSTransitionBlendingKeyframes):
2022-04-11 Wenson Hsieh <wenson_hsieh@apple.com>
[Mail Compose] Preserve attachment identifiers when cloning attachment-backed images
https://bugs.webkit.org/show_bug.cgi?id=239040
rdar://91527065
Reviewed by Aditya Keerthi.
Override HTMLImageElement's `cloneElementWithoutAttributesAndChildren` method so that it additionally clones the
attachment element underneath the original image element, if it exists. This ensures that an image element that
is copied from existing attachment-backed images using `cloneNode` will contain an `attachment` in its shadow
root that points to the same `_WKAttachment` in the embedding client.
Test: WKAttachmentTests.CloneImageWithAttachment
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::cloneElementWithoutAttributesAndChildren):
* html/HTMLImageElement.h:
2022-04-11 Nikolas Zimmermann <nzimmermann@igalia.com>
[LBSE] Activate SVG transform support through layers
https://bugs.webkit.org/show_bug.cgi?id=237711
Reviewed by Rob Buis.
Activate transforms for SVG layers.
Use the flag to keep track of the presence of SVG transformations
on a renderer. CSS/HTML renderers can rely only on the RenderStyle
to determine if transformations are applied, whereas SVG has to
consult additional sources, such as the SVG 'transform' attribute.
A SVG renderer with the 'HasSVGTransform' flag set should behave
like any SVG/HTML renderer that has CSS transformations applied.
With this patch applied SVG transform and CSS transforms can
be applied to <g> / <rect> elements in LBSE.
Covered by existing tests, no change in behaviour.
* platform/graphics/transforms/TransformationMatrix.cpp:
(WebCore::TransformationMatrix::multiplyAffineTransform):
* platform/graphics/transforms/TransformationMatrix.h:
* rendering/RenderBox.cpp:
(WebCore::RenderBox::updateLayerTransform): Deleted.
* rendering/RenderBox.h:
* rendering/RenderLayer.cpp:
(WebCore::canCreateStackingContext):
(WebCore::RenderLayer::currentTransform const):
* rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::updateLayerTransform):
(WebCore::RenderLayerModelObject::applySVGTransform const):
* rendering/RenderLayerModelObject.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::setHasSVGTransform):
* rendering/RenderObject.h:
(WebCore::RenderObject::hasSVGTransform const):
(WebCore::RenderObject::hasTransform const):
* rendering/svg/RenderSVGContainer.cpp:
(WebCore::SVGLayerTransformUpdater::SVGLayerTransformUpdater):
(WebCore::SVGLayerTransformUpdater::~SVGLayerTransformUpdater):
(WebCore::RenderSVGContainer::layout):
* rendering/svg/RenderSVGContainer.h:
(WebCore::RenderSVGContainer::updateLayerInformation): Deleted.
* rendering/svg/RenderSVGModelObject.cpp:
(WebCore::RenderSVGModelObject::updateFromStyle):
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::updateFromStyle):
* rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::layout):
(WebCore::RenderSVGShape::applyTransform const):
* rendering/svg/RenderSVGShape.h:
* rendering/svg/RenderSVGTransformableContainer.cpp:
(WebCore::RenderSVGTransformableContainer::updateFromStyle):
(WebCore::RenderSVGTransformableContainer::applyTransform const):
* svg/SVGGraphicsElement.cpp:
(WebCore::SVGGraphicsElement::animatedLocalTransform const):
2022-04-10 Chris Dumez <cdumez@apple.com>
Unreviewed Windows build fix after r292696.
* platform/win/LoggingWin.cpp:
(WebCore::logLevelString):
2022-04-10 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] DFG / FTL should be aware of JSString's String replacement
https://bugs.webkit.org/show_bug.cgi?id=238918
Reviewed by Saam Barati.
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::reportViolationForUnsafeEval):
2022-04-10 Chris Dumez <cdumez@apple.com>
Finish porting code base to String::fromLatin1() and make String(const char*) private
https://bugs.webkit.org/show_bug.cgi?id=238977
Reviewed by Darin Adler.
* Modules/mediastream/gstreamer/GStreamerDataChannelHandler.cpp:
(WebCore::GStreamerDataChannelHandler::createDataChannelEvent):
* Modules/mediastream/gstreamer/GStreamerMediaEndpoint.cpp:
(WebCore::fetchDescription):
(WebCore::GStreamerMediaEndpoint::storeRemoteMLineInfo):
(WebCore::GStreamerMediaEndpoint::addRemoteStream):
(WebCore::GStreamerMediaEndpoint::createSessionDescriptionSucceeded):
(WebCore::GStreamerMediaEndpoint::collectTransceivers):
* Modules/mediastream/gstreamer/GStreamerRtpTransceiverBackend.cpp:
(WebCore::GStreamerRtpTransceiverBackend::mid):
* Modules/mediastream/gstreamer/GStreamerStatsCollector.cpp:
(WebCore::fillRTCStats):
(WebCore::fillRTCRTPStreamStats):
(WebCore::fillOutboundRTPStreamStats):
* Modules/mediastream/gstreamer/GStreamerWebRTCUtils.cpp:
(WebCore::toRTCEncodingParameters):
* platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
(WebCore::AudioTrackPrivateGStreamer::updateConfigurationFromCaps):
* platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h:
(WebCore::ProtectionSystemEvents::ProtectionSystemEvents):
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
(WebCore::SourceBufferPrivateGStreamer::platformMaximumBufferSize const):
* platform/graphics/opengl/ExtensionsGLOpenGLCommon.cpp:
(WebCore::ExtensionsGLOpenGLCommon::ExtensionsGLOpenGLCommon):
* platform/graphics/opengl/ExtensionsGLOpenGLES.cpp:
(WebCore::ExtensionsGLOpenGLES::getExtensions):
* platform/graphics/opengl/GraphicsContextGLOpenGL.cpp:
(WebCore::GraphicsContextGLOpenGL::getString):
2022-04-10 Commit Queue <commit-queue@webkit.org>
Unreviewed, reverting r292690.
https://bugs.webkit.org/show_bug.cgi?id=239060
fast/multicol tests are randomly failing
Reverted changeset:
"[LBSE] Activate SVG transform support through layers"
https://bugs.webkit.org/show_bug.cgi?id=237711
https://commits.webkit.org/r292690
2022-04-10 Chris Dumez <cdumez@apple.com>
Update listMarkerTextForNodeAndPosition() to return a StringView instead of a String
https://bugs.webkit.org/show_bug.cgi?id=239022
<rdar://problem/91509602>
Reviewed by Darin Adler.
Update listMarkerTextForNodeAndPosition() to return a StringView instead of a String. listMarkerTextForNodeAndPosition()
has a StringView internally and none it its call sites actually need a String. The call sites either use StringBuilder
or want a NSString*. This avoids unnecessary String allocations.
* accessibility/AccessibilityObject.cpp:
(WebCore::listMarkerTextForNode):
(WebCore::AccessibilityObject::listMarkerTextForNodeAndPosition):
* accessibility/AccessibilityObject.h:
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(AXAttributedStringAppendText):
(-[WebAccessibilityObjectWrapperBase contentForSimpleRange:attributed:]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:spellCheck:]):
2022-04-10 Chris Dumez <cdumez@apple.com>
Avoid redundant calls to findHTTPHeaderName()
https://bugs.webkit.org/show_bug.cgi?id=239021
Reviewed by Darin Adler.
Some call sites of HTTPHeaderMap::add() / set() or ResourceResponse::addHTTPHeaderField() / setHTTPHeaderField()
have already called findHTTPHeaderName() and determined that this wasn't a common header. As a result, we were
doing redundant findHTTPHeaderName() checks inside those functions. To avoid this, add overloads that take in
a header that we already know is uncommon.
* Modules/fetch/FetchHeaders.cpp:
(WebCore::appendToHeaderMap):
(WebCore::FetchHeaders::filterAndFill):
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::resourceResponse const):
* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::WebSocketHandshake::readHTTPHeaders):
* platform/network/CacheValidation.cpp:
(WebCore::updateResponseHeadersAfterRevalidation):
* platform/network/HTTPHeaderMap.cpp:
(WebCore::HTTPHeaderMap::setUncommonHeader):
(WebCore::HTTPHeaderMap::add):
(WebCore::HTTPHeaderMap::addUncommonHeader):
* platform/network/HTTPHeaderMap.h:
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::setHTTPHeaderField):
(WebCore::ResourceResponseBase::setUncommonHTTPHeaderField):
(WebCore::ResourceResponseBase::addHTTPHeaderField):
(WebCore::ResourceResponseBase::addUncommonHTTPHeaderField):
* platform/network/ResourceResponseBase.h:
* workers/service/ServiceWorkerJob.cpp:
(WebCore::ServiceWorkerJob::fetchScriptWithContext):
2022-04-10 Alan Bujtas <zalan@apple.com>
[Line clamp] Move line clamp only code from RenderBlockFlow to RenderDeprecatedFlexibleBox
https://bugs.webkit.org/show_bug.cgi?id=239041
Reviewed by Antti Koivisto.
* rendering/RenderBlockFlow.cpp:
(WebCore::shouldIncludeLinesForParentLineCount): Deleted.
(WebCore::RenderBlockFlow::clearTruncation): Deleted.
* rendering/RenderBlockFlow.h:
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::shouldIncludeLinesForParentLineCount):
(WebCore::clearTruncation):
(WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
(WebCore::RenderDeprecatedFlexibleBox::clearLineClamp):
2022-04-10 Nikolas Zimmermann <nzimmermann@igalia.com>
[LBSE] Activate SVG transform support through layers
https://bugs.webkit.org/show_bug.cgi?id=237711
Reviewed by Rob Buis.
Activate transforms for SVG layers.
Use the flag to keep track of the presence of SVG transformations
on a renderer. CSS/HTML renderers can rely only on the RenderStyle
to determine if transformations are applied, whereas SVG has to
consult additional sources, such as the SVG 'transform' attribute.
A SVG renderer with the 'HasSVGTransform' flag set should behave
like any SVG/HTML renderer that has CSS transformations applied.
With this patch applied SVG transform and CSS transforms can
be applied to <g> / <rect> elements in LBSE. However, the order
of the matrix multiplication is not correct yet for SVG -- that
will be adressed in a follow-up patch.
Covered by existing tests, no change in behaviour.
* platform/graphics/transforms/TransformationMatrix.cpp:
(WebCore::TransformationMatrix::multiplyAffineTransform):
* platform/graphics/transforms/TransformationMatrix.h:
* rendering/RenderBox.cpp:
(WebCore::RenderBox::updateLayerTransform): Deleted.
* rendering/RenderBox.h:
* rendering/RenderLayer.cpp:
(WebCore::canCreateStackingContext):
(WebCore::RenderLayer::currentTransform const):
* rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::updateLayerTransform):
(WebCore::RenderLayerModelObject::applySVGTransform const):
* rendering/RenderLayerModelObject.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::setHasSVGTransform):
* rendering/RenderObject.h:
(WebCore::RenderObject::hasSVGTransform const):
(WebCore::RenderObject::hasTransform const):
* rendering/svg/RenderSVGContainer.cpp:
(WebCore::SVGLayerTransformUpdater::SVGLayerTransformUpdater):
(WebCore::SVGLayerTransformUpdater::~SVGLayerTransformUpdater):
(WebCore::RenderSVGContainer::layout):
* rendering/svg/RenderSVGContainer.h:
(WebCore::RenderSVGContainer::updateLayerInformation): Deleted.
* rendering/svg/RenderSVGModelObject.cpp:
(WebCore::RenderSVGModelObject::updateFromStyle):
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::updateFromStyle):
* rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::layout):
(WebCore::RenderSVGShape::applyTransform const):
* rendering/svg/RenderSVGShape.h:
* rendering/svg/RenderSVGTransformableContainer.cpp:
(WebCore::RenderSVGTransformableContainer::updateFromStyle):
(WebCore::RenderSVGTransformableContainer::applyTransform const):
* svg/SVGGraphicsElement.cpp:
(WebCore::SVGGraphicsElement::animatedLocalTransform const):
2022-04-10 Alan Bujtas <zalan@apple.com>
Line clamp specific line-count code should be in RenderDeprecatedFlexibleBox
https://bugs.webkit.org/show_bug.cgi?id=239029
Reviewed by Antti Koivisto.
Moving the line-clamp specific code to RenderDeprecatedFlexibleBox enables us to
make RenderBlockFlow::lineCount "children inline" only.
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::lineCountFor):
(WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
2022-04-10 Tyler Wilcock <tyler_w@apple.com>
Fix accessibility/aria-invalid.html in isolated tree mode
https://bugs.webkit.org/show_bug.cgi?id=238978
Reviewed by Chris Fleizach.
With this patch, we update the isolated tree when the aria-invalid
attribute changes.
Fixes accessibility/aria-invalid.html in isolated tree mode.
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::updateIsolatedTree):
* accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::updateNodeProperty):
Drive-by re-ordering of `case AXPropertyName::IdentifierAttribute` such that this
function handles properties in alphabetical order.
2022-04-09 Alan Bujtas <zalan@apple.com>
[Text autosizing] Remove redundant lineCountForTextAutosizing member function
https://bugs.webkit.org/show_bug.cgi?id=239034
Reviewed by Antti Koivisto.
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::adjustComputedFontSizes): stop walking the list item children when we see multiple lines.
(WebCore::RenderBlockFlow::lineCountForTextAutosizing): Deleted.
* rendering/RenderBlockFlow.h:
2022-04-09 Khem Raj <raj.khem@gmail.com>
Include locale.h for LC_MESSAGES definition.
https://bugs.webkit.org/show_bug.cgi?id=239030
Reviewed by Michael Catanzaro.
* accessibility/atspi/AccessibilityRootAtspi.cpp:
2022-04-09 Simon Fraser <simon.fraser@apple.com>
Put layer backing store buffers into the per-RemoteRenderingBackend IOSurfacePool
https://bugs.webkit.org/show_bug.cgi?id=238972
<rdar://83437978>
Reviewed by Tim Horton.
Add IOSurfacePool::create().
* platform/graphics/cg/IOSurfacePool.cpp:
(WebCore::IOSurfacePool::create):
* platform/graphics/cg/IOSurfacePool.h:
2022-04-09 Chris Dumez <cdumez@apple.com>
The Youtube plugin replacement should only work for actual Youtube URLs
https://bugs.webkit.org/show_bug.cgi?id=239003
<rdar://91323230>
Reviewed by Brent Fulgham.
The Youtube plugin replacement was too permissive and was falling back to using
the original URL in cases there the original URL wasn't an expected Youtube
URL. This patch hardens the plugin replacement and drops the URL if it is not
a valid youtube URL instead.
Covered by new API test.
* Modules/plugins/YouTubePluginReplacement.cpp:
(WebCore::isYouTubeURL):
(WebCore::processAndCreateYouTubeURL):
(WebCore::YouTubePluginReplacement::youTubeURLFromAbsoluteURL):
2022-04-09 Alan Bujtas <zalan@apple.com>
REGRESSION (Safari 15.4): Focused element doesn't render outline when it has an underline
https://bugs.webkit.org/show_bug.cgi?id=238998
<rdar://problem/91484512>
Reviewed by Antti Koivisto.
While outline is supposed to be part of the ink overflow(1), WebKit historically has been
treating it as a special "non ink overflow" type of overflow.
This patch is in preparation for transitioning the outline to regular ink overflow.
First we start treating outline as part of ink overflow within IFC and
handle it as special repaint content only at the block (RenderBlockFlow) level.
Test: fast/repaint/incorrect-outline-repaint.html
(1) https://www.w3.org/TR/css-overflow-3/#ink
* layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp:
(WebCore::Layout::computeInkOverflowForInlineLevelBox):
(WebCore::Layout::InlineDisplayContentBuilder::appendAtomicInlineLevelDisplayBox):
(WebCore::Layout::InlineDisplayContentBuilder::appendInlineBoxDisplayBox):
(WebCore::Layout::InlineDisplayContentBuilder::appendSpanningInlineBoxDisplayBox):
(WebCore::Layout::InlineDisplayContentBuilder::adjustVisualGeometryForDisplayBox):
(WebCore::Layout::computeBoxShadowInkOverflow): Deleted.
* layout/integration/LayoutIntegrationInlineContent.cpp:
(WebCore::LayoutIntegration::InlineContent::hasContent const):
* layout/integration/LayoutIntegrationInlineContent.h:
(WebCore::LayoutIntegration::InlineContent::hasVisualOverflow const):
(WebCore::LayoutIntegration::InlineContent::setHasVisualOverflow):
* layout/integration/LayoutIntegrationInlineContentBuilder.cpp:
(WebCore::LayoutIntegration::InlineContentBuilder::createDisplayLines const):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutModernLines): This may cause overly inflated repaintTop/Bottom when
the ink overflow is not outline based (text stroke only atm) but we will anyway trigger
similar repaint rect on that part later when we process ink overflow.
2022-04-09 Sihui Liu <sihui_liu@apple.com>
Move canAccessStorage() check from SecurityOrigin to ScriptExecutionContext
https://bugs.webkit.org/show_bug.cgi?id=238524
<rdar://problem/91318259>
Reviewed by Chris Dumez.
Add canAccessResource() to ScriptExecutionContext because ScriptExecutionContext, instead of SecurityOrigin,
should be the place that holds StorageBlockingPolicy (otherwise it's confusing that the origin and top origin
disagrees with each other on policy). Also, because ScriptExecutionContext has access to origin and topOrigin,
callers don't need to explicitly get them before the access check.
* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDM::getSupportedConfiguration):
* Modules/geolocation/Geolocation.cpp:
(WebCore::Geolocation::shouldBlockGeolocationRequests):
* Modules/indexeddb/IDBFactory.cpp:
(WebCore::shouldThrowSecurityException):
(WebCore::IDBFactory::openInternal):
(WebCore::IDBFactory::deleteDatabase):
* Modules/storage/StorageManager.cpp:
(WebCore::connectionInfo):
* Modules/webdatabase/DOMWindowWebDatabase.cpp:
(WebCore::DOMWindowWebDatabase::openDatabase):
* dom/Document.cpp:
(WebCore::m_whitespaceCache):
(WebCore::Document::cookie):
(WebCore::Document::setCookie):
(WebCore::Document::storageBlockingStateDidChange):
(WebCore::Document::initSecurityContext):
(WebCore::Document::applyQuickLookSandbox):
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::domainForCachePartition const):
(WebCore::isOriginEquivalentToLocal):
(WebCore::ScriptExecutionContext::canAccessResource const):
* dom/ScriptExecutionContext.h:
(WebCore::ScriptExecutionContext::setStorageBlockingPolicy):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::loadMainResource):
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::selectCache):
(WebCore::ApplicationCacheGroup::selectCacheWithoutManifestURL):
(WebCore::ApplicationCacheGroup::update):
* loader/appcache/ApplicationCacheHost.cpp:
(WebCore::ApplicationCacheHost::isApplicationCacheBlockedForRequest):
* page/DOMWindow.cpp:
* page/Page.cpp:
(WebCore::Page::setupForRemoteWorker):
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::domainForCachePartition const):
(WebCore::SecurityOrigin::canAccessStorage const): Deleted.
* page/SecurityOrigin.h:
(WebCore::SecurityOrigin::encode const):
(WebCore::SecurityOrigin::decode):
(WebCore::SecurityOrigin::setStorageBlockingPolicy): Deleted.
(WebCore::SecurityOrigin::canAccessDatabase const): Deleted.
(WebCore::SecurityOrigin::canAccessSessionStorage const): Deleted.
(WebCore::SecurityOrigin::canAccessLocalStorage const): Deleted.
(WebCore::SecurityOrigin::canAccessStorageManager const): Deleted.
(WebCore::SecurityOrigin::canAccessPluginStorage const): Deleted.
(WebCore::SecurityOrigin::canAccessApplicationCache const): Deleted.
(WebCore::SecurityOrigin::canAccessCookies const): Deleted.
(WebCore::SecurityOrigin::canRequestGeolocation const): Deleted.
* storage/StorageNamespaceProvider.cpp:
(WebCore::StorageNamespaceProvider::localStorageArea):
* workers/WorkerGlobalScope.cpp:
(WebCore::m_credentials):
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::addRegistration):
(WebCore::ServiceWorkerContainer::updateRegistration):
* workers/service/ServiceWorkerJobData.cpp:
(WebCore::ServiceWorkerJobData::isolatedCopy const):
* workers/service/ServiceWorkerJobData.h:
(WebCore::ServiceWorkerJobData::encode const):
(WebCore::ServiceWorkerJobData::decode):
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::startScriptFetch):
* worklets/WorkletGlobalScope.cpp:
(WebCore::WorkletGlobalScope::WorkletGlobalScope):
2022-04-08 Kate Cheney <katherine_cheney@apple.com>
Sharing services picker menu Mail presents in the wrong place when compose web view is scrolled
https://bugs.webkit.org/show_bug.cgi?id=238672
<rdar://problem/88966924>
Reviewed by Wenson Hsieh.
Image menu is offset by the amount the view is scrolled. This patch
changes the menu location point by calculating the bottom corner of
the picker button then using contentsToWindow which handles
the scroll position offset
* dom/mac/ImageControlsMac.cpp:
(WebCore::ImageControlsMac::handleEvent):
2022-04-08 Chris Dumez <cdumez@apple.com>
Drop unused pluginReplacementScriptObject
https://bugs.webkit.org/show_bug.cgi?id=239008
Reviewed by Geoff Garen.
Drop unused pluginReplacementScriptObject as it is always null.
* Modules/plugins/PluginReplacement.h:
(): Deleted.
* Modules/plugins/YouTubePluginReplacement.cpp:
(WebCore::YouTubePluginReplacement::installReplacement):
* Modules/plugins/YouTubePluginReplacement.h:
* bindings/js/JSPluginElementFunctions.cpp:
(WebCore::pluginScriptObject):
(WebCore::pluginElementCustomGetCallData):
(WebCore::pluginScriptObjectFromPluginViewBase): Deleted.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestPluginInterface.cpp:
(WebCore::JSTestPluginInterface::visitChildrenImpl):
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::didAddUserAgentShadowRoot):
(WebCore::HTMLPlugInElement::scriptObjectForPluginReplacement): Deleted.
* html/HTMLPlugInElement.h:
(WebCore::HTMLPlugInElement::pluginReplacementScriptObject): Deleted.
* plugins/PluginViewBase.h:
(WebCore::PluginViewBase::scriptObject): Deleted.
2022-04-08 Elliott Williams <emw@apple.com>
[Xcode] Avoid targeting 32-bit iOS and Mac architectures
https://bugs.webkit.org/show_bug.cgi?id=238971
Reviewed by Alexey Proskuryakov.
* Configurations/DebugRelease.xcconfig:
2022-04-08 Oriol Brufau <obrufau@igalia.com>
[css-cascade] Sort deferred properties at the end of CSSPropertyID enum
https://bugs.webkit.org/show_bug.cgi?id=238345
Reviewed by Darin Adler.
Bug 238260 will optimize the logic for cascading deferred properties.
This sorts them at the end, after low priority ones, which will allow
some further optimizations.
This is in preparation of bug 238260, which plans to turn all logical
and physical properties into deferred.
No new tests since there should be no change in behavior.
* css/makeprop.pl:
(sortByDescendingPriorityAndName):
Sort deferred properties at the end of CSSPropertyID enum.
Add firstHighPriorityProperty, firstLowPriorityProperty,
lastLowPriorityProperty, firstDeferredProperty and lastDeferredProperty.
* style/PropertyCascade.cpp:
(WebCore::Style::PropertyCascade::set):
(WebCore::Style::PropertyCascade::setDeferred):
(WebCore::Style::PropertyCascade::addMatch):
(WebCore::Style::shouldApplyPropertyInParseOrder): Deleted.
Delete shouldApplyPropertyInParseOrder(), since instead we can just
compare the CSSPropertyId and firstDeferredProperty with < or >=.
* style/PropertyCascade.h:
(WebCore::Style::PropertyCascade::hasNormalProperty const):
(WebCore::Style::PropertyCascade::normalProperty const):
(WebCore::Style::PropertyCascade::hasDeferredProperty const):
(WebCore::Style::PropertyCascade::hasProperty const): Deleted.
(WebCore::Style::PropertyCascade::property const): Deleted.
Rename hasProperty() and property() to hasNormalProperty() and
normalProperty(), to make it clear they are not for deferred properties.
Reduce the size of m_properties array and m_propertyIsPresent bitset,
since they don't need to include deferred properties.
* style/StyleBuilder.cpp:
(WebCore::Style::Builder::applyAllProperties):
(WebCore::Style::Builder::applyHighPriorityProperties):
(WebCore::Style::Builder::applyNonHighPriorityProperties):
(WebCore::Style::Builder::applyPropertiesImpl):
(WebCore::Style::Builder::applyProperty):
(WebCore::Style::Builder::applyLowPriorityProperties): Deleted.
Rename applyLowPriorityProperties() to applyNonHighPriorityProperties()
to make it clear that it includes custom and deferred properties.
Use the new firstHighPriorityProperty and lastLowPriorityProperty
constants for clarity and to skip deferred properties.
Rename hasProperty() and property() to hasNormalProperty() and
normalProperty(), to make it clear they are not for deferred properties.
* style/StyleBuilder.h:
Rename applyLowPriorityProperties() to applyNonHighPriorityProperties()
to make it clear that it includes custom and deferred properties.
* style/StyleResolver.cpp:
(WebCore::Style::Resolver::applyMatchedProperties):
Rename applyLowPriorityProperties() to applyNonHighPriorityProperties()
to make it clear that it includes custom and deferred properties.
2022-04-08 Chris Dumez <cdumez@apple.com>
Simplify / Optimize the whitespace cache implementation
https://bugs.webkit.org/show_bug.cgi?id=238736
<rdar://problem/91255370>
Reviewed by Darin Adler.
Follow-up to r292310 to add missing blank lines.
* html/parser/HTMLConstructionSite.h:
2022-04-08 Oriol Brufau <obrufau@igalia.com>
[css-cascade] Merge getRelatedPropertyId() and shouldApplyPropertyInParseOrder()
https://bugs.webkit.org/show_bug.cgi?id=238350
Reviewed by Darin Adler.
Both getRelatedPropertyId() and shouldApplyPropertyInParseOrder() pursue
the same thing: if there are two properties (typically a standard one
and a -webkit- prefixed one) which share the same field in RenderStyle,
then we should take specified order into account when applying them.
The problem is that the logic for getRelatedPropertyId() doesn't work
well in all cases. It was only used for -webkit-text-orientation and
text-orientation, but bug 238356 implemented the former as a shorthand.
So now there is no consumer of getRelatedPropertyId().
On the other hand, shouldApplyPropertyInParseOrder() works better, but
it will need to be automatically generated for bug 238345, and bug
238125 will need to know which property shares a computed value with a
given one.
So this patch removes the consumers of the old getRelatedPropertyId(),
and changes shouldApplyPropertyInParseOrder() to be based on it.
No new tests since there is no change in behavior.
* css/CSSProperties.json:
Mark properties for which shouldApplyPropertyInParseOrder() returned
true with the "related-property" flag.
* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::PropertySetCSSStyleDeclaration::getPropertyValueInternal):
Remove old getRelatedPropertyId() logic which was unused.
* css/makeprop.pl:
Throw errors if "related-property" flag is invalid.
* css/parser/CSSParserImpl.cpp:
(WebCore::filterProperties):
Remove old getRelatedPropertyId() logic which was unused.
* style/PropertyCascade.cpp:
(WebCore::Style::shouldApplyPropertyInParseOrder):
Base shouldApplyPropertyInParseOrder() on getRelatedPropertyId().
2022-04-08 Antti Koivisto <antti@apple.com>
[CSS Container Queries] Search query containers for ::slotted and and ::part rules in their scope
https://bugs.webkit.org/show_bug.cgi?id=238997
Reviewed by Sam Weinig.
"For selectors with pseudo elements, query containers can be established by the shadow-including inclusive ancestors of
the ultimate originating element."
https://drafts.csswg.org/css-contain-3/#container-queries
* style/ContainerQueryEvaluator.cpp:
(WebCore::Style::ContainerQueryEvaluator::ContainerQueryEvaluator):
(WebCore::Style::ContainerQueryEvaluator::selectContainer const):
(WebCore::Style::ContainerQueryEvaluator::selectContainer):
For rules coming from a non-local scope, search query container starting from the originating element in that scope.
* style/ContainerQueryEvaluator.h:
* style/ElementRuleCollector.cpp:
(WebCore::Style::ElementRuleCollector::collectMatchingRulesForList):
(WebCore::Style::ElementRuleCollector::containerQueriesMatch):
Pass rule's style scope ordinal so we can find the right scope.
* style/ElementRuleCollector.h:
2022-04-08 Brent Fulgham <bfulgham@apple.com>
Move WebGPU to WebCore/features.json and add <model> element
https://bugs.webkit.org/show_bug.cgi?id=238981
Reviewed by Myles C. Maxfield
This patch makes the following corrections:
1. Moves the WebGPU Specification definition from JavaScriptCore/features.json to WebCore/features.json
2. Removes the extraneous WebGPU "feature" from both files.
3. Adds the HTML <model> element.
* features.json:
2022-04-08 Philippe Normand <pnormand@igalia.com>
[GStreamer][WebRTC] Fix data-channel handler build for GStreamer 1.21
https://bugs.webkit.org/show_bug.cgi?id=238989
Reviewed by Xabier Rodriguez-Calvar.
The GST_WEBRTC_DATA_CHANNEL_STATE_NEW enum value was removed from public API in
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2099.
* Modules/mediastream/gstreamer/GStreamerDataChannelHandler.cpp:
(WebCore::GStreamerDataChannelHandler::checkState):
2022-04-08 Chris Dumez <cdumez@apple.com>
static_pointer_cast<>() may cause some unnecessary ref-counting churn
https://bugs.webkit.org/show_bug.cgi?id=238961
Reviewed by Darin Adler.
* dom/TreeScope.cpp:
(WebCore::TreeScope::elementFromPoint):
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::textNodeForRebalance const):
* editing/DeleteSelectionCommand.cpp:
(WebCore::firstInSpecialElement):
(WebCore::lastInSpecialElement):
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::getFramebufferAttachmentParameter):
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getFramebufferAttachmentParameter):
* page/ImageOverlayController.cpp:
(WebCore::ImageOverlayController::selectionQuadsDidChange):
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::pageDestroyed):
* page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp:
(WebCore::ScrollingCoordinatorNicosia::pageDestroyed):
2022-04-08 Elliott Williams <emw@apple.com>
Unreviewed, reverting r292591.
Causing spurious EWS errors
Reverted changeset:
"[XCBuild] Enable dependency validation by default"
https://bugs.webkit.org/show_bug.cgi?id=238901
https://commits.webkit.org/r292591
2022-04-08 Alan Bujtas <zalan@apple.com>
Do not use std::numeric_limits<float>::min() as the initial value to collect max values for glyph overflow
https://bugs.webkit.org/show_bug.cgi?id=238334
Reviewed by Simon Fraser.
With zero height glpyhs, glyph (vertical)overflow may still back as 1px due to ceilf(std::max(0.f, std::numeric_limits<float>::min())).
(see WidthIterator::advanceInternal() -> m_maxGlyphBoundingBoxY = std::max(m_maxGlyphBoundingBoxY, bounds.maxY())
and FontCascade::floatWidthForSimpleText() -> std::max<int>(glyphOverflow->bottom, ceilf(it.maxGlyphBoundingBoxY()) - (glyphOverflow->computeBounds ? 0 : metricsOfPrimaryFont().descent())))
* platform/graphics/ComplexTextController.h:
* platform/graphics/WidthIterator.h:
2022-04-08 Rob Buis <rbuis@igalia.com>
Take top layers into account in addLayers/removeLayers
https://bugs.webkit.org/show_bug.cgi?id=238946
Reviewed by Simon Fraser.
Take top layers into account in addLayers/removeLayers, they
should use the RenderView layer as parent (emulating layerParent).
* rendering/RenderElement.cpp:
(WebCore::addLayers):
(WebCore::RenderElement::addLayers):
(WebCore::RenderElement::removeLayers):
(WebCore::RenderElement::willBeRemovedFromTree):
* rendering/RenderElement.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects const):
2022-04-07 Antti Koivisto <antti@apple.com>
[CSS Container Queries] Evaluate against shadow-including ancestors
https://bugs.webkit.org/show_bug.cgi?id=238934
Reviewed by Tim Nguyen.
"Style rules applying to its shadow-including descendants can then be conditioned by querying against it,
using the @container conditional group rule."
https://drafts.csswg.org/css-contain-3/#container-queries
* style/ContainerQueryEvaluator.cpp:
(WebCore::Style::ContainerQueryEvaluator::selectContainer):
Evaluate against shadow-including ancestors instead of flat tree ancestors if the cache is not available.
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::Scope::Scope):
Copy the container state when pushing scope. This also creates a stack of shadow-including ancestors.
* style/StyleTreeResolver.h:
2022-04-07 Elliott Williams <emw@apple.com>
[XCBuild] Enable dependency validation by default
https://bugs.webkit.org/show_bug.cgi?id=238901
<rdar://problem/91379968>
Reviewed by Alexey Proskuryakov.
* Configurations/DebugRelease.xcconfig:
2022-04-07 Chris Dumez <cdumez@apple.com>
Add PAL::TextEncoding() constructor that takes in a StringView
https://bugs.webkit.org/show_bug.cgi?id=238905
Reviewed by Darin Adler.
This allows some call sites to be a bit more efficient.
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::create):
* fileapi/FileReaderLoader.cpp:
(WebCore::FileReaderLoader::setEncoding):
* fileapi/FileReaderLoader.h:
* html/parser/HTMLMetaCharsetParser.cpp:
(WebCore::HTMLMetaCharsetParser::encodingFromMetaAttributes):
* loader/FormSubmission.cpp:
(WebCore::encodingFromAcceptCharset):
* loader/soup/ResourceLoaderSoup.cpp:
(WebCore::ResourceLoader::loadGResource):
* platform/network/HTTPParsers.cpp:
(WebCore::extractCharsetFromMediaType):
* platform/network/HTTPParsers.h:
* platform/network/curl/CurlCacheEntry.cpp:
(WebCore::CurlCacheEntry::setResponseFromCachedHeaders):
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::handleDataURL):
* platform/network/curl/ResourceResponseCurl.cpp:
(WebCore::ResourceResponse::ResourceResponse):
* platform/network/soup/ResourceResponseSoup.cpp:
(WebCore::ResourceResponse::ResourceResponse):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::finalResponseCharset const):
(WebCore::XMLHttpRequest::didReceiveData):
2022-04-07 Gabriel Nava Marino <gnavamarino@apple.com>
When using a TrackDisplayUpdateScope queue updateActiveTextTrackCues as a task
https://bugs.webkit.org/show_bug.cgi?id=238963
Reviewed by Eric Carlson.
The HTMLMediaElement::didRemoveTextTrack call is done under ScriptDisallowedScope but this path
currently can call updateActiveTextTrackCues which could result in updating the layout downstream.
To resolve this we execute updateActiveTextTrackCues under a queueCancellableTaskKeepingObjectAlive call.
We also add a needed check in RenderVTTCue::initializeLayoutParameters exposed by queueing the task.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::endIgnoringTrackDisplayUpdateRequests):
(WebCore::HTMLMediaElement::cancelPendingTasks):
* html/HTMLMediaElement.h:
* rendering/RenderVTTCue.cpp:
(WebCore::RenderVTTCue::initializeLayoutParameters):
2022-04-07 Tim Nguyen <ntim@apple.com>
[:has() pseudo-class] Support invalidation for :indeterminate pseudo class on <progress>
https://bugs.webkit.org/show_bug.cgi?id=238923
Reviewed by Antti Koivisto.
Test: imported/w3c/web-platform-tests/css/selectors/invalidation/input-pseudo-classes-in-has.html
* html/HTMLProgressElement.cpp:
(WebCore::HTMLProgressElement::HTMLProgressElement):
(WebCore::HTMLProgressElement::parseAttribute):
(WebCore::HTMLProgressElement::didAttachRenderers):
(WebCore::HTMLProgressElement::updateDeterminateState):
(WebCore::HTMLProgressElement::didElementStateChange):
(WebCore::HTMLProgressElement::isDeterminate const): Deleted.
* html/HTMLProgressElement.h:
2022-04-07 Nikolas Zimmermann <nzimmermann@igalia.com>
Unify reference box / CTM computation in RenderLayer
https://bugs.webkit.org/show_bug.cgi?id=237701
Reviewed by Rob Buis.
Extract the code in RenderLayer that computes the reference box, obtains the CTM,
applies pixel snapping, etc. into a shared updateTransformFromStyle() helper function.
Use that helper to de-duplicate code between updateTransform() / currentTransform()
(and RenderLayerBacking::updateTransform() in follow-up patches).
currentTransform() needs to compute the CTM, based on a non-default RenderStyle (!= renderer().style()),
namely the aninmatedStyle(), if an accelerated transform animation is running. Therefore extend
RenderLayerModelObject::applyTransform() to take an additional RenderStyle parameter,
that is used to access the CSS transform operations, instead of always querying renderer().style().
RenderLayer::updateTransform() continues to pass 'renderer().style()' to updateTransformFromStyle(),
whereas RenderLayer::currentTransform() passes the elements animatedStyle().
Covered by existing tests, no change in behaviour.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::applyTransform const):
* rendering/RenderBox.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::applyTransform const):
* rendering/RenderBoxModelObject.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateTransformFromStyle const):
(WebCore::RenderLayer::updateTransform):
(WebCore::RenderLayer::currentTransform const):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateTransform):
* rendering/RenderLayerModelObject.h:
* rendering/svg/RenderSVGModelObject.cpp:
(WebCore::RenderSVGModelObject::applyTransform const): Deleted.
* rendering/svg/RenderSVGModelObject.h:
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::applyTransform const): Deleted.
* rendering/svg/RenderSVGRoot.h:
* rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::applyTransform const):
* rendering/svg/RenderSVGShape.h:
* rendering/svg/RenderSVGTransformableContainer.cpp:
(WebCore::RenderSVGTransformableContainer::applyTransform const):
* rendering/svg/RenderSVGTransformableContainer.h:
2022-04-07 Jean-Yves Avenard <jya@apple.com>
Full screen video progress bar flickers after dragging it.
https://bugs.webkit.org/show_bug.cgi?id=238859
rdar://90412851
A WebAVPlayerController pretends to be an AVPlayerController by
implementing most methods of it, but not all.
When dragging the progress bar, AVKit calls the method isSeeking to
determine if we are seeking or not and if true will call seekToTime
to retrieve the last seek position and display the progress bar
accordingly.
Those two methods weren't implemented by WebAVPlayerController.
At present, we don't have information about the seeking operation having
completed or not, but we do know if we are scrubbing. So map isSeeking
to isScrubbing, this approximation is sufficient at present.
Reviewed by Jer Noble.
* platform/ios/WebAVPlayerController.h:
* platform/ios/WebAVPlayerController.mm:
(-[WebAVPlayerController seekToTime:]):
(-[WebAVPlayerController seekToTime:toleranceBefore:toleranceAfter:]):
(-[WebAVPlayerController isSeeking]):
(-[WebAVPlayerController seekToTime]):
2022-04-07 Simon Fraser <simon.fraser@apple.com>
Add a LayerBacking RenderingPurpose
https://bugs.webkit.org/show_bug.cgi?id=238896
Reviewed by Said Abou-Hallawa.
Add RenderingPurpose::LayerBacking so the GPU Process knows which buffers are
associated with layer backing.
* platform/graphics/RenderingMode.h:
2022-04-07 Tyler Wilcock <tyler_w@apple.com>
AX ITM: ARIATreeItemContent, ARIATreeRows, and DisclosedRows properties need to be updated after dynamic page changes
https://bugs.webkit.org/show_bug.cgi?id=238844
Reviewed by Chris Fleizach.
Before this patch, we never updated these properties after
initializing isolated objects, so they become inaccurate
when content / rows were added or removed.
Test: accessibility/mac/tree-properties-update-after-dynamic-change.html
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::ariaTreeItemContent):
Make this function return a value instead of by out-parameter.
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityObjectInterface.h:
* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::initializeAttributeData):
* accessibility/isolatedtree/AXIsolatedObject.h:
* accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::updateNodeProperty):
Handle updates to AXPropertyName::ARIATreeItemContent, AXPropertyName::ARIATreeRows, and
AXPropertyName::DisclosedRows. Also, updateNodeProperty now
takes an `AXCoreObject&` instead of `const AXCoreObject&`
since calling ariaTreeItemContent(), ariaTreeRows(), and disclosedRows() is inherently not const.
(WebCore::AXIsolatedTree::updateChildren):
If the object being updated is a treeitem, also update AXPropertyName::ARIATreeItemContent
and AXPropertyName::DisclosedRows. And if the object has a tree role ancestor, update
AXPropertyName::ARIATreeRows for that ancestor.
* accessibility/isolatedtree/AXIsolatedTree.h:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2022-04-07 Youenn Fablet <youenn@apple.com>
(Safari 15 - iOS15): Increased audio latency on streaming via webrtc
https://bugs.webkit.org/show_bug.cgi?id=236363
<rdar://problem/88969850>
Reviewed by Eric Carlson.
On macOS 12.3, the default preferred buffer size is roughly 100 ms.
This is ok for regular audio playback but is not desirable when playing realtime audio.
To reduce the perceived latency, we now reduce the preferred buffer size to 20ms
whenever playing an audio MediaStreamTrack, similarly to when capturing audio.
Manually tested.
* platform/audio/PlatformMediaSession.cpp:
* platform/audio/PlatformMediaSession.h:
* platform/audio/cocoa/MediaSessionManagerCocoa.mm:
2022-04-07 Antoine Quint <graouts@webkit.org>
[web-animations] REGRESSION (r287881): loading performance for diply.com regressed
https://bugs.webkit.org/show_bug.cgi?id=238931
rdar://91190007
Reviewed by Simon Fraser.
We only need to resolve effects in the stack if they are targeting the property we are
considering for the creation, update or removal of a CSS Transition.
* style/Styleable.cpp:
(WebCore::updateCSSTransitionsForStyleableAndProperty):
2022-04-07 Gabriel Nava Marino <gnavamarino@apple.com>
Iterate over copy of animated properties in WebCore::WebAnimation::commitStyles
https://bugs.webkit.org/show_bug.cgi?id=238940
Reviewed by Antoine Quint.
WebAnimation::resolve can end up clearing the animated properties during iteration.
The proposal here will make a copy of the properties before applying the steps
outlined in the spec.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::commitStyles):
2022-04-07 Tim Nguyen <ntim@apple.com>
[CSS resize property] Correct minimum size computation to allow resizing below initial size
https://bugs.webkit.org/show_bug.cgi?id=135335
Reviewed by Simon Fraser.
Tests:
- LayoutTests/fast/css/resize-above-min-size-and-below-initial-size.html
- LayoutTests/fast/css/resize-below-min-intrinsic-size.html
- LayoutTests/fast/css/resize-below-min-intrinsic-size-large-scrollbars.html
- LayoutTests/fast/css/resize-below-min-size-zoomed.html
- LayoutTests/fast/css/resize-below-min-size.html
- LayoutTests/fast/css/resize-orthogonal-containing-block.html
Ports the relevant Chromium changeset with a few tweaks: https://chromium-review.googlesource.com/c/chromium/src/+/545395/
The previous minimum size used to be whatever size was there before the first resize, which is wrong, and does not allow
resizing below the initial size. It is now based on the min-width/height properties and the scroll corner size.
It is no longer stored in ElementRareData since it is no longer fixed to the initial element size, but depends on the container
on the element style.
* dom/Element.cpp:
(WebCore::Element::minimumSizeForResizing const): Deleted.
(WebCore::Element::setMinimumSizeForResizing): Deleted.
* dom/Element.h:
* dom/ElementRareData.cpp:
* dom/ElementRareData.h:
(WebCore::ElementRareData::useTypes const):
(WebCore::ElementRareData::ElementRareData):
(WebCore::defaultMinimumSizeForResizing): Deleted.
(WebCore::ElementRareData::minimumSizeForResizing const): Deleted.
(WebCore::ElementRareData::setMinimumSizeForResizing): Deleted.
* dom/NodeRareData.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::minimumSizeForResizing const):
(WebCore::RenderLayer::resize):
* rendering/RenderLayer.h:
2022-04-07 Simon Fraser <simon.fraser@apple.com>
Have ImageBuffer store the RenderingPurpose, and send it to the GPU process
https://bugs.webkit.org/show_bug.cgi?id=238887
Reviewed by Said Abou-Hallawa.
Add RenderingPurpose to ImageBufferBackend::Parameters so it's stored on ImageBufferBackend/ImageBuffer,
and propagate that to the GPU process.
* platform/graphics/ConcreteImageBuffer.h:
(WebCore::ConcreteImageBuffer::create):
* platform/graphics/ImageBuffer.cpp:
(WebCore::ImageBuffer::create):
* platform/graphics/ImageBuffer.h:
* platform/graphics/ImageBufferBackend.h:
(WebCore::ImageBufferBackend::renderingPurpose const):
* platform/graphics/PlatformImageBuffer.h:
* platform/graphics/coreimage/FilterImageCoreImage.mm:
(WebCore::FilterImage::imageBufferFromCIImage):
* platform/graphics/displaylists/DisplayListImageBuffer.h:
2022-04-07 Wenson Hsieh <wenson_hsieh@apple.com>
Adjust and refactor some UA styles and logic for injecting Live Text
https://bugs.webkit.org/show_bug.cgi?id=238912
rdar://91383570
Reviewed by Aditya Keerthi.
Adjust various Live-Text-related UA styles for "text recognition blocks", along with other miscellaneous
adjustments:
- Compute and set the border radius, based on the font size and overall height of the block.
- Add horizontal/vertical padding to text recognition, computed relative to the border radius.
- Allow hyphenation in blocks.
- Only center-align text in blocks if there are fewer than 3 text runs in the block.
- Adjust box shadows, backdrop filter blur radius and line height.
- Specify a `line-height`, such that `line-height` from the host element doesn't erroneously apply to blocks.
- Handle text recognition blocks with newline characters (\n) by injecting line break elements between text.
Test: fast/images/text-recognition/image-overlay-block-with-newlines.html
* dom/ImageOverlay.cpp:
(WebCore::ImageOverlay::updateSubtree):
(WebCore::ImageOverlay::fitElementToQuad):
(WebCore::ImageOverlay::updateWithTextRecognitionResult):
* html/shadow/imageOverlay.css:
(:host(:not(img)) div#image-overlay:-webkit-full-screen-document):
(div.image-overlay-block):
(div.image-overlay-line, .image-overlay-text, div.image-overlay-block):
(div.image-overlay-line, .image-overlay-text):
(.image-overlay-block):
2022-04-07 Lauro Moura <lmoura@igalia.com>
Unreviewed, non-unified build fixes
https://bugs.webkit.org/show_bug.cgi?id=238933
* css/CSSToStyleMap.h: Forward declare Quad
* platform/graphics/filters/FilterEffectVector.h: Replace forward with
actual include for Ref.
2022-04-07 Tim Nguyen <ntim@apple.com>
Remove redundant invalidateStyleForSubtree() calls
https://bugs.webkit.org/show_bug.cgi?id=238922
Reviewed by Antti Koivisto.
These calls were for :invalid/:valid validation, which now are invalidated using Style::PseudoClassChangeInvalidation.
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::maxLengthAttributeChanged):
(WebCore::HTMLInputElement::minLengthAttributeChanged):
2022-04-07 Chris Dumez <cdumez@apple.com>
Drop unused EditorClient::getAutoCorrectSuggestionForMisspelledWord()
https://bugs.webkit.org/show_bug.cgi?id=238897
Reviewed by Wenson Hsieh.
* editing/Editor.cpp:
(WebCore::Editor::markMisspellingsAfterTypingToWord):
* editing/TextCheckingHelper.cpp:
(WebCore::findMisspellings):
* loader/EmptyClients.cpp:
* platform/text/TextCheckerClient.h:
2022-04-07 Alan Bujtas <zalan@apple.com>
A float avoider should never take a vertical position where a float is present even when its used width is zero
https://bugs.webkit.org/show_bug.cgi?id=238895
Reviewed by Antti Koivisto.
A zero width available space is never a valid vertical position for a float avoider even when its width is zero too.
Test: fast/block/float/float-avoider-with-zero-width.html
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::getClearDelta): skip and check the next candidate poisition when no space is available.
2022-04-07 Tim Nguyen <ntim@apple.com>
[:has() pseudo-class] Support invalidation for :autofill pseudo class
https://bugs.webkit.org/show_bug.cgi?id=238899
Reviewed by Antti Koivisto.
Tests: LayoutTests/fast/forms/input-autofilled-*.html
I've only added tests for the :autofill case, since the other pseudo-classes are supposed to be internal-only.
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setAutoFilled):
(WebCore::HTMLInputElement::setAutoFilledAndViewable):
(WebCore::HTMLInputElement::setAutoFilledAndObscured):
2022-04-07 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. [GStreamer] Fix compile warning
* Modules/mediastream/gstreamer/GStreamerPeerConnectionBackend.cpp:
(WebCore::gstreamerRtpCapatiblities): Initialize RTCRtpCodecCapability::channels.
2022-04-07 Nikolas Zimmermann <nzimmermann@igalia.com>
Unreviewed build fix after r292525.
Silence an unused parameter warning in vanilla builds (w/o --layer-based-svg-engine).
* rendering/RenderLayerModelObject.cpp:
(WebCore::rendererNeedsPixelSnapping):
2022-04-07 Nikolas Zimmermann <nzimmermann@igalia.com>
Unify 'transform-box' reference box computation
https://bugs.webkit.org/show_bug.cgi?id=237554
Reviewed by Simon Fraser.
Currently the code to compute the reference box, according to the CSS 'transform-box'
property is sprinkled over various places: CSSComputedStyleDeclaration, SVGRenderSupport,
RenderBox, parts in RenderLayer.
Cleanup and unify the code in a new 'FloatRect referenceBoxRect(CSSBoxType) const' method.
RenderElement::referenceBoxRect(CSSBoxType) contains the SVG specific implementation, and
RenderBox::referenceBoxRect() the HTML/CSS one (previously named referenceBox()).
.
RenderElement provides an additional transfromReferenceBoxRect() helper which is used in
various places that previously manually converted the transform-box value into a CSSBoxType.
Remove code from SVGRenderSupport/CSSComputedStyleDeclaration that can now use the shared logic.
Covered by existing tests, no change in behaviour.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::computedTransform):
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
(WebCore::transformReferenceBox): Deleted.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::referenceBoxRect const):
(WebCore::RenderBox::hitTestClipPath const):
(WebCore::RenderBox::referenceBox const): Deleted.
* rendering/RenderBox.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::referenceBoxRect const):
* rendering/RenderElement.h:
(WebCore::RenderElement::transformReferenceBoxRect const):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::referenceBoxRectForClipPath const):
(WebCore::RenderLayer::updateTransform):
(WebCore::RenderLayer::currentTransform const):
(WebCore::RenderLayer::perspectiveTransform const):
(WebCore::RenderLayer::perspectiveOrigin const):
(WebCore::RenderLayer::rendererNeedsPixelSnapping const):
(WebCore::RenderLayer::snapRectToDevicePixelsIfNeeded const):
(WebCore::RenderLayer::computeClipPath const):
(WebCore::RenderLayer::setupClipPath):
(WebCore::computeReferenceRectFromBox): Deleted.
(WebCore::computeReferenceBox): Deleted.
* rendering/RenderLayer.h:
* rendering/svg/SVGRenderSupport.cpp:
(WebCore::SVGRenderSupport::transformReferenceBox): Deleted.
* rendering/svg/SVGRenderSupport.h:
* svg/SVGGraphicsElement.cpp:
(WebCore::SVGGraphicsElement::animatedLocalTransform const):
2022-04-07 Matt Woodrow <mattwoodrow@apple.com>
Grid items that establish an independent formatting context should not be subgrids.
https://bugs.webkit.org/show_bug.cgi?id=237692
Reviewed by Alan Bujtas.
New WPT css/css-grid/subgrid/independent-formatting-context.html added to check this case.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::createsNewFormattingContext const):
* rendering/RenderBox.h:
(WebCore::RenderBox::markForPaginationRelayoutIfNeeded):
(WebCore::RenderBox::isWritingModeRoot const): Deleted.
(WebCore::RenderBox::isDeprecatedFlexItem const): Deleted.
(WebCore::RenderBox::isFlexItemIncludingDeprecated const): Deleted.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::createsNewFormattingContext const):
* rendering/RenderElement.h:
(WebCore::RenderElement::isWritingModeRoot const):
(WebCore::RenderElement::isDeprecatedFlexItem const):
(WebCore::RenderElement::isFlexItemIncludingDeprecated const):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::isBlockContainer const):
* rendering/RenderObject.h:
Grid items establish a new formatting context, unless they're a subgrid [1], but subgrid
is disabled if any other property causes the element to establish a formatting context [2].
Adds a new helper to check everything except grid, so that we can resolve this without
infinite recursion.
Stops writing-mode changes from establishing an independent formatting context if
the box is a grid container, since this should only happen is the box is a block
container [3].
Adds new helper for isBlockContainer, since writing-mode changes use it.
[1] https://drafts.csswg.org/css-grid-2/#grid-item-display
[2] https://drafts.csswg.org/css-grid-2/#subgrid-listing
[3] https://drafts.csswg.org/css-writing-modes/#block-flow
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::isSubgrid const):
(WebCore::RenderGrid::createsNewFormattingContext const):
(WebCore::RenderGrid::mayBeSubgridExcludingAbsPos const): Deleted.
(WebCore::RenderGrid::gridSpanCoversRealTracks const): Deleted.
* rendering/RenderGrid.h:
* rendering/style/GridPositionsResolver.cpp:
(WebCore::adjustGridPositionsFromStyle):
Makes isSubgrid return false if the element establishes an independent formatting context
(excluding contexts established by being a grid item), and removes no longer needed code
for handling position:absolute subgrids.
2022-04-06 Tim Nguyen <ntim@apple.com>
[:has() pseudo-class] Support invalidation for :placeholder-shown
https://bugs.webkit.org/show_bug.cgi?id=238894
Reviewed by Simon Fraser.
Test: imported/w3c/web-platform-tests/css/selectors/invalidation/input-pseudo-classes-in-has.html
Use same pattern as other input pseudo classes.
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::updatePlaceholderVisibility):
2022-04-06 Myles C. Maxfield <mmaxfield@apple.com>
NBSP characters drawn in fonts that don't support the space character turn into boxes
https://bugs.webkit.org/show_bug.cgi?id=238836
<rdar://problem/91130503>
Reviewed by Alan Bujtas.
We have some historical code in WebKit where we swap out the non-breaking space glyph
for the space glyphs when rendering. This is not what the other browsers do; they will
faithfully render the non-breaking space glyph. This patch aligns with the other
browsers.
This patch also fixes a similar problem with tab characters. Other browsers never
render any visible tab glyphs, even if the font has a visible glyph for the tab
character. This patch implements this.
This patch also only clobbers the glyphs used for carriageReturn and newlineCharacter
if the replacement glyph exists.
Test: fast/text/nbsp-no-space.html
* platform/graphics/WidthIterator.cpp:
(WebCore::WidthIterator::applyCSSVisibilityRules):
2022-04-06 Andres Gonzalez <andresg_22@apple.com>
[ Mac ] accessibility/mac/expanded-notification.html is a flaky text failure
https://bugs.webkit.org/show_bug.cgi?id=238830
rdar://91313419
Reviewed by Chris Fleizach.
Test: accessibility/mac/expanded-notification.html
This patch fixes the flackiness of this test and also fixes this test
in isolated tree mode that was timing out.
Instead of AXIsolatedTree::updateChildren on the AXExpandedChanged
notification, we now update the ISExpanded property in the target object.
If new children are added or removed from the tree as the result of an
element's expanded state change, those tree mutations should generate
separate AXChildrenChanged notifications.
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::updateIsolatedTree):
* accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::updateNodeProperty):
2022-04-06 Said Abou-Hallawa <said@apple.com>
[GPU Process] Make SVGFEImageElement::filterEffect() create an ImageBuffer compatible with the destination GraphicsContext
https://bugs.webkit.org/show_bug.cgi?id=236573
rdar://89209695
Reviewed by Simon Fraser.
Pass a GraphicsContext to CSSFilter::create() and SVGFilter::create().
If there is no GraphicsContext available, like the call we make in
CSSFilterImageValue::image(), pass a NullGraphicsContext(). This will
create a local ImageBuffer. And this is exactly what we want.
The GraphicsContext will be passed from SVGFilter::buildFilterExpression()
to all the overridden filterEffect(). SVGFEImageElement::filterEffect()
is the only one that is going to use it. It calls GraphicsContext::
createImageBuffer() to create an ImageBuffer for drawing the SVGElement.
In preparation to remove SVGFilterBuilder:
-- Pass an SVGFilter instead of SVGFilterBuilder to all the overridden
filterEffect() and all the overridden lightSource().
-- Make SVGFilterBuilder::calculateFilterOutsets() a static method.
-- Remove the members: SVGFilterBuilder::m_tragetBoundingBox and
SVGFilterBuilder::m_primitiveUnits since they exist in SVGFilter.
* css/CSSFilterImageValue.cpp:
(WebCore::CSSFilterImageValue::image):
* page/FrameView.cpp:
(WebCore::FrameView::adjustPageHeightDeprecated):
* platform/graphics/NullGraphicsContext.h:
* rendering/CSSFilter.cpp:
(WebCore::CSSFilter::create):
(WebCore::calculateReferenceFilterOutsets):
(WebCore::createReferenceFilter):
(WebCore::CSSFilter::buildFilterFunctions):
* rendering/CSSFilter.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateEventRegion):
* rendering/RenderLayerFilters.cpp:
(WebCore::RenderLayerFilters::beginFilterEffect):
* rendering/svg/RenderSVGResourceFilter.cpp:
(WebCore::RenderSVGResourceFilter::applyResource):
* rendering/svg/SVGRenderTreeAsText.cpp:
(WebCore::writeSVGResourceContainer):
* svg/SVGFEBlendElement.cpp:
(WebCore::SVGFEBlendElement::filterEffect const):
* svg/SVGFEBlendElement.h:
* svg/SVGFEColorMatrixElement.cpp:
(WebCore::SVGFEColorMatrixElement::filterEffect const):
* svg/SVGFEColorMatrixElement.h:
* svg/SVGFEComponentTransferElement.cpp:
(WebCore::SVGFEComponentTransferElement::filterEffect const):
* svg/SVGFEComponentTransferElement.h:
* svg/SVGFECompositeElement.cpp:
(WebCore::SVGFECompositeElement::filterEffect const):
* svg/SVGFECompositeElement.h:
* svg/SVGFEConvolveMatrixElement.cpp:
(WebCore::SVGFEConvolveMatrixElement::filterEffect const):
* svg/SVGFEConvolveMatrixElement.h:
* svg/SVGFEDiffuseLightingElement.cpp:
(WebCore::SVGFEDiffuseLightingElement::filterEffect const):
* svg/SVGFEDiffuseLightingElement.h:
* svg/SVGFEDisplacementMapElement.cpp:
(WebCore::SVGFEDisplacementMapElement::filterEffect const):
* svg/SVGFEDisplacementMapElement.h:
* svg/SVGFEDistantLightElement.cpp:
(WebCore::SVGFEDistantLightElement::lightSource const):
* svg/SVGFEDistantLightElement.h:
* svg/SVGFEDropShadowElement.cpp:
(WebCore::SVGFEDropShadowElement::filterEffect const):
* svg/SVGFEDropShadowElement.h:
* svg/SVGFEFloodElement.cpp:
(WebCore::SVGFEFloodElement::filterEffect const):
* svg/SVGFEFloodElement.h:
* svg/SVGFEGaussianBlurElement.cpp:
(WebCore::SVGFEGaussianBlurElement::filterEffect const):
* svg/SVGFEGaussianBlurElement.h:
* svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::imageBufferForEffect const):
(WebCore::SVGFEImageElement::filterEffect const):
(WebCore::scaledImageBufferRect): Deleted.
(WebCore::clampingScaleForImageBufferSize): Deleted.
(WebCore::createImageBuffer): Deleted.
* svg/SVGFEImageElement.h:
* svg/SVGFELightElement.h:
* svg/SVGFEMergeElement.cpp:
(WebCore::SVGFEMergeElement::filterEffect const):
* svg/SVGFEMergeElement.h:
* svg/SVGFEMorphologyElement.cpp:
(WebCore::SVGFEMorphologyElement::filterEffect const):
* svg/SVGFEMorphologyElement.h:
* svg/SVGFEOffsetElement.cpp:
(WebCore::SVGFEOffsetElement::filterEffect const):
* svg/SVGFEOffsetElement.h:
* svg/SVGFEPointLightElement.cpp:
(WebCore::SVGFEPointLightElement::lightSource const):
* svg/SVGFEPointLightElement.h:
* svg/SVGFESpecularLightingElement.cpp:
(WebCore::SVGFESpecularLightingElement::filterEffect const):
* svg/SVGFESpecularLightingElement.h:
* svg/SVGFESpotLightElement.cpp:
(WebCore::SVGFESpotLightElement::lightSource const):
* svg/SVGFESpotLightElement.h:
* svg/SVGFETileElement.cpp:
(WebCore::SVGFETileElement::filterEffect const):
* svg/SVGFETileElement.h:
* svg/SVGFETurbulenceElement.cpp:
(WebCore::SVGFETurbulenceElement::filterEffect const):
* svg/SVGFETurbulenceElement.h:
* svg/SVGFilterElement.cpp:
* svg/SVGFilterPrimitiveStandardAttributes.cpp:
* svg/SVGFilterPrimitiveStandardAttributes.h:
* svg/graphics/filters/SVGFilter.cpp:
(WebCore::SVGFilter::create):
* svg/graphics/filters/SVGFilter.h:
* svg/graphics/filters/SVGFilterBuilder.cpp:
(WebCore::SVGFilterBuilder::buildFilterExpression):
(WebCore::SVGFilterBuilder::calculateFilterOutsets):
(WebCore::SVGFilterBuilder::SVGFilterBuilder): Deleted.
* svg/graphics/filters/SVGFilterBuilder.h:
(WebCore::SVGFilterBuilder::targetBoundingBox const): Deleted.
(WebCore::SVGFilterBuilder::primitiveUnits const): Deleted.
(): Deleted.
2022-04-06 Simon Fraser <simon.fraser@apple.com>
FilterImage::imageBufferFromPixelBuffer() can trigger accelerated buffers in the web process
https://bugs.webkit.org/show_bug.cgi?id=238848
Unreviewed.
Remove an icorrect FIXME comment now that I've verified that the issue does not occur.
* platform/graphics/filters/FilterImage.cpp:
(WebCore::FilterImage::imageBufferFromPixelBuffer):
2022-04-06 Chris Dumez <cdumez@apple.com>
Drop unnecessary ExceptionOr<> return types
https://bugs.webkit.org/show_bug.cgi?id=238876
Reviewed by Alex Christensen.
Drop unnecessary ExceptionOr<> return types as they may cause unnecessary branching at runtime.
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::create):
* animation/KeyframeEffect.h:
* css/MediaList.cpp:
(WebCore::MediaList::setMediaText):
* css/MediaList.h:
* html/CustomPaintCanvas.cpp:
(WebCore::CustomPaintCanvas::getContext):
* html/CustomPaintCanvas.h:
* html/CustomPaintImage.cpp:
(WebCore::CustomPaintImage::doCustomPaint):
2022-04-06 Simon Fraser <simon.fraser@apple.com>
Stop using the shared IOSurfacePool for WebGL
https://bugs.webkit.org/show_bug.cgi?id=238835
Reviewed by Kimmo Kinnunen.
Opt WebGL out of using the IOSurfacePool for its buffers; this would have almost never
used a surface from the pool, because only RemoteLayerBackingStore put surfaces in the
pool so it would be rare for the size to match. In addition, the pool has insufficient
guarantees about surface state.
* platform/graphics/cocoa/GraphicsContextGLCocoa.mm:
(WebCore::GraphicsContextGLCocoa::allocateAndBindDisplayBufferBacking):
2022-04-06 Ada Chan <adachan@apple.com>
Fix assertion in CSSPropertyAnimationWrapperMap constructor
https://bugs.webkit.org/show_bug.cgi?id=238884
Reviewed by Antoine Quint.
Add more non-animatable properties to the switch statement.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2022-04-06 Per Arne Vollan <pvollan@apple.com>
Avoid calling IOSurfaceAlignProperty in the WebContent process
https://bugs.webkit.org/show_bug.cgi?id=238870
<rdar://91252359>
Reviewed by Geoffrey Garen.
Use cached values for bytes per row alignment.
* platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp:
(WebCore::ImageBufferIOSurfaceBackend::calculateBytesPerRow):
2022-04-06 Chris Dumez <cdumez@apple.com>
Start replacing String(const char*) constructor with a String::fromLatin1(const char*) function
https://bugs.webkit.org/show_bug.cgi?id=238701
Reviewed by Geoffrey Garen.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionFailed):
(WebCore::LibWebRTCMediaEndpoint::setLocalSessionDescriptionFailed):
(WebCore::LibWebRTCMediaEndpoint::setRemoteSessionDescriptionFailed):
(WebCore::RTCStatsLogger::toJSONString const):
* Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
(WebCore::toException):
(WebCore::toRTCError):
* Modules/webauthn/WebAuthenticationUtils.cpp:
(WebCore::buildAttestationMap):
* Modules/webauthn/cbor/CBORValue.cpp:
(cbor::CBORValue::CBORValue):
* Modules/webdatabase/Database.cpp:
(WebCore::Database::Database):
(WebCore::Database::getVersionFromDatabase):
(WebCore::Database::setVersionInDatabase):
* animation/KeyframeEffect.cpp:
(WebCore::processPropertyIndexedKeyframes):
* animation/KeyframeEffect.h:
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::dumpIfTerminal):
* contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::getDomainList):
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
* crypto/algorithms/CryptoAlgorithmAES_CFB.cpp:
* crypto/algorithms/CryptoAlgorithmAES_CTR.cpp:
* crypto/algorithms/CryptoAlgorithmAES_GCM.cpp:
* crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
* crypto/algorithms/CryptoAlgorithmECDSA.cpp:
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
* crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:
* css/DOMCSSCustomPropertyDescriptor.h:
* css/makeprop.pl:
* dom/DataTransfer.cpp:
(WebCore::DataTransfer::types const):
* dom/TextDecoder.cpp:
(WebCore::TextDecoder::encoding const):
* editing/ApplyStyleCommand.cpp:
(WebCore::styleSpanClassString):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::isInterchangeNewlineNode):
(WebCore::isInterchangeConvertedSpaceSpan):
* editing/TextInsertionBaseCommand.cpp:
(WebCore::canAppendNewLineFeedToSelection):
* html/HiddenInputType.cpp:
(WebCore::HiddenInputType::appendFormData const):
* html/MediaFragmentURIParser.cpp:
(WebCore::MediaFragmentURIParser::parseFragments):
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getSupportedExtensions):
* html/parser/HTMLPreloadScanner.cpp:
(WebCore::testPreloadScannerViewportSupport):
* loader/FormSubmission.cpp:
(WebCore::FormSubmission::create):
* loader/MediaResourceLoader.cpp:
(WebCore::MediaResource::responseReceived):
* loader/cache/CachedApplicationManifest.cpp:
(WebCore::CachedApplicationManifest::encoding const):
* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::didAddClient):
(WebCore::CachedCSSStyleSheet::encoding const):
(WebCore::CachedCSSStyleSheet::checkNotify):
* loader/cache/CachedSVGDocument.cpp:
(WebCore::CachedSVGDocument::encoding const):
* loader/cache/CachedScript.cpp:
(WebCore::CachedScript::encoding const):
* loader/cache/CachedXSLStyleSheet.cpp:
(WebCore::CachedXSLStyleSheet::encoding const):
* page/cocoa/ResourceUsageThreadCocoa.mm:
(WebCore::threadInfos):
* platform/cocoa/PasteboardCocoa.mm:
(WebCore::Pasteboard::read):
* platform/gamepad/GamepadConstants.cpp:
(WebCore::standardGamepadMappingString):
(WebCore::xrStandardGamepadMappingString):
* platform/graphics/FourCC.h:
(WTF::LogArgument<WebCore::FourCC>::toString):
* platform/graphics/angle/GraphicsContextGLANGLE.cpp:
(WebCore::GraphicsContextGLANGLE::initialize):
(WebCore::GraphicsContextGLANGLE::getString):
* platform/mac/ThreadCheck.mm:
(WebCoreReportThreadViolation):
* platform/mediastream/RealtimeMediaSourceCenter.cpp:
(WebCore::RealtimeMediaSourceCenter::hashStringWithSalt):
* platform/mock/PlatformSpeechSynthesizerMock.cpp:
(WebCore::PlatformSpeechSynthesizerMock::initializeVoiceList):
* platform/sql/SQLiteDatabase.cpp:
(WebCore::SQLiteDatabase::authorizerFunction):
* platform/text/cocoa/LocaleCocoa.mm:
(WebCore::LocaleCocoa::monthLabels):
(WebCore::LocaleCocoa::shortMonthLabels):
* testing/Internals.cpp:
(WebCore::Internals::testDictionaryLogging):
* xml/XPathValue.h:
(WebCore::XPath::Value::Value):
* xml/XSLTProcessorLibxslt.cpp:
(WebCore::XSLTProcessor::parseErrorFunc):
(WebCore::docLoaderFunc):
(WebCore::XSLTProcessor::transformToString):
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::openFunc):
2022-04-06 Gabriel Nava Marino <gnavamarino@apple.com>
Check for document page in WorkerMessagingProxy::createCacheStorageConnection
https://bugs.webkit.org/show_bug.cgi?id=238872
Reviewed by Chris Dumez.
Add a check to the document page, similarily to how it is currently done in
WorkerMessagingProxy::createRTCDataChannelRemoteHandlerConnection.
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::createCacheStorageConnection):
2022-04-06 Said Abou-Hallawa <said@apple.com>
[GPU Process] Text filled with pattern sometimes draw with incorrect color
https://bugs.webkit.org/show_bug.cgi?id=236924
rdar://89196811
Reviewed by Myles C. Maxfield.
applyFillPattern() and applyStrokePattern() have to explicitly called
for the GraphicsContext or the DisplayList::Recorder before drawing
with the pattern. But this is not happening for the DrawGlyphsRecorder
internalContext. When CoreText calls DrawGlyphsRecorder::recordDrawGlyphs()
back, it applies the CGGState fill color to the DisplayList::Recorder so
it overrides what applyFillPattern() did before recording the glyphs.
* platform/graphics/DrawGlyphsRecorder.h:
* platform/graphics/coretext/DrawGlyphsRecorderCoreText.cpp:
(WebCore::DrawGlyphsRecorder::populateInternalContext):
(WebCore::DrawGlyphsRecorder::updateFillColor):
(WebCore::DrawGlyphsRecorder::updateStrokeColor):
(WebCore::DrawGlyphsRecorder::recordDrawGlyphs):
2022-04-06 Chris Dumez <cdumez@apple.com>
Reduce number of conversions from StringView to String
https://bugs.webkit.org/show_bug.cgi?id=238841
Reviewed by Geoffrey Garen.
* Modules/cache/DOMCacheEngine.cpp:
(WebCore::DOMCacheEngine::queryCacheMatch):
* dom/ViewportArguments.cpp:
(WebCore::viewportErrorMessage):
* inspector/agents/page/PageDebuggerAgent.cpp:
(WebCore::PageDebuggerAgent::sourceMapURLForScript):
* loader/CrossOriginAccessControl.cpp:
(WebCore::validateCrossOriginRedirectionURL):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::disallowWebArchive const):
(WebCore::DocumentLoader::maybeLoadEmpty):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
(WebCore::DocumentThreadableLoader::checkURLSchemeAsCORSEnabled):
* loader/EmptyClients.cpp:
(WebCore::EmptyFrameLoaderClient::representationExistsForURLScheme const):
(WebCore::EmptyFrameLoaderClient::generatedMIMETypeForURLScheme const):
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoaderClient.h:
* loader/archive/mhtml/MHTMLArchive.cpp:
(WebCore::MHTMLArchive::create):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::freshnessLifetime const):
* loader/soup/ResourceLoaderSoup.cpp:
(WebCore::ResourceLoader::loadGResource):
* page/Page.cpp:
(WebCore::Page::userStyleSheetLocationChanged):
(WebCore::Page::allowsLoadFromURL const):
* page/SecurityOrigin.cpp:
(WebCore::shouldTreatAsUniqueOrigin):
(WebCore::shouldTreatAsPotentiallyTrustworthy):
(WebCore::SecurityOrigin::isSecure):
(WebCore::SecurityOrigin::canDisplay const):
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::allowObjectFromSource const):
(WebCore::ContentSecurityPolicy::allowChildFrameFromSource const):
(WebCore::ContentSecurityPolicy::allowResourceFromSource const):
(WebCore::ContentSecurityPolicy::allowWorkerFromSource const):
(WebCore::ContentSecurityPolicy::allowScriptFromSource const):
(WebCore::ContentSecurityPolicy::allowStyleFromSource const):
(WebCore::ContentSecurityPolicy::allowConnectToSource const):
(WebCore::ContentSecurityPolicy::allowBaseURI const):
* page/csp/ContentSecurityPolicySourceList.cpp:
(WebCore::schemeIsInHttpFamily):
(WebCore::ContentSecurityPolicySourceList::isValidSourceForExtensionMode):
* platform/LegacySchemeRegistry.cpp:
(WebCore::LegacySchemeRegistry::schemeIsHandledBySchemeHandler):
(WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsLocal):
(WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsNoAccess):
(WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsDisplayIsolated):
(WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsSecure):
(WebCore::LegacySchemeRegistry::shouldLoadURLSchemeAsEmptyDocument):
(WebCore::LegacySchemeRegistry::canDisplayOnlyIfCanRequest):
(WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsCORSEnabled):
(WebCore::LegacySchemeRegistry::schemeShouldBypassContentSecurityPolicy):
(WebCore::LegacySchemeRegistry::shouldAlwaysRevalidateURLScheme):
(WebCore::LegacySchemeRegistry::isUserExtensionScheme):
* platform/LegacySchemeRegistry.h:
* platform/PublicSuffix.h:
* platform/mac/PublicSuffixMac.mm:
(WebCore::isPublicSuffix):
(WebCore::topPrivatelyControlledDomain):
* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::getBlobDataFromURL const):
* platform/network/CacheValidation.cpp:
(WebCore::headerValueForVary):
(WebCore::collectVaryingRequestHeadersInternal):
(WebCore::collectVaryingRequestHeaders):
* platform/network/HTTPHeaderMap.cpp:
(WebCore::HTTPHeaderMap::get const):
(WebCore::HTTPHeaderMap::getUncommonHeader const):
* platform/network/HTTPHeaderMap.h:
* platform/network/HTTPParsers.cpp:
(WebCore::isCrossOriginSafeHeader):
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::httpHeaderField const):
* platform/network/ResourceRequestBase.h:
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::sanitizeHTTPHeaderFieldsAccordingToTainting):
(WebCore::ResourceResponseBase::httpHeaderField const):
* platform/network/ResourceResponseBase.h:
* platform/network/curl/PublicSuffixCurl.cpp:
(WebCore::isPublicSuffix):
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::SoupNetworkSession::checkTLSErrors):
* platform/soup/PublicSuffixSoup.cpp:
(WebCore::isPublicSuffix):
2022-04-06 Brent Fulgham <bfulgham@apple.com>
Further clean-ups for features.json
https://bugs.webkit.org/show_bug.cgi?id=238769
Reviewed by Tim Nguyen.
While editing the Features file, I noticed two things:
1. A number of APIs that we do not support were missing.
2. A number of APIs were included in the "Features" section, rather than the "Standards" section.
This patch corrects both issues.
* features.json:
2022-04-06 Youenn Fablet <youenn@apple.com>
[Cocoa] Use GCD webrtc task queue
https://bugs.webkit.org/show_bug.cgi?id=238861
Reviewed by Eric Carlson.
Covered by existing tests.
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::LibWebRTCProvider::createPeerConnectionFactory):
2022-04-06 Simon Fraser <simon.fraser@apple.com>
Unify the two ImageBuffer::create() functions, passing RenderingPurpose everywhere
https://bugs.webkit.org/show_bug.cgi?id=238851
Reviewed by Said Abou-Hallawa.
I need to extend RenderingPurpose flags to distinguish layer backing store buffers from
other kinds of buffers. Before doing so, collapse the two ImageBuffer::create() functions
together by combining RenderingMode and ShouldUseDisplayList into OptionSet<ImageBufferOptions>,
and passing RenderingPurpose everywhere.
Always passing RenderingPurpose is revealing, because it finds call sites in the
web process that can trigger accelerated buffers (e.g. webkit.org/b/238846).
* Modules/async-clipboard/ClipboardItemBindingsDataSource.cpp:
(WebCore::ClipboardItemBindingsDataSource::ClipboardItemTypeLoader::sanitizeDataIfNeeded):
* Modules/mediasession/MediaMetadata.cpp:
(WebCore::ArtworkImageLoader::notifyFinished):
* css/CSSFilterImageValue.cpp:
(WebCore::CSSFilterImageValue::image):
* html/CustomPaintCanvas.cpp:
(WebCore::CustomPaintCanvas::copiedImage const):
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::createImageBuffer const):
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::createBufferForPainting const):
* html/ImageBitmap.cpp:
(WebCore::ImageBitmap::createImageBuffer):
* html/canvas/ImageBitmapRenderingContext.cpp:
(WebCore::ImageBitmapRenderingContext::setOutputBitmap):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::LRUImageBufferCache::imageBuffer):
* html/shadow/MediaControlTextTrackContainerElement.cpp:
(WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::indexForData):
* page/FrameSnapshotting.cpp:
(WebCore::snapshotFrameRectWithClip):
* page/PageConsoleClient.cpp:
(WebCore::PageConsoleClient::screenshot):
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::preTransformedNativeImageForCurrentFrame):
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::createImageBuffer const):
* platform/graphics/ImageBuffer.cpp:
(WebCore::ImageBuffer::create):
* platform/graphics/ImageBuffer.h:
(WebCore::ImageBuffer::create):
* platform/graphics/RenderingMode.h:
* platform/graphics/ShadowBlur.cpp:
(WebCore::ScratchBuffer::WTF_REQUIRES_LOCK):
(WebCore::ShadowBlur::drawRectShadowWithoutTiling):
(WebCore::ShadowBlur::drawInsetShadowWithoutTiling):
(WebCore::ShadowBlur::drawRectShadowWithTiling):
(WebCore::ShadowBlur::drawInsetShadowWithTiling):
(WebCore::ShadowBlur::drawShadowLayer):
* platform/graphics/SourceImage.cpp:
(WebCore::SourceImage::imageBuffer const):
* platform/graphics/filters/FilterImage.cpp:
(WebCore::FilterImage::imageBufferFromPixelBuffer):
(WebCore::getConvertedPixelBuffer):
* platform/graphics/filters/software/FETileSoftwareApplier.cpp:
(WebCore::FETileSoftwareApplier::apply const):
* platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.cpp:
(Nicosia::GCGLANGLELayer::swapBuffersIfNeeded):
* platform/graphics/texmap/BitmapTexture.cpp:
(WebCore::BitmapTexture::updateContents):
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::imageBuffer const):
* rendering/shapes/Shape.cpp:
(WebCore::Shape::createRasterShape):
* rendering/svg/RenderSVGResourceClipper.cpp:
(WebCore::RenderSVGResourceClipper::applyClippingToContext):
* svg/SVGFEImageElement.cpp:
(WebCore::createImageBuffer):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::nativeImage):
2022-04-06 Oriol Brufau <obrufau@igalia.com>
[css] Turn -webkit-border-image into a shorthand
https://bugs.webkit.org/show_bug.cgi?id=237487
Reviewed by Antti Koivisto.
The '-webkit-border-image' property was considered to be a longhand,
sharing computed values with the various 'border-image-*'.
This patch turns it into a shorthand of 'border-image-*'.
Tests: fast/borders/border-image-legacy.html
fast/css/border-image-style-length.html
fast/css/getComputedStyle/computed-style.html
fast/css/getComputedStyle/computed-style-without-renderer.html
fast/css/image-set-parsing.html
fast/css/uri-token-parsing.html
imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml.html
imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree.html
svg/css/getComputedStyle-basic.xhtml
* Sources.txt:
Add the new file CSSBorderImageWidthValue.cpp.
* WebCore.xcodeproj/project.pbxproj:
Add the new files CSSBorderImageWidthValue.h and
CSSBorderImageWidthValue.cpp.
* animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc):
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
When animating border-image-width, take into account that it can come
from -webkit-border-image, and thus override border widths.
Do not interpolate a value a does override border widths with another
value that does not.
Even if border-image-width accepts <length-percentage>, when overriding
border widths do not interpolate between a <length-percentage> and a
plain <length>, since only the latter are valid border widths.
* css/CSSBorderImageWidthValue.cpp: Added.
(WebCore::CSSBorderImageWidthValue::CSSBorderImageWidthValue):
(WebCore::CSSBorderImageWidthValue::customCSSText const):
(WebCore::CSSBorderImageWidthValue::equals const):
* css/CSSBorderImageWidthValue.h: Added.
Add CSSBorderImageWidthValue class, based on CSSBorderImageSliceValue.
It's a wrapper for a CSS_QUAD CSSPrimitiveValue, but with a bool that
indicates if the value will override border widths.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::valueForNinePieceImage):
(WebCore::valueForReflection):
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
Serialize border-image-width as empty string if it overrides border
widths, since its grammar doesn't allow this.
Serialize border-image as empty string if border-image-width overrides
border widths, since its grammar doesn't allow this.
Handle serialization of -webkit-border-image.
* css/CSSProperties.json:
Turn -webkit-border-image into a shorthand of border-image-source,
border-image-slice, border-image-width, border-image-outset and
border-image-repeat.
* css/CSSToStyleMap.cpp:
(WebCore::CSSToStyleMap::mapNinePieceImage):
(WebCore::CSSToStyleMap::mapNinePieceImageWidth):
(WebCore::CSSToStyleMap::mapNinePieceImageQuad):
* css/CSSToStyleMap.h:
Handle CSSBorderImageWidthValue values.
Remove old way of handling -webkit-border-image.
* css/CSSValue.cpp:
(WebCore::CSSValue::equals const):
(WebCore::CSSValue::cssText const):
(WebCore::CSSValue::destroy):
* css/CSSValue.h:
(WebCore::CSSValue::isBorderImageWidthValue const):
Handle new CSSBorderImageWidthValue value.
* css/StyleProperties.cpp:
(WebCore::StyleProperties::getPropertyValue const):
(WebCore::StyleProperties::borderImagePropertyValue const):
(WebCore::StyleProperties::asText const):
* css/StyleProperties.h:
Serialize border-image as empty string if border-image-width overrides
border widths, since its grammar doesn't allow this.
Handle serialization of -webkit-border-image.
Make cssText choose the right shorthand between border-image and
-webkit-border-image. Prefer the former if both are suitable.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeBorderImageWidth):
(WebCore::consumeBorderImageComponents):
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::CSSPropertyParser::consumeBorderImage):
(WebCore::CSSPropertyParser::parseShorthand):
Parse border-image-width as a CSSBorderImageWidthValue.
Parse -webkit-border-image as a shorthand.
* rendering/RenderTreeAsText.cpp:
(WebCore::RenderTreeAsText::writeRenderObject):
Take into account that border widths may be overridden.
* rendering/style/BorderData.h:
(WebCore::BorderData::borderLeftWidth const):
(WebCore::BorderData::borderRightWidth const):
(WebCore::BorderData::borderTopWidth const):
(WebCore::BorderData::borderBottomWidth const):
Add logic for overriding border widths. Same approach as 'border-style'
set to 'none' making the border widths compute to '0px'.
* rendering/style/NinePieceImage.cpp:
(WebCore::NinePieceImage::NinePieceImage):
(WebCore::NinePieceImage::Data::Data):
(WebCore::NinePieceImage::Data::create):
(WebCore::NinePieceImage::Data::operator== const):
* rendering/style/NinePieceImage.h:
(WebCore::NinePieceImage::overridesBorderWidths const):
(WebCore::NinePieceImage::setOverridesBorderWidths):
(WebCore::NinePieceImage::copyBorderSlicesFrom):
Add flag for overriding border widths.
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::setBorderImageWidthOverridesBorderWidths):
* rendering/style/RenderStyle.h:
Add method for setting flag to override border widths.
* style/PropertyCascade.cpp:
(WebCore::Style::shouldApplyPropertyInParseOrder):
Stop deferring border image properties. That was previously needed since
-webkit-border-image was a longhand sharing a computed value with the
border-image longhands. No longer needed since -webkit-border-image is
now a horthand.
* style/StyleBuilderConverter.h:
(WebCore::Style::BuilderConverter::convertBorderMask):
(WebCore::Style::BuilderConverter::convertReflection):
(WebCore::Style::BuilderConverter::convertBorderImage): Deleted.
Remove code no longer needed.
* style/StyleBuilderCustom.h:
(WebCore::Style::ApplyPropertyBorderImageModifier::applyInitialValue):
(WebCore::Style::ApplyPropertyBorderImageModifier::applyValue):
Handle border-image-width as a CSSBorderImageWidthValue.
2022-04-06 Tim Nguyen <ntim@apple.com>
[:has() pseudo-class] Support invalidation for more input pseudo classes
https://bugs.webkit.org/show_bug.cgi?id=238451
Reviewed by Antti Koivisto.
- :indeterminate
- :read-only
- :read-write
- :required
- :optional
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::parseAttribute):
(WebCore::HTMLFormControlElement::readOnlyStateChanged):
(WebCore::HTMLFormControlElement::requiredStateChanged):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setIndeterminate):
2022-04-06 Alan Bujtas <zalan@apple.com>
[CSS-Contain] Grid layout should take "contain: inline-size" into account when computing the grid item's logical width
https://bugs.webkit.org/show_bug.cgi?id=238850
Reviewed by Antti Koivisto.
Ignore grid item's logical width when "contain: inline-size" is present (i.e. ignore descendant content in inline direction when sizing).
* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrackSizingAlgorithm::computeGridContainerIntrinsicSizes):
(WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild const):
(WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild const):
(WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
(WebCore::GridTrackSizingAlgorithmStrategy::minLogicalSizeForChild const):
(WebCore::GridTrackSizingAlgorithm::advanceNextState):
* rendering/GridTrackSizingAlgorithm.h:
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutBlock):
(WebCore::RenderGrid::computeEmptyTracksForAutoRepeat const):
2022-04-06 Oriol Brufau <obrufau@igalia.com>
[css] Turn -webkit-text-orientation into a legacy shorthand
https://bugs.webkit.org/show_bug.cgi?id=238356
Reviewed by Antti Koivisto.
`-webkit-text-orientation` and `text-orientation` were both implemented
as longhands, just with a `related-property` flag so that declaration
blocks with both of them would use the one appearing last.
However, the logic for `related-property` wasn't always working well.
In bug 238350 I plan to merge it with shouldApplyPropertyInParseOrder(),
which has the same purpose and works better. But it's not suitable for
high priority properties like `text-orientation`.
So this patch turns `-webkit-text-orientation` into a shorthand that
expands into `text-orientation`.
`-webkit-text-orientation` continues accepting the legacy value
`sideways-right`, which is now mapped into `sideways` at parse time.
Previously this happened at computed-value time, but it implied that
serializing `text-decoration` could yield an invalid value.
Tests: fast/text/text-orientation-parse-competition.html
fast/text/text-orientation-parse-stylesheet.html
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::operator TextOrientation const):
Remove mapping of `sideways-right` into `sideways`, this is now
done at parse time. Also remove mapping of `vertical-right` into `mixed`
since `vertical-right` is a remnant of the past which has not been
considered valid syntax for years.
* css/CSSProperties.json:
Turn `-webkit-text-orientation` into a shorthand of `text-orientation`.
Remove their `related-property` flags and a remnant of `vertical-right`.
* css/StyleProperties.cpp:
(WebCore::StyleProperties::getPropertyValue const):
Add code for serializing the `-webkit-text-orientation` shorthand.
* css/makeprop.pl:
Avoid a compile warning in getRelatedPropertyId() when no property has
the `related-property` flag.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
Remove `-webkit-text-orientation` from code which is only relevant for
longhands.
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::consumeLegacyTextOrientation):
(WebCore::CSSPropertyParser::parseShorthand):
Add parsing logic for `-webkit-text-orientation` as a shorthand.
* css/parser/CSSPropertyParser.h:
Add parsing logic for `-webkit-text-orientation` as a shorthand.
* style/StyleBuilderCustom.h:
(WebCore::Style::BuilderCustom::applyValueWebkitTextOrientation): Deleted.
Remove `-webkit-text-orientation` from code which is only relevant for
longhands.
2022-04-06 Zan Dobersek <zdobersek@igalia.com>
[TextureMapper] Clean up the GraphicsContextGLTextureMapperANGLE header
https://bugs.webkit.org/show_bug.cgi?id=238864
Reviewed by Carlos Garcia Campos.
* platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.h:
Remove two unused libgbm declarations and mark the class destructor as
virtual, which it is due to its inheritance.
2022-04-06 Youenn Fablet <youenn@apple.com>
Implement ServiceWorkerWindowClient.navigate
https://bugs.webkit.org/show_bug.cgi?id=238738
Reviewed by Chris Dumez.
Introduce a routine to navigate a Document.
Send FrameIdentifier as part of ServiceWorkerClientData.
Implement ServiceWorkerWindowClient::navigate by sending IPC to network process.
Test: http/wpt/service-workers/navigate-iframes-window-client.https.html
* dom/Document.cpp:
* dom/Document.h:
* loader/FrameLoader.cpp:
* workers/service/ServiceWorkerClientData.cpp:
* workers/service/ServiceWorkerClientData.h:
* workers/service/ServiceWorkerWindowClient.cpp:
* workers/service/context/SWContextManager.h:
* workers/service/server/SWServer.cpp:
* workers/service/server/SWServer.h:
* workers/service/server/SWServerWorker.cpp:
* workers/service/server/SWServerWorker.h:
2022-04-06 Youenn Fablet <youenn@apple.com>
ServiceWorkerClients.openWindow should not need to get all clients asynchronously to resolve its promise
https://bugs.webkit.org/show_bug.cgi?id=238503
Reviewed by Chris Dumez.
Move matching client in openWindow in network process as an optimization.
This also prevents some race conditions where the opened page could quickly navigate to another page.
Also have a code path that rejects the openWindow promise, and trigger that code path in case of internal error.
Covered by existing and API test.
* workers/WorkerGlobalScope.h:
* workers/service/ServiceWorkerClients.cpp:
* workers/service/context/SWContextManager.h:
* workers/service/server/SWServer.cpp:
* workers/service/server/SWServer.h:
* workers/service/server/SWServerToContextConnection.h:
2022-04-06 Antti Koivisto <antti@apple.com>
Remove some @apply leftover code
https://bugs.webkit.org/show_bug.cgi?id=238857
Reviewed by Tim Nguyen.
@apply is not a thing.
* css/CSSVariableData.h:
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::consumeAtRule):
(WebCore::CSSParserImpl::consumeDeclarationList):
* css/parser/CSSParserImpl.h:
* css/parser/CSSVariableParser.cpp:
(WebCore::classifyBlock):
(WebCore::isValidVariableReference):
(WebCore::isValidConstantReference):
(WebCore::classifyVariableRange):
(WebCore::CSSVariableParser::containsValidVariableReferences):
(WebCore::CSSVariableParser::parseDeclarationValue):
2022-04-06 Youenn Fablet <youenn@apple.com>
Remove Notification::m_relatedNotificationIdentifier
https://bugs.webkit.org/show_bug.cgi?id=238603
Reviewed by Brady Eidson.
m_relatedNotificationIdentifier was added as a temporary workaround for persistent notifications that are recreated in other contexts.
To directly support this case, Notification is no longer a Identified<UUID> and instead has a m_identifier.
When created from JS, Notification::m_identifier is generated.
When created from NotificationData, Notification::m_identifier is copied from NotificationData.
Covered by existing tests.
* Modules/notifications/Notification.cpp:
* Modules/notifications/Notification.h:
2022-04-05 Ada Chan <adachan@apple.com>
[WebXR] Add a new enum type to represent session features
https://bugs.webkit.org/show_bug.cgi?id=238837
Reviewed by Dean Jackson.
Test: http/wpt/webxr/xrDevice_requestSession_hand_tracking_feature.https.html
Add a new enum type, PlatformXR::SessionFeature, to represent session features.
It includes the ReferenceSpaceTypes and the hand-tracking feature for now.
Fix the algorithm to resolve the requested features to recognize hand-tracking
as a feature that requires explicit consent.
* Modules/webxr/WebXRSession.cpp:
(WebCore::WebXRSession::referenceSpaceIsSupported const):
Convert the XRReferenceSpaceType to PlatformXR::SessionFeature first before
checking against the feature list.
* Modules/webxr/WebXRSystem.cpp:
(WebCore::WebXRSystem::inlineSessionRequestIsAllowedForGlobalObject const):
Use PlatformXR::parseSessionFeatureDescriptor() to parse the feature string.
(WebCore::featureRequiresExplicitConsent):
Returns true for the hand tracking feature.
(WebCore::WebXRSystem::isFeatureSupported const):
Check whether the device supports the feature. For hand-tracking, make sure
the hand input module setting is enabled.
(WebCore::WebXRSystem::resolveRequestedFeatures const):
Update the string conversion between JS and WTF::String now that features cannot
be parsed as XRReferenceSpaceType enum. If the feature requires explicit consent
and it's not already in the granted list, add it to consentRequired or consentOptional
depending on whether it's specified as required.
(WebCore::WebXRSystem::resolveFeaturePermissions const):
If a feature is required but not given a clear signal of user intent, the session
should not be created.
(WebCore::WebXRSystem::DummyInlineDevice::DummyInlineDevice):
Updated to use PlatformXR::SessionFeature.
* Modules/webxr/WebXRSystem.h:
* platform/xr/PlatformXR.h:
(PlatformXR::sessionFeatureFromReferenceSpaceType):
(PlatformXR::parseSessionFeatureDescriptor):
Parse feature string to return PlatformXR::SessionFeature.
(PlatformXR::sessionFeatureDescriptor):
Return feature string from PlatformXR::SessionFeature.
(PlatformXR::Device::supports const):
Read from the m_supportedFeaturesMap.
(PlatformXR::Device::setSupportedFeatures):
Write to the m_supportedFeaturesMap.
(PlatformXR::Device::supportedFeatures const):
Read from the m_supportedFeaturesMap.
* platform/xr/openxr/PlatformXROpenXR.cpp:
(PlatformXR::OpenXRDevice::collectSupportedFeatures const):
Updated to use PlatformXR::SessionFeature.
* testing/WebXRTest.cpp:
(WebCore::WebXRTest::simulateDeviceConnection):
Updated to parse feature string to PlatformXR::SessionFeature.
2022-04-05 Andres Gonzalez <andresg_22@apple.com>
Eliminate delays for processing live regions and modal notifications.
https://bugs.webkit.org/show_bug.cgi?id=238833
<rdar://problem/91314023>
Reviewed by Chris Fleizach.
We had arbitrary delays to process notifications for live regions and
modal elements. This is no longer necessary and may cause problems
updating the isolated tree that depends on these notifications being
processed in a timely manner.
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::handleChildrenChanged):
(WebCore::AXObjectCache::postLiveRegionChangeNotification):
(WebCore::AXObjectCache::focusModalNode):
2022-04-05 Stephan Szabo <stephan.szabo@sony.com>
[PlayStation[ Fix build break after r292408
https://bugs.webkit.org/show_bug.cgi?id=238840
Unreviewed build fix.
* platform/LocalizedStrings.cpp:
* platform/network/playstation/CurlSSLHandlePlayStation.cpp:
* platform/playstation/UserAgentPlayStation.cpp:
2022-04-05 Matt Woodrow <mattwoodrow@apple.com>
Support transitions/animations on grid-template-columns|rows
https://bugs.webkit.org/show_bug.cgi?id=204580
Reviewed by Antoine Quint.
* animation/CSSPropertyAnimation.cpp:
(WebCore::canInterpolate):
(WebCore::blendFunc):
GridTrackLists can be interpolated if they are the same length, and if any repeat() functions
have the same length and count/type.
Adds function for determining if two GridTrackLists can be interpolated, and function for interpolating
per-entry if so.
Adds blending helpers for GridTrackSize and GridLength.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::valueForGridTrackList):
Remove empty line name sets from the serialized computed style in order to satisfy the shortest equivalent
serialization principle.
* style/StyleBuilderConverter.h:
(WebCore::Style::BuilderConverter::createGridTrackList):
Ensures computed track lists are stored in the canonical format (alternating between line name sets
and track sizes, starting and ending with a line name set), in order to make the interpolation
code simpler.
2022-04-05 Eric Carlson <eric.carlson@apple.com>
[Cocoa] Video is sometimes not visible after r292049
https://bugs.webkit.org/show_bug.cgi?id=238826
Reviewed by Jer Noble.
RenderVideo::willBeDestroyed calls MediaPlayer::setPageIsVisible, which causes
MediaPlayerPrivateAVFoundationObjC::platformSetVisible to hide the AVPlayerLayer.
HTMLMediaElement::visibilityStateChanged is the only other thing that calls
MediaPlayer::setPageIsVisible, and it only calls it when the page visibility changes,
so if that doesn't happen the AVPlayerLayer is not shown when the renderer is
recreated.
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::willBeDestroyed): Don't call MediaPlayer::setPageIsVisible(false),
the page visibility has not changed.
2022-04-05 Andres Gonzalez <andresg_22@apple.com>
Make subtrees collapsible in the output of the AXLogger streamSubtree.
https://bugs.webkit.org/show_bug.cgi?id=238829
<rdar://problem/91310566>
Reviewed by Chris Fleizach.
Moved the TextStream::GroupScope from the method logging an individual
object to the method logging the hierarchy. This allows to collapse the
entire subtree rooted at a given object.
* accessibility/AXLogger.cpp:
(WebCore::streamAXCoreObject):
(WebCore::streamSubtree):
2022-04-05 Antti Koivisto <antti@apple.com>
Avoid unnecessary traversal when updating list markers
https://bugs.webkit.org/show_bug.cgi?id=238795
Reviewed by Anders Carlsson.
This code could use a full rewrite but there are also some simple optimizations that can be done.
* rendering/RenderListItem.cpp:
(WebCore::nextListItemHelper):
Don't advance into non-rendered subtrees. We won't find any renderers there.
2022-04-05 Chris Dumez <cdumez@apple.com>
Implement faster lookup of HTML tags in the HTML parser
https://bugs.webkit.org/show_bug.cgi?id=238804
Reviewed by Geoffrey Garen.
Implement faster lookup of HTML tags in the HTML parser by having make_names.pl generate
a findHTMLTag function that returns very efficient well-known HTML tag names.
It is a little more efficient that our current HTMLNameCache (0.4% progression on
Speedometer on MacBookAir 10,1, neutral on iMac20,1). Unlike the HTMLNameCache, It doesn't
require any hashing or additional storage since the set of well-known HTML tags is known
at compile time.
* dom/make_names.pl:
(printNamesHeaderFile):
(findMaxTagLength):
(tagsWithLength):
(generateFindTagForLength):
(printNamesCppFile):
* html/parser/AtomHTMLToken.h:
(WebCore::AtomHTMLToken::AtomHTMLToken):
* html/parser/HTMLNameCache.cpp:
(WebCore::HTMLNameCache::atomStringCache):
* html/parser/HTMLNameCache.h:
(WebCore::HTMLNameCache::makeAttributeValue):
(WebCore::HTMLNameCache::clear):
(WebCore::HTMLNameCache::makeAtomString):
(WebCore::HTMLNameCache::atomStringCacheSlot):
(WebCore::HTMLNameCache::makeTagName): Deleted.
2022-04-05 Alan Bujtas <zalan@apple.com>
[CSS-Contain] Flex layout should take "contain: inline-size" into account when computing the flex item's logical width
https://bugs.webkit.org/show_bug.cgi?id=238805
Reviewed by Antti Koivisto.
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths const):
2022-04-05 Chris Dumez <cdumez@apple.com>
Unreviewed WinCairo build fix after r292408.
* platform/win/GDIObjectCounter.cpp:
(WebCore::GDIObjectCounter::GDIObjectCounter):
* platform/win/GDIObjectCounter.h:
2022-04-05 Chris Dumez <cdumez@apple.com>
Unreviewed Windows debug build fix after r292279.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2022-04-05 Chris Dumez <cdumez@apple.com>
Mark String(const char*) constructor as explicit
https://bugs.webkit.org/show_bug.cgi?id=238693
Reviewed by Geoffrey Garen.
* Modules/mediastream/gstreamer/GStreamerMediaEndpoint.cpp:
(WebCore::fetchDescription):
(WebCore::GStreamerMediaEndpoint::storeRemoteMLineInfo):
(WebCore::GStreamerMediaEndpoint::addIceCandidate):
(WebCore::GStreamerMediaEndpoint::createSessionDescriptionSucceeded):
(WebCore::GStreamerMediaEndpoint::createSessionDescriptionFailed):
(WebCore::GStreamerMediaEndpoint::collectTransceivers):
* Modules/mediastream/gstreamer/GStreamerPeerConnectionBackend.cpp:
(WebCore::gstreamerRtpCapatiblities):
(WebCore::GStreamerPeerConnectionBackend::doCreateAnswer):
* Modules/mediastream/gstreamer/GStreamerRtpTransceiverBackend.cpp:
(WebCore::GStreamerRtpTransceiverBackend::mid):
* Modules/mediastream/gstreamer/GStreamerStatsCollector.cpp:
(WebCore::fillRTCStats):
(WebCore::fillRTCRTPStreamStats):
(WebCore::fillOutboundRTPStreamStats):
* Modules/mediastream/gstreamer/GStreamerWebRTCUtils.cpp:
(WebCore::toRTCError):
(WebCore::toRTCEncodingParameters):
* Modules/webxr/WebXROpaqueFramebuffer.cpp:
(WebCore::WebXROpaqueFramebuffer::setupFramebuffer):
* accessibility/AXObjectCache.h:
* accessibility/atspi/AccessibilityObjectAtspi.cpp:
(WebCore::AccessibilityObjectAtspi::attributes const):
(WebCore::AccessibilityObjectAtspi::effectiveRoleName const):
(WebCore::AccessibilityObjectAtspi::roleName const):
* accessibility/atspi/AccessibilityObjectTextAtspi.cpp:
(WebCore::AccessibilityObjectAtspi::textAttributes const):
* accessibility/atspi/AccessibilityRootAtspi.cpp:
(WebCore::AccessibilityRootAtspi::embedded):
* accessibility/ios/AXObjectCacheIOS.mm:
(WebCore::AXObjectCache::notificationPlatformName):
(WebCore::AXObjectCache::postPlatformNotification):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityScroll:]):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::executeScriptInWorld):
* editing/gtk/WebContentReaderGtk.cpp:
(WebCore::WebContentReader::readFilePath):
* editing/ios/EditorIOS.mm:
(WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection):
(WebCore::Editor::removeUnchangeableStyles):
* editing/libwpe/EditorLibWPE.cpp:
(WebCore::createFragmentFromPasteboardData):
* html/HTMLMediaElement.cpp:
(WTF::LogArgument<URL>::toString):
* html/OffscreenCanvas.h:
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::indexForData):
* loader/soup/ResourceLoaderSoup.cpp:
(WebCore::ResourceLoader::loadGResource):
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::contextMenuItemSelected):
* page/DebugPageOverlays.cpp:
(WebCore::InteractionRegionOverlay::valueForSetting):
(WebCore::InteractionRegionOverlay::drawRect):
(WebCore::InteractionRegionOverlay::mouseEvent):
* page/cocoa/SettingsBaseCocoa.mm:
(WebCore::SettingsBase::initializeDefaultFontFamilies):
* platform/PasteboardCustomData.h:
(WebCore::PasteboardCustomData::gtkType):
* platform/UserAgent.h:
* platform/audio/gstreamer/AudioDestinationGStreamer.cpp:
(WebCore::AudioDestinationGStreamer::AudioDestinationGStreamer):
* platform/glib/UserAgentGLib.cpp:
(WebCore::platformVersionForUAString):
(WebCore::standardUserAgent):
* platform/graphics/ANGLEWebKitBridge.cpp:
(WebCore::ANGLEWebKitBridge::compileShaderSource):
* platform/graphics/angle/GraphicsContextGLANGLE.cpp:
(WebCore::GraphicsContextGLANGLE::validateDepthStencil):
* platform/graphics/angle/GraphicsContextGLANGLE.h:
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(printColor):
(printLayer):
* platform/graphics/cairo/ImageBufferCairoBackend.cpp:
(WebCore::ImageBufferCairoBackend::toDataURL const):
* platform/graphics/freetype/FontCacheFreeType.cpp:
(WebCore::getFamilyNameStringFromFamily):
* platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
(WebCore::AudioTrackPrivateGStreamer::updateConfigurationFromCaps):
* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::parseGstStructureValue):
* platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:
(WebCore::GStreamerRegistryScanner::ElementFactories::hasElementForMediaType const):
(WebCore::GStreamerRegistryScanner::initializeDecoders):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::createAudioSink):
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
(WebCore::MediaPlayerPrivateGStreamer::processTableOfContentsEntry):
(WebCore::MediaPlayerPrivateGStreamer::configureDownloadBuffer):
(WebCore::MediaPlayerPrivateGStreamer::downloadBufferFileCreatedCallback):
(WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
(WebCore::MediaPlayerPrivateGStreamer::parseInitDataFromProtectionMessage):
(WebCore::MediaPlayerPrivateGStreamer::handleProtectionEvent):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
(WebCore::TrackPrivateBaseGStreamer::getLanguageCode):
(WebCore::TrackPrivateBaseGStreamer::getTag):
* platform/graphics/gstreamer/VideoFrameMetadataGStreamer.cpp:
(webkitGstTraceProcessingTimeForElement):
* platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
(WebCore::VideoTrackPrivateGStreamer::updateConfigurationFromCaps):
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webKitWebSrcSetExtraHeader):
(webKitWebSrcMakeRequest):
(convertPlaybinURI):
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::load):
* platform/graphics/opengl/ExtensionsGLOpenGL.cpp:
(WebCore::ExtensionsGLOpenGL::platformSupportsExtension):
(WebCore::ExtensionsGLOpenGL::isVertexArrayObjectSupported):
* platform/graphics/opengl/ExtensionsGLOpenGLCommon.cpp:
(WebCore::ExtensionsGLOpenGLCommon::getTranslatedShaderSourceANGLE):
* platform/graphics/opengl/ExtensionsGLOpenGLES.cpp:
(WebCore::ExtensionsGLOpenGLES::platformSupportsExtension):
* platform/graphics/opengl/GraphicsContextGLOpenGL.cpp:
(WebCore::GraphicsContextGLOpenGL::validateDepthStencil):
* platform/graphics/opengl/GraphicsContextGLOpenGL.h:
* platform/graphics/opengl/GraphicsContextGLOpenGLBase.cpp:
(WebCore::GraphicsContextGLOpenGL::validateAttributes):
(WebCore::GraphicsContextGLOpenGL::reshapeFBOs):
* platform/graphics/opengl/GraphicsContextGLOpenGLES.cpp:
(WebCore::GraphicsContextGLOpenGL::reshapeFBOs):
(WebCore::GraphicsContextGLOpenGL::validateAttributes):
* platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.cpp:
(WebCore::GraphicsContextGLTextureMapperANGLE::platformInitialize):
* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayerTextureMapper::commitLayerChanges):
* platform/graphics/texmap/TextureMapperFPSCounter.cpp:
(WebCore::TextureMapperFPSCounter::TextureMapperFPSCounter):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::animationStartedTimerFired):
(WebCore::CoordinatedGraphicsLayer::dumpAdditionalProperties const):
* platform/gtk/PasteboardGtk.cpp:
(WebCore::Pasteboard::createForCopyAndPaste):
(WebCore::Pasteboard::createForGlobalSelection):
* platform/gtk/PlatformKeyboardEventGtk.cpp:
(WebCore::PlatformKeyboardEvent::keyIdentifierForGdkKeyCode):
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::nameOfDragPasteboard):
* platform/ios/UserAgentIOS.mm:
(WebCore::osNameForUserAgent):
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(VideoFullscreenInterfaceAVKit::~VideoFullscreenInterfaceAVKit):
* platform/libwpe/PasteboardLibWPE.cpp:
(WebCore::Pasteboard::read):
(WebCore::Pasteboard::write):
(WebCore::Pasteboard::writePlainText):
* platform/libwpe/PlatformKeyboardEventLibWPE.cpp:
(WebCore::PlatformKeyboardEvent::keyIdentifierForWPEKeyCode):
* platform/mediarecorder/MediaRecorderPrivateGStreamer.cpp:
(WebCore::MediaRecorderPrivateGStreamer::containerProfile):
* platform/network/MIMEHeader.cpp:
(WebCore::MIMEHeader::parseHeader):
* platform/network/cf/ResourceErrorCF.cpp:
(WebCore::ResourceError::platformLazyInit):
(WebCore::ResourceError::ResourceError):
* platform/network/cocoa/ResourceRequestCocoa.mm:
(WebCore::ResourceRequest::doUpdatePlatformRequest):
* platform/network/curl/CertificateInfoCurl.cpp:
(WebCore::CertificateInfo::verificationErrorDescription const):
* platform/network/curl/CookieJarDB.cpp:
(WebCore::CookieJarDB::searchCookies):
* platform/network/curl/CookieUtil.cpp:
(WebCore::CookieUtil::defaultPathForURL):
* platform/network/curl/CurlCacheEntry.cpp:
(WebCore::CurlCacheEntry::CurlCacheEntry):
(WebCore::CurlCacheEntry::saveResponseHeaders):
* platform/network/curl/CurlCacheManager.cpp:
(WebCore::CurlCacheManager::setCacheDirectory):
(WebCore::CurlCacheManager::saveIndex):
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::appendRequestHeader):
(WebCore::CurlHandle::removeRequestHeader):
* platform/network/curl/CurlDownload.cpp:
(WebCore::CurlDownload::willSendRequest):
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::setupPUT):
(WebCore::CurlRequest::setupSendData):
* platform/network/curl/CurlResourceHandleDelegate.cpp:
(WebCore::CurlResourceHandleDelegate::curlDidReceiveResponse):
* platform/network/curl/NetworkStorageSessionCurl.cpp:
(WebCore::defaultCookieJarPath):
* platform/network/curl/OpenSSLHelper.cpp:
(OpenSSL::tlsVersion):
(OpenSSL::tlsCipherName):
* platform/network/curl/PublicSuffixCurl.cpp:
(WebCore::topPrivatelyControlledDomainInternal):
* platform/network/curl/ResourceError.h:
* platform/network/curl/ResourceErrorCurl.cpp:
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::willSendRequest):
* platform/network/curl/ResourceResponseCurl.cpp:
(WebCore::ResourceResponse::ResourceResponse):
* platform/network/ios/LegacyPreviewLoaderClient.h:
(WebCore::LegacyPreviewLoaderClient::didRequestPassword):
* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::hasCookies const):
* platform/network/soup/ResourceErrorSoup.cpp:
(WebCore::ResourceError::transportError):
(WebCore::ResourceError::authenticationError):
(WebCore::ResourceError::genericGError):
(WebCore::ResourceError::tlsError):
(WebCore::ResourceError::timeoutError):
* platform/network/soup/ResourceResponseSoup.cpp:
(WebCore::ResourceResponse::ResourceResponse):
* platform/text/hyphen/HyphenationLibHyphen.cpp:
(WebCore::scanDirectoryForDictionaries):
* platform/text/win/LocaleWin.cpp:
(WebCore::LocaleWin::initializeLocaleData):
* platform/win/KeyEventWin.cpp:
(WebCore::keyIdentifierForWindowsKeyCode):
* platform/win/LocalizedStringsWin.cpp:
(WebCore::uploadFileText):
(WebCore::allFilesText):
* platform/win/MIMETypeRegistryWin.cpp:
(WebCore::MIMETypeRegistry::mimeTypeForExtension):
* platform/win/PasteboardWin.cpp:
(WebCore::addMimeTypesForFormat):
(WebCore::Pasteboard::typesSafeForBindings):
(WebCore::Pasteboard::readString):
(WebCore::writeURL):
(WebCore::Pasteboard::writeURLToDataObject):
(WebCore::Pasteboard::write):
(WebCore::Pasteboard::read):
(WebCore::createGlobalImageFileDescriptor):
(WebCore::Pasteboard::writeMarkup):
* platform/win/SystemInfo.cpp:
(WebCore::osVersionForUAString):
(WebCore::architectureTokenForUAString):
* platform/xr/openxr/OpenXRInputMappings.h:
(PlatformXR::buttonTypeToString):
(PlatformXR::axisTypetoString):
* platform/xr/openxr/OpenXRUtils.h:
(PlatformXR::handenessToString):
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
2022-04-05 Manuel Rego Casasnovas <rego@igalia.com>
[macOS][selectors] :focus-visible matching on button focused via script (after clicking on a different button)
https://bugs.webkit.org/show_bug.cgi?id=236782
<rdar://problem/89382543>
Reviewed by Antti Koivisto.
Document::m_latestFocusTrigger was not being updated after clicking on a button (or other form controls)
on platforms different than GTK and WPE.
This is because HTMLFormControlElement::isMouseFocusable() returns false on such platforms.
This issue is causing problems with :focus-visible, as the button is not actually focused via mouse click,
if you move the focus via script afterwards, the new focused element always match :focus-visible.
This patch is a workaround to solve that issue, by updating m_latestFocusTrigger on Document
even if the element is not actually focused.
That way :focus-visible doesn't match if there's a script focus afterwards.
Fix :focus-visible after clicking on a button on Mac
Test: imported/w3c/web-platform-tests/css/selectors/focus-visible-script-focus-008-b.html
* dom/Document.h:
(WebCore::Document::setLatestFocusTrigger):
* page/EventHandler.cpp:
(WebCore::EventHandler::dispatchMouseEvent):
2022-04-05 Simon Fraser <simon.fraser@apple.com>
Pass an IOSurfacePool to ImageBuffer::releaseBufferToPool()
https://bugs.webkit.org/show_bug.cgi?id=238768
Reviewed by Said Abou-Hallawa.
In order to move away from a singleton IOSurfacePool, we need to pass the pool
which the IOSurface will be added to.
* platform/graphics/ConcreteImageBuffer.h:
* platform/graphics/ImageBuffer.h:
(WebCore::ImageBuffer::CreationContext::CreationContext):
* platform/graphics/ImageBufferBackend.h:
(WebCore::ImageBufferBackend::releaseBufferToPool):
* platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp:
(WebCore::ImageBufferIOSurfaceBackend::releaseBufferToPool):
* platform/graphics/cg/ImageBufferIOSurfaceBackend.h:
2022-04-05 Wenson Hsieh <wenson_hsieh@apple.com>
Unreviewed, fix the internal iOS build after r292370
Remove an extraneous opening parenthesis.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::addEventListener):
2022-04-05 Alan Bujtas <zalan@apple.com>
[CSS-Contain] Add support for contain: inline-size
https://bugs.webkit.org/show_bug.cgi?id=238787
Reviewed by Antti Koivisto.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeContain):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computeIntrinsicLogicalWidths const):
(WebCore::RenderBlock::computeBlockPreferredLogicalWidths const):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::computeIntrinsicLogicalWidths const):
(WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::createsNewFormattingContext const):
(WebCore::RenderBox::establishesIndependentFormattingContext const):
* rendering/RenderBox.h:
* style/StyleBuilderCustom.h:
(WebCore::Style::BuilderCustom::applyValueContain):
2022-04-05 Carlos Garcia Campos <cgarcia@igalia.com>
[GStreamer] GstCapsForeachFunc returns a gboolean
https://bugs.webkit.org/show_bug.cgi?id=238799
Reviewed by Adrian Perez de Castro.
* platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceGStreamer.cpp:
(WebCore::RealtimeOutgoingVideoSourceGStreamer::RealtimeOutgoingVideoSourceGStreamer):
2022-04-05 Zan Dobersek <zdobersek@igalia.com>
[GTK][WPE] Use UnixFileDescriptor in DMABufObject, DMABufReleaseFlag
https://bugs.webkit.org/show_bug.cgi?id=238733
Reviewed by Adrian Perez de Castro.
Replace integer values for file descriptors in the DMABufObject and
DMABufReleaseFlag structs with UnixFileDescriptors. This enables
simply defaulting the destructors and the move constructors and
assignment operatos for the two types since the fd wrapper takes care
of these operations.
Additionally, when constructing the UnixFileDescriptor objects from
file descriptors coming from different sources, we can more easily
adapt to the need for either adoption or duplication of the passed-in
file descriptor right there in the constructor invocation.
* platform/graphics/gbm/DMABufObject.h:
(WebCore::DMABufObject::~DMABufObject): Deleted.
(WebCore::DMABufObject::operator=): Deleted.
* platform/graphics/gbm/DMABufReleaseFlag.h:
(WebCore::DMABufReleaseFlag::DMABufReleaseFlag):
(WebCore::DMABufReleaseFlag::dup const):
(WebCore::DMABufReleaseFlag::released const):
(WebCore::DMABufReleaseFlag::release):
(WebCore::DMABufReleaseFlag::~DMABufReleaseFlag): Deleted.
(WebCore::DMABufReleaseFlag::operator=): Deleted.
* platform/graphics/gbm/GBMBufferSwapchain.cpp:
(WebCore::GBMBufferSwapchain::Buffer::createDMABufObject const):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::pushDMABufToCompositor):
* platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.cpp:
(WebCore::GraphicsContextGLANGLE::makeContextCurrent):
* platform/graphics/texmap/TextureMapperPlatformLayerProxyDMABuf.cpp:
(WebCore::TextureMapperPlatformLayerProxyDMABuf::DMABufLayer::createEGLImageData):
2022-04-05 Diego Pino Garcia <dpino@igalia.com>
[GStreamer] gst_video_format_info_component not defined in GStreamer <1.18
https://bugs.webkit.org/show_bug.cgi?id=238685
Reviewed by Philippe Normand.
* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::webkitGstVideoFormatInfoComponent):
* platform/graphics/gstreamer/GStreamerCommon.h:
2022-04-05 Nikolaos Mouchtaris <nmouchtaris@apple.com>
Support rendering url(), CSS basic shapes other than path(), and coord-box for offset-path
https://bugs.webkit.org/show_bug.cgi?id=233382
Reviewed by Simon Fraser.
Introduce support for url(), CSS basic shapes, and coord-box. Url() allows references to SVG
shapes, so we check for either an SVGPathElement or SVGGeometryElement (which includes
circles, polygons, etc.). We can then get a Path object for that particular SVGElement
using pathFromGraphicsElement(). For coord-box, we check the value for the BoxPathOperation
(if it exists) in updateTransform(), and choose the corresponding reference box to the
referenceBox() value of the BoxPathOperation.
Tests: imported/w3c/web-platform-tests/css/motion/offset-path-shape.html
imported/w3c/web-platform-tests/css/motion/offset-path-url.html
* Sources.txt:
* rendering/PathOperation.cpp: Added.
(WebCore::ReferencePathOperation::create):
(WebCore::ReferencePathOperation::ReferencePathOperation):
(WebCore::ReferencePathOperation::element const):
* rendering/PathOperation.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateTransform):
* rendering/style/RenderStyle.cpp:
(WebCore::getPathFromPathOperation):
* style/StyleBuilderConverter.h:
(WebCore::Style::BuilderConverter::convertPathOperation):
2022-04-05 Megan Gardner <megan_gardner@apple.com>
Moving forwards and backwards by sentences across a table results in different breaks in each direction.
https://bugs.webkit.org/show_bug.cgi?id=238621
Reviewed by Darin Adler.
Tests: editing/selection/move-selection-backwards-at-end-of-table-by-sentence-granularity.html
editing/selection/move-selection-forwards-at-beginning-of-table-by-sentence-granularity.html
We need to emit tabs even in a simplified backwards text iterator because otherwise traversing a table by
sentence granularity results in not having the same behavior backwards and forwards.
* editing/TextIterator.cpp:
(WebCore::SimplifiedBackwardsTextIterator::handleNonTextNode):
(WebCore::SimplifiedBackwardsTextIterator::exitNode):
2022-04-05 Zan Dobersek <zdobersek@igalia.com>
Unreviewed, reverting r292377.
The depended-on patch hasn't landed yet
Reverted changeset:
"[GTK][WPE] Use UnixFileDescriptor in DMABufObject,
DMABufReleaseFlag"
https://bugs.webkit.org/show_bug.cgi?id=238733
https://commits.webkit.org/r292377
2022-04-04 Zan Dobersek <zdobersek@igalia.com>
[GTK][WPE] Use UnixFileDescriptor in DMABufObject, DMABufReleaseFlag
https://bugs.webkit.org/show_bug.cgi?id=238733
Reviewed by Adrian Perez de Castro.
Replace integer values for file descriptors in the DMABufObject and
DMABufReleaseFlag structs with UnixFileDescriptors. This enables
simply defaulting the destructors and the move constructors and
assignment operatos for the two types since the fd wrapper takes care
of these operations.
Additionally, when constructing the UnixFileDescriptor objects from
file descriptors coming from different sources, we can more easily
adapt to the need for either adoption or duplication of the passed-in
file descriptor right there in the constructor invocation.
* platform/graphics/gbm/DMABufObject.h:
(WebCore::DMABufObject::~DMABufObject): Deleted.
(WebCore::DMABufObject::operator=): Deleted.
* platform/graphics/gbm/DMABufReleaseFlag.h:
(WebCore::DMABufReleaseFlag::DMABufReleaseFlag):
(WebCore::DMABufReleaseFlag::dup const):
(WebCore::DMABufReleaseFlag::released const):
(WebCore::DMABufReleaseFlag::release):
(WebCore::DMABufReleaseFlag::~DMABufReleaseFlag): Deleted.
(WebCore::DMABufReleaseFlag::operator=): Deleted.
* platform/graphics/gbm/GBMBufferSwapchain.cpp:
(WebCore::GBMBufferSwapchain::Buffer::createDMABufObject const):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::pushDMABufToCompositor):
* platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.cpp:
(WebCore::GraphicsContextGLANGLE::makeContextCurrent):
* platform/graphics/texmap/TextureMapperPlatformLayerProxyDMABuf.cpp:
(WebCore::TextureMapperPlatformLayerProxyDMABuf::DMABufLayer::createEGLImageData):
2022-04-04 Ziran Sun <zsun@igalia.com>
[Forms] change the default appearance of button, checkbox etc. to 'auto'
https://bugs.webkit.org/show_bug.cgi?id=236012
Reviewed by Tim Nguyen.
Change the default appearance of a few element to 'auto'.
This shouldn't change rendering behavior, but changes
| getComputedStyle(element)['appearance']| results. The new behavior
matches to Firefox and chromium.
* css/html.css:
(button):
(#if defined(WTF_PLATFORM_IOS_FAMILY) && WTF_PLATFORM_IOS_FAMILY):
(#endif):
(input[type="search"]::-webkit-search-cancel-button):
(input[type="search"]::-webkit-search-decoration):
(input[type="search"]::-webkit-search-results-decoration):
(input[type="search"]::-webkit-search-results-button):
(#if defined(ENABLE_DATE_AND_TIME_INPUT_TYPES) && ENABLE_DATE_AND_TIME_INPUT_TYPES):
(input::-webkit-inner-spin-button):
(input::-webkit-caps-lock-indicator):
(#if defined(ENABLE_DATALIST_ELEMENT) && ENABLE_DATALIST_ELEMENT):
(textarea):
(input:is([type="hidden"], [type="image"], [type="file"])):
(input:is([type="button"], [type="submit"], [type="reset"])):
(input[type="file"]::file-selector-button):
(input[type="range"]::-webkit-slider-thumb, input[type="range"]::-webkit-media-slider-thumb):
(input[type="checkbox"]):
(#endif // defined(ENABLE_INPUT_TYPE_COLOR) && ENABLE_INPUT_TYPE_COLOR):
(#if !(defined(WTF_PLATFORM_IOS_FAMILY) && WTF_PLATFORM_IOS_FAMILY)):
(select:is([size=""], [size="0"], [size="1"])):
(meter):
(progress):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::colorInputStyleSheet const):
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::colorInputStyleSheet const):
2022-04-04 Antti Koivisto <antti@apple.com>
[CSS Container Queries] Simplify grammar
https://bugs.webkit.org/show_bug.cgi?id=238732
Reviewed by Sam Weinig.
Because size() function syntax is no longer supported, separate SizeQuery and SizeCondition productions
are no longer needed.
Some slightly unnecessary templatization is retained to help with future work.
* css/ContainerQuery.cpp:
* css/ContainerQuery.h:
* css/ContainerQueryParser.cpp:
(WebCore::ContainerQueryParser::consumeContainerQuery):
(WebCore::ContainerQueryParser::consumeCondition):
(WebCore::ContainerQueryParser::consumeSizeFeature):
(WebCore::ContainerQueryParser::consumePlainSizeFeature):
(WebCore::ContainerQueryParser::consumeSizeQuery): Deleted.
* css/ContainerQueryParser.h:
* style/ContainerQueryEvaluator.cpp:
(WebCore::Style::ContainerQueryEvaluator::evaluateQuery const):
* style/ContainerQueryEvaluator.h:
2022-04-04 Chris Dumez <cdumez@apple.com>
Avoid repeated calls to WebCore::eventNames()
https://bugs.webkit.org/show_bug.cgi?id=238773
Reviewed by Geoffrey Garen.
Avoid repeated calls to WebCore::eventNames() by caching it where appropriate.
WebCore::eventNames() calls pthread_get_specific.
* dom/Element.cpp:
(WebCore::isCompatibilityMouseEvent):
* dom/EventContext.cpp:
(WebCore::EventContext::handleLocalEvents const):
* dom/EventTarget.cpp:
(WebCore::legacyType):
(WebCore::EventTarget::removeAllEventListeners):
* dom/MouseEvent.cpp:
(WebCore::MouseEvent::toElement const):
(WebCore::MouseEvent::fromElement const):
* dom/Node.cpp:
(WebCore::Node::moveNodeToNewDocument):
(WebCore::tryAddEventListener):
(WebCore::tryRemoveEventListener):
(WebCore::Node::defaultEventHandler):
(WebCore::Node::willRespondToMouseMoveEvents):
(WebCore::Node::willRespondToTouchEvents):
(WebCore::Node::willRespondToMouseClickEvents):
* dom/PointerEvent.h:
(WebCore::PointerEvent::typeIsEnterOrLeave):
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::defaultEventHandler):
* html/HTMLButtonElement.cpp:
(WebCore::HTMLButtonElement::defaultEventHandler):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::willDispatchEvent):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::menuListDefaultEventHandler):
(WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
* html/HTMLSummaryElement.cpp:
(WebCore::HTMLSummaryElement::defaultEventHandler):
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::forwardEvent):
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::forwardEvent):
* html/shadow/SliderThumbElement.cpp:
(WebCore::SliderThumbElement::handleTouchEvent):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::dispatchAllPendingUnloadEvents):
(WebCore::DOMWindow::addEventListener):
(WebCore::DOMWindow::deviceOrientationController const): Deleted.
(WebCore::DOMWindow::deviceMotionController const): Deleted.
(WebCore::DOMWindow::isAllowedToUseDeviceMotionOrOrientation const): Deleted.
(WebCore::DOMWindow::isAllowedToUseDeviceMotion const): Deleted.
(WebCore::DOMWindow::isAllowedToUseDeviceOrientation const): Deleted.
(WebCore::DOMWindow::hasPermissionToReceiveDeviceMotionOrOrientationEvents const): Deleted.
(WebCore::DOMWindow::startListeningForDeviceOrientationIfNecessary): Deleted.
(WebCore::DOMWindow::stopListeningForDeviceOrientationIfNecessary): Deleted.
(WebCore::DOMWindow::startListeningForDeviceMotionIfNecessary): Deleted.
(WebCore::DOMWindow::stopListeningForDeviceMotionIfNecessary): Deleted.
(WebCore::DOMWindow::failedToRegisterDeviceMotionEventListener): Deleted.
(WebCore::DOMWindow::incrementScrollEventListenersCount): Deleted.
(WebCore::DOMWindow::decrementScrollEventListenersCount): Deleted.
(WebCore::DOMWindow::resetAllGeolocationPermission): Deleted.
(WebCore::DOMWindow::removeEventListener): Deleted.
(WebCore::DOMWindow::languagesChanged): Deleted.
(WebCore::DOMWindow::dispatchLoadEvent): Deleted.
(WebCore::DOMWindow::dispatchEvent): Deleted.
(WebCore::DOMWindow::removeAllEventListeners): Deleted.
(WebCore::DOMWindow::captureEvents): Deleted.
(WebCore::DOMWindow::releaseEvents): Deleted.
(WebCore::DOMWindow::finishedLoading): Deleted.
(WebCore::DOMWindow::setLocation): Deleted.
(WebCore::DOMWindow::printErrorMessage const): Deleted.
(WebCore::DOMWindow::crossDomainAccessErrorMessage): Deleted.
(WebCore::DOMWindow::isInsecureScriptAccess): Deleted.
(WebCore::DOMWindow::createWindow): Deleted.
(WebCore::DOMWindow::open): Deleted.
(WebCore::DOMWindow::showModalDialog): Deleted.
(WebCore::DOMWindow::enableSuddenTermination): Deleted.
(WebCore::DOMWindow::disableSuddenTermination): Deleted.
(WebCore::DOMWindow::frame const): Deleted.
(WebCore::DOMWindow::eventListenersDidChange): Deleted.
* page/EventHandler.cpp:
(WebCore::EventHandler::updateMouseEventTargetNode):
(WebCore::EventHandler::isKeyboardOptionTab):
2022-04-04 Said Abou-Hallawa <said@apple.com>
[GPU Process] CSSFilter should be created only at the painting time
https://bugs.webkit.org/show_bug.cgi?id=236574
rdar://89210004
Reviewed by Simon Fraser.
Instead of building the whole filter chain to get the filter outsets at
the layout time, we can use the SVGFilterPrimitiveStandardAttributes and
the FilterOperation super classes to get their outsets without having to
build the FilterEffects.
CSSFilter::calculateOutsets() is a static method which will loop through
the FilterOperations and will add up the outsets of the blur, the drop-
shadow and the reference FilterOperation.
SVGFilterBuilder::calculateFilterOutsets() will loop through the primitives
of the filter element and will call the new virtual method outsets() which
will call a static method in the corresponding FilterEffect.
FEDropShadow, FEGaussianBlur and FEOffset will be provide static methods
for calculating the effect outsets. These static methods will be called
from CSSFilter::calculateOutsets() and from the SVGFExxxElements.
To remove the duplication of the code from SVGFilterBuilder::
buildFilterEffects() and calculateFilterOutsets(), a new template class
named SVGFilterGraph will be introduced. It represents the graph of the
SVGFilter. The nodes of this graph will be of type FilterEffecct when
it is used to build the SVGFilterExpression. The nodes will be of type
SVGFilterPrimitiveStandardAttributes when it is used to calculate the
filter outsets.
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/filters/FEDropShadow.cpp:
(WebCore::FEDropShadow::calculateOutsets):
(WebCore::FEDropShadow::outsets const): Deleted.
* platform/graphics/filters/FEDropShadow.h:
* platform/graphics/filters/FEGaussianBlur.cpp:
(WebCore::FEGaussianBlur::calculateOutsets):
(WebCore::FEGaussianBlur::outsets const): Deleted.
* platform/graphics/filters/FEGaussianBlur.h:
* platform/graphics/filters/FEOffset.cpp:
(WebCore::FEOffset::calculateOutsets):
(WebCore::FEOffset::outsets const): Deleted.
* platform/graphics/filters/FEOffset.h:
* platform/graphics/filters/Filter.h:
* platform/graphics/filters/FilterFunction.h:
(WebCore::FilterFunction::apply):
(WebCore::FilterFunction::outsets const): Deleted.
* rendering/CSSFilter.cpp:
(WebCore::calculateBlurEffectOutsets):
(WebCore::calculateDropShadowEffectOutsets):
(WebCore::referenceFilterElement):
(WebCore::calculateReferenceFilterOutsets):
(WebCore::createReferenceFilter):
(WebCore::CSSFilter::buildFilterFunctions):
(WebCore::CSSFilter::calculateOutsets):
(WebCore::createSVGFilter): Deleted.
(WebCore::CSSFilter::outsets const): Deleted.
* rendering/CSSFilter.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::filtersForPainting const):
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayerFilters.cpp:
(WebCore::RenderLayerFilters::calculateOutsets):
(WebCore::RenderLayerFilters::beginFilterEffect):
(WebCore::RenderLayerFilters::setFilter): Deleted.
(WebCore::RenderLayerFilters::buildFilter): Deleted.
* rendering/RenderLayerFilters.h:
* rendering/svg/RenderSVGResourceFilter.cpp:
(WebCore::RenderSVGResourceFilter::applyResource):
* rendering/svg/SVGRenderTreeAsText.cpp:
(WebCore::writeSVGResourceContainer):
* svg/SVGFEDropShadowElement.cpp:
(WebCore::SVGFEDropShadowElement::outsets const):
* svg/SVGFEDropShadowElement.h:
* svg/SVGFEGaussianBlurElement.cpp:
(WebCore::SVGFEGaussianBlurElement::outsets const):
* svg/SVGFEGaussianBlurElement.h:
* svg/SVGFEOffsetElement.cpp:
(WebCore::SVGFEOffsetElement::outsets const):
* svg/SVGFEOffsetElement.h:
* svg/SVGFilterPrimitiveStandardAttributes.h:
(WebCore::SVGFilterPrimitiveStandardAttributes::outsets const):
* svg/graphics/filters/SVGFilter.cpp:
(WebCore::SVGFilter::create):
(WebCore::SVGFilter::calculateResolvedSize):
(WebCore::SVGFilter::resolvedSize const):
(WebCore::SVGFilter::outsets const): Deleted.
* svg/graphics/filters/SVGFilter.h:
* svg/graphics/filters/SVGFilterBuilder.cpp:
(WebCore::SVGFilterBuilder::SVGFilterBuilder):
(WebCore::appendEffectToExpression):
(WebCore::appendGraphToExpression):
(WebCore::SVGFilterBuilder::buildFilterExpression):
(WebCore::calculatePrimitiveOutsets):
(WebCore::calculateGraphOutsets):
(WebCore::SVGFilterBuilder::calculateFilterOutsets):
(WebCore::SVGFilterBuilder::setupBuiltinEffects): Deleted.
(WebCore::SVGFilterBuilder::buildFilterEffects): Deleted.
(WebCore::SVGFilterBuilder::sourceGraphic const): Deleted.
(WebCore::SVGFilterBuilder::sourceAlpha const): Deleted.
(WebCore::SVGFilterBuilder::addNamedEffect): Deleted.
(WebCore::SVGFilterBuilder::namedEffect const): Deleted.
(WebCore::SVGFilterBuilder::namedEffects const): Deleted.
(WebCore::SVGFilterBuilder::setEffectInputs): Deleted.
(WebCore::SVGFilterBuilder::appendEffectToEffectRenderer): Deleted.
(WebCore::SVGFilterBuilder::effectGeometry const): Deleted.
(WebCore::SVGFilterBuilder::buildEffectExpression const): Deleted.
(WebCore::SVGFilterBuilder::buildExpression const): Deleted.
* svg/graphics/filters/SVGFilterBuilder.h:
(WebCore::SVGFilterBuilder::targetBoundingBox const):
(WebCore::SVGFilterBuilder::primitiveUnits const):
(WebCore::SVGFilterBuilder::effectByRenderer):
(WebCore::SVGFilterBuilder::setTargetBoundingBox): Deleted.
(WebCore::SVGFilterBuilder::setPrimitiveUnits): Deleted.
* svg/graphics/filters/SVGFilterExpression.h:
* svg/graphics/filters/SVGFilterGraph.h: Added.
(WebCore::SVGFilterGraph::SVGFilterGraph):
(WebCore::SVGFilterGraph::sourceGraphic const):
(WebCore::SVGFilterGraph::sourceAlpha const):
(WebCore::SVGFilterGraph::addNamedNode):
(WebCore::SVGFilterGraph::getNamedNode const):
(WebCore::SVGFilterGraph::getNamedNodes const):
(WebCore::SVGFilterGraph::setNodeInputs):
(WebCore::SVGFilterGraph::getNodeInputs const):
(WebCore::SVGFilterGraph::lastNode const):
2022-04-04 Gabriel Nava Marino <gnavamarino@apple.com>
Use Ref and RefPtr pattern when handling document close calls
https://bugs.webkit.org/show_bug.cgi?id=238747
Reviewed by Sam Weinig.
Ensure document object remains for the scope of the call.
* inspector/DOMPatchSupport.cpp:
(WebCore::DOMPatchSupport::patchDocument):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::stopLoading):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::init):
(WebCore::FrameLoader::clear):
* loader/cache/CachedSVGDocument.cpp:
(WebCore::CachedSVGDocument::finishLoading):
* loader/cache/CachedSVGFont.cpp:
(WebCore::CachedSVGFont::ensureCustomFontData):
* xml/XMLHttpRequest.cpp:
2022-04-04 Matt Woodrow <mattwoodrow@apple.com>
intersectsWithAncestor should take fragmented boxes into account.
https://bugs.webkit.org/show_bug.cgi?id=238648
Reviewed by Dean Jackson.
Test: compositing/backing/backing-store-columns-inside-position-fixed.html
* rendering/RenderLayerBacking.cpp:
(WebCore::intersectsWithAncestor):
Use boundingBox() for intersectsWithAncestor, so that we can explicitly request the box that contains
all fragment boxes.
2022-04-04 Tyler Wilcock <tyler_w@apple.com>
AccessibilityNodeObject::elementRect should use children rects for display:contents AX objects
https://bugs.webkit.org/show_bug.cgi?id=238680
Reviewed by Chris Fleizach and Andres Gonzalez.
Because display:contents AccessibilityNodeObjects can have rendered
content (unlike `hidden`, `aria-hidden="false"` node objects), we can compute
AccessibilityNodeObject::elementRect by adding up the rectangles of the object's children.
This provides a more accurate frame for these objects.
Test: accessibility/node-only-object-element-rect.html
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::boundingBoxRect const):
2022-04-04 Devin Rousso <drousso@apple.com>
[Apple Pay] buttons should be localized based on the system if not specified by the HTML
https://bugs.webkit.org/show_bug.cgi?id=238743
<rdar://problem/89592004>
Reviewed by Wenson Hsieh.
* rendering/RenderThemeCocoa.mm:
(WebCore::RenderThemeCocoa::paintApplePayButton):
2022-04-04 Brent Fulgham <bfulgham@apple.com>
Update 'features.json' for current state of WebKit
https://bugs.webkit.org/show_bug.cgi?id=238746
Reviewed by Tim Nguyen.
I noticed that the current 'features.json' file is out of date. I think the attached changes more
accurately reflect the state of the engine.
* features.json:
2022-04-04 Chris Dumez <cdumez@apple.com>
Simplify / Optimize the whitespace cache implementation
https://bugs.webkit.org/show_bug.cgi?id=238736
Reviewed by Sam Weinig.
Instead of using 2 C arrays of size maximumCachedStringLength + 1 Vector with an inline
buffer of size maximumCachedStringLength, we now used a single FixedVector of size
maximumCachedStringLength.
Because the Vector has an inline buffer whose size is the max size of the cache, using
a FixedVector is just more efficient. It also means we don't need to store indexes in
that Vector in a separate C array. Finally, I used a struct named AtomStringWithCode to
store { AtomString, uint64 code } so we don't need separate containers for the AtomString
and the code.
Note that I added VectorTraits for the new AtomStringWithCode struct to make sure it can
get initialized via a simple memset.
This is a 0.25-0.3% progression on Speedometer according to A/B bots.
* html/parser/HTMLConstructionSite.cpp:
(WebCore::WhitespaceCache::lookup):
* html/parser/HTMLConstructionSite.h:
(WebCore::WhitespaceCache::WhitespaceCache):
2022-04-04 Tim Nguyen <ntim@apple.com>
Conditionally inject <attachment> styles based on runtime flag
https://bugs.webkit.org/show_bug.cgi?id=238739
Reviewed by Tim Horton.
Also use appearance: auto instead of -webkit-appearance: attachment, since it also works thanks to
RenderTheme::adjustAppearanceForElement().
Test: LayoutTests/fast/attachment/attachment-disabled-rendering.html
* css/html.css:
(#endif):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::attachmentStyleSheet const):
Move html.css styles in there.
(WebCore::RenderTheme::adjustStyle):
(WebCore::RenderTheme::adjustAttachmentStyle const): Deleted.
adjustAttachmentStyle was unused, not overriden and no-op.
* rendering/RenderTheme.h:
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::attachmentStyleSheet const):
Put iOS specific styles there.
* style/UserAgentStyle.cpp:
(WebCore::Style::UserAgentStyle::ensureDefaultStyleSheetsForElement):
Append styles to UA styling.
* style/UserAgentStyle.h:
2022-04-04 Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
[GTK][WPE] Compilation error in debug mode after r292279
https://bugs.webkit.org/show_bug.cgi?id=238741
Reviewed by Philippe Normand.
No functional changes.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): Add symbol
guards.
2022-04-04 Philippe Normand <pnormand@igalia.com>
Unreviewed, GStreamer 1.21 build fix after r292215
* Modules/mediastream/gstreamer/GStreamerStatsCollector.cpp:
(WebCore::fillInboundRTPStreamStats): Fix typo in packetsLost variable name.
2022-04-04 Said Abou-Hallawa <said@apple.com>
[GPU Process] [iOS] Sometimes the text drop shadow is not drawn
https://bugs.webkit.org/show_bug.cgi?id=236923
rdar://89196794
Reviewed by Simon Fraser.
The baseCTM of internal context of DrawGlyphsRecorder has to match the
baseCTM of the owner DisplayList::Recorder.
When recording the glyph runs, DrawGlyphsRecorder::recordDrawGlyphs()
updates the shadow of the recorder such that ShadowsIgnoreTransforms is
set to "false". That means no shadow transformation will be applied to
the offset or the blur radius in GPUP.
* platform/graphics/DrawGlyphsRecorder.h:
* platform/graphics/coretext/DrawGlyphsRecorderCoreText.cpp:
(WebCore::DrawGlyphsRecorder::DrawGlyphsRecorder):
(WebCore::DrawGlyphsRecorder::populateInternalState):
* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::Recorder):
* platform/graphics/harfbuzz/DrawGlyphsRecorderHarfBuzz.cpp:
(WebCore::DrawGlyphsRecorder::DrawGlyphsRecorder):
* platform/graphics/win/DrawGlyphsRecorderWin.cpp:
(WebCore::DrawGlyphsRecorder::DrawGlyphsRecorder):
* rendering/RenderThemeIOS.mm:
(WebCore::paintAttachmentText):
2022-04-04 Youenn Fablet <youenn@apple.com>
CORS: Allow particular Range header values without a preflight
https://bugs.webkit.org/show_bug.cgi?id=231174
<rdar://problem/84101544>
Reviewed by Alex Christensen.
Covered by updated tests.
* platform/network/HTTPParsers.cpp:
2022-04-04 Jer Noble <jer.noble@apple.com>
[Perf] HTMLVideoElement is performing synchronous paints; causing main thread hangs
https://bugs.webkit.org/show_bug.cgi?id=238707
<rdar://91025299>
Reviewed by Eric Carlson.
Spin trace diagnostics show that the main thread of the WebContent process is often hung,
blocked on a synchronous Paint message to the GPU process; in turn, the GPU process is often
busy performing media-related work, but in each of the cases found, painting is unnecessary.
The media player in question is accelerated, and should only be painted during layer snapshotting
or during a print operation.
Only paint if the renderer is not accelerated, the media element is not accelerated, or if
the paint operation isn't flattening or snapshotting. HTMLMediaElement inappropriately caches
the value of MediaPlayer::supportsAcceleratedRendering(), under the (incorrect) assumption that
the value cannot change during the lifetime of the MediaPlayer, so remove this caching layer.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaEngineWasUpdated):
(WebCore::HTMLMediaElement::clearMediaPlayer):
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::supportsAcceleratedRendering const):
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::paintReplaced):
2022-03-28 Antoine Quint <graouts@webkit.org>
Make it hard to add a new CSS property to WebKit wihtout adding animation support
https://bugs.webkit.org/show_bug.cgi?id=238447
Reviewed by Dean Jackson.
It's easy to add a new CSS property to WebKit without thinking about animation support.
Down the line, it would be better to add support to the script dealing with CSSProperties.json
to automatically generate animation support where possible, but to get started we now
ASSERT() whether all properties have been found to have animated support, except those
known not to be animatable.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2022-04-03 Tim Horton <timothy_horton@apple.com>
Standardize naming of WK_NETWORK_EXTENSION_LDFLAGS (from LD_FLAGS)
https://bugs.webkit.org/show_bug.cgi?id=238717
Reviewed by Wenson Hsieh.
No new tests, just a style fix.
* Configurations/WebCore.xcconfig:
2022-04-03 Geoffrey Garen <ggaren@apple.com>
Document::addListenerTypeIfNeeded should not call pthread_get_specific 14 times
https://bugs.webkit.org/show_bug.cgi?id=238702
Reviewed by Cameron McCormack.
Document::addListenerTypeIfNeeded => pthread_get_specific showed up in
a profile of Preact-TodoMVC, and I verified by disassembly that the
generated code really does call pthread_get_specific 14x, along with
related inefficiencies.
Only worth about 0.5%, so I didn't A/B test it.
You could imagine lots of other ways to speed up this function /
functionality, but why don't we start with 14x and see where that takes
us.
* dom/Document.cpp:
(WebCore::Document::addListenerTypeIfNeeded): Use a local variable
because, like, come on.
2022-04-03 Tyler Wilcock <tyler_w@apple.com>
-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:] should fail fast if the given parameter wrapper has no backing object
https://bugs.webkit.org/show_bug.cgi?id=238635
Reviewed by Chris Fleizach.
If this method is called with a parameter wrapper object that has lost
its backing object, we should return early to avoid dereferencing a
null pointer.
This could happen in rare split-second transition states where a wrapper
has lost its backing object but has not yet been cleaned up by a notification.
This could also happen if WebKit is vending detached objects (e.g. via AXChildren)
in a similar transition state.
No test added because I haven't been able to find any scenario reproducing
this issue either in our existing layout tests or on real webpages.
rdar://90925399
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
2022-04-02 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Automatically relayout the page when new fonts are installed
https://bugs.webkit.org/show_bug.cgi?id=238483
<rdar://problem/80544133>
Reviewed by Chris Dumez.
This patch simply calls setNeedsRecalcStyleInAllFrames on every Page when we receive a
kCTFontManagerRegisteredFontsChangedNotification.
FontCache::invalidateAllFontCaches() can't do this directly because it's in platform/ and
therefore isn't allowed to know what Pages are. Instead, this patch takes a process-global
callback and calls that instead. This callback is set at initialization time.
Test: fast/text/install-font-style-recalc.html
* page/Page.cpp:
(WebCore::m_contentSecurityPolicyModeForExtension):
(WebCore::Page::firstTimeInitialization):
* page/Page.h:
* platform/graphics/FontCache.cpp:
(WebCore::Function<void):
(WebCore::FontCache::registerFontCacheInvalidationCallback):
(WebCore::FontCache::invalidateAllFontCaches):
* platform/graphics/FontCache.h:
2022-04-02 Simon Fraser <simon.fraser@apple.com>
Plumb the IOSurfacePool through to ImageBufferBackend creation via ImageBuffer::CreationContext
https://bugs.webkit.org/show_bug.cgi?id=238695
Reviewed by Said Abou-Hallawa.
Wrap the existing HostWindow* and a new IOSurfacePool* pointers into a ImageBuffer::CreationContext
struct, and replace the HostWindow* argument with it in buffer creation functions.
RemoteLayerBackingStoreCollection::allocateBufferForBackingStore() passes the singleton IOSurfacePool
which is thus used in the non-GPU Process code path (DOM rendering disabled).
* css/CSSFilterImageValue.cpp:
(WebCore::CSSFilterImageValue::image):
* platform/graphics/ConcreteImageBuffer.h:
(WebCore::ConcreteImageBuffer::create):
* platform/graphics/ImageBuffer.cpp:
(WebCore::ImageBuffer::create):
* platform/graphics/ImageBuffer.h:
(WebCore::ImageBuffer::CreationContext::CreationContext):
(WebCore::ImageBuffer::create):
* platform/graphics/ImageBufferBackend.h:
* platform/graphics/PlatformImageBuffer.h:
* platform/graphics/cairo/ImageBufferCairoImageSurfaceBackend.cpp:
(WebCore::ImageBufferCairoImageSurfaceBackend::create):
* platform/graphics/cairo/ImageBufferCairoImageSurfaceBackend.h:
* platform/graphics/cg/IOSurfacePool.cpp:
(WebCore::IOSurfacePool::poolStatistics const):
* platform/graphics/cg/ImageBufferCGBitmapBackend.cpp:
(WebCore::ImageBufferCGBitmapBackend::create):
* platform/graphics/cg/ImageBufferCGBitmapBackend.h:
* platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp:
(WebCore::ImageBufferIOSurfaceBackend::create):
* platform/graphics/cg/ImageBufferIOSurfaceBackend.h:
* platform/graphics/displaylists/DisplayListImageBuffer.h:
2022-04-02 Chris Dumez <cdumez@apple.com>
Add default constructor to ASCIILiteral
https://bugs.webkit.org/show_bug.cgi?id=238700
Reviewed by Geoffrey Garen.
Add default constructor to ASCIILiteral, to replace the more verbose ASCIILiteral::null().
* css/makevalues.pl:
* dom/DOMException.cpp:
(WebCore::DOMException::description const):
* platform/cocoa/PasteboardCocoa.mm:
(WebCore::imageTypeToFakeFilename):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::propertyIdToString):
2022-04-02 Alan Bujtas <zalan@apple.com>
[Ruby] Remove incorrect implicit integral floor in RenderRubyText::adjustInlineDirectionLineBounds
https://bugs.webkit.org/show_bug.cgi?id=238671
Reviewed by Simon Fraser.
In case of a fractional width value, the unintended integral flooring makes us believe we've got content overflow and we apply
a fractional inset which slightly moves the content in the inline direction.
* rendering/RenderRubyText.cpp:
(WebCore::RenderRubyText::adjustInlineDirectionLineBounds const):
2022-04-02 Ziran Sun <zsun@igalia.com>
[css-ui] Only apply 'overflow:visible' to elements that support menulist appearance
https://bugs.webkit.org/show_bug.cgi?id=238501
Reviewed by Tim Nguyen.
This CL adds support to alias appearance <compat-auto> keywords to 'auto' for menulist.
When an element supports '-webkit-appearance: menulist' or 'appearance: menulist' appearance,
we will apply 'overflow: visible'. The existing code, though, apply 'overflow: visible' before
the 'menulist' appearance is workable. This patch corrects it.
It is an import of chromium CL at
https://chromium.googlesource.com/chromium/src.git/+/1635202d8979f4d42b96021d8386278261e52768
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::adjustAppearanceForElement const):
(WebCore::RenderTheme::adjustMenuListStyle const):
* rendering/RenderThemeAdwaita.cpp:
(WebCore::RenderThemeAdwaita::adjustMenuListStyle const):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::adjustMenuListStyle const):
* rendering/RenderThemeWin.cpp:
(WebCore::RenderThemeWin::adjustMenuListStyle const):
* style/StyleAdjuster.cpp:
(WebCore::Style::Adjuster::adjust const):
2022-04-02 Patrick Griffis <pgriffis@igalia.com>
CSP: Improve compatibility of source matching
https://bugs.webkit.org/show_bug.cgi?id=235873
Reviewed by Darin Adler.
- Improved handling of protocol changes:
- For host and self sources direct upgrades are allowed (ws->wss) (http->https already worked).
- For self sources side grades are now allowed (http->ws).
- For self sources upgrades are always allowed (*->https, *->wss).
This is documented here: https://www.w3.org/TR/CSP3/#match-url-to-source-expression
I also included some minor cleanups and adding of comments.
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::updateSourceSelf):
(WebCore::ContentSecurityPolicy::protocolMatchesSelf const): Deleted.
* page/csp/ContentSecurityPolicy.h:
(WebCore::ContentSecurityPolicy::selfProtocol const):
* page/csp/ContentSecurityPolicySource.cpp:
(WebCore::ContentSecurityPolicySource::ContentSecurityPolicySource):
(WebCore::ContentSecurityPolicySource::matches const):
(WebCore::ContentSecurityPolicySource::schemeMatches const):
(WebCore::ContentSecurityPolicySource::portMatches const):
* page/csp/ContentSecurityPolicySource.h:
* page/csp/ContentSecurityPolicySourceList.cpp:
(WebCore::ContentSecurityPolicySourceList::isProtocolAllowedByStar const):
(WebCore::ContentSecurityPolicySourceList::parse):
2022-04-02 Andres Gonzalez <andresg_22@apple.com>
Expose AXObjectCache::treeData to the UI process.
https://bugs.webkit.org/show_bug.cgi?id=238563
<rdar://problem/91057915>
Reviewed by Chris Fleizach.
Added Page::accessibilityTreeData so that it can be invoked from the UI
process. This will be used to log a textual representation of the AX
trees from the browser process.
* page/Page.cpp:
(WebCore::Page::accessibilityTreeData const):
* page/Page.h:
2022-04-02 Youenn Fablet <youenn@apple.com>
Remove notifications from notification list when notification gets closed
https://bugs.webkit.org/show_bug.cgi?id=238665
Reviewed by Darin Adler.
Test: http/tests/workers/service/getnotifications-stop.html
* Modules/notifications/Notification.cpp:
(WebCore::Notification::stop):
Do not destroy persistent permissions when the JS object gets stopped.
2022-04-01 Michael Saboff <msaboff@apple.com>
Stop copying StagedFrameworks to the secondary path by default
https://bugs.webkit.org/show_bug.cgi?id=238688
Reviewed by Saam Barati.
Decoupled COPY_STAGED_FRAMEWORKS_TO_SECONDARY_PATH from USE_SYSTEM_CONTENT_PATH so we won't
always copy frameworks to the secondary path on macOS. Instead, the build configuration can set
COPY_STAGED_FRAMEWORKS_TO_SECONDARY_PATH as appropriate.
* Configurations/WebCore.xcconfig:
2022-04-01 Jeff Miller <jeffm@apple.com>
WKBundlePageUIClient console message support should include source URL, column number, and console messages with arguments
https://bugs.webkit.org/show_bug.cgi?id=238032
Reviewed by Alex Christensen.
Add a new ChromeClient addMessageWithArgumentsToConsole() member function for adding a console
message that includes formatted arguments. I left the existing behavior of addMessageToConsole()
unchanged since layout tests expect to get the console message without these arguments.
New API test was added in TestWebKitAPI/Tests/WebKitCocoa/ConsoleMessageWithDetails.mm.
* loader/EmptyClients.h:
Added addMessageWithArgumentsToConsole().
* page/ChromeClient.h:
(WebCore::ChromeClient::addMessageWithArgumentsToConsole):
Added, subclasses can optionally override this.
* page/PageConsoleClient.cpp:
(WebCore::additionalArgumentsFromArgumentsVector):
Added, pulls out any additional arguments beyond the initial message.
(WebCore::PageConsoleClient::addMessage):
Create a Span of any message arguments and include it when calling the new
addMessageWithArgumentsToConsole() function.
(WebCore::PageConsoleClient::messageWithTypeAndLevel):
Ditto.
2022-04-01 Tim Horton <timothy_horton@apple.com>
Fix the WebGPU-less build
https://bugs.webkit.org/show_bug.cgi?id=238692
Reviewed by Myles Maxfield.
* Configurations/WebCore.xcconfig:
2022-04-01 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] [WK2] Add plumbing for extracting video frames in element fullscreen
https://bugs.webkit.org/show_bug.cgi?id=238607
rdar://91102888
Reviewed by Eric Carlson.
Add a helper function on HTMLMediaElement to return the identifier of its MediaPlayer. See WebKit ChangeLog for
more information.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::playerIdentifier const):
* html/HTMLMediaElement.h:
2022-04-01 Simon Fraser <simon.fraser@apple.com>
Hoist the IOSurfacePool out of IOSurface
https://bugs.webkit.org/show_bug.cgi?id=238675
Reviewed by Tim Horton.
A future patch will break the assumption that there is a singleton IOSurfacePool per
process, so we can't have IOSurface::create() consult the pool internally. Instead,
pass the pool to the create() functions, and to the moveToPool() function.
Callers in the web process pass IOSurfacePool::sharedPool(); those in the UI process
pass nullptr to avoid pool creation there.
* Modules/system-preview/ARKitBadgeSystemImage.mm:
(WebCore::ARKitBadgeSystemImage::draw const):
* platform/graphics/cg/IOSurfacePool.cpp:
(WebCore::IOSurfacePool::addSurface):
* platform/graphics/cg/IOSurfacePool.h:
* platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp:
(WebCore::ImageBufferIOSurfaceBackend::create):
(WebCore::ImageBufferIOSurfaceBackend::releaseBufferToPool):
* platform/graphics/cocoa/GraphicsContextGLCocoa.mm:
(WebCore::GraphicsContextGLCocoa::allocateAndBindDisplayBufferBacking):
* platform/graphics/cocoa/IOSurface.h: createFromImageBuffer() was unused; remove it.
* platform/graphics/cocoa/IOSurface.mm:
(WebCore::IOSurface::create):
(WebCore::IOSurface::createFromImage):
(WebCore::IOSurface::moveToPool):
(WebCore::IOSurface::surfaceFromPool): Deleted.
* testing/WebFakeXRDevice.cpp:
(WebCore::SimulatedXRDevice::frameTimerFired):
2022-04-01 Commit Queue <commit-queue@webkit.org>
Unreviewed, reverting r292072.
https://bugs.webkit.org/show_bug.cgi?id=238690
Caused webAPIStatistics test failures
Reverted changeset:
"[Cocoa] Automatically relayout the page when new fonts are
installed"
https://bugs.webkit.org/show_bug.cgi?id=238483
https://commits.webkit.org/r292072
2022-04-01 Diego Pino Garcia <dpino@igalia.com>
Unreviewed, fix non-unified build after r292208
* css/typedom/ComputedStylePropertyMapReadOnly.cpp:
* css/typedom/StylePropertyMapReadOnly.cpp:
* page/FrameSnapshotting.h:
* page/InteractionRegion.cpp:
* platform/graphics/gbm/GBMDevice.cpp:
2022-04-01 Yusuke Suzuki <ysuzuki@apple.com>
Change one-shot maxTimerNestingLevel from 5 to 10
https://bugs.webkit.org/show_bug.cgi?id=237168
Reviewed by Sam Weinig, Saam Barati, and Cameron McCormack .
Recently, we found from Chromium change[1] that changing this from 5 to 10 offers 10% Speedometer2 improvement
because Speedometer2's setTimeout nesting level is typically 7-8. We discussed with folks including Chris, Maciej,
Saam, and Cameron and for now, we increase this from 5 to 10 to align to Blink's change to keep these kind of web
content fast. This is not aligned to the spec, and currently, we only apply it to one-shot timer.
[1]: https://chromium-review.googlesource.com/c/chromium/src/+/3473463
* page/DOMTimer.cpp:
(WebCore::DOMTimer::intervalClampedToMinimum const):
(WebCore::DOMTimer::alignedFireTime const):
2022-04-01 Ben Nham <nham@apple.com>
Add more push-related logging
https://bugs.webkit.org/show_bug.cgi?id=238591
Reviewed by Youenn Fablet.
Add logging to help diagnose Push API errors. We currently log very little, which is making
it hard for us to diagnose bug reports.
- Log if PushManager.subscribe fails the user gesture check. We log this to both syslog and
the developer console. We do the latter to inform developers, and we already log an
identical message from Notification.requestPermission when that fails in this manner.
- Log if we can't fire a push event because the service worker registration went away.
* Modules/push-api/PushManager.cpp:
(WebCore::PushManager::subscribe):
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::processPushMessage):
2022-04-01 Kate Cheney <katherine_cheney@apple.com>
CSP: WASM fails to execute after window.open
https://bugs.webkit.org/show_bug.cgi?id=238562
<rdar://problem/90778752>
Reviewed by Brent Fulgham.
Test: http/tests/security/contentSecurityPolicy/allow-wasm-after-window-open.html
Reset WASM enabled value after a window.open() call. This patch simplifies
eval and wasm setters by removing the distinct enable/disable functions
and using one consistent setter.
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::setEvalEnabled):
(WebCore::ScriptController::setWebAssemblyEnabled):
(WebCore::ScriptController::enableEval): Deleted.
(WebCore::ScriptController::enableWebAssembly): Deleted.
(WebCore::ScriptController::disableEval): Deleted.
(WebCore::ScriptController::disableWebAssembly): Deleted.
* bindings/js/ScriptController.h:
* dom/Document.cpp:
(WebCore::Document::disableEval):
(WebCore::Document::disableWebAssembly):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::clear):
* page/csp/ContentSecurityPolicy.h:
(WebCore::ContentSecurityPolicy::webAssemblyErrorMessage const):
2022-04-01 Alan Bujtas <zalan@apple.com>
(REGRESSION r291992) showRenderTree fails to print the name of the renderer when "(" is present
https://bugs.webkit.org/show_bug.cgi?id=238666
Reviewed by Antti Koivisto.
* rendering/RenderObject.cpp:
(WebCore::RenderObject::outputRenderObject const): with names like "RenderRubyBase (anonymous)" we print an address and not "RenderRubyBase"
2022-04-01 Alan Bujtas <zalan@apple.com>
[Ruby] Statically positioned out-of-flow block boxes are mispositioned
https://bugs.webkit.org/show_bug.cgi?id=238653
Reviewed by Antti Koivisto.
A statically positioned out-of-flow ruby base e.g.
<div>A<ruby><rb style="position: absolute">B</rb></ruby></div>
and
<div>A<span style="position: absolute">B</span></div>
should match layout where <rb> box's top is aligned with current line box's top position
(as if <rb> was inflow, which then puts "A" and "B" (somewhat) next to each other vertically).
However since we wrap such content (<rb>) inside an inline-block type anonymous box (RenderRubyBase), in practice
we match instead this:
<div>A
<span style="display: inline-block">
<span style="position: absolute">B</span>
</span>
</div>
where <rb>'s top is now aligned with the top of the wrapper inline-block box's top.
But this inline-block box sits on the line box's baseline with the height of 0 (it's inflow empty)
which makes the <rb> aligned with the line box's baseline instead of its top (and now "B" in below "A" under the baseline).
This patch fixes this by making sure that the (inflow empty) inline-block box's baseline is computed as if it had inflow content.
Test: fast/ruby/ruby-with-out-of-flow-base-content.html
* rendering/RenderRubyBase.cpp:
(WebCore::RenderRubyBase::isEmptyOrHasInFlowContent const):
* rendering/RenderRubyBase.h:
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::baselinePosition const):
* rendering/RenderRubyRun.h:
2022-04-01 Andres Gonzalez <andresg_22@apple.com>
Add AXObjectCache::treeData() to retrieve serialized representation of the AX trees.
https://bugs.webkit.org/show_bug.cgi?id=238561
<rdar://problem/91055027>
Reviewed by Chris Fleizach.
Added AXObjectCache::treeData() to retrieve a serialized representation
of both the live and isolated AX trees. The immediate application of
this will be log to file the trees from the browser. Other application
down the road may be to expose a text document-like representation of
the web page for AT clients.
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::treeData):
* accessibility/AXObjectCache.h:
(WebCore::AXObjectCache::treeData):
2022-04-01 Tim Nguyen <ntim@apple.com>
[css-logical] Add support for block/inline CSS values for resize property
https://bugs.webkit.org/show_bug.cgi?id=218088
Reviewed by Antti Koivisto.
Tests:
- Parsing: imported/w3c/web-platform-tests/css/css-logical/logical-values-resize.html
- Functionality: fast/css/resize-single-axis.html
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator Resize const):
* css/CSSProperties.json:
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::resize):
* rendering/style/RenderStyleConstants.cpp:
(WebCore::operator<<):
* rendering/style/RenderStyleConstants.h:
* rendering/style/StyleRareNonInheritedData.h:
2022-04-01 Rob Buis <rbuis@igalia.com>
Add RenderGrid parameter to resolveGridPositionsFromStyle
https://bugs.webkit.org/show_bug.cgi?id=238660
Reviewed by Javier Fernandez.
The containing block of an out of flow grid item does
not have to be of type RenderGrid. To obtain the correct
RenderGrid pass it at the time the RenderGrid calls
resolveGridPositionsFromStyle.
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::populateExplicitGridAndOrderIterator const):
(WebCore::RenderGrid::computeGridPositionsForOutOfFlowChild const):
* rendering/style/GridPositionsResolver.cpp:
(WebCore::GridPositionsResolver::resolveGridPositionsFromStyle):
* rendering/style/GridPositionsResolver.h:
2022-04-01 Chris Dumez <cdumez@apple.com>
Unreviewed, update DerivedSources-output.xcfilelist to fix build.
* DerivedSources-output.xcfilelist:
2022-04-01 Rob Buis <rbuis@igalia.com>
Abort formatBlock command on null start or end selections
https://bugs.webkit.org/show_bug.cgi?id=238657
Reviewed by Wenson Hsieh.
Abort formatBlock command in case selectionForParagraphIteration
returns with a null start or end selection due to inline table specific
adjustments.
* editing/ApplyBlockElementCommand.cpp:
(WebCore::ApplyBlockElementCommand::doApply):
2022-04-01 Youenn Fablet <youenn@apple.com>
ServiceWorkerRegistration.getNotifications should list all persistent notifications
https://bugs.webkit.org/show_bug.cgi?id=238544
Reviewed by Darin Adler.
Remove context based notification list since the list is global.
Add creation time to notification data.
Instead of reading the list locally, use the SWClient connection to get it.
Covered by updated test.
* Modules/notifications/Notification.cpp:
* Modules/notifications/Notification.h:
* Modules/notifications/NotificationData.h:
* workers/service/SWClientConnection.h:
* workers/service/ServiceWorkerContainer.cpp:
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerRegistration.cpp:
* workers/service/ServiceWorkerRegistration.h:
* workers/service/ServiceWorkerRegistration.idl:
* workers/service/WorkerSWClientConnection.cpp:
* workers/service/WorkerSWClientConnection.h:
2022-04-01 Youenn Fablet <youenn@apple.com>
Notification should be exposed to ServiceWorker contexts
https://bugs.webkit.org/show_bug.cgi?id=238548
Reviewed by Chris Dumez.
Mark Notification as exposed in ServiceWorker (not yet Worker as it would not be functional).
Add a dedicated createForServiceWorker routine that takes a registration URL to create persistent permissions.
Throw an exception in case of calling Notification constructor directly in a ServiceWorkerGlobalScope, as per spec.
Covered by updated and existing tests.
* Modules/notifications/Notification.cpp:
* Modules/notifications/Notification.h:
* Modules/notifications/Notification.idl:
* workers/service/ServiceWorkerRegistration.cpp:
2022-04-01 Philippe Normand <philn@igalia.com>
[GStreamer][WebRTC] Improve RTP stats gathering
https://bugs.webkit.org/show_bug.cgi?id=238602
Reviewed by Xabier Rodriguez-Calvar.
Proxy a few more stats fields from GstWebRTC to the WebCore StatsCollector.
* Modules/mediastream/gstreamer/GStreamerStatsCollector.cpp:
(WebCore::fillInboundRTPStreamStats):
(WebCore::fillOutboundRTPStreamStats):
2022-04-01 Tim Nguyen <ntim@apple.com>
Unreviewed, fix obsolete FIXME comments in CSSParserFastPaths.cpp
- overflow-anchor is still not implemented, and the visible value has been removed from the spec.
- text-combine-upright was implemented in r287487
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2022-04-01 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION(r290360): [GLX] Crash on process exit
https://bugs.webkit.org/show_bug.cgi?id=238494
Reviewed by Michael Catanzaro.
When creating a PlatformDisplay from a shared GdkDisplay, we need to keep a reference to the display and connect
to closed signal to release our display dependent resources. Closed signal is emitted right before the native
display is actually closed by GDK. We also need to make sure that the sharing GL context is released before the
PlatformDisplay is destroyed. This is always happening for EGL because the sharing GL context is cleared before
terminating the EGL display in the atexit handler, but that's not the case of GLX. Since X11 only allows one
PlatformDisplay, which is always the shared one, we can just install an atexit handler in the constructor to
clear the sharing context before the destructor is called.
* platform/graphics/PlatformDisplay.cpp:
(WebCore::PlatformDisplay::createPlatformDisplay):
(WebCore::PlatformDisplay::PlatformDisplay):
(WebCore::PlatformDisplay::sharedDisplayDidClose):
(WebCore::PlatformDisplay::~PlatformDisplay):
(WebCore::PlatformDisplay::clearSharingGLContext):
(WebCore::PlatformDisplay::terminateEGLDisplay):
* platform/graphics/PlatformDisplay.h:
* platform/graphics/libwpe/PlatformDisplayLibWPE.cpp:
(WebCore::PlatformDisplayLibWPE::PlatformDisplayLibWPE):
* platform/graphics/wayland/PlatformDisplayWayland.cpp:
(WebCore::PlatformDisplayWayland::create):
(WebCore::PlatformDisplayWayland::PlatformDisplayWayland):
(WebCore::PlatformDisplayWayland::~PlatformDisplayWayland):
(WebCore::PlatformDisplayWayland::sharedDisplayDidClose):
* platform/graphics/wayland/PlatformDisplayWayland.h:
* platform/graphics/win/PlatformDisplayWin.h:
* platform/graphics/x11/PlatformDisplayX11.cpp:
(WebCore::PlatformDisplayX11::create):
(WebCore::clearSharingGLContextAtExit):
(WebCore::PlatformDisplayX11::PlatformDisplayX11):
(WebCore::PlatformDisplayX11::~PlatformDisplayX11):
(WebCore::PlatformDisplayX11::sharedDisplayDidClose):
* platform/graphics/x11/PlatformDisplayX11.h:
2022-04-01 Carlos Garcia Campos <cgarcia@igalia.com>
Add support for element.computedStyleMap()
https://bugs.webkit.org/show_bug.cgi?id=238375
Reviewed by Alex Christensen.
Covered by existing w3c tests.
* CMakeLists.txt:
* Sources.txt:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue): Add PropertyValueType parameter to get either the computed or
resolved value.
* css/CSSComputedStyleDeclaration.h:
* css/typedom/CSSStyleValueFactory.cpp:
(WebCore::CSSStyleValueFactory::reifyValue): Handle more cases of custom property.
* css/typedom/ComputedStylePropertyMapReadOnly.cpp: Added.
(WebCore::ComputedStylePropertyMapReadOnly::create):
(WebCore::ComputedStylePropertyMapReadOnly::ComputedStylePropertyMapReadOnly):
(WebCore::ComputedStylePropertyMapReadOnly::get const):
(WebCore::ComputedStylePropertyMapReadOnly::getAll const):
(WebCore::ComputedStylePropertyMapReadOnly::has const):
(WebCore::ComputedStylePropertyMapReadOnly::size const):
(WebCore::ComputedStylePropertyMapReadOnly::entries const):
* css/typedom/ComputedStylePropertyMapReadOnly.h: Added.
* css/typedom/StylePropertyMapReadOnly.cpp:
(WebCore::StylePropertyMapReadOnly::reifyValueToVector): Returns a Vector so in case of CSSValueList, every
value is added to the vector.
(WebCore::StylePropertyMapReadOnly::Iterator::Iterator): Add iterator implementation, since this is now iterable.
(WebCore::StylePropertyMapReadOnly::Iterator::next): Ditto.
* css/typedom/StylePropertyMapReadOnly.h:
(WebCore::StylePropertyMapReadOnly::createIterator):
* css/typedom/StylePropertyMapReadOnly.idl:
* dom/Element+ComputedStyleMap.idl: Added.
* dom/Element.cpp:
(WebCore::Element::computedStyleMap): Get or create the computed style map.
* dom/Element.h:
* dom/ElementRareData.cpp:
* dom/ElementRareData.h:
(WebCore::ElementRareData::computedStyleMap):
(WebCore::ElementRareData::setComputedStyleMap):
(WebCore::ElementRareData::useTypes const):
* dom/NodeRareData.h:
* dom/StyledElement.cpp:
* html/CustomPaintImage.cpp:
2022-04-01 Tim Horton <timothy_horton@apple.com>
Add a debug overlay for interaction regions
https://bugs.webkit.org/show_bug.cgi?id=238187
Reviewed by Wenson Hsieh.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/Node.cpp:
(WebCore::Node::willRespondToTouchEvents):
* dom/Node.h:
Expose `willRespondToTouchEvents`, similar to `willRespondToMouseMoveEvents`.
* page/DebugOverlayRegions.h:
* page/DebugPageOverlays.cpp:
(WebCore::InteractionRegionOverlay::updateRegion):
(WebCore::pathsForRegion):
(WebCore::InteractionRegionOverlay::activeRegion):
(WebCore::drawCheckbox):
(WebCore::InteractionRegionOverlay::rectForSettingAtIndex):
(WebCore::InteractionRegionOverlay::valueForSetting):
(WebCore::InteractionRegionOverlay::drawSettings):
(WebCore::InteractionRegionOverlay::drawRect):
(WebCore::InteractionRegionOverlay::mouseEvent):
(WebCore::RegionOverlay::create):
(WebCore::DebugPageOverlays::updateOverlayRegionVisibility):
* page/DebugPageOverlays.h:
(WebCore::DebugPageOverlays::didLayout):
(WebCore::DebugPageOverlays::didChangeEventHandlers):
(WebCore::DebugPageOverlays::doAfterUpdateRendering):
Add an overlay for indicating interaction regions.
* page/FrameSnapshotting.cpp:
(WebCore::styleContainsComplexBackground):
(WebCore::estimatedBackgroundColorForRange):
* page/FrameSnapshotting.h:
* page/TextIndicator.cpp:
(WebCore::styleContainsComplexBackground): Deleted.
(WebCore::estimatedBackgroundColorForRange): Deleted.
Move `estimatedBackgroundColorForRange` from TextIndicator to
FrameSnapshotting for ease of reuse.
* page/InteractionRegion.cpp: Added.
(WebCore::absoluteBoundingRectForRange):
(WebCore::regionForElement):
(WebCore::cursorTypeForElement):
(WebCore::interactionRegions):
* page/InteractionRegion.h: Added.
(WebCore::InteractionRegion::encode const):
(WebCore::InteractionRegion::decode):
Add InteractionRegion, which keeps track of the location of and metadata
about interaction regions.
* platform/graphics/LayoutSize.h:
(WebCore::LayoutSize::minDimension const):
(WebCore::LayoutSize::maxDimension const):
* platform/graphics/RoundedRect.h:
(WebCore::RoundedRect::Radii::minimumRadius const):
Add minimumRadius() to Radii.
2022-04-01 Youenn Fablet <youenn@apple.com>
Persistent notifications should work in document scopes as well as service worker global scopes
https://bugs.webkit.org/show_bug.cgi?id=238601
Reviewed by Brady Eidson.
Add a m_serviceWorkerRegistrationURL in Notification to identify whether a notfication is persistent or not.
Set that field when creating a notification from NotificationData or from ServiceWorkerRegistration::showNotification.
Test: http/tests/workers/service/shownotification-allowed-document.html
* Modules/notifications/Notification.cpp:
(WebCore::Notification::create):
(WebCore::Notification::data const):
* Modules/notifications/Notification.h:
* workers/service/ServiceWorkerRegistration.cpp:
(WebCore::ServiceWorkerRegistration::showNotification):
2022-03-31 Wenson Hsieh <wenson_hsieh@apple.com>
Add a heuristic to identify and extract the prominent video element in element fullscreen
https://bugs.webkit.org/show_bug.cgi?id=238579
Reviewed by Jer Noble.
Mark a couple of methods as WEBCORE_EXPORT so that they can be invoked from the WebKit layer.
No change in behavior (yet).
* dom/Element.h:
* html/HTMLMediaElement.h:
Drive-by-fix: also remove an (unused) function declaration with no implementation
(`updatePlaybackControlsManager()`).
2022-03-31 Said Abou-Hallawa <said@apple.com>
[GPU Process] [iOS] Vertical text is incorrectly displaced
https://bugs.webkit.org/show_bug.cgi?id=232917
rdar://85483031
Reviewed by Myles C. Maxfield.
DrawGlyphsRecorder calls FontCascade::drawGlyphs() which calls CoreText
to draw the vertical text to its internal context. This internal context
is setup to be called back for every single run. When CoreText calls
DrawGlyphsRecorder::recordDrawGlyphs(), it records drawing the glyph runs
into the owner recorder. The problem is CoreText passes the transformed
positions to recordDrawGlyphs(). To call drawGlyphsAndCacheFont() in the
recorder we have to pass the un-transformed anchor point. To get this anchor
point, we have to apply the inverse of fillVectorWithVerticalGlyphPositions()
to the first transformed position.
* platform/graphics/GraphicsContext.h:
* platform/graphics/coretext/DrawGlyphsRecorderCoreText.cpp:
(WebCore::DrawGlyphsRecorder::recordDrawGlyphs):
2022-03-31 Chris Dumez <cdumez@apple.com>
Prepare WebKit/ & WebKitLegacy/ for making the String(const char*) constructor explicit
https://bugs.webkit.org/show_bug.cgi?id=238525
Reviewed by Darin Adler.
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::createOrMigrateRecordsTableIfNecessary):
(WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidBlobTables):
(WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidIndexRecordsTable):
(WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidIndexRecordsIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidIndexRecordsRecordIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidObjectStoreInfoTable):
(WebCore::IDBServer::SQLiteIDBBackingStore::extractExistingDatabaseInfo):
(WebCore::IDBServer::SQLiteIDBBackingStore::databaseNameAndVersionFromFile):
* Modules/model-element/scenekit/SceneKitModelLoaderUSD.mm:
(WebCore::writeToTemporaryFile):
* Modules/webdatabase/Database.cpp:
(WebCore::Database::performOpenAndVerify):
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::trackerDatabasePath const):
(WebCore::DatabaseTracker::openTrackerDatabase):
* bindings/js/GCController.cpp:
(WebCore::GCController::dumpHeap):
* contentextensions/SerializedNFA.cpp:
(WebCore::ContentExtensions::SerializedNFA::serialize):
* contentextensions/URLFilterParser.cpp:
(WebCore::ContentExtensions::URLFilterParser::addPattern):
* contentextensions/URLFilterParser.h:
* loader/ResourceLoadStatistics.cpp:
(WebCore::appendBoolean):
* page/SecurityOriginData.cpp:
(WebCore::SecurityOriginData::fromDatabaseIdentifier):
* page/SecurityOriginData.h:
* platform/graphics/cg/ImageUtilitiesCG.cpp:
(WebCore::transcodeImage):
* platform/ios/PlatformEventFactoryIOS.mm:
(WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::writeBlobsToTemporaryFilesForIndexedDB):
* platform/sql/SQLiteDatabase.cpp:
(WebCore::SQLiteDatabase::tableExists):
(WebCore::SQLiteDatabase::tableSQL):
(WebCore::SQLiteDatabase::indexSQL):
(WebCore::SQLiteDatabase::inMemoryPath): Deleted.
* platform/sql/SQLiteDatabase.h:
(WebCore::SQLiteDatabase::inMemoryPath):
* platform/sql/SQLiteFileSystem.cpp:
(WebCore::SQLiteFileSystem::appendDatabaseFileNameToPath):
(WebCore::SQLiteFileSystem::computeHashForFileName):
* platform/sql/SQLiteFileSystem.h:
2022-03-31 Chris Dumez <cdumez@apple.com>
Adopt Identifier::fromString(ASCIILiteral) more broadly
https://bugs.webkit.org/show_bug.cgi?id=238574
Reviewed by Darin Adler.
Adopt Identifier::fromString(ASCIILiteral) more broadly, now that it is very efficient.
* Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
(WebCore::CDMSessionClearKey::update):
* bridge/testbindings.cpp:
(main):
* bridge/testbindings.mm:
(main):
* crypto/SubtleCrypto.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updatePageScaleFactorJSProperty):
(WebCore::HTMLMediaElement::updateUsesLTRUserInterfaceLayoutDirectionJSProperty):
(WebCore::HTMLMediaElement::setControllerJSProperty):
(WebCore::HTMLMediaElement::setMediaControlsMaximumRightContainerButtonCountOverride):
(WebCore::HTMLMediaElement::setMediaControlsHidePlaybackRates):
* html/HTMLMediaElement.h:
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::addSelfToGlobalObjectInWorld):
(WebCore::InspectorFrontendHost::showContextMenu):
* inspector/WebInjectedScriptHost.cpp:
(WebCore::constructInternalProperty):
(WebCore::objectForPaymentOptions):
(WebCore::objectForPaymentCurrencyAmount):
(WebCore::objectForPaymentItem):
(WebCore::objectForPaymentShippingOption):
(WebCore::objectForPaymentDetailsModifier):
(WebCore::objectForPaymentDetails):
(WebCore::objectForEventTargetListeners):
* inspector/agents/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::consoleStartRecordingCanvas):
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForEventListener):
* inspector/agents/page/PageAuditAgent.cpp:
(WebCore::PageAuditAgent::populateAuditObject):
* testing/Internals.cpp:
* testing/Internals.h:
* worklets/PaintWorkletGlobalScope.cpp:
(WebCore::PaintWorkletGlobalScope::registerPaint):
2022-03-31 Said Abou-Hallawa <said@apple.com>
[GPU Process] [iOS] Text decoration is always drawn with solid stroke style
https://bugs.webkit.org/show_bug.cgi?id=236909
rdar://89196615
Reviewed by Simon Fraser.
Pass the missing StrokeStyle parameter to the DrawLinesForText item and
to the recorder methods: drawLinesForText() and recordDrawLinesForText().
* platform/graphics/GraphicsTypes.h:
* platform/graphics/displaylists/DisplayListItems.cpp:
(WebCore::DisplayList::DrawLinesForText::DrawLinesForText):
(WebCore::DisplayList::DrawLinesForText::apply const):
* platform/graphics/displaylists/DisplayListItems.h:
(WebCore::DisplayList::DrawLinesForText::style const):
(WebCore::DisplayList::DrawLinesForText::encode const):
(WebCore::DisplayList::DrawLinesForText::decode):
* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::drawLinesForText):
* platform/graphics/displaylists/DisplayListRecorder.h:
* platform/graphics/displaylists/DisplayListRecorderImpl.cpp:
(WebCore::DisplayList::RecorderImpl::recordDrawLinesForText):
* platform/graphics/displaylists/DisplayListRecorderImpl.h:
2022-03-31 Don Olmstead <don.olmstead@sony.com>
Fix unused parameter warning in AccessibilityObject::previousLineStartPosition when !ENABLE(ACCESSIBILITY)
https://bugs.webkit.org/show_bug.cgi?id=238629
Reviewed by Yusuke Suzuki.
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::previousLineStartPosition const):
2022-03-31 Patrick Angle <pangle@apple.com>
Web Inspector: Support Container Queries in the Styles sidebar
https://bugs.webkit.org/show_bug.cgi?id=238346
Reviewed by Devin Rousso.
Test: inspector/css/getMatchedStylesForNodeContainerGrouping.html
Add basic support to Web Inspector for viewing styles in `@container` rules.
* css/CSSContainerRule.cpp:
(WebCore::CSSContainerRule::nameFilterText const):
* css/CSSContainerRule.h:
- Provide a way to get the name that is used to filter the rule to specific containers.
* inspector/InspectorStyleSheet.cpp:
(flattenSourceData):
- In order to prevent future rule types from being added without some consideration for how they are inspected,
use an exhaustive switch-case statement here. This will at minimum allow us to make sure we have opened a bug
and put a FIXME here for new values in the future.
(WebCore::asCSSRuleList):
(WebCore::buildArrayForGroupings):
* style/InspectorCSSOMWrappers.cpp:
(WebCore::Style::InspectorCSSOMWrappers::collect):
2022-03-31 Diego Pino Garcia <dpino@igalia.com>
[WPE] Unreviewed, fix non-unified build after r292150
* css/typedom/CSSNumericFactory.h:
* css/typedom/numeric/CSSMathSum.cpp:
2022-03-31 Alan Bujtas <zalan@apple.com>
[CSS contain] Containment disables the special handling of the HTML body element for overflow viewport propagation [part2]
https://bugs.webkit.org/show_bug.cgi?id=238572
Reviewed by Simon Fraser.
While neither the overflow(1) nor the css containment(2) specs are explicit about disabling the propagation of non-visible overflow to the viewport
when the <html> has containment, this behavior makes sense (and also see https://github.com/w3c/csswg-drafts/issues/7184).
(1) https://www.w3.org/TR/css-overflow-3/#overflow-propagation
(2) https://www.w3.org/TR/css-contain-1/#contain-property
* rendering/RenderBox.cpp:
(WebCore::RenderBox::updateFromStyle):
2022-03-31 Alex Christensen <achristensen@webkit.org>
Remove EXPERIMENTAL_FEATURES flag use on Cocoa platforms
https://bugs.webkit.org/show_bug.cgi?id=238565
Reviewed by Darin Adler.
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::isExperimentalBuild): Deleted.
* inspector/InspectorFrontendHost.h:
* inspector/InspectorFrontendHost.idl:
2022-03-31 Rob Buis <rbuis@igalia.com>
Interop issue with position: sticky within contain: paint
https://bugs.webkit.org/show_bug.cgi?id=238016
Reviewed by Simon Fraser.
Elements with overflow: clip (contain: paint enables it) are
not scroll containers, so they can't act as scrolling
ancestor for sticky elements.
Tests: imported/w3c/web-platform-tests/css/css-position/sticky/position-sticky-overflow-clip-container-ref.html
imported/w3c/web-platform-tests/css/css-position/sticky/position-sticky-overflow-clip-container.html
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::enclosingOverflowClipLayer const):
2022-03-31 Kimmo Kinnunen <kkinnunen@apple.com>
REGRESSION? (248052@main): ASSERTION FAILED: didContain in WebCore::removeActiveContext(WebCore::WebGLRenderingContextBase &)
https://bugs.webkit.org/show_bug.cgi?id=238280
Reviewed by Myles C. Maxfield.
WebGL would record active contexts to a TLS variable in order to cap amount of
contexts. In WebKitLegacy the main thread might be either web thread or real main
thread, and as such the TLS variable cannot be used for main thread.
Instead, special case main thread active contexts to a specific global variable.
Tested by TestWebKitAPI.WebKitLegacy.WebGLNoCrashOnOtherThreadAccess.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::activeContexts):
2022-03-31 Diego Pino Garcia <dpino@igalia.com>
[WPE] Unreviewed, fix non-unified build after r292139
* loader/ThreadableLoader.cpp:
* page/csp/ContentSecurityPolicySourceList.cpp:
* workers/service/context/ServiceWorkerThreadProxy.cpp:
2022-03-31 Alex Christensen <achristensen@webkit.org>
Implement units for CSS Typed OM
https://bugs.webkit.org/show_bug.cgi?id=238532
Reviewed by Simon Fraser.
This feature is off by default and this part is covered by WPT tests.
* css/typedom/CSSNumericFactory.h:
* css/typedom/CSSNumericValue.cpp:
(WebCore::negate):
(WebCore::invert):
(WebCore::operationOnValuesOfSameUnit):
(WebCore::CSSNumericValue::addInternal):
(WebCore::CSSNumericValue::add):
(WebCore::CSSNumericValue::sub):
(WebCore::CSSNumericValue::multiplyInternal):
(WebCore::CSSNumericValue::mul):
(WebCore::CSSNumericValue::to):
(WebCore::CSSNumericValue::toSum):
(WebCore::CSSNumericValue::type): Deleted.
* css/typedom/CSSNumericValue.h:
(WebCore::CSSNumericValue::type const):
(WebCore::CSSNumericValue::CSSNumericValue):
* css/typedom/CSSUnitValue.cpp:
(WebCore::numericType):
(WebCore::parseUnit):
(WebCore::CSSUnitValue::unit const):
(WebCore::CSSUnitValue::unitSerialization const):
(WebCore::CSSUnitValue::create):
(WebCore::CSSUnitValue::CSSUnitValue):
* css/typedom/CSSUnitValue.h:
* css/typedom/numeric/CSSMathInvert.cpp:
(WebCore::negatedType):
(WebCore::CSSMathInvert::CSSMathInvert):
* css/typedom/numeric/CSSMathNegate.cpp:
(WebCore::copyType):
(WebCore::CSSMathNegate::CSSMathNegate):
* css/typedom/numeric/CSSMathProduct.cpp:
(WebCore::multiplyTypes):
(WebCore::CSSMathProduct::create):
(WebCore::CSSMathProduct::CSSMathProduct):
(WebCore::CSSMathProduct::values const): Deleted.
* css/typedom/numeric/CSSMathProduct.h:
* css/typedom/numeric/CSSMathSum.cpp:
(WebCore::addTypes):
(WebCore::CSSMathSum::create):
(WebCore::CSSMathSum::CSSMathSum):
* css/typedom/numeric/CSSMathSum.h:
* css/typedom/numeric/CSSMathValue.h:
(WebCore::CSSMathValue::CSSMathValue):
* css/typedom/numeric/CSSNumericArray.cpp:
(WebCore::CSSNumericArray::create):
* css/typedom/numeric/CSSNumericBaseType.h:
(WebCore::eachBaseType):
(WebCore::debugString):
(): Deleted.
* css/typedom/numeric/CSSNumericType.h:
(WebCore::CSSNumericType::operator== const):
(WebCore::CSSNumericType::valueForType):
(WebCore::CSSNumericType::applyPercentHint):
(WebCore::CSSNumericType::debugString const):
(): Deleted.
* css/typedom/numeric/CSSNumericType.idl:
2022-03-31 Zan Dobersek <zdobersek@igalia.com>
[GTK][WPE] Make ENABLE(GPU_PROCESS) code buildable
https://bugs.webkit.org/show_bug.cgi?id=238595
Reviewed by Adrian Perez de Castro.
* platform/TextureMapper.cmake:
List the relevant headers under platform/graphics/gbm/ and append them
to WebCore_PRIVATE_FRAMEWORK_HEADERS so that the necessary relay headers
usable from WebKit are generated.
2022-03-30 Andres Gonzalez <andresg_22@apple.com>
Split streaming of AX trees from the class AXLogger.
https://bugs.webkit.org/show_bug.cgi?id=238550
<rdar://problem/91041921>
Reviewed by Chris Fleizach.
AXLogger functionality is debug only. We need to stream the content of
the AX trees both in debug and release builds. This patch splits
streaming of the AX trees from the AXLogger class, which remains a debug
only utility.
In addition, added a mechanism to control what is streamed via the
AXStreamOptions enumeration.
* accessibility/AXLogger.cpp:
(WebCore::shouldLog):
(WebCore::operator<<):
(WebCore::streamIsolatedSubtreeOnMainThread):
Streams a snapshot of the hierarchy of AXIsolatedObjects on the main
thread, limiting the properties of the AXIsolatedObject that can be
accessed using AXStreamOptions.
(WebCore::streamAXCoreObject):
(WebCore::streamSubtree):
(WebCore::AXLogger::add): Replaced with streamSubtree.
* accessibility/AXLogger.h:
* accessibility/isolatedtree/AXIsolatedTree.h:
2022-03-30 Brent Fulgham <bfulgham@apple.com>
[Cocoa] Ensure correct isAppInitiated state when creating URLRequests from URL
https://bugs.webkit.org/show_bug.cgi?id=238159
<rdar://problem/88490742>
Reviewed by Kate Cheney.
Update various load operations to ensure AppInitiated state is properly handled.
* loader/NavigationScheduler.cpp:
(WebCore::NavigationScheduler::scheduleLocationChange): The ScheduledPageBlock
load did not propagating the value of the driving document's AppInitiated state.
* loader/ThreadableLoader.cpp:
(WebCore::ThreadableLoader::create): Reflect the AppInitiated state in the load.
* page/DragController.cpp:
(WebCore::DragController::performDragOperation): A page load triggered by the user
dragging content into the view is never AppInitiated.
2022-03-30 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Link WebCore with WebGPU.framework 🎉
https://bugs.webkit.org/show_bug.cgi?id=236751
Reviewed by Dean Jackson.
Apple's build system has been configured, so it's now safe to
link WebCore.framework and WebGPU.framework.
We correctly handle the situation where the framework isn't present
at runtime.
* Configurations/WebCore.xcconfig:
2022-03-30 Kate Cheney <katherine_cheney@apple.com>
Migrate manifest version content security policy filtering for extensions into WebKit
https://bugs.webkit.org/show_bug.cgi?id=238230
<rdar://problem/60081492>
Reviewed by Timothy Hatcher.
Currently Safari handles parsing CSP for extensions depending on the manifest version. This patch moves
parsing to WebKit to align with existing CSP implementation.
There are two current versions of the manifest, v2 and v3. The rules for V2 affect the script-src and default-src
directives and the rules are:
1. Standalone wildcards are prohibited.
2. Wildcards with only a tld (e.g. *.com) are prohibited.
3. Only full https:// urls are allowed as sources, with the exception of the blob: scheme.
4. The 'unsafe-inline' source expression is prohibited.
The rules for V3 affect the script-src, worker-src, object-src and default-src directives and the rules are:
1. Wildcards are prohibited.
2. External sources are prohibited.
3. The 'self' and 'none' keywords are allowed. All others are prohibited.
Tests: http/tests/security/contentSecurityPolicy/extensions/manifest-v2/default-src/manifest-v2-default-src-blob-scheme-allowed.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v2/default-src/manifest-v2-default-src-insecure-scheme.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v2/default-src/manifest-v2-default-src-missing-scheme.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v2/default-src/manifest-v2-default-src-scheme-only.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v2/default-src/manifest-v2-default-src-unsafe-eval-allowed.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v2/default-src/manifest-v2-default-src-unsafe-inline-blocked.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v2/default-src/manifest-v2-default-src-wildcard-allowed.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v2/default-src/manifest-v2-default-src-wildcard-prohibited.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v2/img-src/manifest-v2-img-src-host-only-allowed.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v2/img-src/manifest-v2-img-src-scheme-only-allowed.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v2/img-src/manifest-v2-img-src-wildcard-allowed.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v2/script-src/manifest-v2-script-src-blob-scheme-allowed.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v2/script-src/manifest-v2-script-src-hash-source-allowed.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v2/script-src/manifest-v2-script-src-insecure-scheme.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v2/script-src/manifest-v2-script-src-missing-scheme.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v2/script-src/manifest-v2-script-src-scheme-only.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v2/script-src/manifest-v2-script-src-unsafe-eval-allowed.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v2/script-src/manifest-v2-script-src-unsafe-inline-blocked.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v2/script-src/manifest-v2-script-src-wildcard-allowed.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v2/script-src/manifest-v2-script-src-wildcard-blocked.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v3/default-src/manifest-v3-default-src-block-non-https-scheme.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v3/default-src/manifest-v3-default-src-block-wildcard.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v3/default-src/manifest-v3-default-src-can-load-insecure-loopback-ip.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v3/default-src/manifest-v3-default-src-can-load-secure-loopback-ip.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v3/default-src/manifest-v3-default-src-self.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v3/img-src/manifest-v3-img-src-host-only-allowed.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v3/img-src/manifest-v3-img-src-scheme-only-allowed.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v3/img-src/manifest-v3-img-src-wildcard-allowed.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v3/object-src/manifest-v3-object-src-block-non-https-scheme.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v3/object-src/manifest-v3-object-src-block-partial-wildcard.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v3/object-src/manifest-v3-object-src-block-wildcard.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v3/object-src/manifest-v3-object-src-can-load-insecure-loopback-ip.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v3/object-src/manifest-v3-object-src-can-load-secure-loopback-ip.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v3/object-src/manifest-v3-object-src-self.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v3/script-src/manifest-v3-script-src-block-non-https-scheme.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v3/script-src/manifest-v3-script-src-block-partial-wildcard.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v3/script-src/manifest-v3-script-src-block-wildcard.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v3/script-src/manifest-v3-script-src-blockes-nonces.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v3/script-src/manifest-v3-script-src-blocks-hashes.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v3/script-src/manifest-v3-script-src-can-load-insecure-loopback-ip.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v3/script-src/manifest-v3-script-src-can-load-secure-loopback-ip.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v3/script-src/manifest-v3-script-src-self.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v3/style-src/manifest-v3-style-src-allows-keywords.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v3/worker-src/manifest-v3-worker-src-block-partial-wildcard.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v3/worker-src/manifest-v3-worker-src-block-wildcard.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v3/worker-src/manifest-v3-worker-src-can-load-insecure-loopback-ip.html
http/tests/security/contentSecurityPolicy/extensions/manifest-v3/worker-src/manifest-v3-worker-src-self.html
* WebCore.xcodeproj/project.pbxproj:
* page/Page.cpp:
(WebCore::m_contentSecurityPolicyModeForExtension):
(WebCore::m_attachmentElementClient): Deleted.
* page/Page.h:
(WebCore::Page::contentSecurityPolicyModeForExtension const):
* page/PageConfiguration.h:
* page/csp/ContentSecurityPolicy.cpp:
Planning on fixing the non-document case in a followup, this patch was big enough.
* page/csp/ContentSecurityPolicy.h:
(WebCore::ContentSecurityPolicy::contentSecurityPolicyModeForExtension const):
* page/csp/ContentSecurityPolicySourceList.cpp:
(WebCore::ContentSecurityPolicySourceList::ContentSecurityPolicySourceList):
(WebCore::schemeIsInHttpFamily):
(WebCore::isRestrictedDirectiveForMode):
This function returns the specific directives that have rules applied to them
in each manifest version. It can be used for blocking wildcards and unsafe-inline
for both versions, and all other keywords for manifest v3.
(WebCore::ContentSecurityPolicySourceList::isValidSourceForExtensionMode):
This function checks a given source against the rules for a specific version.
(WebCore::extensionModeAllowsKeywordsForDirective):
Most keywords (aside from unsafe-inline) are allowed in manifest v2, but only
'self' and 'none' are allowed in v3.
(WebCore::ContentSecurityPolicySourceList::parse):
(WebCore::ContentSecurityPolicySourceList::parseSource):
(WebCore::ContentSecurityPolicySourceList::parseNonceSource):
(WebCore::ContentSecurityPolicySourceList::parseHashSource):
Nonces and hashes are not allowed for specified v3 directives.
* page/csp/ContentSecurityPolicySourceList.h:
2022-03-30 Alan Bujtas <zalan@apple.com>
[CSS contain] Containment disables the special handling of the HTML body element for overflow viewport propagation.
https://bugs.webkit.org/show_bug.cgi?id=238526
Reviewed by Simon Fraser.
https://www.w3.org/TR/css-overflow-3/#overflow-propagation
"...UAs must apply the overflow-* values set on the root element to the viewport when the root element’s display value is not none.
However, when the root element is an html element whose overflow value is visible, and that element has as a
child a body element whose display value is also not none, user agents must instead apply the
overflow-* values of the first such child element to the viewport.
The element from which the value is propagated must then have a used overflow value of visible.
Note: Using containment disables this special handling of the HTML body element..."
* rendering/RenderBox.cpp:
(WebCore::RenderBox::updateFromStyle):
2022-03-30 Devin Rousso <drousso@apple.com>
Web Inspector: Sources: the mapped file URL of a Response Local Override should be clickable
https://bugs.webkit.org/show_bug.cgi?id=238533
Reviewed by Patrick Angle.
* inspector/InspectorFrontendHost.h:
* inspector/InspectorFrontendHost.idl:
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::revealFileExternally): Added.
Add a helper for selecting a file in the system file explorer.
* inspector/InspectorFrontendClient.h:
* inspector/InspectorFrontendClientLocal.h:
(WebCore::InspectorFrontendClientLocal::revealFileExternally): Added.
Do nothing in tests (and WK1) as there is no way to check for another app being opened.
2022-03-30 Chris Dumez <cdumez@apple.com>
Optimize the construction of a JSC::Identifier from an ASCIILiteral
https://bugs.webkit.org/show_bug.cgi?id=238552
Reviewed by Geoffrey Garen.
Adopt the JSC::Identifier constructor from an ASCIILiteral more widely.
* Modules/applepay-ams-ui/ApplePayAMSUIPaymentHandler.cpp:
(WebCore::ApplePayAMSUIPaymentHandler::finishSession):
* Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
(WebCore::CDMSessionClearKey::update):
* Modules/webaudio/AudioWorkletGlobalScope.cpp:
(WebCore::AudioWorkletGlobalScope::registerProcessor):
* Modules/webaudio/AudioWorkletProcessor.cpp:
(WebCore::AudioWorkletProcessor::process):
* bindings/js/JSCustomElementRegistryCustom.cpp:
(WebCore::JSCustomElementRegistry::define):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::DialogHandler::dialogCreated):
(WebCore::DialogHandler::returnValue const):
(WebCore::JSDOMWindow::setOpener):
(WebCore::JSDOMWindow::setOpenDatabase):
* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::handleEvent):
* bindings/js/JSImageDataCustom.cpp:
(WebCore::toJSNewlyCreated):
* bindings/js/ScriptModuleLoader.cpp:
(WebCore::ScriptModuleLoader::createImportMetaProperties):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryImplementationContent):
(addUnscopableProperties):
(GenerateImplementation):
(GenerateAttributeSetterBodyDefinition):
(GenerateDefaultToJSONOperationDefinition):
(GenerateCallbackImplementationContent):
(GenerateConstructorHelperMethods):
* bindings/scripts/test/JS/JSExposedStar.cpp:
(WebCore::JSExposedStarPrototype::finishCreation):
* bindings/scripts/test/JS/JSExposedToWorkerAndWindow.cpp:
(WebCore::convertDictionary<ExposedToWorkerAndWindow::Dict>):
(WebCore::convertDictionaryToJS):
* bindings/scripts/test/JS/JSTestCEReactions.cpp:
(WebCore::setJSTestCEReactions_stringifierAttributeSetter):
(WebCore::setJSTestCEReactions_stringifierAttributeNotNeededSetter):
* bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
(WebCore::convertDictionary<TestCallbackInterface::Dictionary>):
(WebCore::JSTestCallbackInterface::callbackWithNoParam):
(WebCore::JSTestCallbackInterface::callbackWithArrayParam):
(WebCore::JSTestCallbackInterface::callbackWithSerializedScriptValueParam):
(WebCore::JSTestCallbackInterface::callbackWithStringList):
(WebCore::JSTestCallbackInterface::callbackWithBoolean):
(WebCore::JSTestCallbackInterface::callbackRequiresThisToPass):
(WebCore::JSTestCallbackInterface::callbackWithAReturnValue):
(WebCore::JSTestCallbackInterface::callbackThatRethrowsExceptions):
(WebCore::JSTestCallbackInterface::callbackWithThisObject):
* bindings/scripts/test/JS/JSTestConditionalIncludes.cpp:
(WebCore::JSTestConditionalIncludesDOMConstructor::initializeProperties):
(WebCore::JSTestConditionalIncludesPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestConditionallyReadWrite.cpp:
(WebCore::JSTestConditionallyReadWritePrototype::finishCreation):
* bindings/scripts/test/JS/JSTestDefaultToJSON.cpp:
(WebCore::JSTestDefaultToJSONPrototype::finishCreation):
(WebCore::jsTestDefaultToJSONPrototypeFunction_toJSONBody):
* bindings/scripts/test/JS/JSTestDefaultToJSONFilteredByExposed.cpp:
(WebCore::JSTestDefaultToJSONFilteredByExposedPrototype::finishCreation):
(WebCore::jsTestDefaultToJSONFilteredByExposedPrototypeFunction_toJSONBody):
* bindings/scripts/test/JS/JSTestDefaultToJSONInherit.cpp:
(WebCore::jsTestDefaultToJSONInheritPrototypeFunction_toJSONBody):
* bindings/scripts/test/JS/JSTestDefaultToJSONInheritFinal.cpp:
(WebCore::jsTestDefaultToJSONInheritFinalPrototypeFunction_toJSONBody):
* bindings/scripts/test/JS/JSTestDerivedDictionary.cpp:
(WebCore::convertDictionary<TestDerivedDictionary>):
(WebCore::convertDictionaryToJS):
* bindings/scripts/test/JS/JSTestDerivedDictionary2.cpp:
(WebCore::convertDictionary<TestDerivedDictionary2>):
(WebCore::convertDictionaryToJS):
(WebCore::convertDictionary<TestDerivedDictionary2::Dictionary>):
* bindings/scripts/test/JS/JSTestDictionary.cpp:
(WebCore::convertDictionary<TestDictionary>):
* bindings/scripts/test/JS/JSTestDictionaryWithOnlyConditionalMembers.cpp:
(WebCore::convertDictionary<TestDictionaryWithOnlyConditionalMembers>):
(WebCore::convertDictionaryToJS):
* bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
(WebCore::JSTestEnabledBySettingDOMConstructor::initializeProperties):
(WebCore::JSTestEnabledBySettingPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::convertDictionary<TestEventConstructor::Init>):
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
(WebCore::JSTestGenerateIsReachablePrototype::finishCreation):
* bindings/scripts/test/JS/JSTestInheritedDictionary.cpp:
(WebCore::convertDictionary<TestInheritedDictionary>):
(WebCore::convertDictionaryToJS):
* bindings/scripts/test/JS/JSTestInheritedDictionary2.cpp:
(WebCore::convertDictionary<TestInheritedDictionary2>):
(WebCore::convertDictionaryToJS):
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::JSTestInterfacePrototype::finishCreation):
* bindings/scripts/test/JS/JSTestNamespaceObject.cpp:
(WebCore::JSTestNamespaceObjectDOMConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::JSTestNodePrototype::finishCreation):
(WebCore::jsTestNodePrototypeFunction_toJSONBody):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertDictionary<TestObj::Dictionary>):
(WebCore::convertDictionaryToJS):
(WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
(WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
(WebCore::convertDictionary<AlternateDictionaryName>):
(WebCore::convertDictionary<TestObj::ParentDictionary>):
(WebCore::convertDictionary<TestObj::ChildDictionary>):
(WebCore::convertDictionary<TestObj::ConditionalDictionaryA>):
(WebCore::convertDictionary<TestObj::ConditionalDictionaryB>):
(WebCore::convertDictionary<TestObj::ConditionalDictionaryC>):
(WebCore::JSTestObjDOMConstructor::initializeProperties):
(WebCore::JSTestObjPrototype::finishCreation):
(WebCore::setJSTestObj_putForwardsAttributeSetter):
(WebCore::setJSTestObj_putForwardsNullableAttributeSetter):
* bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
(WebCore::convertDictionary<TestPromiseRejectionEvent::Init>):
* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
(WebCore::convertDictionary<DictionaryImplName>):
(WebCore::convertDictionaryToJS):
* html/HTMLMediaElement.cpp:
(WebCore::controllerJSValue):
(WebCore::HTMLMediaElement::updateCaptionContainer):
(WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
(WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
(WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange):
(WebCore::HTMLMediaElement::getCurrentMediaControlsStatus):
2022-03-30 Antti Koivisto <antti@apple.com>
[CSS Container Queries] Keep colon syntax when serializing container condition
https://bugs.webkit.org/show_bug.cgi?id=238542
Reviewed by Tim Nguyen.
Don't switch to the range syntax when serializing (min-width: 100px) and similar.
* css/ContainerQuery.cpp:
(WebCore::CQ::serialize):
Add an enum that remembers the syntax used and use it when deciding how to serialize.
* css/ContainerQuery.h:
* css/ContainerQueryParser.cpp:
(WebCore::consumeFeatureName):
(WebCore::ContainerQueryParser::consumePlainSizeFeature):
Also fix a bug where plain size feature names were not lowercased.
(WebCore::ContainerQueryParser::consumeRangeSizeFeature):
2022-03-30 Youenn Fablet <youenn@apple.com>
Implement persistent notification handling
https://bugs.webkit.org/show_bug.cgi?id=238498
Reviewed by Brady Eidson.
Before the patch, we were directly going from UIProcess to service worker process.
This works if the service worker is running but does not otherwise.
To make sure we now go to NetworkProcess.
To implement https://notifications.spec.whatwg.org/#persistent-notification,
we add a service worker registration URL to NotficationData.
We remove the notfication handling going through NotificationEvent and make it Document specific.
Instead, we go through ServiceWorkerThreadProxy.
Make sure SWServer treats notification events as functional events.
Covered by updated test.
* Headers.cmake:
* Modules/notifications/Notification.cpp:
(WebCore::Notification::create):
(WebCore::Notification::dispatchClickEvent):
(WebCore::Notification::dispatchCloseEvent):
(WebCore::Notification::data const):
* Modules/notifications/Notification.h:
* Modules/notifications/NotificationData.cpp:
(WebCore::NotificationData::isolatedCopy const):
(WebCore::NotificationData::isolatedCopy):
* Modules/notifications/NotificationData.h:
(WebCore::NotificationData::encode const):
(WebCore::NotificationData::decode):
* Modules/notifications/NotificationEvent.h:
* Modules/notifications/NotificationEventType.h: Added.
* WebCore.xcodeproj/project.pbxproj:
* workers/service/ServiceWorkerGlobalScope.cpp:
(WebCore::ServiceWorkerGlobalScope::postTaskToFireNotificationEvent): Deleted.
* workers/service/ServiceWorkerGlobalScope.h:
* workers/service/context/SWContextManager.cpp:
(WebCore::SWContextManager::fireNotificationEvent):
* workers/service/context/SWContextManager.h:
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::queueTaskToFirePushSubscriptionChangeEvent):
(WebCore::ServiceWorkerThread::queueTaskToFireNotificationEvent):
(WebCore::ServiceWorkerThread::startFunctionalEventMonitoring):
(WebCore::ServiceWorkerThread::heartBeatTimerFired):
(WebCore::ServiceWorkerThread::startPushEventMonitoring): Deleted.
* workers/service/context/ServiceWorkerThread.h:
(WebCore::ServiceWorkerThread::stopFunctionalEventMonitoring):
(WebCore::ServiceWorkerThread::stopPushEventMonitoring): Deleted.
* workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::ServiceWorkerThreadProxy::~ServiceWorkerThreadProxy):
(WebCore::ServiceWorkerThreadProxy::firePushEvent):
(WebCore::ServiceWorkerThreadProxy::fireNotificationEvent):
* workers/service/context/ServiceWorkerThreadProxy.h:
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::unregisterServiceWorkerClient):
(WebCore::SWServer::processPushMessage):
(WebCore::SWServer::processNotificationEvent):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerToContextConnection.h:
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::decrementFunctionalEventCounter):
(WebCore::SWServerWorker::terminateIfPossible):
(WebCore::SWServerWorker::decrementPushEventCounter): Deleted.
* workers/service/server/SWServerWorker.h:
(WebCore::SWServerWorker::incrementFunctionalEventCounter):
(WebCore::SWServerWorker::shouldContinue const):
(WebCore::SWServerWorker::incrementPushEventCounter): Deleted.
2022-03-30 Carlos Alberto Lopez Perez <clopez@igalia.com>
[GTK][WPE] generate-bundle: self-contained bundle for the MiniBrowser that can work on any distro
https://bugs.webkit.org/show_bug.cgi?id=237107
Rubber-stamped by Philippe Normand.
No new tests, no change in behaviour.
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::SoupNetworkSession::SoupNetworkSession): Allow to load the TLS database specified on the
environment variable WEBKIT_TLS_CAFILE_PEM when DEVELOPER_MODE is enabled
* platform/network/soup/SoupVersioning.h:
(soup_session_set_tls_database):
2022-03-30 Chris Dumez <cdumez@apple.com>
Add HashTranslator for ASCIILiteral for faster lookup in HashMaps / HashSets
https://bugs.webkit.org/show_bug.cgi?id=238521
Reviewed by Geoffrey Garen.
Add HashTranslator for ASCIILiteral for faster lookup in HashMaps / HashSets using an ASCIILiteral,
without the need for allocating a String.
* Modules/fetch/FetchBodyConsumer.cpp:
(WebCore::FetchBodyConsumer::packageFormData):
* Modules/plugins/YouTubePluginReplacement.cpp:
(WebCore::YouTubePluginReplacement::installReplacement):
* Modules/websockets/WebSocketDeflateFramer.cpp:
(WebCore::WebSocketExtensionDeflateFrame::processResponse):
* loader/CrossOriginPreflightResultCache.cpp:
(WebCore::CrossOriginPreflightResultCacheItem::allowsCrossOriginMethod const):
(WebCore::CrossOriginPreflightResultCacheItem::validateCrossOriginHeaders const):
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::filter):
(WebCore::ResourceResponseBase::sanitizeHTTPHeaderFieldsAccordingToTainting):
2022-03-30 Youenn Fablet <youenn@apple.com>
Implement ServiceWorker WindowClient.ancestorOrigins
https://bugs.webkit.org/show_bug.cgi?id=238441
Reviewed by Chris Dumez.
Add ancestorOrigins to ServiceWorkerClientData.
Migrate client map to UniqueRef since ServiceWorkerClientData size goes above 128.
Covered by updated tests.
* workers/service/ServiceWorkerClientData.cpp:
* workers/service/ServiceWorkerClientData.h:
* workers/service/ServiceWorkerWindowClient.h:
* workers/service/ServiceWorkerWindowClient.idl:
* workers/service/server/SWServer.cpp:
* workers/service/server/SWServer.h:
2022-03-30 Zan Dobersek <zdobersek@igalia.com>
Slim down ANGLEHeaders.h
https://bugs.webkit.org/show_bug.cgi?id=238539
Reviewed by Adrian Perez de Castro.
Define the EGL_NO_PLATFORM_SPECIFIC_TYPES macro in ANGLEHeaders.h before
including the ANGLE entrypoint headers. These will subsequently include
EGL's platform headers, but the macro prevents including additional
platform-specific headers (e.g. X11 development headers) that often
bring in additional generically-named identifiers and macros that end up
colliding with WebCore and WebKit types. The libepoxy header inclusion
is also removed, it should be done where necessary and not everywhere
ANGLEHeaders.h ends up included.
* platform/graphics/angle/ANGLEHeaders.h:
* platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.cpp:
* platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.h:
2022-03-30 Lauro Moura <lmoura@igalia.com>
Unreviewed, non-unified build fixes
https://bugs.webkit.org/show_bug.cgi?id=238536
* contentextensions/ContentExtensionError.cpp:
* contentextensions/ContentExtensionError.h:
* css/ContainerQuery.cpp:
* html/HTMLTextFormControlElement.cpp:
* inspector/InspectorFrontendHost.cpp:
* page/Page.cpp:
* page/csp/ContentSecurityPolicyDirectiveNames.cpp:
2022-03-29 Brandon Stewart <brandonstewart@apple.com>
Ensure m_layerRulesBeforeImportRules is properly copied during StyleSheetContents instantiation
https://bugs.webkit.org/show_bug.cgi?id=238537
Reviewed by Antti Koivisto.
During the instantiation of the StyleSheetContents the m_layerRulesBeforeImportRules was not being
properly copied.
* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::StyleSheetContents):
2022-03-29 Diego Pino Garcia <dpino@igalia.com>
[GCC] Ubuntu LTS build broken after r291956
https://bugs.webkit.org/show_bug.cgi?id=238481
Reviewed by Darin Adler.
Default comparisons by value (P1946R0) is only supported since GCC10.
https://en.cppreference.com/w/cpp/compiler_support/20
* rendering/style/StyleGridData.h:
(WebCore::GridTrackEntrySubgrid::operator== const):
(WebCore::GridTrackEntryRepeat::operator== const):
(WebCore::GridTrackEntryAutoRepeat::operator== const):
2022-03-29 Tyler Wilcock <tyler_w@apple.com>
AX: Don't detach children in AXIsolatedTree::applyPendingChanges for nodes being updated (removed and added)
https://bugs.webkit.org/show_bug.cgi?id=238460
Reviewed by Chris Fleizach and Andres Gonzalez.
In AXIsolatedTree::updateNode, we perform the update by queuing the node to be
removed, and then queueing it to be added. When performing the removal in
AXIsolatedTree::applyPendingChanges, we call AXCoreObject::detach, which unconditionally
calls AXCoreObject::detachRemoteParts. Specifically, AXIsolatedObject::detachRemoteParts
detaches all the object's children from the itself (by setting their m_parentID to zero).
Then, when we start applying m_pendingAppends, we re-add the object, but never re-attach
the children, resulting in a broken tree.
This patch fixes this by storing the reason (AccessibilityDetachmentType) the node is
being removed in m_pendingNodeRemovals, and not detaching children if the type is
AccessibilityDetachmentType::ElementChanged, as in the case of a node update.
This patch also removes AXIsolatedObject::setParent. It's never called, and
its existence is therefore confusing.
Test: accessibility/search-traversal-after-role-change.html.
This test exercises the behavior in this patch because changing an
object's role triggers AXIsolatedTree::updateNode.
* accessibility/AccessibilityObjectInterface.h:
(WebCore::AXCoreObject::detach):
* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::setParent): Deleted.
* accessibility/isolatedtree/AXIsolatedObject.h:
* accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::updateNode):
(WebCore::AXIsolatedTree::applyPendingChanges):
* accessibility/isolatedtree/AXIsolatedTree.h:
2022-03-29 Tyler Wilcock <tyler_w@apple.com>
AXIsolatedObject::isAccessibilityObject should not be ASSERT_NOT_REACHED
https://bugs.webkit.org/show_bug.cgi?id=238511
Reviewed by Chris Fleizach.
We try to downcast AXCoreObjects to AccessibilityObjects here in AXLogger's TextStream& operator<<(TextStream&, const AXCoreObject&):
if (auto* axObject = dynamicDowncast<AccessibilityObject>(&object); axObject && axObject->hasDisplayContents())
stream.dumpProperty("hasDisplayContents", true);
So this should not ASSERT_NOT_REACHED in AXIsolatedObject.
* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::isAccessibilityObject const): Deleted.
* accessibility/isolatedtree/AXIsolatedObject.h:
2022-03-29 Devin Rousso <drousso@apple.com>
Web Inspector: Sources: allow Response Local Overrides to map to a file on disk
https://bugs.webkit.org/show_bug.cgi?id=238236
<rdar://problem/59009154>
Reviewed by Patrick Angle.
This makes Response Local Overrides even more powerful by allowing developers to map the
contents of the (Local Override) resource to a file on disk (e.g. a local copy of the file),
meaning that they can use their preferred editor of choice (and all the tools that may come
with it) to make changes instead of having to stay within Web Inspector.
Test: http/tests/inspector/network/local-resource-override-mapped-to-file.html
* inspector/InspectorFrontendHost.idl:
* inspector/InspectorFrontendHost.h:
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::canLoad): Added.
(WebCore::InspectorFrontendHost::load): Added.
(WebCore::InspectorFrontendHost::getPath): Added.
Add helpers for loading the contents of a file on disk and getting the full path of a `File`.
* inspector/InspectorFrontendClient.h:
* inspector/InspectorFrontendClientLocal.h:
(WebCore::InspectorFrontendClientLocal::canLoad): Added.
(WebCore::InspectorFrontendClientLocal::load): Added.
Do not allow file mapping in tests (and WK1).
* testing/Internals.idl:
* testing/Internals.h:
* testing/Internals.cpp:
(WebCore::Internals::createTemporaryFile): Added.
Add a way for tests to create a temporary file with given contents.
2022-03-29 Matt Woodrow <mattwoodrow@apple.com>
Don't mutate children during RenderGrid::computeIntrinsicLogicalWidths unless we're about to re-layout.
https://bugs.webkit.org/show_bug.cgi?id=237732
Reviewed by Dean Jackson.
Test: fast/css-grid-layout/compute-intrinsic-logical-widths-should-not-mutate-children.html
* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild const):
(WebCore::GridTrackSizingAlgorithm::advanceNextState):
(WebCore::GridTrackSizingAlgorithm::isValidTransition const):
* rendering/GridTrackSizingAlgorithm.h:
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutBlock):
(WebCore::RenderGrid::computeIntrinsicLogicalWidths const):
* rendering/RenderGrid.h:
computeIntrinsicLogicalWidths can re-layout children (via performGridItemsPreLayout, as well as during
the track sizing algorithm), and does so using the estimated track sizes. This can be incorrect, and if
we're not about to do a full layout on this RenderGrid, it can leave the children in an invalid state.
This caches the intrinsic sizes when we do a full layout, so that we can use these values instead when
we just want to query the RenderGrid without mutating anything.
2022-03-29 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Automatically relayout the page when new fonts are installed
https://bugs.webkit.org/show_bug.cgi?id=238483
<rdar://problem/80544133>
Reviewed by Chris Dumez.
This patch simply calls setNeedsRecalcStyleInAllFrames on every Page when we receive a
kCTFontManagerRegisteredFontsChangedNotification.
FontCache::invalidateAllFontCaches() can't do this directly because it's in platform/ and
therefore isn't allowed to know what Pages are. Instead, this patch takes a process-global
callback and calls that instead. This callback is set at initialization time.
Test: fast/text/install-font-style-recalc.html
* page/Page.cpp:
(WebCore::m_attachmentElementClient):
* platform/graphics/FontCache.cpp:
(WebCore::Function<void):
(WebCore::FontCache::registerFontCacheInvalidationCallback):
(WebCore::FontCache::invalidateAllFontCaches):
* platform/graphics/FontCache.h:
2022-03-29 Alex Christensen <achristensen@webkit.org>
Navigation Timing data is corrupt in WebView (UIWebView/WKWebView)
https://bugs.webkit.org/show_bug.cgi?id=186919
<rdar://41393423>
Reviewed by Simon Fraser.
Sometimes the observed requestStart time is after the observed responseStart time.
This may be due to the device's clock changing. It may be due to something else,
but currently CFNetwork does not use a monotonic timer to gather the data.
When this happens, use the later of the two times for responseStart.
* platform/network/cocoa/NetworkLoadMetrics.mm:
(WebCore::packageTimingData):
2022-03-29 Fujii Hironori <Hironori.Fujii@sony.com>
drop-shadow filter doesn't work correctly in tiled backing layer
https://bugs.webkit.org/show_bug.cgi?id=236800
<rdar://problem/89382612>
Reviewed by Simon Fraser.
If an element with drop-shadow filter wasn't placed in the
painting rect, the drop-shadow wasn't rendered correctly. This
issue tended to be observed in tiled backing layers becuase each
tile is painted separately. But, not necessary. If an element with
drop-shadow filter was placed in the outside of view, this issue
could arise.
Tests: css3/filters/drop-shadow-in-tiled-backing.html
imported/w3c/web-platform-tests/css/filter-effects/filters-drop-shadow-003.html
* rendering/RenderLayerFilters.cpp:
(WebCore::RenderLayerFilters::beginFilterEffect): If the
drop-shadow is cast to the right direction, dirtyRect needs to be
extended to left direction to calculate targetBoundingBox.
2022-03-29 Chris Dumez <cdumez@apple.com>
Use "UTF-8"_s instead of PAL::UTF8Encoding().domName()
https://bugs.webkit.org/show_bug.cgi?id=238508
Reviewed by Geoffrey Garen.
Use "UTF-8"_s instead of PAL::UTF8Encoding().domName() as it is equivalent and more efficient.
* dom/Document.cpp:
(WebCore::Document::characterSetWithUTF8Fallback const):
(WebCore::Document::defaultCharsetForLegacyBindings const):
2022-03-29 Alan Bujtas <zalan@apple.com>
WebCore::LegacyRootInlineBox::lineSnapAdjustment should bail out on grid line height < 1
https://bugs.webkit.org/show_bug.cgi?id=238465
<rdar://80630664>
Reviewed by Antti Koivisto.
The !gridLineHeight check was added to avoid division by zero but the integral roundToInt() may also produce a 0 value for
gridLineHeight.
* rendering/LegacyRootInlineBox.cpp:
(WebCore::LegacyRootInlineBox::lineSnapAdjustment const):
2022-03-29 Eric Carlson <eric.carlson@apple.com>
[macOS] Muted video is sometimes paused when entering fullscreen
https://bugs.webkit.org/show_bug.cgi?id=238462
rdar://89104216
Reviewed by Jer Noble.
Test: media/fullscreen-when-muted.html
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::didMoveToNewDocument): Add logging.
(WebCore::HTMLMediaElement::elementIsHidden const): Consider both element fullscreen
and video fullscreen.
(WebCore::HTMLMediaElement::visibilityStateChanged): Use elementIsHidden.
(WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction const): Add
logging for the one case that didn't have it.
(WebCore::HTMLMediaElement::updateMediaPlayer): New, wrap MediaPlayer functions
that are called frequently by RenderVideo so we can only call them when necessary.
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::elementIsHidden const): Deleted.
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::visibilityChanged): Just use elementIsHidden, it
already accounts for fullscreen.
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::setVisibleInViewport): Do nothing when visibility is not changing.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setPageIsVisible): Add logging.
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::updatePlayer): Call HTMLMediaElement::updateMediaPlayer instead
of calling MediaPlayer directly.
2022-03-29 Antti Koivisto <antti@apple.com>
[CSS Container Queries] Support CSSOM
https://bugs.webkit.org/show_bug.cgi?id=238500
Reviewed by Simon Fraser.
Add CSSContainerRule interface.
https://drafts.csswg.org/css-contain-3/#the-csscontainerrule-interface
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCSSRuleCustom.cpp:
(WebCore::toJSNewlyCreated):
* css/CSSContainerRule.cpp: Added.
(WebCore::CSSContainerRule::CSSContainerRule):
(WebCore::CSSContainerRule::create):
(WebCore::CSSContainerRule::styleRuleContainer const):
(WebCore::CSSContainerRule::cssText const):
(WebCore::CSSContainerRule::conditionText const):
Implementation, the only real functionality is serialization.
* css/CSSContainerRule.h: Added.
* css/CSSContainerRule.idl: Added.
Interface.
* css/ContainerQuery.cpp:
(WebCore::CQ::serialize):
(WebCore::serialize):
Query syntax serialization support.
* css/ContainerQuery.h:
* css/ContainerQueryParser.cpp:
(WebCore::ContainerQueryParser::consumeContainerQuery):
Remember the text of unknown queries.
* css/StyleRule.cpp:
(WebCore::StyleRuleBase::createCSSOMWrapper const):
2022-03-29 Alan Bujtas <zalan@apple.com>
RenderText::width should call FontCascade directly on single space characters
https://bugs.webkit.org/show_bug.cgi?id=238484
Reviewed by Antti Koivisto.
Some "text and inline box" heavy pages (e.g. wikipedia) have the pattern of leaving one space
gap between adjacent inline boxes (<span>some content</span> <span>and some more</span>).
This patch ensures that we don't construct redundant TextRun objects (and measure their widths)
for such simple cases when applicable.
* rendering/RenderText.cpp:
(WebCore::RenderText::width const):
2022-03-29 Devin Rousso <drousso@apple.com>
Unreviewed, fix UAF after r291980
* page/FrameView.h:
(WebCore::FrameView::overrideSizeForCSSDefaultViewportUnits): Added.
(WebCore::FrameView::overrideSizeForCSSSmallViewportUnits): Added.
(WebCore::FrameView::overrideSizeForCSSLargeViewportUnits): Added.
* page/FrameView.cpp:
(WebCore::FrameView::setSizeForCSSDefaultViewportUnits):
(WebCore::FrameView::overrideWidthForCSSDefaultViewportUnits):
(WebCore::FrameView::resetOverriddenWidthForCSSDefaultViewportUnits):
(WebCore::FrameView::setOverrideSizeForCSSDefaultViewportUnits): Renamed from `overrideSizeForCSSDefaultViewportUnits`.
(WebCore::FrameView::setSizeForCSSSmallViewportUnits):
(WebCore::FrameView::overrideWidthForCSSSmallViewportUnits):
(WebCore::FrameView::resetOverriddenWidthForCSSSmallViewportUnits):
(WebCore::FrameView::setOverrideSizeForCSSSmallViewportUnits): Renamed from `overrideSizeForCSSSmallViewportUnits`.
(WebCore::FrameView::setSizeForCSSLargeViewportUnits):
(WebCore::FrameView::overrideWidthForCSSLargeViewportUnits):
(WebCore::FrameView::resetOverriddenWidthForCSSLargeViewportUnits):
(WebCore::FrameView::setOverrideSizeForCSSLargeViewportUnits): Renamed from `overrideSizeForCSSLargeViewportUnits`.
(WebCore::FrameView::copyCSSViewportSizeOverrides): Deleted.
Expose `OverrideViewportSize` so that we can copy those members specifically instead of
having to keep alive the old `FrameView` when transitioning to a new page.
2022-03-29 Patrick Angle <pangle@apple.com>
Web Inspector: [Cocoa] Indicate a request was sent through proxy/private relay in Network tab
https://bugs.webkit.org/show_bug.cgi?id=233202
Reviewed by Devin Rousso.
Add plumbing for the new `isProxyConnection` network metric.
* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::buildObjectForMetrics):
* platform/network/NetworkLoadMetrics.cpp:
(WebCore::AdditionalNetworkLoadMetricsForWebInspector::isolatedCopy):
* platform/network/NetworkLoadMetrics.h:
(WebCore::AdditionalNetworkLoadMetricsForWebInspector::encode const):
(WebCore::AdditionalNetworkLoadMetricsForWebInspector::decode):
2022-03-29 Brandon Stewart <brandonstewart@apple.com>
Need to add ISO annotations to GPUUncapturedErrorEvent
https://bugs.webkit.org/show_bug.cgi?id=238512
Reviewed by Yusuke Suzuki.
ISO annotations are required in GPUUncapturedErrorEvent for proper initialization.
* Modules/WebGPU/GPUUncapturedErrorEvent.cpp:
* Modules/WebGPU/GPUUncapturedErrorEvent.h:
(WebCore::GPUUncapturedErrorEvent::create): Deleted.
(WebCore::GPUUncapturedErrorEvent::backing): Deleted.
(WebCore::GPUUncapturedErrorEvent::backing const): Deleted.
(WebCore::GPUUncapturedErrorEvent::GPUUncapturedErrorEvent): Deleted.
2022-03-28 Simon Fraser <simon.fraser@apple.com>
[iOS GPUProcess] Image decoding should not trigger IOSurface usage in the web process
https://bugs.webkit.org/show_bug.cgi?id=238489
<rdar://88717577>
Reviewed by Per Arne Vollan.
When hardwareAcceleratedDecodingDisabled() has been called, turn off hardware acceleration
for image decoding.
* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::createImageSourceOptions):
(WebCore::ImageDecoderCG::disableHardwareAcceleratedDecoding):
(WebCore::ImageDecoderCG::hardwareAcceleratedDecodingDisabled):
* platform/graphics/cg/ImageDecoderCG.h:
2022-03-29 Brandon Stewart <brandonstewart@apple.com>
Check page exists before trying to access authenticatorCoordinator
https://bugs.webkit.org/show_bug.cgi?id=238507
Reviewed by Brent Fulgham.
Check we have a valid page before trying to access the authenticatorCoordinator.
* Modules/webauthn/PublicKeyCredential.cpp:
(WebCore::PublicKeyCredential::isUserVerifyingPlatformAuthenticatorAvailable):
2022-03-29 Wenson Hsieh <wenson_hsieh@apple.com>
HTMLAttachmentElement.getAttachmentIdentifier() should propagate attachment data to the client
https://bugs.webkit.org/show_bug.cgi?id=238473
rdar://90938796
Reviewed by Devin Rousso.
In the case where a WebKit client that has enabled the attachment element uses
`HTMLAttachmentElement.getAttachmentIdentifier` on an image element to create a new attachment-backed image, we
currently propagate an empty `_WKAttachment` to the UI delegate in the UI process, even in the case where the
image element has a visible image that has been loaded.
To support plain-text editing mode, Mail needs to be able to call `getAttachmentIdentifier` to create attachment
elements for images that already contain images with blob sources, but are inserted into the document via
JavaScript (as opposed to native editing code).
To make this work, we plumb the image element itself through the `registerAttachmentIdentifier` method that
currently only takes a single attachment identifier, and use it to send the image data, image name, and MIME
type to the attachment client if the image has a loaded image; otherwise, we fall back to creating and surfacing
an empty _WKAttachment to the client.
Test: WKAttachmentTests.CreateAttachmentsFromExistingImage
* dom/Document.cpp:
(WebCore::Document::registerAttachmentIdentifier):
* dom/Document.h:
* editing/Editor.cpp:
(WebCore::Editor::registerAttachmentIdentifier):
* editing/Editor.h:
* html/HTMLAttachmentElement.cpp:
(WebCore::HTMLAttachmentElement::getAttachmentIdentifier):
2022-03-29 Tim Nguyen <ntim@apple.com>
Use Canvas/CanvasText system colors for <dialog> default styling
https://bugs.webkit.org/show_bug.cgi?id=238425
Reviewed by Antti Koivisto.
Per HTML spec change: https://github.com/whatwg/html/commit/22154a4c1d426dddf187fb12c05fbcb8816c94a5
Main change is that the colors now adapt to dark mode by default.
Test: LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/default-color.html
* css/dialog.css:
(dialog):
2022-03-29 Youenn Fablet <youenn@apple.com>
RealtimeMediaSource::Type::Video is misleading as it is actually referring to camera sources
https://bugs.webkit.org/show_bug.cgi?id=238449
Reviewed by Eric Carlson.
Make RealtimeMediaSource::Type a boolean (audio or video) and use deviceType wherever more fine grained information is needed.
No change of behavior.
* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::getAudioTracks const):
(WebCore::MediaStream::getVideoTracks const):
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::MediaStreamTrack):
(WebCore::MediaStreamTrack::~MediaStreamTrack):
(WebCore::MediaStreamTrack::kind const):
(WebCore::MediaStreamTrack::setContentHint):
(WebCore::updateVideoCaptureAccordingMicrophoneInterruption):
(WebCore::trackTypeForMediaProducerCaptureKind):
(WebCore::MediaStreamTrack::endCapture):
(WebCore::MediaStreamTrack::trackEnded):
(WebCore::MediaStreamTrack::isCapturingAudio const):
* Modules/mediastream/MediaStreamTrack.h:
(WebCore::MediaStreamTrack::isVideo const):
(WebCore::MediaStreamTrack::isAudio const):
(WebCore::MediaStreamTrack::hasVideo const): Deleted.
(WebCore::MediaStreamTrack::hasAudio const): Deleted.
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::mediaStreamDidFail): Deleted.
* Modules/mediastream/UserMediaRequest.h:
* Modules/mediastream/gstreamer/GStreamerMediaEndpoint.cpp:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::addTrack):
(WebCore::LibWebRTCMediaEndpoint::createSourceAndRTCTrack):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::updateTracksOfKind):
* platform/mediarecorder/MediaRecorderPrivate.cpp:
(WebCore::MediaRecorderPrivate::selectTracks):
* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::hasVideo const):
(WebCore::MediaStreamPrivate::hasAudio const):
(WebCore::MediaStreamPrivate::updateActiveVideoTrack):
(WebCore::MediaStreamPrivate::monitorOrientation):
* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::type const): Deleted.
* platform/mediastream/MediaStreamTrackPrivate.h:
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::convertEnumerationToString):
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/cocoa/DisplayCaptureSourceCocoa.cpp:
(WebCore::DisplayCaptureSourceCocoa::DisplayCaptureSourceCocoa):
(WebCore::sourceTypeForDevice): Deleted.
* platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
* testing/Internals.cpp:
(WebCore::Internals::stopObservingRealtimeMediaSource):
(WebCore::Internals::observeMediaStreamTrack):
2022-03-29 Said Abou-Hallawa <said@apple.com>
REGRESSION(r291771): [ iOS ] Text sometimes draw with incorrect color
https://bugs.webkit.org/show_bug.cgi?id=238466
rdar://90941790
Reviewed by Simon Fraser.
r291771 uncovers this bug: TextBoxPainter::paintForeground() records the
glyphs to a DisplayList before settings the destination GraphicsContext.
The fix is to apply all the changes to the GraphicsContext before calling
TextPainter::setGlyphDisplayListIfNeeded().
Delete TextPainter::paint() because it is not used.
Initialize TextPainter with a reference to FontCascade.
* rendering/TextBoxPainter.cpp:
(WebCore::TextBoxPainter::paintForeground):
* rendering/TextPainter.cpp:
(WebCore::TextPainter::TextPainter):
(WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded):
(WebCore::TextPainter::paintRange):
(WebCore::TextPainter::paint): Deleted.
* rendering/TextPainter.h:
(WebCore::TextPainter::setShadowColorFilter):
(WebCore::TextPainter::setGlyphDisplayListIfNeeded):
(WebCore::TextPainter::setFont): Deleted.
2022-03-29 Zan Dobersek <zdobersek@igalia.com>
[GTK][WPE] Use GBMBufferSwapchain in GraphicsContextGLTextureMapperANGLE
https://bugs.webkit.org/show_bug.cgi?id=237883
Reviewed by Alejandro G. Castro.
Use the generic GBMBufferSwapchain for managing dmabuf-based buffer
objects in GraphicsContextGLTextureMapperANGLE. This usage is guarded
behind the USE(TEXTURE_MAPPER_DMABUF) build guards.
When that build guard is enabled, we can avoid using additional textures
but instead have to manage a GBMBufferSwapchain instance from which we
can retrieve buffers that should be acting as backing for the different
draw operations.
This buffer setup is handled in the
GraphicsContextGLTextureMapperANGLE::makeContextCurrent() method. Once
called, if there's a swapchain available (after initial or each
subsequent backing reshaping) a buffer will be retrieved from that
swapchain, a corresponding EGLImage created and associated to the GL
texture that acts as the color attachment for the default buffer. All
subsequent drawing will be done onto this buffer object, all the way
to the prepareForDisplay() method where that buffer is moved into the
display-buffer position, waiting for the display to occur.
The display of this buffer is still handled in Nicosia::GCGLANGLELayer.
In the swapBuffersIfNeeded() method, if the pending buffer is detected,
the dmabuf information is pushed into the
TextureMapperPlatformLayerProxyDMABuf instance and prepared for
presentation.
No new tests -- covered by existing tests, where the ANGLE-backed
GraphicsContextGL continues to improve the overall state of WebGL tests.
Only problem is the software-backed rasterization in the WPE/GTK testing
tooling which disables a few features and to a degree breaks WebGL
content display, but this specific issue will be resolved later.
* platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.cpp:
(Nicosia::GCGLANGLELayer::swapBuffersIfNeeded):
(Nicosia::GCGLANGLELayer::GCGLANGLELayer):
* platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.h:
* platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.cpp:
(WebCore::GraphicsContextGLANGLE::makeContextCurrent):
(WebCore::GraphicsContextGLTextureMapperANGLE::~GraphicsContextGLTextureMapperANGLE):
(WebCore::GraphicsContextGLTextureMapperANGLE::platformInitializeContext):
(WebCore::GraphicsContextGLTextureMapperANGLE::platformInitialize):
(WebCore::GraphicsContextGLTextureMapperANGLE::prepareTexture):
(WebCore::GraphicsContextGLTextureMapperANGLE::reshapeDisplayBufferBacking):
(WebCore::GraphicsContextGLTextureMapperANGLE::prepareForDisplay):
(WebCore::GraphicsContextGLTextureMapperANGLE::Swapchain::Swapchain):
(WebCore::GraphicsContextGLTextureMapperANGLE::Swapchain::~Swapchain):
(WebCore::GraphicsContextGLTextureMapperANGLE::EGLImageBacking::EGLImageBacking): Deleted.
(WebCore::GraphicsContextGLTextureMapperANGLE::EGLImageBacking::~EGLImageBacking): Deleted.
(WebCore::GraphicsContextGLTextureMapperANGLE::EGLImageBacking::format const): Deleted.
(WebCore::GraphicsContextGLTextureMapperANGLE::EGLImageBacking::stride const): Deleted.
(WebCore::GraphicsContextGLTextureMapperANGLE::EGLImageBacking::releaseResources): Deleted.
(WebCore::GraphicsContextGLTextureMapperANGLE::EGLImageBacking::isReleased): Deleted.
(WebCore::GraphicsContextGLTextureMapperANGLE::EGLImageBacking::reset): Deleted.
* platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.h:
2022-03-28 Alan Bujtas <zalan@apple.com>
[ macOS & Win ] fast/repaint/list-item-equal-style-change-no-repaint.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=215723
<rdar://problem/67520729>
Reviewed by Simon Fraser.
* animation/KeyframeEffect.h:
2022-03-28 Ada Chan <adachan@apple.com>
[WebXR][Cocoa] Enable GL_OES_EGL_image extension when makeXRCompatible() is called on GL context
https://bugs.webkit.org/show_bug.cgi?id=238477
Reviewed by Dean Jackson.
Without this extension, EGLImageTargetTexture2DOES() will fail
in GraphicsContextGLCocoa::attachIOSurfaceToSharedTexture().
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::makeXRCompatible):
2022-03-28 Lauro Moura <lmoura@igalia.com>
Unreviewed, non-unified buildfix after 248938@main
https://bugs.webkit.org/show_bug.cgi?id=238478
* workers/service/server/SWServerToContextConnection.h:
2022-03-28 Nikolaos Mouchtaris <nmouchtaris@apple.com>
Clamp degenerate calc() values for <angle>
https://bugs.webkit.org/show_bug.cgi?id=238401
Reviewed by Simon Fraser.
Clamp nan, infinity and -infinity to zero for <angle>. Issue discussing this:
https://github.com/w3c/csswg-drafts/issues/6105.
* css/calc/CSSCalcValue.cpp:
(WebCore::CSSCalcValue::clampToPermittedRange const):
2022-03-28 Rob Buis <rbuis@igalia.com>
Check for re-entrancy in stopForBackForwardCache
https://bugs.webkit.org/show_bug.cgi?id=223536
Reviewed by Darin Adler.
Check for re-entrancy in stopForBackForwardCache.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::stopForBackForwardCache):
2022-03-28 Cameron McCormack <heycam@apple.com>
Remove the 1ms minimum for setTimeout
https://bugs.webkit.org/show_bug.cgi?id=221124
<rdar://problem/73852354>
Reviewed by Sam Weinig.
This patch removes the 1ms minimum for setTimeout. The HTML spec makes
no mention of such a minimum, and Firefox and Chrome do not enforce
this minimum. Removing this for setTimeout results in a 0.7-2.1%
improvement on Speedometer, depending on platform and hardware.
The WPT added here demonstrates how this change can affect pages: if a
page schedules a 1ms and then a 0ms timeout in the same turn of the
event loop, then with this patch they will now be fired in the reverse
order. Since Firefox and Chrome do not impose a 1ms minimum, this
reduces the risk of this being a compatbility problem.
Scheduling a 0ms timeout will cause its callback to be called the next
time around the event loop. Other, non-timer queued tasks, will be
pre-empted. This behavior is permitted by the HTML spec, since the
event loop processing model[1] states that the implementation can
choose which task source to service, and timer callbacks are
dispatched using their own task source. Due to the way the SharedTimer
is called, we don't need to literally dispatch a task with a new
TaskSource::Timer source. (If we decided later to make a different
about whether to service timer callbacks before tasks from all other
task sources, we might need to.)
Not addressing the setTimeout 1ms minimum here, which should likely also
be removed.
While we're here, settle on "one shot" rather rather than "single
shot" as the term for timers that fire once.
[1] https://html.spec.whatwg.org/#event-loop-processing-model
Tests: imported/w3c/web-platform-tests/html/webappapis/timers/zero-settimeout.any.html
imported/w3c/web-platform-tests/html/webappapis/timers/zero-settimeout.any.worker.html
* page/DOMTimer.h:
* page/DOMTimer.cpp:
(WebCore::DOMTimer::DOMTimer):
(WebCore::DOMTimer::install):
(WebCore::DOMTimer::fired):
(WebCore::DOMTimer::updateTimerIntervalIfNecessary):
(WebCore::DOMTimer::intervalClampedToMinimum const):
2022-03-28 Chris Dumez <cdumez@apple.com>
Prepare WebCore for making the String(const char*) constructor explicit
https://bugs.webkit.org/show_bug.cgi?id=238408
Reviewed by Geoff Garen.
Prepare WebCore for making the String(const char*) constructor explicit.
Making this constructor explicit helps findings cases where a String is constructed
from a literal without the ""_s suffix.
* Scripts/SettingsTemplates/Settings.cpp.erb:
* contentextensions/ContentExtensionError.cpp:
* contentextensions/ContentExtensionError.h:
* css/MediaQueryEvaluator.cpp:
(WebCore::MediaQueryEvaluator::mediaAttributeMatches):
* dom/BroadcastChannel.cpp:
(WebCore::BroadcastChannel::postMessage):
* dom/DataTransfer.cpp:
(WebCore::normalizeType):
(WebCore::IEOpFromDragOp):
* dom/Document.cpp:
(WebCore::Document::compatMode const):
(WebCore::Document::characterSetWithUTF8Fallback const):
(WebCore::Document::processMetaHttpEquiv):
(WebCore::Document::setDomain):
(WebCore::Document::execCommand):
(WebCore::Document::queryCommandEnabled):
(WebCore::Document::queryCommandIndeterm):
(WebCore::Document::queryCommandState):
(WebCore::Document::queryCommandSupported):
(WebCore::Document::queryCommandValue):
(WebCore::Document::updateResizeObservations):
* dom/Element.cpp:
(WebCore::Element::setOuterHTML):
(WebCore::Element::animate):
* dom/ImageOverlay.cpp:
(WebCore::ImageOverlay::updateWithTextRecognitionResult):
* dom/Node.cpp:
(WebCore::Node::showTreeForThisAcrossFrame const):
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::checkStyleSheet):
* dom/ViewportArguments.cpp:
(WebCore::viewportErrorMessageTemplate):
(WebCore::viewportErrorMessage):
* editing/Editor.cpp:
(WebCore::Editor::toggleBold):
(WebCore::Editor::toggleUnderline):
(WebCore::Editor::setBaseWritingDirection):
* editing/EditorCommand.cpp:
(WebCore::isStylePresent):
(WebCore::executeToggleStyle):
(WebCore::stateStyle):
(WebCore::textDecorationChangeForToggling):
* editing/InsertLineBreakCommand.cpp:
(WebCore::InsertLineBreakCommand::doApply):
* editing/InsertTextCommand.cpp:
(WebCore::InsertTextCommand::insertTab):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
(WebCore::ReplaceSelectionCommand::addSpacesForSmartReplace):
* editing/TextManipulationController.cpp:
(WebCore::TextManipulationController::observeParagraphs):
* editing/TypingCommand.cpp:
(WebCore::TypingCommand::insertLineBreakAndNotifyAccessibility):
(WebCore::TypingCommand::insertParagraphSeparatorAndNotifyAccessibility):
(WebCore::TypingCommand::insertParagraphSeparatorInQuotedContentAndNotifyAccessibility):
* editing/markup.cpp:
(WebCore::createPageForSanitizingWebContent):
* fileapi/BlobURL.cpp:
(WebCore::BlobURL::createInternalURL):
* fileapi/FileReaderLoader.cpp:
(WebCore::FileReaderLoader::start):
(WebCore::FileReaderLoader::convertToText):
(WebCore::FileReaderLoader::convertToDataURL):
* history/BackForwardCache.cpp:
(WebCore::BackForwardCache::BackForwardCache):
* html/EmailInputType.cpp:
* html/EnterKeyHint.cpp:
(WebCore::attributeValueForEnterKeyHint):
* html/FTPDirectoryDocument.cpp:
(WebCore::FTPDirectoryDocumentParser::createBasicDocument):
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::handleClick):
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::parseAttribute):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
(WebCore::HTMLImageElement::evaluateDynamicMediaQueryDependencies):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::showPicker):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::play):
(WebCore::HTMLMediaElement::selectNextSourceChild):
(WebCore::HTMLMediaElement::updateSleepDisabling):
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::parametersForPlugin):
* html/ImageBitmap.cpp:
(WebCore::ImageBitmap::createPromise):
(WebCore::croppedSourceRectangleWithFormatting):
(WebCore::ImageBitmap::createFromBuffer):
* html/ImageDocument.cpp:
(WebCore::ImageDocument::createDocumentStructure):
* html/MediaFragmentURIParser.cpp:
(WebCore::MediaFragmentURIParser::parseFragments):
* html/PDFDocument.cpp:
(WebCore::PDFDocument::sendPDFArrayBuffer):
* html/canvas/ANGLEInstancedArrays.cpp:
(WebCore::ANGLEInstancedArrays::ANGLEInstancedArrays):
(WebCore::ANGLEInstancedArrays::supported):
* html/canvas/EXTTextureCompressionRGTC.cpp:
(WebCore::EXTTextureCompressionRGTC::EXTTextureCompressionRGTC):
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::initializeShaderExtensions):
* html/canvas/WebGLCompressedTextureATC.cpp:
(WebCore::WebGLCompressedTextureATC::WebGLCompressedTextureATC):
(WebCore::WebGLCompressedTextureATC::supported):
* html/canvas/WebGLCompressedTextureETC.cpp:
(WebCore::WebGLCompressedTextureETC::WebGLCompressedTextureETC):
(WebCore::WebGLCompressedTextureETC::supported):
* html/canvas/WebGLCompressedTextureETC1.cpp:
(WebCore::WebGLCompressedTextureETC1::WebGLCompressedTextureETC1):
(WebCore::WebGLCompressedTextureETC1::supported):
* html/canvas/WebGLCompressedTexturePVRTC.cpp:
(WebCore::WebGLCompressedTexturePVRTC::WebGLCompressedTexturePVRTC):
(WebCore::WebGLCompressedTexturePVRTC::supported):
* html/canvas/WebGLCompressedTextureS3TC.cpp:
(WebCore::WebGLCompressedTextureS3TC::WebGLCompressedTextureS3TC):
(WebCore::WebGLCompressedTextureS3TC::supported):
* html/canvas/WebGLCompressedTextureS3TCsRGB.cpp:
(WebCore::WebGLCompressedTextureS3TCsRGB::WebGLCompressedTextureS3TCsRGB):
(WebCore::WebGLCompressedTextureS3TCsRGB::supported):
* html/canvas/WebGLDebugShaders.cpp:
(WebCore::WebGLDebugShaders::WebGLDebugShaders):
* html/canvas/WebGLDepthTexture.cpp:
(WebCore::WebGLDepthTexture::WebGLDepthTexture):
(WebCore::WebGLDepthTexture::supported):
* html/canvas/WebGLDrawBuffers.cpp:
(WebCore::WebGLDrawBuffers::WebGLDrawBuffers):
(WebCore::WebGLDrawBuffers::supported):
(WebCore::WebGLDrawBuffers::satisfiesWebGLRequirements):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create):
(WebCore::WebGLRenderingContextBase::setupFlags):
(WebCore::WebGLRenderingContextBase::getActiveUniform):
(WebCore::WebGLRenderingContextBase::addExtensionSupportedFormatsAndTypes):
(WebCore::WebGLRenderingContextBase::loseContextImpl):
(WebCore::WebGLRenderingContextBase::printToConsole):
(WebCore::WebGLRenderingContextBase::maybeRestoreContext):
(WebCore::WebGLRenderingContextBase::recycleContext):
* html/parser/CSSPreloadScanner.cpp:
(WebCore::CSSPreloadScanner::emitRule):
* html/parser/HTMLParserIdioms.cpp:
(WebCore::serializeForNumberType):
* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::initiatorFor):
(WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
* html/parser/HTMLPreloadScanner.h:
* html/parser/HTMLResourcePreloader.h:
(WebCore::PreloadRequest::PreloadRequest):
* html/track/TextTrackCue.cpp:
(WebCore::TextTrackCue::create):
* html/track/TextTrackCueGeneric.cpp:
(WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
* html/track/VTTCue.cpp:
(WebCore::VTTCueBox::applyCSSProperties):
* html/track/WebVTTParser.cpp:
(WebCore::WebVTTParser::WebVTTParser):
(WebCore::WebVTTTreeBuilder::constructTreeFromToken):
* inspector/InspectorAuditAccessibilityObject.cpp:
(WebCore::InspectorAuditAccessibilityObject::getComputedProperties):
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::indexForData):
(WebCore::InspectorCanvas::buildArrayForCanvasPattern):
* inspector/InspectorFrontendClientLocal.cpp:
* inspector/InspectorFrontendHost.cpp:
* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::setGridOverlayForNode):
(WebCore::InspectorOverlay::clearGridOverlayForNode):
(WebCore::InspectorOverlay::setFlexOverlayForNode):
(WebCore::InspectorOverlay::clearFlexOverlayForNode):
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyle::buildObjectForStyle const):
(WebCore::InspectorStyle::styleWithProperties const):
(WebCore::selectorsFromSource):
* inspector/agents/InspectorAnimationAgent.cpp:
(WebCore::InspectorAnimationAgent::resolveAnimation):
* inspector/agents/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::getFontDataForNode):
(WebCore::InspectorCSSAgent::getStyleSheet):
(WebCore::InspectorCSSAgent::setRuleSelector):
(WebCore::InspectorCSSAgent::addRule):
* inspector/agents/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::resolveContext):
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::getSupportedEventNames):
(WebCore::InspectorDOMAgent::showGridOverlay):
(WebCore::InspectorDOMAgent::showFlexOverlay):
* inspector/agents/InspectorDOMDebuggerAgent.cpp:
(WebCore::InspectorDOMDebuggerAgent::setEventBreakpoint):
(WebCore::InspectorDOMDebuggerAgent::removeEventBreakpoint):
(WebCore::InspectorDOMDebuggerAgent::breakOnURLIfNeeded):
* inspector/agents/InspectorDOMStorageAgent.cpp:
(WebCore::InspectorDOMStorageAgent::findStorageArea):
* inspector/agents/InspectorDatabaseAgent.cpp:
(WebCore::InspectorDatabaseAgent::executeSQL):
* inspector/agents/InspectorIndexedDBAgent.cpp:
(WebCore::Inspector::ExecutableWithDatabase::start):
* inspector/agents/InspectorLayerTreeAgent.cpp:
(WebCore::InspectorLayerTreeAgent::buildObjectForLayer):
* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::resolveWebSocket):
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::parseCookieObject):
* inspector/agents/page/PageDOMDebuggerAgent.cpp:
(WebCore::PageDOMDebuggerAgent::setDOMBreakpoint):
(WebCore::PageDOMDebuggerAgent::removeDOMBreakpoint):
(WebCore::PageDOMDebuggerAgent::willInsertDOMNode):
(WebCore::PageDOMDebuggerAgent::willRemoveDOMNode):
(WebCore::PageDOMDebuggerAgent::buildPauseDataForDOMBreakpoint):
* layout/Verification.cpp:
(WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
* layout/integration/LayoutIntegrationCoverage.cpp:
(WebCore::LayoutIntegration::canUseForLineLayoutWithReason):
* loader/ContentFilter.h:
(WebCore::ContentFilter::urlScheme):
* loader/CrossOriginAccessControl.cpp:
(WebCore::createAccessControlPreflightRequest):
* loader/CrossOriginPreflightResultCache.cpp:
(WebCore::CrossOriginPreflightResultCacheItem::allowsCrossOriginMethod const):
(WebCore::CrossOriginPreflightResultCacheItem::validateCrossOriginHeaders const):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::maybeLoadEmpty):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
(WebCore::DocumentThreadableLoader::checkURLSchemeAsCORSEnabled):
(WebCore::DocumentThreadableLoader::cancel):
(WebCore::DocumentThreadableLoader::loadRequest):
* loader/FormSubmission.cpp:
(WebCore::FormSubmission::create):
(WebCore::FormSubmission::populateFrameLoadRequest):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::updateRequestAndAddExtraFields):
(WebCore::FrameLoader::loadPostRequest):
(WebCore::FrameLoader::loadDifferentDocumentItem):
* loader/ImageLoader.cpp:
(WebCore::rejectPromises):
(WebCore::ImageLoader::rejectDecodePromises):
(WebCore::ImageLoader::notifyFinished):
(WebCore::ImageLoader::decode):
* loader/ImageLoader.h:
* loader/MixedContentChecker.cpp:
(WebCore::logWarning):
(WebCore::MixedContentChecker::canDisplayInsecureContent):
(WebCore::MixedContentChecker::canRunInsecureContent):
* loader/PingLoader.cpp:
(WebCore::PingLoader::sendPing):
* loader/ResourceLoadStatistics.cpp:
(WebCore::encodeFontHashSet):
(WebCore::encodeCanvasActivityRecord):
(WebCore::ResourceLoadStatistics::encode const):
(WebCore::decodeHashCountedSet):
(WebCore::decodeFontHashSet):
(WebCore::decodeCanvasActivityRecord):
(WebCore::ResourceLoadStatistics::decode):
(WebCore::ResourceLoadStatistics::toString const):
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::start):
(WebCore::ResourceLoader::loadDataURL):
* loader/ServerTimingParser.cpp:
(WebCore::ServerTimingParser::parseServerTiming):
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didReceiveResponse):
* loader/TextResourceDecoder.cpp:
(WebCore::TextResourceDecoder::textFromUTF8):
* loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::create):
(WebCore::LegacyWebArchive::createFromSelection):
* loader/cache/CachedApplicationManifest.cpp:
(WebCore::CachedApplicationManifest::CachedApplicationManifest):
(WebCore::CachedApplicationManifest::encoding const):
* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet):
(WebCore::CachedCSSStyleSheet::didAddClient):
(WebCore::CachedCSSStyleSheet::encoding const):
(WebCore::CachedCSSStyleSheet::checkNotify):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::load):
* loader/cache/CachedSVGDocument.cpp:
(WebCore::CachedSVGDocument::CachedSVGDocument):
(WebCore::CachedSVGDocument::encoding const):
* loader/cache/CachedSVGFont.cpp:
(WebCore::CachedSVGFont::ensureCustomFontData):
* loader/cache/CachedScript.cpp:
(WebCore::CachedScript::encoding const):
* loader/cache/CachedXSLStyleSheet.cpp:
(WebCore::CachedXSLStyleSheet::CachedXSLStyleSheet):
(WebCore::CachedXSLStyleSheet::encoding const):
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::MemoryCache):
(WebCore::MemoryCache::originsWithCache const):
* mathml/MathMLElement.cpp:
(WebCore::convertMathSizeIfNeeded):
* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::CaptionUserPreferencesMediaAF::captionsTextEdgeCSS const):
* page/Chrome.cpp:
(WebCore::Chrome::print):
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::contextMenuItemSelected):
(WebCore::ContextMenuController::checkOrEnableIfNeeded const):
* page/DOMSelection.cpp:
(WebCore::DOMSelection::extend):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::print):
(WebCore::DOMWindow::alert):
(WebCore::DOMWindow::confirmForBindings):
(WebCore::DOMWindow::prompt):
(WebCore::DOMWindow::showModalDialog):
* page/EventHandler.cpp:
(WebCore::handleKeyboardSelectionMovement):
* page/EventSource.cpp:
(WebCore::EventSource::connect):
* page/Frame.cpp:
(WebCore::createRegExpForLabels):
(WebCore::matchLabelsAgainstString):
* page/FrameView.cpp:
(WebCore::FrameView::adjustMediaTypeForPrinting):
* page/IntersectionObserver.cpp:
(WebCore::parseRootMargin):
(WebCore::IntersectionObserver::create):
* page/LoggedInStatus.cpp:
(WebCore::LoggedInStatus::create):
* page/NavigatorBase.cpp:
* page/Page.cpp:
(WebCore::Page::userStyleSheet const):
* page/Quirks.cpp:
(WebCore::Quirks::triggerOptionalStorageAccessQuirk const):
* page/WindowFeatures.cpp:
(WebCore::parseDialogFeatures):
(WebCore::boolFeature):
(WebCore::floatFeature):
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::consoleMessageForViolation):
(WebCore::ContentSecurityPolicy::allowEval const):
(WebCore::ContentSecurityPolicy::reportInvalidPluginTypes const):
* page/csp/ContentSecurityPolicyDirectiveList.cpp:
(WebCore::ContentSecurityPolicyDirectiveList::shouldReportSample const):
* page/csp/ContentSecurityPolicyDirectiveNames.cpp:
* page/csp/ContentSecurityPolicyDirectiveNames.h:
* platform/LegacySchemeRegistry.cpp:
(WebCore::allBuiltinSchemes):
* platform/LocalizedStrings.cpp:
(WebCore::AXMenuListPopupActionVerb):
(WebCore::AXMenuListActionVerb):
(WebCore::AXListItemActionVerb):
* platform/SleepDisabler.cpp:
(WebCore::SleepDisabler::SleepDisabler):
* platform/SleepDisabler.h:
* platform/audio/HRTFDatabase.cpp:
(WebCore::HRTFDatabase::HRTFDatabase):
* platform/encryptedmedia/CDMPrivate.cpp:
(WebCore::CDMPrivate::getSupportedCapabilitiesForAudioVideoType):
* platform/encryptedmedia/clearkey/CDMClearKey.cpp:
(WebCore::parseLicenseFormat):
(WebCore::parseLicenseReleaseAcknowledgementFormat):
(WebCore::extractKeyidsFromCencInitData):
(WebCore::extractKeyIdFromWebMInitData):
(WebCore::CDMInstanceSessionClearKey::removeSessionData):
* platform/graphics/Font.cpp:
(WebCore::Font::description const):
* platform/graphics/GraphicsTypes.cpp:
* platform/graphics/InbandGenericCue.cpp:
(WebCore::InbandGenericCue::toJSONString const):
* platform/graphics/MediaPlayer.cpp:
* platform/graphics/avfoundation/FormatDescriptionUtilities.cpp:
(WebCore::codecFromFormatDescription):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::updateAnimations):
* platform/graphics/cg/PDFDocumentImage.cpp:
(WebCore::PDFDocumentImage::filenameExtension const):
* platform/graphics/cocoa/VP9UtilitiesCocoa.mm:
(WebCore::createVideoInfoFromVP9HeaderParser):
(WebCore::createVideoInfoFromVP8Header):
* platform/graphics/cocoa/VideoTrackPrivateWebM.cpp:
(WebCore::VideoTrackPrivateWebM::codec const):
* platform/graphics/filters/FEBlend.cpp:
(WebCore::FEBlend::externalRepresentation const):
* platform/graphics/opengl/GraphicsContextGLOpenGL.cpp:
(WebCore::GraphicsContextGLOpenGL::validateDepthStencil):
* platform/ios/QuickLook.h:
* platform/ios/QuickLook.mm:
* platform/mediastream/RealtimeMediaSourceCenter.cpp:
(WebCore::RealtimeMediaSourceCenter::hashStringWithSalt):
* platform/mock/RTCNotifiersMock.cpp:
(WebCore::RemoteDataChannelNotifier::fire):
* platform/mock/ScrollbarsControllerMock.cpp:
(WebCore::ScrollbarsControllerMock::mouseEnteredContentArea):
(WebCore::ScrollbarsControllerMock::mouseMovedInContentArea):
(WebCore::ScrollbarsControllerMock::mouseExitedContentArea):
* platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
(WebCore::mimeTypeCache):
* platform/network/BlobResourceHandle.cpp:
(WebCore::BlobResourceHandle::loadResourceSynchronously):
(WebCore::BlobResourceHandle::notifyResponseOnError):
* platform/network/DataURLDecoder.cpp:
(WebCore::DataURLDecoder::DecodeTask::process):
* platform/network/HTTPParsers.cpp:
(WebCore::parseStructuredFieldValue):
(WebCore::parseHTTPHeader):
* platform/network/NetworkStorageSession.cpp:
(WebCore::NetworkStorageSession::storageAccessQuirks):
* platform/network/ParsedContentType.cpp:
(WebCore::ParsedContentType::charset const):
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::filter):
* platform/network/cf/DNSResolveQueueCFNet.cpp:
(WebCore::DNSResolveQueueCFNet::updateIsUsingProxy):
* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
(WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
(WebCore::SocketStreamHandleImpl::addCONNECTCredentials):
(WebCore::SocketStreamHandleImpl::readStreamCallback):
* platform/sql/SQLiteDatabase.cpp:
(WebCore::SQLiteDatabase::authorizerFunction):
* rendering/RenderAttachment.h:
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::renderName const):
* rendering/RenderBlock.h:
* rendering/RenderButton.h:
* rendering/RenderCombineText.h:
* rendering/RenderCounter.cpp:
(WebCore::RenderCounter::renderName const):
* rendering/RenderCounter.h:
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::renderName const):
* rendering/RenderDeprecatedFlexibleBox.h:
* rendering/RenderDetailsMarker.h:
* rendering/RenderEmbeddedObject.h:
* rendering/RenderFileUploadControl.h:
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::renderName const):
* rendering/RenderFlexibleBox.h:
* rendering/RenderFragmentContainer.h:
* rendering/RenderFragmentContainerSet.h:
* rendering/RenderFragmentedFlow.h:
* rendering/RenderFrame.h:
* rendering/RenderFrameSet.h:
* rendering/RenderFullScreen.h:
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::renderName const):
* rendering/RenderGrid.h:
* rendering/RenderHTMLCanvas.h:
* rendering/RenderIFrame.h:
* rendering/RenderImage.h:
* rendering/RenderInline.cpp:
(WebCore::RenderInline::renderName const):
* rendering/RenderInline.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
(WebCore::RenderLayerBacking::ensureClippingStackLayers):
(WebCore::RenderLayerBacking::updateDescendantClippingLayer):
(WebCore::RenderLayerBacking::updateOverflowControlsLayers):
(WebCore::RenderLayerBacking::updateMaskingLayer):
(WebCore::RenderLayerBacking::updateChildClippingStrategy):
(WebCore::RenderLayerBacking::updateScrollingLayers):
* rendering/RenderLineBreak.h:
* rendering/RenderListBox.h:
* rendering/RenderListItem.h:
* rendering/RenderListMarker.h:
* rendering/RenderMedia.h:
* rendering/RenderMenuList.h:
* rendering/RenderMeter.h:
* rendering/RenderModel.h:
* rendering/RenderMultiColumnFlow.cpp:
(WebCore::RenderMultiColumnFlow::renderName const):
* rendering/RenderMultiColumnFlow.h:
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::renderName const):
* rendering/RenderMultiColumnSet.h:
* rendering/RenderMultiColumnSpannerPlaceholder.cpp:
(WebCore::RenderMultiColumnSpannerPlaceholder::renderName const):
* rendering/RenderMultiColumnSpannerPlaceholder.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::outputRenderObject const):
* rendering/RenderObject.h:
* rendering/RenderProgress.h:
* rendering/RenderQuote.h:
* rendering/RenderReplaced.h:
* rendering/RenderReplica.h:
* rendering/RenderRuby.h:
* rendering/RenderRubyBase.h:
* rendering/RenderRubyRun.h:
* rendering/RenderRubyText.h:
* rendering/RenderScrollbarPart.h:
* rendering/RenderSlider.h:
* rendering/RenderTable.h:
* rendering/RenderTableCell.h:
* rendering/RenderTableCol.h:
* rendering/RenderTableRow.h:
* rendering/RenderTableSection.h:
* rendering/RenderText.cpp:
(WebCore::RenderText::renderName const):
* rendering/RenderText.h:
* rendering/RenderTextControl.h:
* rendering/RenderTreeAsText.cpp:
(WebCore::getTagName):
(WebCore::RenderTreeAsText::writeRenderObject):
* rendering/RenderVideo.h:
* rendering/RenderView.h:
* rendering/mathml/RenderMathMLBlock.h:
* rendering/mathml/RenderMathMLFenced.h:
* rendering/mathml/RenderMathMLFraction.h:
* rendering/mathml/RenderMathMLMath.h:
* rendering/mathml/RenderMathMLMenclose.h:
* rendering/mathml/RenderMathMLOperator.h:
* rendering/mathml/RenderMathMLPadded.h:
* rendering/mathml/RenderMathMLRoot.h:
* rendering/mathml/RenderMathMLRow.h:
* rendering/mathml/RenderMathMLScripts.h:
* rendering/mathml/RenderMathMLSpace.h:
* rendering/mathml/RenderMathMLToken.h:
* rendering/mathml/RenderMathMLUnderOver.h:
* rendering/shapes/ShapeOutsideInfo.cpp:
(WebCore::checkShapeImageOrigin):
* rendering/style/GridPositionsResolver.cpp:
(WebCore::adjustGridPositionsFromStyle):
* rendering/svg/LegacyRenderSVGContainer.h:
* rendering/svg/LegacyRenderSVGRect.h:
* rendering/svg/LegacyRenderSVGRoot.h:
* rendering/svg/LegacyRenderSVGShape.h:
* rendering/svg/RenderSVGContainer.h:
* rendering/svg/RenderSVGEllipse.h:
* rendering/svg/RenderSVGForeignObject.h:
* rendering/svg/RenderSVGGradientStop.h:
* rendering/svg/RenderSVGHiddenContainer.h:
* rendering/svg/RenderSVGImage.h:
* rendering/svg/RenderSVGInline.h:
* rendering/svg/RenderSVGInlineText.h:
* rendering/svg/RenderSVGPath.h:
* rendering/svg/RenderSVGRect.h:
* rendering/svg/RenderSVGResourceClipper.h:
* rendering/svg/RenderSVGResourceFilter.h:
* rendering/svg/RenderSVGResourceFilterPrimitive.h:
* rendering/svg/RenderSVGResourceLinearGradient.h:
* rendering/svg/RenderSVGResourceMarker.h:
* rendering/svg/RenderSVGResourceMasker.h:
* rendering/svg/RenderSVGResourcePattern.h:
* rendering/svg/RenderSVGResourceRadialGradient.h:
* rendering/svg/RenderSVGRoot.h:
* rendering/svg/RenderSVGShape.h:
* rendering/svg/RenderSVGTSpan.h:
* rendering/svg/RenderSVGText.h:
* rendering/svg/RenderSVGTextPath.h:
* rendering/svg/RenderSVGViewportContainer.h:
* rendering/svg/SVGContainerLayout.cpp:
(WebCore::SVGContainerLayout::verifyLayoutLocationConsistency):
* rendering/svg/SVGRenderTreeAsText.cpp:
(WebCore::TextStreamSeparator::TextStreamSeparator):
(WebCore::writeSVGFillPaintingResource):
(WebCore::writeSVGStrokePaintingResource):
(WebCore::writeStandardPrefix):
* svg/LinearGradientAttributes.h:
(WebCore::LinearGradientAttributes::LinearGradientAttributes):
* svg/RadialGradientAttributes.h:
(WebCore::RadialGradientAttributes::RadialGradientAttributes):
* svg/SVGFitToViewBox.cpp:
(WebCore::SVGFitToViewBox::parseViewBoxGeneric):
* svg/SVGGeometryElement.cpp:
(WebCore::SVGGeometryElement::parseAttribute):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::dataChanged):
* testing/Internals.cpp:
(WebCore::styleValidityToToString):
(WebCore::responseSourceToString):
(WebCore::Internals::openDummyInspectorFrontend):
(WebCore::Internals::elementBufferingPolicy):
(WebCore::Internals::createSleepDisabler):
(WebCore::Internals::loadArtworkImage):
* testing/InternalsMapLike.cpp:
(WebCore::InternalsMapLike::InternalsMapLike):
* testing/MockMediaSessionCoordinator.cpp:
(WebCore::MockMediaSessionCoordinator::positionStateChanged):
(WebCore::MockMediaSessionCoordinator::readyStateChanged):
(WebCore::MockMediaSessionCoordinator::playbackStateChanged):
(WebCore::MockMediaSessionCoordinator::trackIdentifierChanged):
* testing/MockMediaSessionCoordinator.h:
* testing/MockPageOverlayClient.cpp:
(WebCore::MockPageOverlayClient::layerTreeAsText):
* testing/MockPaymentCoordinator.cpp:
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::notifyError):
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::addRegistration):
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::RegistrationDatabase::ensureValidRecordsTable):
(WebCore::updateViaCacheToString):
(WebCore::workerTypeToString):
(WebCore::RegistrationDatabase::doPushChanges):
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::scheduleJob):
* workers/shared/SharedWorker.cpp:
(WebCore::SharedWorker::create):
* worklets/PaintWorkletGlobalScope.cpp:
(WebCore::PaintWorkletGlobalScope::registerPaint):
* worklets/WorkletGlobalScope.cpp:
(WebCore::WorkletGlobalScope::userAgent const):
* xml/XMLErrors.cpp:
(WebCore::XMLErrors::handleError):
(WebCore::XMLErrors::appendErrorMessage):
* xml/XMLErrors.h:
* xml/XMLHttpRequest.cpp:
(WebCore::replaceCharsetInMediaTypeIfNeeded):
(WebCore::XMLHttpRequest::setTimeout):
(WebCore::XMLHttpRequest::setResponseType):
(WebCore::XMLHttpRequest::open):
(WebCore::XMLHttpRequest::createDecoder const):
* xml/XPathParser.cpp:
(WebCore::XPath::Parser::nextTokenInternal):
* xml/XSLTProcessor.cpp:
(WebCore::XSLTProcessor::transformToFragment):
* xml/XSLTProcessorLibxslt.cpp:
(WebCore::XSLTProcessor::parseErrorFunc):
(WebCore::docLoaderFunc):
(WebCore::resultMIMEType):
(WebCore::XSLTProcessor::transformToString):
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::createLeafTextNode):
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::openFunc):
2022-03-28 Ziran Sun <zsun@igalia.com>
[selection] Fire Select event when selection extent or direction changes
https://bugs.webkit.org/show_bug.cgi?id=238142
Reviewed by Chris Dumez.
As per step 6 at [1], if either extent or direction of the text control to be modified,
we need to queue an element task on the user interaction task source given the element
to fire an select event with the bubbles attribute initialized to true.
[1] https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#set-the-selection-range
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::setSelectionRange):
(WebCore::HTMLTextFormControlElement::cacheSelection):
(WebCore::HTMLTextFormControlElement::restoreCachedSelection):
(WebCore::HTMLTextFormControlElement::scheduleSelectEvent):
* html/HTMLTextFormControlElement.h:
(WebCore::HTMLTextFormControlElement::cacheSelection): Deleted.
2022-03-28 Kimmo Kinnunen <kkinnunen@apple.com>
Accessing WebGL content crashes in macOS Recovery OS, workaround 2
https://bugs.webkit.org/show_bug.cgi?id=238448
Reviewed by Dean Jackson.
Add a two new quick workarounds to try fix a recovery OS crash when
WebKit tries to use ANGLE that is not present in the OS image.
Compare explicitly against NULL as instructed in weak linking documentation.
Check for the EGL_GetPlatformDisplayEXT, this is nullptr in the
recovery OS.
Remove the previous workaround. The environment variable is
not available in WP or GPUP. The Metal symbol is not the problem.
* platform/graphics/cocoa/GraphicsContextGLCocoa.mm:
(WebCore::platformSupportsMetal):
(WebCore::initializeEGLDisplay):
2022-03-28 Chris Dumez <cdumez@apple.com>
Speed up Element::removedFromAncestor()
https://bugs.webkit.org/show_bug.cgi?id=238404
Reviewed by Geoffrey Garen.
Speed up Element::removedFromAncestor() by inlining some of the functions it is calling.
This is a confirmed 1.5-2% progression on Speedometer on iMac 20,1.
* dom/Element.cpp:
(WebCore::Element::removedFromAncestor):
(WebCore::Element::clearBeforePseudoElementSlow):
(WebCore::Element::clearAfterPseudoElementSlow):
(WebCore::Element::setSavedLayerScrollPositionSlow):
(WebCore::Element::clearBeforePseudoElement): Deleted.
(WebCore::Element::clearAfterPseudoElement): Deleted.
(WebCore::Element::setSavedLayerScrollPosition): Deleted.
* dom/Element.h:
(WebCore::Element::setSavedLayerScrollPosition):
(WebCore::Element::clearBeforePseudoElement):
(WebCore::Element::clearAfterPseudoElement):
* page/PointerCaptureController.cpp:
(WebCore::PointerCaptureController::elementWasRemovedSlow):
(WebCore::PointerCaptureController::elementWasRemoved): Deleted.
* page/PointerCaptureController.h:
(WebCore::PointerCaptureController::elementWasRemoved):
* page/PointerLockController.cpp:
(WebCore::PointerLockController::elementWasRemovedInternal):
(WebCore::PointerLockController::elementWasRemoved): Deleted.
* page/PointerLockController.h:
(WebCore::PointerLockController::elementWasRemoved):
2022-03-28 Devin Rousso <drousso@apple.com>
[iOS] Add `WKWebView` API to control CSS "small viewport" `sv*` and "large viewport" `lv*` units
https://bugs.webkit.org/show_bug.cgi?id=237979
<rdar://problem/89434696>
Reviewed by Tim Horton.
Tests: CSSViewportUnits.NegativeMinimumViewportInset
CSSViewportUnits.NegativeMaximumViewportInset
CSSViewportUnits.MinimumViewportInsetLargerThanMaximumViewportInset
CSSViewportUnits.MinimumViewportInsetLargerThanFrame
CSSViewportUnits.MaximumViewportInsetLargerThanFrame
CSSViewportUnits.MinimumViewportInset
CSSViewportUnits.MaximumViewportInset
CSSViewportUnits.MinimumViewportInsetWithZoom
CSSViewportUnits.MaximumViewportInsetWithZoom
CSSViewportUnits.MinimumViewportInsetWithWritingMode
CSSViewportUnits.MaximumViewportInsetWithWritingMode
CSSViewportUnits.MinimumViewportInsetWithFrame
CSSViewportUnits.MaximumViewportInsetWithFrame
CSSViewportUnits.MinimumViewportInsetWithBounds
CSSViewportUnits.MaximumViewportInsetWithBounds
CSSViewportUnits.MinimumViewportInsetWithContentInset
CSSViewportUnits.MaximumViewportInsetWithContentInset
CSSViewportUnits.MinimumViewportInsetWithSafeAreaInsets
CSSViewportUnits.MaximumViewportInsetWithSafeAreaInsets
CSSViewportUnits.UnobscuredSizeOverridesIgnoreMaximumViewportInsetAPI
* page/FrameView.h:
* page/FrameView.cpp:
(WebCore::FrameView::performSizeToContentAutoSize):
(WebCore::FrameView::enableAutoSizeMode):
(WebCore::FrameView::clearSizeOverrideForCSSDefaultViewportUnits): Added.
(WebCore::FrameView::setSizeForCSSDefaultViewportUnits): Added.
(WebCore::FrameView::overrideWidthForCSSDefaultViewportUnits): Added.
(WebCore::FrameView::resetOverriddenWidthForCSSDefaultViewportUnits): Added.
(WebCore::FrameView::overrideSizeForCSSDefaultViewportUnits): Added.
(WebCore::FrameView::sizeForCSSDefaultViewportUnits const): Renamed from `sizeForCSSDefaultViewportUnits`.
(WebCore::FrameView::copyCSSViewportUnits const): Added.
Add all the various methods for getting/setting/overriding/clearing an override value for
CSS "default viewport" `v*` units. This allows for `WKWebView` clients to preserve existing
behavior (where CSS "default viewport" `v*` units match the size of the `WKWebView`) while
adding supporting CSS "small viewport" `sv*` units and CSS "large viewport" `lv*` units.
2022-03-28 Brady Eidson <beidson@apple.com>
Support ServiceWorkerClients.openWindow.
<rdar://90616651> and https://bugs.webkit.org/show_bug.cgi?id=238400
Reviewed by Youenn Fablet.
Test: http/tests/workers/service/openwindow-from-notification-click.html
* dom/Document.cpp:
(WebCore::Document::pageID const):
* page/ClientOrigin.h:
(WebCore::ClientOrigin::loggingString const):
* workers/service/ServiceWorkerClientData.cpp:
(WebCore::ServiceWorkerClientData::isolatedCopy const):
(WebCore::ServiceWorkerClientData::isolatedCopy):
(WebCore::ServiceWorkerClientData::from):
* workers/service/ServiceWorkerClientData.h:
(WebCore::ServiceWorkerClientData::encode const):
(WebCore::ServiceWorkerClientData::decode):
* workers/service/ServiceWorkerClients.cpp:
(WebCore::matchWindowWithPageIdentifier):
(WebCore::ServiceWorkerClients::openWindow):
* workers/service/context/SWContextManager.h:
* workers/service/server/SWServerToContextConnection.h:
* workers/service/server/SWServerWorker.h:
2022-03-28 Ian Anderson <iana@apple.com>
Some Apple internal clients fail to build due to redeclared AppKit types in WebKitLegacy
https://bugs.webkit.org/show_bug.cgi?id=238368
Reviewed by Jonathan Bedard.
Some Apple internal Mac Catalyst clients need to use both AppKit and
WebKitLegacy. WebKitLegacy's redeclaration of AppKit types causes errors
for those clients. Copy AppKit's Apple internal logic for identifying
the special Mac Catalyst clients that are allowed to use the AppKit
types, and when such clients use WebKitLegacy, don't redeclare the
AppKit types.
* platform/ios/KeyEventCodesIOS.h:
* platform/ios/wak/WAKAppKitStubs.h:
* platform/ios/wak/WAKView.h:
* platform/ios/wak/WAKWindow.h:
2022-03-28 Chris Dumez <cdumez@apple.com>
Use StringView for Yarr / RegularExpression parsing
https://bugs.webkit.org/show_bug.cgi?id=238420
Reviewed by Sam Weinig.
* platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
(WebCore::CDMPrivateMediaSourceAVFObjC::parseKeySystem):
2022-03-28 Diego Pino Garcia <dpino@igalia.com>
[GLIB] Fix build error 'not match operator !=' in Ubuntu LTS after r291696
https://bugs.webkit.org/show_bug.cgi?id=238443
Reviewed by Adrian Perez de Castro.
The error was also happening in build bots using GCC 8.3 like Debian
Stable.
* platform/graphics/GraphicsTypes.h:
(WebCore::operator==):
(WebCore::operator!=):
(WebCore::CompositeMode::operator==): Deleted.
* platform/graphics/SourceBrush.h:
(WebCore::operator!=):
2022-03-28 Youenn Fablet <youenn@apple.com>
ImageTransferSessionVT::setSize should properly create its buffer pool
https://bugs.webkit.org/show_bug.cgi?id=238455
Reviewed by Eric Carlson.
Covered by existing tests.
* platform/graphics/cv/ImageTransferSessionVT.mm:
(WebCore::ImageTransferSessionVT::setSize):
We check the Expected, then move the RetainPtr if available.
2022-03-28 Tyler Wilcock <tyler_w@apple.com>
AccessibilityObject::listMarkerTextForNodeAndPosition should check for presence of list item before anything else
https://bugs.webkit.org/show_bug.cgi?id=238341
Reviewed by Andres Gonzalez.
The first thing AccessibilityObject::listMarkerTextForNodeAndPosition
does is check to see that the given range `isStartOfLine`. We
should instead check if there's an actual list item to work with
before doing this, since `isStartOfLine` can cause crashes.
Covered by test
accessibility/mac/attributed-string-with-listitem-multiple-lines.html.
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::listMarkerTextForNodeAndPosition):
2022-03-28 Youenn Fablet <youenn@apple.com>
Share more code between RemoteRealtimeAudioSource and RemoteRealtimeVideoSource
https://bugs.webkit.org/show_bug.cgi?id=237704
<rdar://problem/90424679>
Reviewed by Eric Carlson.
The remote video source is now correctly exposing whether it is camera, screen...
This was not well handled before in some places, we replace type == Video by hasVideo to handle all video types appropriately.
Covered by existing tests.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
* platform/mediastream/MediaStreamPrivate.cpp:
2022-03-28 Chris Dumez <cdumez@apple.com>
Optimize toJS() for HTMLElements
https://bugs.webkit.org/show_bug.cgi?id=238426
Reviewed by Yusuke Suzuki.
Optimize toJS() for HTMLElements. Previously, the more generic Element's toJS() would be called,
which would have to do more checks.
This is a 0.6% progression on Speedometer 2.0 on MacBook Air 10,1 (AS).
* bindings/js/JSHTMLElementCustom.cpp:
(WebCore::toJS):
(WebCore::toJSNewlyCreated):
* html/HTMLElement.idl:
2022-03-28 Chris Dumez <cdumez@apple.com>
Drop unnecessary isReachableFromDOM() function in JSNodeCustom.cpp
https://bugs.webkit.org/show_bug.cgi?id=238422
Reviewed by Peng Liu.
Drop unnecessary isReachableFromDOM() function in JSNodeCustom.cpp and inline its implementation in the only caller instead.
* bindings/js/JSNodeCustom.cpp:
(WebCore::JSNodeOwner::isReachableFromOpaqueRoots):
(WebCore::isReachableFromDOM): Deleted.
2022-03-28 Ziran Sun <zsun@igalia.com>
[Forms] Alias appearance <compat-auto> keywords to 'auto' for button
https://bugs.webkit.org/show_bug.cgi?id=238252
Reviewed by Darin Adler.
We need to alias appearance <compat-auto> keywords to 'auto'. This is to
handle some button related cases including button, push-button and square-button.
Also the slider-horizontal case has been addressed. We still have menulist and
textfield cases left to look into.
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::adjustAppearanceForElement const):
2022-03-28 Cameron McCormack <heycam@apple.com>
Remove pending UA shadow tree state when an input element is removed from the document
https://bugs.webkit.org/show_bug.cgi?id=238429
<rdar://90682918>
Reviewed by Antti Koivisto.
If an <input> element has a pending UA shadow tree, and the element is
removed from the document, we don't currently remove the element from
Document::m_elementsWithPendingUserAgentShadowTreeUpdates. Not only
does that means we may wastefully create the shadow tree if the
element is not inserted into the document again, but if the element is
then inserted into a different document, flushing style in the new
document won't correctly create the shadow tree.
Test: fast/forms/lazy-shadow-tree-creation-move-document-crash.html
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::removedFromAncestor):
2022-03-27 Lauro Moura <lmoura@igalia.com>
Unreviewed, non-unified buildfix
https://bugs.webkit.org/show_bug.cgi?id=238436
* workers/service/ServiceWorkerWindowClient.cpp:
2022-03-27 Matt Woodrow <mattwoodrow@apple.com>
Preserve repeat() notation for grid-templates
https://bugs.webkit.org/show_bug.cgi?id=202259
Reviewed by Dean Jackson.
* animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc):
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
(WebCore::GridTemplateTracksWrapper<ForColumns>::GridTemplateTracksWrapper): Deleted.
(WebCore::GridTemplateTracksWrapper<ForRows>::GridTemplateTracksWrapper): Deleted.
Replaces GridTemplateTracksWrapper with a simpler GridTemplatePropertyWrapper that just compares the
track lists. In the future we can iterate the two tracks lists in parallel and interpolate per-item,
in order to get animation correct per-spec.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::populateGridTrackList):
(WebCore::populateSubgridLineNameList):
(WebCore::valueForGridTrackList):
(WebCore::OrderedNamedLinesCollectorInsideRepeat::OrderedNamedLinesCollectorInsideRepeat): Deleted.
(WebCore::OrderedNamedLinesCollector::collectLineNamesForIndex const): Deleted.
(WebCore::OrderedNamedLinesCollectorInsideRepeat::collectLineNamesForIndex const): Deleted.
Implements getComputedStyle by iterating the track list and doing a 1:1 conversion to CSSValues, instead
of reconstructing from the processed hashtables.
This correctly preserves repeat() instances in the track list, which weren't retreivable from the processed
data.
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::gridColumns const):
(WebCore::RenderStyle::gridRows const):
(WebCore::RenderStyle::gridColumnList const):
(WebCore::RenderStyle::gridRowList const):
(WebCore::RenderStyle::gridAutoRepeatColumns const):
(WebCore::RenderStyle::gridAutoRepeatRows const):
(WebCore::RenderStyle::gridAutoRepeatColumnsInsertionPoint const):
(WebCore::RenderStyle::gridAutoRepeatRowsInsertionPoint const):
(WebCore::RenderStyle::gridAutoRepeatColumnsType const):
(WebCore::RenderStyle::gridAutoRepeatRowsType const):
(WebCore::RenderStyle::namedGridColumnLines const):
(WebCore::RenderStyle::namedGridRowLines const):
(WebCore::RenderStyle::orderedNamedGridColumnLines const):
(WebCore::RenderStyle::orderedNamedGridRowLines const):
(WebCore::RenderStyle::autoRepeatNamedGridColumnLines const):
(WebCore::RenderStyle::autoRepeatNamedGridRowLines const):
(WebCore::RenderStyle::autoRepeatOrderedNamedGridColumnLines const):
(WebCore::RenderStyle::autoRepeatOrderedNamedGridRowLines const):
(WebCore::RenderStyle::gridSubgridRows const):
(WebCore::RenderStyle::gridSubgridColumns const):
(WebCore::RenderStyle::setGridColumnList):
(WebCore::RenderStyle::setGridRowList):
(WebCore::RenderStyle::setGridAutoRows):
(WebCore::RenderStyle::setGridAutoFlow):
(WebCore::RenderStyle::setGridColumns): Deleted.
(WebCore::RenderStyle::setGridRows): Deleted.
(WebCore::RenderStyle::setGridAutoRepeatColumns): Deleted.
(WebCore::RenderStyle::setGridAutoRepeatRows): Deleted.
(WebCore::RenderStyle::setGridAutoRepeatColumnsInsertionPoint): Deleted.
(WebCore::RenderStyle::setGridAutoRepeatRowsInsertionPoint): Deleted.
(WebCore::RenderStyle::setGridAutoRepeatColumnsType): Deleted.
(WebCore::RenderStyle::setGridAutoRepeatRowsType): Deleted.
(WebCore::RenderStyle::setNamedGridColumnLines): Deleted.
(WebCore::RenderStyle::setNamedGridRowLines): Deleted.
(WebCore::RenderStyle::setOrderedNamedGridColumnLines): Deleted.
(WebCore::RenderStyle::setOrderedNamedGridRowLines): Deleted.
(WebCore::RenderStyle::setAutoRepeatNamedGridColumnLines): Deleted.
(WebCore::RenderStyle::setAutoRepeatNamedGridRowLines): Deleted.
(WebCore::RenderStyle::setAutoRepeatOrderedNamedGridColumnLines): Deleted.
(WebCore::RenderStyle::setAutoRepeatOrderedNamedGridRowLines): Deleted.
(WebCore::RenderStyle::setGridSubgridRows): Deleted.
(WebCore::RenderStyle::setGridSubgridColumns): Deleted.
* rendering/style/StyleGridData.cpp:
(WebCore::StyleGridData::StyleGridData):
(WebCore::StyleGridData::setRows):
(WebCore::StyleGridData::setColumns):
(WebCore::createGridLineNamesList):
(WebCore::StyleGridData::computeCachedTrackData):
(WebCore::operator<<):
* rendering/style/StyleGridData.h:
(WebCore::StyleGridData::operator== const):
(WebCore::StyleGridData::gridColumns const):
(WebCore::StyleGridData::gridRows const):
(WebCore::StyleGridData::namedGridColumnLines const):
(WebCore::StyleGridData::namedGridRowLines const):
(WebCore::StyleGridData::orderedNamedGridColumnLines const):
(WebCore::StyleGridData::orderedNamedGridRowLines const):
(WebCore::StyleGridData::autoRepeatNamedGridColumnLines const):
(WebCore::StyleGridData::autoRepeatNamedGridRowLines const):
(WebCore::StyleGridData::autoRepeatOrderedNamedGridColumnLines const):
(WebCore::StyleGridData::autoRepeatOrderedNamedGridRowLines const):
(WebCore::StyleGridData::gridAutoRepeatColumns const):
(WebCore::StyleGridData::gridAutoRepeatRows const):
(WebCore::StyleGridData::autoRepeatColumnsInsertionPoint const):
(WebCore::StyleGridData::autoRepeatRowsInsertionPoint const):
(WebCore::StyleGridData::autoRepeatColumnsType const):
(WebCore::StyleGridData::autoRepeatRowsType const):
(WebCore::StyleGridData::subgridRows const):
(WebCore::StyleGridData::subgridColumns const):
(WebCore::StyleGridData::columns const):
(WebCore::StyleGridData::rows const):
Stores the computed track lists directly on RenderGrid, while retaining storage of the processed data.
computeCachedTrackData should be logically identical to the old BuilderConverter::createGridTrackList, but
happens when we modify the StyleGridData so that we can run it during animations.
* style/StyleBuilderConverter.h:
(WebCore::Style::BuilderConverter::createGridTrackList):
(WebCore::Style::createGridLineNamesList): Deleted.
(): Deleted.
* style/StyleBuilderCustom.h:
(WebCore::Style::BuilderCustom::applyInitialGridTemplateColumns):
(WebCore::Style::BuilderCustom::applyValueGridTemplateColumns):
(WebCore::Style::BuilderCustom::applyInitialGridTemplateRows):
(WebCore::Style::BuilderCustom::applyValueGridTemplateRows):
Rather than converting the track list into processed hashtables, just copies the data in the track list
format so that the StyleGridData can access the original data.
2022-03-27 Matt Woodrow <mattwoodrow@apple.com>
Fix serialization of grid-template
https://bugs.webkit.org/show_bug.cgi?id=237868
Reviewed by Dean Jackson.
Existing WPT tests marked as passing.
* css/CSSGridTemplateAreasValue.cpp:
(WebCore::CSSGridTemplateAreasValue::stringForRow):
* css/CSSGridTemplateAreasValue.h:
* css/StyleProperties.cpp:
(WebCore::StyleProperties::getPropertyValue const):
(WebCore::isNoneValue):
(WebCore::isValueID):
(WebCore::StyleProperties::getGridTemplateValue const):
(WebCore::StyleProperties::getGridValue const):
* css/StyleProperties.h:
Creates custom serialization for grid-template that handles the case
where no areas were specified (and omits trailing 'none' value), as well as handling
the case where areas are interleaved within the tracks definitions.
2022-03-27 Daniel Adams <msub2official@gmail.com>
Sort IDL extended attributes alphabetically
https://bugs.webkit.org/show_bug.cgi?id=235531
<rdar://problem/88284366>
Reviewed by Sam Weinig.
This just goes through and corrects the ordering of "Conditional" and
"EnabledBySetting" in all of the files mentioned in the report.
Test: Trivial change, no test changes required.
* Modules/gamepad/Gamepad.idl:
* Modules/gamepad/GamepadButton.idl:
* Modules/webxr/Navigator+WebXR.idl:
* Modules/webxr/WebXRBoundedReferenceSpace.idl:
* Modules/webxr/WebXRFrame+HandInput.idl:
* Modules/webxr/WebXRFrame.idl:
* Modules/webxr/WebXRHand.idl:
* Modules/webxr/WebXRInputSource+HandInput.idl:
* Modules/webxr/WebXRInputSource.idl:
* Modules/webxr/WebXRInputSourceArray.idl:
* Modules/webxr/WebXRJointPose.idl:
* Modules/webxr/WebXRJointSpace.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/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:
* testing/FakeXRBoundsPoint.idl:
* testing/FakeXRButtonStateInit.idl:
* testing/FakeXRInputSourceInit.idl:
* testing/FakeXRRigidTransformInit.idl:
* testing/FakeXRViewInit.idl:
* testing/WebFakeXRDevice.idl:
* testing/WebFakeXRInputController.idl:
* testing/WebXRTest.idl:
2022-03-27 Matt Woodrow <mattwoodrow@apple.com>
Use the sizing algorithm's available size to compute grid gap.
https://bugs.webkit.org/show_bug.cgi?id=236956
Reviewed by Tim Nguyen.
Computing the grid gap for subgridded tracks happens during the sizing algorithm
(as part of copying the sizes from the parent, instead of computing new sizes). At
this point we should always have a definite size available (the size of the tracks in
the parent that the subgrid spans), but it may not yet be set on the subgrid's RenderElement.
This retreives the size from the track sizing algorithm instead, where it should always be
available by this point.
* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrackSizingAlgorithm::copyUsedTrackSizesForSubgrid):
2022-03-27 Matt Woodrow <mattwoodrow@apple.com>
Lazily allocate backing store for grid columns.
https://bugs.webkit.org/show_bug.cgi?id=212201
Reviewed by Dean Jackson.
Existing WPT test grid-limits-001.html marked as passing.
* rendering/Grid.cpp:
(WebCore::Grid::ensureGridSize):
(WebCore::Grid::ensureStorageForRow):
(WebCore::Grid::insert):
(WebCore::Grid::cell const):
Only grow the first row's column storage (since we use this
to remember the column count) and lazily grow the others when
we try write to them.
(WebCore::GridIterator::GridIterator):
(WebCore::GridIterator::nextGridItem):
(WebCore::GridIterator::isEmptyAreaEnough const):
(WebCore::GridIterator::nextEmptyGridArea):
* rendering/Grid.h:
Changes GridIterator to use the Grid API rather than directly
accessing the inner Vector using 'friend'. This makes it easier to
ensure that we never access areas outside of our lazy allocations.
2022-03-27 Alan Bujtas <zalan@apple.com>
[LFC][IFC] ASSERTs in BoxGeometry when loading Twitter page
https://bugs.webkit.org/show_bug.cgi?id=238421
<rdar://89980547>
Reviewed by Antti Koivisto.
Ensure that we set size/position on trailing, empty inline box(es) in bidi context.
e.g.
<div>some content<span> <-line breaks here</span></div>
where the first line has the following runs:
[some content]
[inline box start]
second line has:
[spanning inline box start]
[<-line breaks here]
[inline box end]
The first line's trailing (and empty, due to trailing whitespace trimming) [inline box start] run
needs computed geometry/display box so that when on the subsequent line we see the [spanning inline box start] run
we can properly compute the enclosing geometry for the <span> element.
(and that's where we currently assert as we don't find the associated box geometry for the inline box on the first line.)
See the comment in InlineDisplayContentBuilder::processBidiContent for details.
(Note that this change has no visual impact as these trailing inline boxes are always empty.)
Test: fast/inline/trailing-empty-bidi-inline-box.html
* layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp:
(WebCore::Layout::InlineDisplayContentBuilder::processBidiContent):
2022-03-27 Alexander Mikhaylenko <alexm@gnome.org>
[GTK][WPE] Support CSS accent-color
https://bugs.webkit.org/show_bug.cgi?id=238398
Reviewed by Carlos Garcia Campos.
Add accent-color support for progress, range and entries.
Update check and radio styles so that they can use accent color as well.
* platform/adwaita/ThemeAdwaita.cpp:
(WebCore::ThemeAdwaita::paint):
(WebCore::ThemeAdwaita::paintCheckbox):
(WebCore::ThemeAdwaita::paintRadio):
* platform/adwaita/ThemeAdwaita.h:
* rendering/RenderThemeAdwaita.cpp:
(WebCore::getSystemAccentColor):
(WebCore::getAccentColor):
(WebCore::RenderThemeAdwaita::platformActiveSelectionBackgroundColor const):
(WebCore::RenderThemeAdwaita::paintTextField):
(WebCore::RenderThemeAdwaita::paintProgressBar):
(WebCore::RenderThemeAdwaita::paintSliderTrack):
(WebCore::RenderThemeAdwaita::paintSliderThumb):
2022-03-26 Yusuke Suzuki <ysuzuki@apple.com>
Use static_assert instead of COMPILE_ASSERT
https://bugs.webkit.org/show_bug.cgi?id=238417
Reviewed by Mark Lam.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* contentextensions/DFANode.h:
* css/CSSBasicShapes.cpp:
(WebCore::buildPolygonString):
* css/CSSProperty.cpp:
* css/CSSRule.cpp:
* css/CSSValue.cpp:
* css/StyleProperties.cpp:
* css/StyleRule.cpp:
* css/calc/CSSCalcOperationNode.cpp:
(WebCore::sortingCategoryForType):
* dom/ElementData.cpp:
* dom/NodeRareData.cpp:
* dom/ShadowRoot.cpp:
* dom/SpaceSplitString.cpp:
* dom/StyledElement.cpp:
* dom/TreeScope.cpp:
* editing/HTMLInterchange.cpp:
(WebCore::convertHTMLTextToInterchangeFormat):
* html/HTMLTrackElement.cpp:
* html/track/VTTCue.cpp:
* platform/Length.cpp:
* platform/ScrollableArea.cpp:
* platform/UserAgentQuirks.h:
(WebCore::UserAgentQuirks::UserAgentQuirks):
* platform/graphics/FontCascadeDescription.cpp:
* platform/graphics/Region.cpp:
(WebCore::Region::Shape::shapeOperation):
* platform/graphics/TextRun.cpp:
* platform/text/BidiContext.cpp:
* platform/text/TextFlags.h:
* platform/win/ImportedFunctionsEnumerator.cpp:
(WebCore::ImportedFunctionsEnumerator::addressOfCurrentFunctionPointer const):
* rendering/BreakLines.cpp:
* rendering/FloatingObjects.cpp:
* rendering/LegacyInlineBox.cpp:
* rendering/LegacyInlineFlowBox.cpp:
* rendering/LegacyInlineTextBox.cpp:
* rendering/LegacyRootInlineBox.cpp:
* rendering/RenderBlock.cpp:
* rendering/RenderBlockFlow.cpp:
* rendering/RenderBox.cpp:
* rendering/RenderObject.cpp:
* rendering/RenderTableCell.cpp:
* rendering/RenderText.cpp:
* rendering/style/FillLayer.cpp:
* rendering/style/RenderStyle.cpp:
* rendering/style/StyleBoxData.cpp:
* rendering/style/StyleRareInheritedData.cpp:
* rendering/style/WillChangeData.h:
* rendering/svg/SVGInlineTextBox.cpp:
* style/RuleData.cpp:
* svg/GradientAttributes.h:
2022-03-26 Youenn Fablet <youenn@apple.com>
Implement ServiceWorkerWindowClient.focus
https://bugs.webkit.org/show_bug.cgi?id=238319
<rdar://90616490>
Reviewed by Brady Eidson.
Add support for service worker focus:
- Implement user gesture requirement by introducing a flag in ServiceWorkerGlobalScope that is turned on for some time
when receiving specific events like notification click event. The max time is currently set to 2 seconds.
We might want to improve handling of user activation in non-document contexts but this is a fuzzy area right now so a service worker
solution seems good for now.
- Remove the map of service worker client since we need to create new ones every time.
- focus will go its context manager that will send an IPC message to the network process to actually trigger focus.
We are missing focused check at promise resolution, this will be done in a follow-up.
Covered by API test.
* testing/ServiceWorkerInternals.cpp:
* testing/ServiceWorkerInternals.h:
* testing/js/WebCoreTestSupport.cpp:
* workers/service/ServiceWorkerClient.cpp:
* workers/service/ServiceWorkerClient.h:
* workers/service/ServiceWorkerClientData.h:
* workers/service/ServiceWorkerClients.cpp:
* workers/service/ServiceWorkerClients.h:
* workers/service/ServiceWorkerGlobalScope.cpp:
* workers/service/ServiceWorkerGlobalScope.h:
* workers/service/ServiceWorkerWindowClient.cpp:
* workers/service/ServiceWorkerWindowClient.h:
* workers/service/ServiceWorkerWindowClient.idl:
* workers/service/context/SWContextManager.h:
* workers/service/context/ServiceWorkerThread.cpp:
* workers/service/server/SWServer.h:
2022-03-26 Yusuke Suzuki <ysuzuki@apple.com>
Use unary static_assert
https://bugs.webkit.org/show_bug.cgi?id=238412
Reviewed by Mark Lam.
* Modules/entriesapi/FileSystemDirectoryEntry.h:
* Modules/entriesapi/FileSystemFileEntry.h:
* css/DOMMatrix.h:
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateAddStyleRelation):
* dom/DOMPoint.h:
* dom/DOMRect.h:
* html/HTMLAllCollection.h:
* html/track/AudioTrackList.h:
* html/track/VideoTrackList.h:
* layout/formattingContexts/inline/InlineItem.cpp:
* layout/formattingContexts/inline/InlineTextItem.cpp:
* platform/KeyedCoding.h:
(WebCore::KeyedDecoder::decodeBytes):
* xml/XMLHttpRequestEventTarget.h:
2022-03-25 Chris Dumez <cdumez@apple.com>
Simplify / Optimize JSNodeOwner::isReachableFromOpaqueRoots()
https://bugs.webkit.org/show_bug.cgi?id=238380
Reviewed by Geoffrey Garen.
Drop checks specific to HTMLAudioElement and HTMLImageElement from
JSNodeOwner::isReachableFromOpaqueRoots() so that other Node wrappers
that are not audio or image elements do not have to pay the cost.
In the HTMLAudioElement case, HTMLAudioElement already subclasses HTMLMediaElement which
is an ActiveDOMObject and HTMLMediaElement::virtualHasPendingActivity() already takes
care of keeping the JS wrapper alive is there is audio playing.
For HTMLImageElement, I made it subclass ActiveDOMObject so that the JSHTMLImageElement
wrapper is now calling HTMLImageElement::hasPendingActivity() instead of every JS Node
wrapper via JSNodeOwner::isReachableFromOpaqueRoots().
* bindings/js/JSNodeCustom.cpp:
(WebCore::isReachableFromDOM):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::HTMLImageElement):
(WebCore::HTMLImageElement::create):
(WebCore::HTMLImageElement::createForLegacyFactoryFunction):
(WebCore::HTMLImageElement::activeDOMObjectName const):
(WebCore::HTMLImageElement::virtualHasPendingActivity const):
(WebCore::HTMLImageElement::hasPendingActivity const): Deleted.
* html/HTMLImageElement.h:
* html/HTMLImageElement.idl:
* html/ImageDocument.cpp:
(WebCore::ImageDocumentElement::create):
2022-03-25 Nikolaos Mouchtaris <nmouchtaris@apple.com>
Incorrect handling of NaN inside calc() for top-level calculation
https://bugs.webkit.org/show_bug.cgi?id=234176
Reviewed by Simon Fraser.
Add function to convert any top level NaN values to infinity values as per the spec.
This only affects the computed value of the calc expression, not its serialization.
Test: imported/w3c/web-platform-tests/css/css-values/calc-infinity-nan-computed.html
* css/calc/CSSCalcOperationNode.cpp:
(WebCore::CSSCalcOperationNode::combineChildren):
(WebCore::convertToTopLevelValue):
(WebCore::CSSCalcOperationNode::evaluateOperator):
* css/calc/CSSCalcOperationNode.h:
2022-03-25 Chris Dumez <cdumez@apple.com>
Use StringView::split() instead of String::split() in more places
https://bugs.webkit.org/show_bug.cgi?id=238362
Reviewed by Geoffrey Garen.
Use StringView::split() instead of String::split() where suitable and more efficient.
* Modules/applepay/cocoa/PaymentContactCocoa.mm:
(WebCore::convert):
* html/HTMLInputElement.cpp:
(WebCore::isValidMIMEType):
(WebCore::isValidFileExtension):
(WebCore::parseAcceptAttribute):
* html/ValidationMessage.cpp:
(WebCore::ValidationMessage::setMessageDOMAndStartTimer):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::compileShader):
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::nodeForPath):
* page/WindowFeatures.cpp:
(WebCore::parseDisabledAdaptations):
(WebCore::parseDialogFeatures):
(WebCore::parseDialogFeaturesMap):
* page/WindowFeatures.h:
* platform/network/CacheValidation.cpp:
(WebCore::collectVaryingRequestHeadersInternal):
* platform/network/HTTPParsers.cpp:
(WebCore::filenameFromHTTPContentDisposition):
(WebCore::parseXFrameOptionsHeader):
* platform/network/HTTPParsers.h:
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::isAttachmentWithFilename const):
* svg/SVGToOTFFontConversion.cpp:
(WebCore::SVGToOTFFontConverter::appendOS2Table):
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::parseOffsetValue):
(WebCore::SVGSMILElement::parseClockValue):
(WebCore::SVGSMILElement::parseCondition):
(WebCore::SVGSMILElement::parseBeginOrEnd):
(WebCore::SVGSMILElement::parseAttribute):
* svg/animation/SVGSMILElement.h:
2022-03-25 Alexander Mikhaylenko <alexm@gnome.org>
[GTK][WPE] Update widget style to match libadwaita
https://bugs.webkit.org/show_bug.cgi?id=235884
Reviewed by Adrian Perez de Castro.
Update Adwaita widgets style to be closer to their Libadwaita versions instead of GTK3.
- Use new colors
- Opacity for disabled states instead of separate colors
- Translucent text selection, grey for inactive state
- Translucent borders, so the widgets don't get blurry depending on the page background
- Light borders for dark variant for visibility
- Update sliders and progress bars, as they can't really work with translucent borders as is
- Use grey selection for listboxes
Since text selection and accent are different colors now, move activeSelectionBackgroundColor()
etc out of ThemeAdwaita and expose a function for getting the accent color instead.
Update scrollbars to closely match libadwaita - update colors and dimensions, have a visible
trough in overlay mode. Reverse how borders are done - make sure the trough in regular and
overlay mode has the same size and draw borders around it rather than making borders a part
of the trough size.
* platform/adwaita/ScrollbarThemeAdwaita.cpp:
(WebCore::ScrollbarThemeAdwaita::paint):
(WebCore::ScrollbarThemeAdwaita::paintScrollCorner):
* platform/adwaita/ThemeAdwaita.cpp:
(WebCore::ThemeAdwaita::paintCheckbox):
(WebCore::ThemeAdwaita::paintRadio):
(WebCore::ThemeAdwaita::paintButton):
(WebCore::ThemeAdwaita::accentColor):
(WebCore::ThemeAdwaita::activeSelectionForegroundColor const): Deleted.
(WebCore::ThemeAdwaita::activeSelectionBackgroundColor const): Deleted.
(WebCore::ThemeAdwaita::inactiveSelectionForegroundColor const): Deleted.
(WebCore::ThemeAdwaita::inactiveSelectionBackgroundColor const): Deleted.
* platform/adwaita/ThemeAdwaita.h:
* rendering/RenderThemeAdwaita.cpp:
(WebCore::getAccentColor):
(WebCore::RenderThemeAdwaita::platformActiveSelectionBackgroundColor const):
(WebCore::RenderThemeAdwaita::platformInactiveSelectionBackgroundColor const):
(WebCore::RenderThemeAdwaita::platformActiveSelectionForegroundColor const):
(WebCore::RenderThemeAdwaita::platformInactiveSelectionForegroundColor const):
(WebCore::RenderThemeAdwaita::platformActiveListBoxSelectionBackgroundColor const):
(WebCore::RenderThemeAdwaita::platformInactiveListBoxSelectionBackgroundColor const):
(WebCore::RenderThemeAdwaita::platformActiveListBoxSelectionForegroundColor const):
(WebCore::RenderThemeAdwaita::platformInactiveListBoxSelectionForegroundColor const):
(WebCore::RenderThemeAdwaita::paintTextField):
(WebCore::RenderThemeAdwaita::paintProgressBar):
(WebCore::RenderThemeAdwaita::paintSliderTrack):
(WebCore::RenderThemeAdwaita::paintSliderThumb):
* rendering/RenderThemeAdwaita.h:
2022-03-25 Alan Bujtas <zalan@apple.com>
FontCascade::widthForSimpleText needs the glyph only
https://bugs.webkit.org/show_bug.cgi?id=238385
Reviewed by Antti Koivisto.
widthForSimpleText operates on primary font only so let's just call PrimaryFont.glyphForCharacter() directly.
(This should provide a slight perf gain on text heavy pages. e.g. wikipedia over 50 page loads ->
w/o: widthForSimpleText: 266286 calls, mean duration: 0.000201ms, total duration: 53.403753ms, max duration 0.016750ms
w: widthForSimpleText: 266274 calls, mean duration: 0.000176ms, total duration: 46.949579ms, max duration 0.016917ms)
* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::widthForSimpleText const):
2022-03-25 Chris Dumez <cdumez@apple.com>
Unreviewed, update DerivedSources-output.xcfilelist to fix build.
* DerivedSources-output.xcfilelist:
2022-03-25 Wenson Hsieh <wenson_hsieh@apple.com>
Enable PGO when building for release and production
https://bugs.webkit.org/show_bug.cgi?id=238119
rdar://90182309
Reviewed by Alexey Proskuryakov and Geoff Garen.
Attempt to re-land support for compiling against profiling data, after it was reverted due to the profiling data
files being too large. We mitigate this by instead storing sparse profdata files as compressed files in
WebKitAdditions through `git lfs`, such that they don't cause the repo to grow significantly each time we update
profiling data.
At build time, we then introduce new build phase scripts to the JavaScriptCore, WebCore and WebKit builds to
decompress their respective `.profdata.compressed` files into `.profdata` files in the build, using
`compression_tool`. We compile against these `profdata` files when building for release and production
configurations, via the `-fprofile-instr-use` flag.
In the case where the *.profdata.compressed files are non-existent or haven't been downloaded yet, we instead
fall back to using an empty profiling data file, but only on non-production builds; this allows us to continue
passing in the `-fprofile-instr-use` flag, without running into build failures.
Note that we intentionally require production builds to use the (real) profiling data, and explicitly fail the
build with a specific error message in the case where the profiles are missing.
Additionally, note that in order to check for and deal with the case where the *.profdata.compressed files are
only undownloaded `git-lfs` stubs, we not only check whether or not the `profdata.compressed` file exists, but
also whether or not the file size is at least an arbitrary cutoff of 4 KB (which should already be an order of
magnitude larger than the `git-lfs` stub). While mostly arbitrary, I chose this cutoff due to the fact that it's
very close to the size of the `Empty.profdata` placeholder file in Tools; in practice, we should expect the
profiles for WebKit, WebCore and JavaScriptCore to be much, much larger than this empty file.
* Configurations/Base.xcconfig:
* Configurations/WebCore.xcconfig:
* WebCore.xcodeproj/project.pbxproj:
2022-03-25 Youenn Fablet <youenn@apple.com>
Add support for focused and visible ServiceWorkerWindowClient states
https://bugs.webkit.org/show_bug.cgi?id=238372
Reviewed by Brady Eidson.
Add visible and focused to ServiceWorkerClientData.
In case document visibility or focused state changes, we push the corresponding ServiceWorkerClientData to network process.
Test: http/wpt/service-workers/client-properties.https.html
* dom/Document.cpp:
* dom/Document.h:
* page/FocusController.cpp:
* workers/service/ServiceWorkerClient.h:
* workers/service/ServiceWorkerClientData.cpp:
* workers/service/ServiceWorkerClientData.h:
* workers/service/ServiceWorkerClients.cpp:
* workers/service/ServiceWorkerWindowClient.cpp:
* workers/service/ServiceWorkerWindowClient.h:
2022-03-25 Devin Rousso <drousso@apple.com>
`PointerEvent.movementX` always 0 (breaks https://noisecraft.app/)
https://bugs.webkit.org/show_bug.cgi?id=220194
<rdar://problem/72814440>
Reviewed by Simon Fraser.
Test: pointer-lock/pointermove-movement-delta.html
* dom/PointerEvent.cpp:
(WebCore::PointerEvent::PointerEvent):
Also pass along the movement delta in the constructor that takes a `MouseEvent`.
* dom/MouseEvent.h:
* dom/MouseEvent.cpp:
(WebCore::MouseEvent::create):
(WebCore::MouseEvent::MouseEvent):
Require that all constructors that aren't invoked from JS always provide a movement delta.
* dom/MouseRelatedEvent.h:
(WebCore::MouseRelatedEvent::movementX const):
(WebCore::MouseRelatedEvent::movementY const):
Expose these methods even when `!ENABLE(POINTER_LOCK)` so that they can be called without
the callsite having to also have a `#if`.
* page/EventHandler.cpp:
(WebCore::EventHandler::dispatchDragEvent):
Pass along the movement delta even when `!ENABLE(POINTER_LOCK)`.
2022-03-25 Chris Dumez <cdumez@apple.com>
Drop duplicate isFiringEventListeners check in Node wrappers' isReachableFromOpaqueRoots()
https://bugs.webkit.org/show_bug.cgi?id=238376
Reviewed by Geoffrey Garen.
Drop duplicate isFiringEventListeners check in Node wrappers' isReachableFromOpaqueRoots().
Those wrappers already call JSNodeOwner::isReachableFromOpaqueRoots() which already takes care
of checking the isFiringEventListeners flag.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
2022-03-25 J Pascoe <j_pascoe@apple.com>
[WebAuthn] Maintain last modification time separate from last used time for platform credentials
https://bugs.webkit.org/show_bug.cgi?id=238293
rdar://90655676
Reviewed by Brent Fulgham.
This patch splits a key returned from [_WKWebAuthenticationPanel getAllLocalAuthenticatorCredentials...],
_WKLocalAuthenticatorCredentialLastModificationDateKey, which previously signified the last time a
credential was modified or used in an assertion, to just the last time the credential was modified.
A new key, _WKLocalAuthenticatorCredentialLastUsedDateKey represents the old definition, the last
time a key was used or modified.
* Modules/webauthn/WebAuthenticationConstants.h:
2022-03-25 Zan Dobersek <zdobersek@igalia.com>
[TextureMapper] Implement GraphicsContextGLTextureMapperANGLE::prepareForDisplay()
https://bugs.webkit.org/show_bug.cgi?id=238322
Reviewed by Darin Adler.
Use GraphicsContextGLTextureMapperANGLE::prepareForDisplay() to handle
buffer/texture preparation during the composition state flush instead of
doing it in the platform layer integration class.
The virtual GraphicsContextGL::prepareForDisplay() method is called
during the composition state flush on every context-backed canvas that
was changed since the previous flush. It's the most optimal location to
handle content display preparation, and it simplifies the actual display
through the TextureMapper facilities. It's a simple matter of ensuring
a current context and invoking texture preparation.
In Nicosia::GCGLANGLELayer::swapBuffersIfNeeded(), there's no need to
bother with the state of layer composition, everything is already set
to be wrapped into a buffer and pushed into the composition engine.
Similarly in TextureMapperGCGLPlatformLayer::paintToTextureMapper(),
the texture is already prepared and can be painted immediately, with
no further need for GL context switching.
GraphicsContextGLANGLE::prepareTexture() is not really used anymore
so it can be removed, and prepareTextureImpl() can use that name.
The method is still virtual so that GraphicsContextGLTextureMapperANGLE
can provide a more focused override, but GraphicsContextGLCocoa should
at some point also use its own implementation, at which point the
method could just be rolled into each class's prepareForDisplay().
No new tests, covered by existing tests.
* platform/graphics/angle/GraphicsContextGLANGLE.cpp:
(WebCore::GraphicsContextGLANGLE::prepareTexture):
(WebCore::GraphicsContextGLANGLE::prepareTextureImpl): Deleted.
* platform/graphics/angle/GraphicsContextGLANGLE.h:
* platform/graphics/cocoa/GraphicsContextGLCocoa.mm:
(WebCore::GraphicsContextGLCocoa::prepareForDisplay):
* platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.cpp:
(Nicosia::GCGLANGLELayer::swapBuffersIfNeeded):
* platform/graphics/opengl/GraphicsContextGLOpenGL.h:
Remove unused prepareTextureImpl() method declaration.
* platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.cpp:
(WebCore::GraphicsContextGLTextureMapperANGLE::prepareTexture):
(WebCore::GraphicsContextGLTextureMapperANGLE::prepareForDisplay):
(WebCore::GraphicsContextGLTextureMapperANGLE::prepareTextureImpl): Deleted.
* platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.h:
* platform/graphics/texmap/TextureMapperGCGLPlatformLayer.cpp:
(WebCore::TextureMapperGCGLPlatformLayer::paintToTextureMapper):
2022-03-25 Chris Dumez <cdumez@apple.com>
Unreviewed, update DerivedSources-output.xcfilelist.
* DerivedSources-output.xcfilelist:
2022-03-25 Alex Christensen <achristensen@webkit.org>
Add css-typed-om color IDL skeletons
https://bugs.webkit.org/show_bug.cgi?id=238208
Reviewed by Sam Weinig.
This is an off-by-default experimental feature.
Covered by wpt tests.
* DerivedSources-input.xcfilelist:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* css/typedom/CSSKeywordValue.idl:
* css/typedom/CSSNumericValue.h:
* css/typedom/color/CSSColor.cpp: Added.
(WebCore::CSSColor::setColorSpace):
(WebCore::CSSColor::CSSColor):
* css/typedom/color/CSSColor.h: Added.
(WebCore::CSSColor::create):
(WebCore::CSSColor::alpha const):
(WebCore::CSSColor::setAlpha):
* css/typedom/color/CSSColor.idl:
* css/typedom/color/CSSColorValue.h: Added.
(WebCore::CSSColorValue::colorSpace):
(WebCore::CSSColorValue::to):
(WebCore::CSSColorValue::parse):
* css/typedom/color/CSSColorValue.idl:
* css/typedom/color/CSSHSL.cpp: Added.
(WebCore::CSSHSL::CSSHSL):
* css/typedom/color/CSSHSL.h: Added.
(WebCore::CSSHSL::create):
(WebCore::CSSHSL::h const):
(WebCore::CSSHSL::setH):
(WebCore::CSSHSL::s const):
(WebCore::CSSHSL::setS):
(WebCore::CSSHSL::l const):
(WebCore::CSSHSL::setL):
(WebCore::CSSHSL::alpha const):
(WebCore::CSSHSL::setAlpha):
* css/typedom/color/CSSHSL.idl:
* css/typedom/color/CSSHWB.cpp: Added.
(WebCore::CSSHWB::CSSHWB):
* css/typedom/color/CSSHWB.h: Added.
(WebCore::CSSHWB::create):
(WebCore::CSSHWB::h const):
(WebCore::CSSHWB::setH):
(WebCore::CSSHWB::w const):
(WebCore::CSSHWB::setW):
(WebCore::CSSHWB::b const):
(WebCore::CSSHWB::setB):
(WebCore::CSSHWB::alpha const):
(WebCore::CSSHWB::setAlpha):
* css/typedom/color/CSSHWB.idl:
* css/typedom/color/CSSLCH.cpp: Added.
(WebCore::CSSLCH::CSSLCH):
* css/typedom/color/CSSLCH.h: Added.
(WebCore::CSSLCH::create):
(WebCore::CSSLCH::l const):
(WebCore::CSSLCH::setL):
(WebCore::CSSLCH::c const):
(WebCore::CSSLCH::setC):
(WebCore::CSSLCH::h const):
(WebCore::CSSLCH::setH):
(WebCore::CSSLCH::alpha const):
(WebCore::CSSLCH::setAlpha):
* css/typedom/color/CSSLCH.idl:
* css/typedom/color/CSSLab.cpp: Added.
(WebCore::CSSLab::CSSLab):
* css/typedom/color/CSSLab.h: Added.
(WebCore::CSSLab::create):
(WebCore::CSSLab::l const):
(WebCore::CSSLab::setL):
(WebCore::CSSLab::a const):
(WebCore::CSSLab::setA):
(WebCore::CSSLab::b const):
(WebCore::CSSLab::setB):
(WebCore::CSSLab::alpha const):
(WebCore::CSSLab::setAlpha):
* css/typedom/color/CSSLab.idl:
* css/typedom/color/CSSOKLCH.cpp: Added.
(WebCore::CSSOKLCH::CSSOKLCH):
* css/typedom/color/CSSOKLCH.h: Added.
(WebCore::CSSOKLCH::create):
(WebCore::CSSOKLCH::l const):
(WebCore::CSSOKLCH::setL):
(WebCore::CSSOKLCH::c const):
(WebCore::CSSOKLCH::setC):
(WebCore::CSSOKLCH::h const):
(WebCore::CSSOKLCH::setH):
(WebCore::CSSOKLCH::alpha const):
(WebCore::CSSOKLCH::setAlpha):
* css/typedom/color/CSSOKLCH.idl:
* css/typedom/color/CSSOKLab.cpp: Added.
(WebCore::CSSOKLab::CSSOKLab):
* css/typedom/color/CSSOKLab.h: Added.
(WebCore::CSSOKLab::create):
(WebCore::CSSOKLab::l const):
(WebCore::CSSOKLab::setL):
(WebCore::CSSOKLab::a const):
(WebCore::CSSOKLab::setA):
(WebCore::CSSOKLab::b const):
(WebCore::CSSOKLab::setB):
(WebCore::CSSOKLab::alpha const):
(WebCore::CSSOKLab::setAlpha):
* css/typedom/color/CSSOKLab.idl:
* css/typedom/color/CSSRGB.cpp: Added.
(WebCore::CSSRGB::CSSRGB):
* css/typedom/color/CSSRGB.h: Added.
(WebCore::CSSRGB::create):
(WebCore::CSSRGB::r const):
(WebCore::CSSRGB::setR):
(WebCore::CSSRGB::g const):
(WebCore::CSSRGB::setG):
(WebCore::CSSRGB::b const):
(WebCore::CSSRGB::setB):
(WebCore::CSSRGB::alpha const):
(WebCore::CSSRGB::setAlpha):
* css/typedom/color/CSSRGB.idl:
2022-03-25 Chris Dumez <cdumez@apple.com>
Reduce EventListenerVector's minimum capacity from 16 to 2
https://bugs.webkit.org/show_bug.cgi?id=238374
Reviewed by Geoffrey Garen.
Reduce EventListenerVector's minimum capacity from 16 to 2 to save memory and get a small speedup on Speedometer.
Very few event listeners are registered for a given type in the common case so eagerly allocating enough memory for 16 is wasteful.
This is a confirmed 0.4% progression on Speedometer according to A/B bots.
* dom/EventListenerMap.h:
2022-03-25 Chris Dumez <cdumez@apple.com>
Start preparing WebCore for making the String(const char*) constructor explicit
https://bugs.webkit.org/show_bug.cgi?id=238336
Reviewed by Geoffrey Garen.
Start preparing WebCore for making the String(const char*) constructor explicit.
Making this constructor explicit helps catch at compile time cases where the ""_s
prefix is missing on String literals.
* Modules/applepay-ams-ui/ApplePayAMSUIPaymentHandler.cpp:
(WebCore::convertAndValidateApplePayAMSUIRequest):
* Modules/applepay/ApplePayContactField.cpp:
(WebCore::convertAndValidate):
* Modules/applepay/ApplePayMerchantCapability.cpp:
(WebCore::convertAndValidate):
* Modules/applepay/ApplePayRequestBase.cpp:
(WebCore::convertAndValidate):
* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::create):
(WebCore::ApplePaySession::openPaymentSetup):
(WebCore::ApplePaySession::begin):
* Modules/applepay/ApplePaySetup.cpp:
(WebCore::ApplePaySetup::begin):
* Modules/applepay/PaymentInstallmentConfiguration.mm:
(WebCore::PaymentInstallmentConfiguration::create):
* Modules/applepay/PaymentRequestValidator.mm:
(WebCore::PaymentRequestValidator::validateTotal):
(WebCore::validateCountryCode):
(WebCore::validateCurrencyCode):
(WebCore::validateMerchantCapabilities):
(WebCore::validateSupportedNetworks):
(WebCore::validateShippingMethod):
* Modules/applepay/PaymentSession.cpp:
(WebCore::PaymentSession::canCreateSession):
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::convertAndValidateApplePayRequest):
* Modules/applicationmanifest/ApplicationManifestParser.cpp:
(WebCore::ApplicationManifestParser::parseIcons):
(WebCore::ApplicationManifestParser::parseScope):
* Modules/cache/WindowOrWorkerGlobalScopeCaches.cpp:
* Modules/encryptedmedia/InitDataRegistry.cpp:
(WebCore::sanitizeKeyids):
* Modules/entriesapi/DOMFileSystem.cpp:
(WebCore::listDirectoryWithMetadata):
(WebCore::validatePathIsExpectedType):
* Modules/fetch/FetchBodyConsumer.cpp:
(WebCore::FetchBodyConsumer::packageFormData):
* Modules/fetch/FetchHeaders.cpp:
(WebCore::fillHeaderMap):
* Modules/fetch/FetchLoader.cpp:
(WebCore::FetchLoader::startLoadingBlobURL):
* Modules/filesystemaccess/FileSystemFileHandle.cpp:
(WebCore::FileSystemFileHandle::getFile):
(WebCore::FileSystemFileHandle::createSyncAccessHandle):
* Modules/filesystemaccess/FileSystemHandle.cpp:
(WebCore::FileSystemHandle::isSameEntry const):
(WebCore::FileSystemHandle::move):
* Modules/indexeddb/IDBDatabaseIdentifier.h:
* Modules/indexeddb/IDBKeyData.cpp:
(WebCore::IDBKeyData::encode const):
(WebCore::IDBKeyData::decode):
* Modules/indexeddb/IDBKeyRange.cpp:
(WebCore::IDBKeyRange::includes):
* Modules/indexeddb/server/IDBSerialization.cpp:
(WebCore::serializeIDBKeyPath):
(WebCore::deserializeIDBKeyPath):
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::getAllDatabaseNamesAndVersions):
(WebCore::IDBServer::IDBServer::getOrigins const):
(WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince):
(WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesForOrigins):
(WebCore::IDBServer::removeAllDatabasesForFullOriginPath):
(WebCore::IDBServer::IDBServer::renameOrigin):
(WebCore::IDBServer::IDBServer::upgradeFilesIfNecessary):
(WebCore::IDBServer::IDBServer::upgradedDatabaseDirectory):
* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::beginTransaction):
(WebCore::IDBServer::MemoryIDBBackingStore::abortTransaction):
(WebCore::IDBServer::MemoryIDBBackingStore::commitTransaction):
(WebCore::IDBServer::MemoryIDBBackingStore::generateKeyNumber):
* Modules/indexeddb/server/MemoryObjectStore.cpp:
(WebCore::IDBServer::MemoryObjectStore::updateIndexesForPutRecord):
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::v1RecordsTableSchema):
(WebCore::IDBServer::v1RecordsTableSchemaAlternate):
(WebCore::IDBServer::v2RecordsTableSchema):
(WebCore::IDBServer::v2RecordsTableSchemaAlternate):
(WebCore::IDBServer::v1IndexRecordsTableSchema):
(WebCore::IDBServer::v1IndexRecordsTableSchemaAlternate):
(WebCore::IDBServer::v2IndexRecordsTableSchema):
(WebCore::IDBServer::v2IndexRecordsTableSchemaAlternate):
(WebCore::IDBServer::SQLiteIDBBackingStore::encodeDatabaseName):
(WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabasePathForDirectory):
(WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
(WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetKeyGeneratorValue):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedSetKeyGeneratorValue):
(WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber):
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::createObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::deleteObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::renameObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::clearObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::createIndex):
(WebCore::IDBServer::UniqueIDBDatabase::deleteIndex):
(WebCore::IDBServer::UniqueIDBDatabase::renameIndex):
(WebCore::IDBServer::UniqueIDBDatabase::putOrAdd):
(WebCore::IDBServer::UniqueIDBDatabase::putOrAddAfterSpaceCheck):
(WebCore::IDBServer::UniqueIDBDatabase::getRecord):
(WebCore::IDBServer::UniqueIDBDatabase::getAllRecords):
(WebCore::IDBServer::UniqueIDBDatabase::getCount):
(WebCore::IDBServer::UniqueIDBDatabase::deleteRecord):
(WebCore::IDBServer::UniqueIDBDatabase::openCursor):
(WebCore::IDBServer::UniqueIDBDatabase::iterateCursor):
(WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):
* Modules/indexeddb/shared/IDBIndexInfo.cpp:
(WebCore::IDBIndexInfo::loggingString const):
* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::layoutTraitsClassName const):
* Modules/mediarecorder/MediaRecorder.cpp:
(WebCore::MediaRecorder::create):
* Modules/mediasource/MediaSource.cpp:
(WebCore::addVP9FullRangeVideoFlagToContentType):
(WebCore::MediaSource::isTypeSupported):
* Modules/mediastream/MediaTrackConstraints.cpp:
(WebCore::set):
(WebCore::convertToInternalForm):
* Modules/mediastream/RTCIceCandidate.cpp:
(WebCore::RTCIceCandidate::create):
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::setLocalDescription):
(WebCore::RTCPeerConnection::addIceCandidate):
(WebCore::RTCPeerConnection::iceServersFromConfiguration):
(WebCore::RTCPeerConnection::certificatesFromConfiguration):
(WebCore::RTCPeerConnection::initializeConfiguration):
(WebCore::RTCPeerConnection::setConfiguration):
(WebCore::RTCPeerConnection::chainOperation):
* Modules/mediastream/RTCRtpSFrameTransformer.cpp:
(WebCore::RTCRtpSFrameTransformer::transform):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::doCreateAnswer):
* Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp:
(WebCore::toRtpCodecCapability):
* Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
(WebCore::toException):
(WebCore::toRTCError):
* Modules/model-element/scenekit/SceneKitModelLoaderUSD.mm:
(WebCore::writeToTemporaryFile):
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::checkAndCanonicalizeDetails):
(WebCore::PaymentRequest::show):
* Modules/pictureinpicture/HTMLVideoElementPictureInPicture.cpp:
(WebCore::HTMLVideoElementPictureInPicture::requestPictureInPicture):
* Modules/plugins/YouTubePluginReplacement.cpp:
(WebCore::YouTubePluginReplacement::installReplacement):
(WebCore::processAndCreateYouTubeURL):
* Modules/speech/SpeechRecognitionCaptureSourceImpl.cpp:
(WebCore::SpeechRecognitionCaptureSourceImpl::updateDataSource):
(WebCore::SpeechRecognitionCaptureSourceImpl::sourceStopped):
(WebCore::SpeechRecognitionCaptureSourceImpl::sourceMutedChanged):
* Modules/speech/cocoa/WebSpeechRecognizerTaskMock.mm:
(-[WebSpeechRecognizerTaskMock audioSamplesAvailable:]):
* Modules/storage/StorageManager.cpp:
(WebCore::connectionInfo):
* Modules/web-locks/WebLockManager.cpp:
(WebCore::WebLockManager::signalToAbortTheRequest):
* Modules/webaudio/AudioListener.cpp:
(WebCore::AudioListener::AudioListener):
* Modules/webaudio/AudioParam.cpp:
(WebCore::AudioParam::setAutomationRate):
* Modules/webaudio/AudioParamTimeline.cpp:
(WebCore::AudioParamTimeline::insertEvent):
* Modules/webaudio/BiquadFilterNode.cpp:
(WebCore::BiquadFilterNode::getFrequencyResponse):
* Modules/webaudio/BiquadProcessor.cpp:
(WebCore::BiquadProcessor::BiquadProcessor):
* Modules/webaudio/DelayProcessor.cpp:
(WebCore::DelayProcessor::DelayProcessor):
* Modules/webaudio/WaveShaperNode.cpp:
(WebCore::WaveShaperNode::create):
(WebCore::WaveShaperNode::setCurveForBindings):
* Modules/webauthn/AuthenticatorCoordinator.cpp:
(WebCore::AuthenticatorCoordinatorInternal::needsAppIdQuirks):
* Modules/webauthn/WebAuthenticationUtils.cpp:
(WebCore::buildAttestationMap):
* Modules/webauthn/fido/DeviceResponseConverter.cpp:
(fido::readCTAPMakeCredentialResponse):
* Modules/webauthn/fido/Pin.cpp:
(fido::pin::KeyAgreementResponse::parseFromCOSE):
(fido::pin::TokenRequest::tryCreate):
* Modules/webauthn/fido/U2fResponseConverter.cpp:
(fido::readU2fRegisterResponse):
* Modules/webdatabase/ChangeVersionWrapper.cpp:
(WebCore::ChangeVersionWrapper::performPreflight):
* Modules/webdatabase/DOMWindowWebDatabase.cpp:
(WebCore::DOMWindowWebDatabase::openDatabase):
* Modules/webdatabase/Database.cpp:
(WebCore::Database::Database):
(WebCore::Database::runTransaction):
* Modules/webdatabase/DatabaseAuthorizer.cpp:
(WebCore::DatabaseAuthorizer::addAllowedFunctions):
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::trackerDatabasePath const):
(WebCore::DatabaseTracker::openTrackerDatabase):
* Modules/webdatabase/SQLStatement.cpp:
(WebCore::SQLStatement::execute):
(WebCore::SQLStatement::setDatabaseDeletedError):
(WebCore::SQLStatement::setVersionMismatchedError):
(WebCore::SQLStatement::setFailureDueToQuota):
* Modules/webdatabase/SQLTransaction.cpp:
(WebCore::SQLTransaction::callErrorCallbackDueToInterruption):
(WebCore::SQLTransaction::openTransactionAndPreflight):
(WebCore::SQLTransaction::deliverTransactionCallback):
(WebCore::SQLTransaction::deliverStatementCallback):
(WebCore::SQLTransaction::handleCurrentStatementError):
(WebCore::SQLTransaction::postflightAndCommit):
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::subprotocolSeparator):
(WebCore::WebSocket::close):
(WebCore::WebSocket::suspend):
* Modules/websockets/WebSocket.h:
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::didOpenSocketStream):
(WebCore::WebSocketChannel::didReceiveSocketStreamData):
(WebCore::WebSocketChannel::processFrame):
(WebCore::WebSocketChannel::processOutgoingFrameQueue):
* Modules/websockets/WebSocketDeflateFramer.cpp:
(WebCore::WebSocketExtensionDeflateFrame::processResponse):
(WebCore::WebSocketDeflateFramer::deflate):
(WebCore::WebSocketDeflateFramer::inflate):
* Modules/websockets/WebSocketExtensionDispatcher.cpp:
(WebCore::WebSocketExtensionDispatcher::processHeaderValue):
* Modules/websockets/WebSocketFrame.cpp:
(WebCore::WebSocketFrame::parseFrame):
* Modules/webxr/WebXRWebGLLayer.cpp:
(WebCore::createOpaqueFramebuffer):
(WebCore::WebXRWebGLLayer::create):
* accessibility/AXImage.cpp:
(WebCore::AXImage::imageOverlayElements):
* accessibility/AXLogger.cpp:
(WebCore::AXLogger::AXLogger):
(WebCore::AXLogger::log):
(WebCore::operator<<):
* accessibility/AXLogger.h:
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::isModalElement const):
(WebCore::createFromRenderer):
(WebCore::AXObjectCache::remove):
(WebCore::AXObjectCache::textChanged):
(WebCore::AXObjectCache::handleMenuOpened):
(WebCore::AXObjectCache::notificationPostTimerFired):
(WebCore::AXObjectCache::passwordNotificationPostTimerFired):
(WebCore::AXObjectCache::postNotification):
(WebCore::AXObjectCache::handleMenuItemSelected):
(WebCore::AXObjectCache::selectedStateChanged):
(WebCore::AXObjectCache::postTextStateChangeNotification):
(WebCore::AXObjectCache::handleModalChange):
(WebCore::AXObjectCache::performDeferredCacheUpdate):
(WebCore::AXObjectCache::updateIsolatedTree):
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::determineAccessibilityRole):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::readOnlyValue const):
(WebCore::AccessibilityObject::autoCompleteValue const):
(WebCore::AccessibilityObject::currentValue const):
(WebCore::AccessibilityObject::replaceTextInRange):
(WebCore::AccessibilityObject::computedRoleString const):
(WebCore::nodeHasPresentationRole):
(WebCore::AccessibilityObject::resolvedEditingStyles const):
(WebCore::Accessibility::isRadioButtonInDifferentAdhocGroup):
(WebCore::Accessibility::findMatchingObjects):
* accessibility/AccessibilityObjectInterface.h:
(WebCore::accessibilityRoleToString):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::renderObjectIsObservable const):
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
(WebCore::AccessibilityRenderObject::updateRoleAfterChildrenCreation):
(WebCore::AccessibilityRenderObject::liveRegionRelevant const):
* accessibility/AccessibilityTableCell.cpp:
(WebCore::AccessibilityTableCell::computeAccessibilityIsIgnored const):
* accessibility/AccessibilityTree.cpp:
(WebCore::AccessibilityTree::nodeHasTreeItemChild const):
(WebCore::AccessibilityTree::isTreeValid const):
* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::initializeAttributeData):
(WebCore::AXIsolatedObject::classList const):
* accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::AXIsolatedTree):
(WebCore::AXIsolatedTree::~AXIsolatedTree):
(WebCore::AXIsolatedTree::clear):
(WebCore::AXIsolatedTree::treeForID):
(WebCore::AXIsolatedTree::create):
(WebCore::AXIsolatedTree::removeTreeForPageID):
(WebCore::AXIsolatedTree::objectsForIDs const):
(WebCore::AXIsolatedTree::generateSubtree):
(WebCore::AXIsolatedTree::collectNodeChangesForSubtree):
(WebCore::AXIsolatedTree::updateNode):
(WebCore::AXIsolatedTree::updateNodeProperty):
(WebCore::AXIsolatedTree::updateChildren):
(WebCore::AXIsolatedTree::focusedNode):
(WebCore::AXIsolatedTree::rootNode):
(WebCore::AXIsolatedTree::setRootNode):
(WebCore::AXIsolatedTree::setFocusedNodeID):
(WebCore::AXIsolatedTree::updateLoadingProgress):
(WebCore::AXIsolatedTree::removeNode):
(WebCore::AXIsolatedTree::removeSubtreeFromNodeMap):
(WebCore::AXIsolatedTree::applyPendingChanges):
* accessibility/mac/AccessibilityObjectMac.mm:
(WebCore::AccessibilityObject::subrolePlatformString const):
(WebCore::AccessibilityObject::rolePlatformDescription const):
* animation/AnimationEffect.cpp:
(WebCore::AnimationEffect::getTiming const):
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::animate):
* animation/EffectTiming.h:
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::CSSPropertyIDToIDLAttributeName):
(WebCore::KeyframeEffect::getKeyframes):
* bindings/js/GCController.cpp:
(WebCore::GCController::GCController):
* bindings/js/JSCustomElementInterface.cpp:
(WebCore::JSCustomElementInterface::upgradeElement):
* bindings/js/JSDOMConvertNumbers.h:
(WebCore::Converter<IDLFloat>::convert):
* bindings/js/JSExecStateInstrumentation.h:
(WebCore::JSExecState::instrumentFunction):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::callInWorld):
* bridge/objc/objc_runtime.mm:
(JSC::Bindings::ObjcArray::setValueAt const):
(JSC::Bindings::ObjcArray::valueAt const):
* bridge/runtime_array.cpp:
(JSC::RuntimeArray::put):
(JSC::RuntimeArray::putByIndex):
* bridge/runtime_object.cpp:
(JSC::Bindings::throwRuntimeObjectInvalidAccessError):
* contentextensions/ContentExtensionActions.cpp:
(WebCore::ContentExtensions::ModifyHeadersAction::ModifyHeaderInfo::parse):
(WebCore::ContentExtensions::RedirectAction::parse):
(WebCore::ContentExtensions::RedirectAction::URLTransformAction::parse):
(WebCore::ContentExtensions::RedirectAction::URLTransformAction::QueryTransform::parse):
(WebCore::ContentExtensions::RedirectAction::URLTransformAction::QueryTransform::QueryKeyValue::parse):
* contentextensions/ContentExtensionCompiler.cpp:
(WebCore::ContentExtensions::compileRuleList):
* contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::getDomainList):
(WebCore::ContentExtensions::loadTrigger):
(WebCore::ContentExtensions::loadAction):
* contentextensions/SerializedNFA.cpp:
(WebCore::ContentExtensions::SerializedNFA::serialize):
* contentextensions/URLFilterParser.cpp:
(WebCore::ContentExtensions::URLFilterParser::statusString):
* contentextensions/URLFilterParser.h:
* crypto/SubtleCrypto.cpp:
(WebCore::SubtleCrypto::addAuthenticatedEncryptionWarningIfNecessary):
* crypto/algorithms/CryptoAlgorithmAES_CBC.h:
* crypto/algorithms/CryptoAlgorithmAES_CFB.h:
* crypto/algorithms/CryptoAlgorithmAES_CTR.h:
* crypto/algorithms/CryptoAlgorithmAES_GCM.h:
* crypto/algorithms/CryptoAlgorithmAES_KW.h:
* crypto/algorithms/CryptoAlgorithmECDH.h:
* crypto/algorithms/CryptoAlgorithmECDSA.h:
* crypto/algorithms/CryptoAlgorithmHKDF.h:
* crypto/algorithms/CryptoAlgorithmHMAC.h:
* crypto/algorithms/CryptoAlgorithmPBKDF2.h:
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
* crypto/algorithms/CryptoAlgorithmRSA_PSS.h:
* crypto/algorithms/CryptoAlgorithmSHA1.h:
* crypto/algorithms/CryptoAlgorithmSHA224.h:
* crypto/algorithms/CryptoAlgorithmSHA256.h:
* crypto/algorithms/CryptoAlgorithmSHA384.h:
* crypto/algorithms/CryptoAlgorithmSHA512.h:
* crypto/keys/CryptoKeyAES.cpp:
(WebCore::CryptoKeyAES::exportJwk const):
* crypto/keys/CryptoKeyEC.cpp:
(WebCore::CryptoKeyEC::exportJwk const):
* crypto/keys/CryptoKeyHMAC.cpp:
(WebCore::CryptoKeyHMAC::exportJwk const):
* crypto/keys/CryptoKeyRSA.cpp:
(WebCore::CryptoKeyRSA::exportJwk const):
* css/CSSFontFaceSrcValue.cpp:
(WebCore::CSSFontFaceSrcValue::isSupportedFormat const):
* css/CSSGridTemplateAreasValue.cpp:
(WebCore::stringForPosition):
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::unitTypeString):
* css/CSSSubgridValue.cpp:
(WebCore::CSSSubgridValue::customCSSText const):
* css/DOMCSSNamespace.cpp:
(WebCore::valueWithoutImportant):
* css/DOMCSSRegisterCustomProperty.cpp:
(WebCore::DOMCSSRegisterCustomProperty::registerProperty):
* css/DeprecatedCSSOMValue.cpp:
(WebCore::DeprecatedCSSOMValue::cssText const):
* css/FontFace.cpp:
(WebCore::FontFace::unicodeRange const):
* css/MediaQueryExpression.cpp:
(WebCore::MediaQueryExpression::serialize const):
* css/StyleProperties.cpp:
(WebCore::StyleProperties::getLayeredShorthandValue const):
(WebCore::MutableStyleProperties::setCustomProperty):
* css/makevalues.pl:
* css/parser/MediaQueryParser.cpp:
(WebCore::MediaQueryParser::skipUntilComma):
(WebCore::MediaQueryParser::parseInternal):
* css/parser/SizesAttributeParser.cpp:
(WebCore::SizesAttributeParser::mediaConditionMatches):
* css/typedom/CSSNumericFactory.h:
* css/typedom/CSSNumericValue.cpp:
(WebCore::CSSNumericValue::multiplyInternal):
(WebCore::CSSNumericValue::to):
(WebCore::CSSNumericValue::parse):
* css/typedom/CSSStyleValueFactory.cpp:
(WebCore::CSSStyleValueFactory::reifyValue):
* editing/cocoa/HTMLConverter.mm:
(HTMLConverterCaches::propertyValueForNode):
(HTMLConverter::_processElement):
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::attachmentForData):
* loader/cocoa/BundleResourceLoader.mm:
(WebCore::BundleResourceLoader::loadResourceFromBundle):
* loader/mac/LoaderNSURLExtras.mm:
(suggestedFilenameWithMIMEType):
* page/cocoa/ResourceUsageOverlayCocoa.mm:
(WebCore::HistoricResourceUsageData::HistoricResourceUsageData):
(WebCore::drawCpuHistory):
(WebCore::drawGCHistory):
(WebCore::drawMemHistory):
* page/cocoa/SettingsBaseCocoa.mm:
(WebCore::SettingsBase::initializeDefaultFontFamilies):
* page/mac/PageMac.mm:
(WebCore::Page::platformInitialize):
* platform/LocalizedStrings.cpp:
(WebCore::AXARIAContentGroupText):
* platform/LocalizedStrings.h:
* platform/Pasteboard.h:
* platform/PasteboardCustomData.h:
* platform/audio/cocoa/MediaSessionManagerCocoa.mm:
(WebCore::MediaSessionManagerCocoa::updateNowPlayingInfo):
* platform/cocoa/KeyEventCocoa.mm:
(WebCore::keyIdentifierForCharCode):
* platform/cocoa/PasteboardCocoa.mm:
(WebCore::imageTypeToFakeFilename):
(WebCore::Pasteboard::read):
* platform/cocoa/PasteboardCustomDataCocoa.mm:
(WebCore::PasteboardCustomData::cocoaType):
* platform/graphics/FourCC.h:
(WTF::LogArgument<WebCore::FourCC>::toString):
* platform/graphics/angle/GraphicsContextGLANGLE.cpp:
(WebCore::GraphicsContextGLANGLE::validateDepthStencil):
* platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
(WebCore::CDMPrivateMediaSourceAVFObjC::parseKeySystem):
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::setStorageDirectory):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequests):
* platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
(WebCore::CDMSessionMediaSourceAVFObjC::storagePath const):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::streamSession):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
* platform/mac/DataDetectorHighlight.mm:
(WebCore::DataDetectorHighlight::fadeIn):
(WebCore::DataDetectorHighlight::fadeOut):
* platform/mac/PasteboardMac.mm:
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::keyIdentifierForKeyEvent):
(WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
* platform/mac/PlatformPasteboardMac.mm:
(WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
(WebCore::PlatformPasteboard::write):
(WebCore::createPasteboardItem):
* platform/mac/StringUtilities.mm:
(WebCore::wildcardRegexPatternString):
* platform/mac/ThreadCheck.mm:
(WebCoreReportThreadViolation):
* platform/mac/UserAgentMac.mm:
(WebCore::standardUserAgentWithApplicationName):
* platform/network/ResourceErrorBase.cpp:
* platform/network/ResourceErrorBase.h:
* platform/network/cocoa/RangeResponseGenerator.mm:
(WebCore::synthesizedResponseForRange):
* rendering/RenderThemeMac.mm:
(WebCore::iconForAttachment):
* rendering/style/RenderStyleConstants.cpp:
(WebCore::operator<<):
* svg/SVGFilterElement.h:
* svg/SVGFilterPrimitiveStandardAttributes.h:
* svg/SVGLinearGradientElement.h:
* svg/SVGMarkerElement.h:
* svg/SVGMaskElement.h:
* svg/SVGPathSegImpl.h:
* svg/SVGRadialGradientElement.h:
* svg/properties/SVGPropertyTraits.h:
(WebCore::SVGPropertyTraits<bool>::toString):
* testing/MockContentFilterSettings.h:
(WebCore::MockContentFilterSettings::unblockURLHost):
* xml/XPathValue.h:
(WebCore::XPath::Value::Value):
* xml/XSLStyleSheet.h:
2022-03-25 Tyler Wilcock <tyler_w@apple.com>
Include object IDs in logs and assert in AXIsolatedTree and WebAccessibilityObjectWrapperBase
https://bugs.webkit.org/show_bug.cgi?id=238352
Reviewed by Chris Fleizach.
I've found this additional information to be useful in other branches I'm working on.
* accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::removeSubtreeFromNodeMap):
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(-[WebAccessibilityObjectWrapperBase detachIsolatedObject:]):
2022-03-25 Youenn Fablet <youenn@apple.com>
media/auto-play-web-audio-in-about-blank-iframe.html is failing on EWS MacOS Debug bot
https://bugs.webkit.org/show_bug.cgi?id=238315
Reviewed by Eric Carlson.
Make sure to reset the state to foreground.
Speculative fix as I was not able to reproduce locally.
* testing/Internals.cpp:
2022-03-25 Frédéric Wang <fwang@igalia.com>
Improve rebuilding of ruby subtrees
https://bugs.webkit.org/show_bug.cgi?id=238365
Reviewed by Alan Bujtas.
Don't collapse generated Ruby subtree when tearing down children and take into account the
fact that anonymous before/after node can belong to a display: content child.
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::destroyAndCleanUpAnonymousWrappers): Don't collapse.
* rendering/updating/RenderTreeBuilderRuby.cpp:
(WebCore::lastRubyRun): Child can be also be an anonymous after content.
(WebCore::RenderTreeBuilder::Ruby::findOrCreateParentForChild): When beforeChild is
an anonymous before/after, just fallback to appending to the last ruby run.
2022-03-25 Don Olmstead <don.olmstead@sony.com>
Mismatched forward declaration of GraphicsContextState
https://bugs.webkit.org/show_bug.cgi?id=238359
Reviewed by Darin Adler.
Forward declaration should be for a class not a struct. Fixes a warning.
* platform/graphics/cairo/CairoOperations.h:
2022-03-24 Don Olmstead <don.olmstead@sony.com>
Non-unified build fixes, late March 2022 edition
https://bugs.webkit.org/show_bug.cgi?id=238358
Unreviewed non-unified build fixes.
* html/HTMLInputElement.cpp:
2022-03-24 Chris Dumez <cdumez@apple.com>
String::split() should take in a StringView instead of a String
https://bugs.webkit.org/show_bug.cgi?id=238355
Reviewed by Geoffrey Garen.
* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::classList const):
Call the more efficient split(UChar) overload instead.
2022-03-24 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] REGRESSION(r281291): When accessibility bold is enabled, font-family:system-ui is supposed to be bold
https://bugs.webkit.org/show_bug.cgi?id=237817
<rdar://problem/88249241>
Reviewed by Alan Bujtas.
Accessibility bold is supposed to cause the system font to be rendered as bold, even if the
value of the font-weight property is normal.
The way this is originally supposed to work is that, when accessibility bold is enabled and
software asks for the system font, the font reports to not be bold, but the metrics/contours
end up visually bold to the user. Font variations, however, are a lower-level interface to
the font, and don't abide by the facade. So, before r281291, we weren't applying font variations
to the system font, so the facade was maintained, but r281291 started applying variations to the
system font, thereby breaking this accessibility bold setting.
The solution is to re-implement accessibility bold when we apply font variations. At the point
where we apply the weight variation, we should determine if accessibility bold is in effect, and
if it is, artificially increase the weight of the created font according to the platform's
inflation amount. There are a few SPI functions which aid in this endeavor.
Test: fast/text/accessibility-bold.html
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::fontIsSystemFont):
(WebCore::normalizeGXWeight):
(WebCore::normalizeCTWeight):
(WebCore::denormalizeGXWeight):
(WebCore::denormalizeCTWeight):
(WebCore::overrideEnhanceTextLegibility):
(WebCore::setOverrideEnhanceTextLegibility):
(WebCore::shouldEnhanceTextLegibility):
(WebCore::preparePlatformFont):
(WebCore::fontCacheRegisteredFontsChangedNotificationCallback):
(WebCore::FontCache::platformInit):
(WebCore::variationCapabilitiesForFontDescriptor):
(WebCore::normalizeWeight): Deleted.
(WebCore::denormalizeWeight): Deleted.
* platform/graphics/cocoa/FontCacheCoreText.h:
* testing/Internals.cpp:
(WebCore::Internals::setOverrideEnhanceTextLegibility):
* testing/Internals.h:
* testing/Internals.idl:
2022-03-24 Chris Dumez <cdumez@apple.com>
FileSystem::pathByAppendingComponent() should take in StringViews instead of Strings
https://bugs.webkit.org/show_bug.cgi?id=238344
Reviewed by Geoff Garen.
* Modules/indexeddb/IDBDatabaseIdentifier.cpp:
(WebCore::IDBDatabaseIdentifier::databaseDirectoryRelativeToRoot const):
(WebCore::IDBDatabaseIdentifier::databaseDirectoryRelativeToRoot):
* Modules/indexeddb/IDBDatabaseIdentifier.h:
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::getAllDatabaseNamesAndVersions):
(WebCore::IDBServer::IDBServer::diskUsage):
(WebCore::IDBServer::IDBServer::upgradedDatabaseDirectory):
* Modules/webdatabase/OriginLock.cpp:
(WebCore::lockFileNameForPath):
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::setStorageDirectory):
* platform/network/curl/CurlCacheManager.cpp:
(WebCore::CurlCacheManager::loadIndex):
2022-03-24 Nikolaos Mouchtaris <nmouchtaris@apple.com>
calc(): Handle finite value with infinite step in round()
https://bugs.webkit.org/show_bug.cgi?id=238231
Reviewed by Simon Fraser.
Add handling for finite value with infinite step in round().
* css/calc/CSSCalcOperationNode.cpp:
(WebCore::CSSCalcOperationNode::evaluateOperator):
* css/calc/CSSCalcPrimitiveValueNode.cpp:
(WebCore::CSSCalcPrimitiveValueNode::invert):
2022-03-24 Chris Dumez <cdumez@apple.com>
String's startsWith() / endsWith() / replace() should take in a StringView instead of a String
https://bugs.webkit.org/show_bug.cgi?id=238333
Reviewed by Geoff Garen.
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::shouldIgnoreIceCandidate):
* css/CSSImageValue.cpp:
(WebCore::ResolvedURL::isLocalURL const):
* page/PageConsoleClient.cpp:
(WebCore::PageConsoleClient::screenshot):
* page/csp/ContentSecurityPolicySource.cpp:
(WebCore::ContentSecurityPolicySource::pathMatches const):
* platform/graphics/angle/GraphicsContextGLANGLE.cpp:
(WebCore::GraphicsContextGLANGLE::getUnmangledInfoLog):
* platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
(WebCore::CDMFactoryFairPlayStreaming::supportsKeySystem):
* platform/graphics/gstreamer/ImageDecoderGStreamer.cpp:
(WebCore::ImageDecoderGStreamer::supportsContainerType):
(WebCore::ImageDecoderGStreamer::canDecodeType):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::supportsType):
* platform/graphics/opengl/GraphicsContextGLOpenGL.cpp:
(WebCore::GraphicsContextGLOpenGL::checkVaryingsPacking const):
* platform/network/ParsedRequestRange.cpp:
(WebCore::ParsedRequestRange::parse):
* platform/network/curl/CookieJarDB.cpp:
(WebCore::checkSecureCookie):
2022-03-24 Nikolaos Mouchtaris <nmouchtaris@apple.com>
Fix serialization of nan, infinity, -infinity for calc()
https://bugs.webkit.org/show_bug.cgi?id=238288
Reviewed by Simon Fraser.
Update serializing of nan, infinity, -infinity to be in line with step 2 of:
https://drafts.csswg.org/css-values/#calc-serialize.
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::formatNumberValue const):
(WebCore::CSSPrimitiveValue::formatIntegerValue const):
2022-03-24 Patrick Angle <pangle@apple.com>
Web Inspector: Blank inspector in a page with container queries
https://bugs.webkit.org/show_bug.cgi?id=238338
Reviewed by Devin Rousso.
Because there is no CSSOM implementation for container queries, we are unable to inspect them currently.
However, we should be resilient to the absence of that implementation and expect that not all rules have a
matching CSSOM implementation, instead of just crashing when it happens. This patch only resolves crashes as the
result of the presence of container queries, and followup work will be done to actually plumb the correct
information to Web Inspector to show these rules.
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyleSheet::collectFlatRules):
* inspector/agents/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::collectStyleSheets):
* style/InspectorCSSOMWrappers.cpp:
(WebCore::Style::InspectorCSSOMWrappers::collect):
2022-03-24 Antoine Quint <graouts@webkit.org>
DOM GPUP: paintSystemPreviewBadge (AR QuickLook element badge)
https://bugs.webkit.org/show_bug.cgi?id=238295
rdar://83580608
Reviewed by Dean Jackson.
Add a new SystemImage subclass to deal with the ARKit badge, moving the custom drawing code under
RenderThemeIOS::paintSystemPreviewBadge() to ARKitBadgeSystemImage::draw().
To facilitate this, we must also have ARKitBadgeSystemImage wrap the input Image provided to
RenderThemeIOS::paintSystemPreviewBadge() so that the CoreImage filters are applied correctly.
Finally, we remove some use of `using namespace WebCore` in WebSpeechRecognizerTask and
WebSpeechRecognizerTaskMock since it caused some unified build failures.
* Headers.cmake:
* Modules/speech/cocoa/WebSpeechRecognizerTask.mm:
(-[WebSpeechRecognizerTaskImpl initWithIdentifier:locale:doMultipleRecognitions:reportInterimResults:maxAlternatives:delegateCallback:]):
(-[WebSpeechRecognizerTaskImpl callbackWithTranscriptions:isFinal:]):
(-[WebSpeechRecognizerTaskImpl sendSpeechStartIfNeeded]):
(-[WebSpeechRecognizerTaskImpl sendSpeechEndIfNeeded]):
(-[WebSpeechRecognizerTaskImpl sendEndIfNeeded]):
(-[WebSpeechRecognizerTaskImpl speechRecognizer:availabilityDidChange:]):
(-[WebSpeechRecognizerTaskImpl speechRecognitionTask:didFinishSuccessfully:]):
(-[WebSpeechRecognizerTask initWithIdentifier:locale:doMultipleRecognitions:reportInterimResults:maxAlternatives:delegateCallback:]):
* Modules/speech/cocoa/WebSpeechRecognizerTaskMock.mm:
(-[WebSpeechRecognizerTaskMock initWithIdentifier:locale:doMultipleRecognitions:reportInterimResults:maxAlternatives:delegateCallback:]):
(-[WebSpeechRecognizerTaskMock audioSamplesAvailable:]):
(-[WebSpeechRecognizerTaskMock abort]):
* Modules/system-preview/ARKitBadgeSystemImage.h: Added.
(WebCore::ARKitBadgeSystemImage::encode const):
(WebCore::ARKitBadgeSystemImage::decode):
(isType):
* Modules/system-preview/ARKitBadgeSystemImage.mm: Added.
(WebCore::arKitBundle):
(WebCore::loadARKitPDFPage):
(WebCore::systemPreviewLogo):
(WebCore::ARKitBadgeSystemImage::draw const):
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/SystemImage.h:
* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::drawSystemImage):
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::paintSystemPreviewBadge):
(WebCore::arKitBundle): Deleted.
(WebCore::loadARKitPDFPage): Deleted.
(WebCore::systemPreviewLogo): Deleted.
2022-03-24 Kate Cheney <katherine_cheney@apple.com>
REGRESSION (Safari 15.4): Nonce from link isn't used when loading style sheet
https://bugs.webkit.org/show_bug.cgi?id=238014
<rdar://problem/90599352>
Reviewed by Brent Fulgham.
In https://bugs.webkit.org/show_bug.cgi?id=179728 we implemented
nonce hiding from the DOM. It seems we missed once location
where we need to reference the element.nonce() instead of the
nonce attribute.
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::process):
2022-03-24 Jean-Yves Avenard <jya@apple.com>
Safari can't play video completely at bilibili.com
https://bugs.webkit.org/show_bug.cgi?id=236440
rdar://88761053
Reviewed by Jer Noble.
Video frames were incorrectly evicted during a call to appendBuffer
as the Source Buffer incorrectly assumed a discontinuity was present.
When appending data to a source buffer, the MSE specs describe a method
to detect discontinuities in the Coded Frame Processing algorithm
(https://www.w3.org/TR/media-source/#sourcebuffer-coded-frame-processing)
step 6:
"
- If last decode timestamp for track buffer is set and decode timestamp
is less than last decode timestamp:
OR
- If last decode timestamp for track buffer is set and the difference
between decode timestamp and last decode timestamp is greater than
2 times last frame duration.
"
The issue being what defines the last frame duration.
Is it the frame last seen in the coded frame processing loop or the frame
whose presentation timestamp is just before the one we are currently
processing.
H264 and HEVC have a concept of b-frames: that is a frame that depends
on a future frame to be decoded.
Those frames are found in the container and can be identified by their
presentation timestamp higher than the frame following in decode order.
Those present a challenge as the frame prior the current one in
presentation order, may actually only be found several frames back in
decode order.
Bug 181891 attempted to fix a similar issue, and used the longest
"decode duration" as a workaround to detect discontinuity in the content.
It mentioned adopting the same technique as in Mozilla's MSE
implementation, but Mozilla also skip discontinuity detection within a
media segment (https://www.w3.org/TR/media-source/#media-segment which for
fMP4 is a single moof box) an approach that can't be achieved with
CoreMedia's AVStreamDataParser.
As mentioned in bug 181891, CoreMedia ignore the decode timestamps' delta
and juggles with the sample's duration so that there's no discontinuity
in the demuxed samples' presentation time, causing false positive in the
gap detection algorithm.
Bilibili uses HEVC content, and uses an encoding that generate lots
of b-frames, with a very wide sliding window (seen up to 12 frames).
By using the longest frame duration found in either presentation or
decode duration as threshold to identify a discontinuity, we can
properly parse the content and not incorrectly evict appended frames.
(As a side note, the use of HEVC with B-Frames is peculiar as not all
hardware support it.)
It is difficult to identify here if the issue is within the bilibili's
content or CoreMedia's output, though the responsibility more than
likely lies with bilibili.
Test: media/media-source/media-mp4-hevc-bframes.html
* platform/graphics/SourceBufferPrivate.cpp:
(WebCore::SourceBufferPrivate::TrackBuffer::TrackBuffer):
(WebCore::SourceBufferPrivate::resetTrackBuffers):
(WebCore::SourceBufferPrivate::didReceiveSample):
* platform/graphics/SourceBufferPrivate.h:
2022-03-24 Alan Bujtas <zalan@apple.com>
[LFC][IFC] Remove slow codepath matching arithmetics in FontCascade::widthForSimpleText
https://bugs.webkit.org/show_bug.cgi?id=238306
Reviewed by Antti Koivisto.
By now if we measure some text using the fast codepath, we usually stay on this codepath for the rest
of the layout (i.e. preferred width computation uses the same fast codepath, and we also don't dynamically switch between modern and legacy).
* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::widthForSimpleText const):
2022-03-24 Gabriel Nava Marino <gnavamarino@apple.com>
FormDataConsumer callback happens more than once with an exception
https://bugs.webkit.org/show_bug.cgi?id=238091
In case of an error, it is not expected for the FormDataConsumer callback to happen
more than once with an exception. To avoid this, we introduce FormDataConsumer::didFail
which cancels/clears everything after reporting an error.
Reviewed by Youenn Fablet.
* Modules/fetch/FormDataConsumer.cpp:
(WebCore::FormDataConsumer::read):
(WebCore::FormDataConsumer::consumeFile):
(WebCore::FormDataConsumer::consumeBlob):
(WebCore::FormDataConsumer::didFail):
(WebCore::FormDataConsumer::cancel):
* Modules/fetch/FormDataConsumer.h:
(WebCore::FormDataConsumer::isCancelled):
2022-03-24 Matteo Flores <matteo_flores@apple.com>
Unreviewed, reverting r291789.
This revision caused 65+ new API failures on iOS debug
Reverted changeset:
"Release assert in Document::updateLayout() via
HTMLTextAreaElement::childrenChanged"
https://bugs.webkit.org/show_bug.cgi?id=224471
https://commits.webkit.org/r291789
2022-03-24 Ben Nham <nham@apple.com>
PushAPI.firePushEventWithNoPagesTimeout fails in debug builds
https://bugs.webkit.org/show_bug.cgi?id=238309
Reviewed by Youenn Fablet.
Export RegistrationDatabase::schemaVersion for tests to use.
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::databaseFilename):
(WebCore::cleanOldDatabases):
* workers/service/server/RegistrationDatabase.h:
2022-03-24 Chris Dumez <cdumez@apple.com>
String's find() / reverseFind() / replace() should take in a StringView instead of a String
https://bugs.webkit.org/show_bug.cgi?id=238287
Reviewed by Darin Adler.
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::decodeDatabaseName):
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::setValueCommon):
* page/UserContentURLPattern.cpp:
(WebCore::UserContentURLPattern::parse):
* platform/mediastream/CaptureDevice.h:
(WebCore::CaptureDevice::label const):
2022-03-24 Alan Bujtas <zalan@apple.com>
[LFC][IFC] Do not construct a TextRun for measuring a single whitespace when simplified content measuring can be used
https://bugs.webkit.org/show_bug.cgi?id=238228
Reviewed by Antti Koivisto.
* layout/formattingContexts/inline/InlineItemsBuilder.cpp:
(WebCore::Layout::InlineItemsBuilder::computeInlineTextItemWidths): Just simply call TextUtil::width
* layout/formattingContexts/inline/text/TextUtil.cpp:
(WebCore::Layout::spaceWidth):
(WebCore::Layout::TextUtil::width):
(WebCore::Layout::TextUtil::spaceWidth): Deleted.
* layout/formattingContexts/inline/text/TextUtil.h:
2022-03-24 Tyler Wilcock <tyler_w@apple.com>
AX: Remove firstChild, lastChild, previousSibling, nextSibling, nextSiblingUnignored, and previousSiblingUnignored from the AXCoreObject interface
https://bugs.webkit.org/show_bug.cgi?id=238267
Reviewed by Andres Gonzalez.
All of these except nextSibling and previousSibling are ASSERT_NOT_REACHED no-ops
in AXIsolatedObject. We do compute next and previous sibling for isolated objects,
but they're only used in one place (appendChildrenToArray). Usage of these functions
in appendChildrenToArray doesn't make sense for isolated objects, as it would require
the isolated object to be ignored for them to be called, and we should never have created an
isolated object from an ignored live object.
Dovetailing from that, this patch also removes AXPropertyName::IsAccessibilityIgnored,
since this should always be false for isolated objects. ASSERTs have been added in a
few places to assure this is the case.
* accessibility/AccessibilityObject.cpp:
(WebCore::Accessibility::appendChildrenToArray):
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::firstChild const):
(WebCore::AccessibilityObject::lastChild const):
(WebCore::AccessibilityObject::previousSibling const):
(WebCore::AccessibilityObject::nextSibling const):
* accessibility/AccessibilityObjectInterface.h:
* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::initializeAttributeData):
(WebCore::AXIsolatedObject::firstChild const): Deleted.
(WebCore::AXIsolatedObject::lastChild const): Deleted.
(WebCore::AXIsolatedObject::nextSiblingUnignored const): Deleted.
(WebCore::AXIsolatedObject::previousSiblingUnignored const): Deleted.
* accessibility/isolatedtree/AXIsolatedObject.h:
* accessibility/isolatedtree/AXIsolatedTree.h:
Remove AXPropertyName::NextSibling, AXPropertyName::PreviousSibling,
AXPropertyName::IsAccessibilityIgnored.
2022-03-24 Antti Koivisto <antti@apple.com>
MatchedDeclarationCache key is already hashed
https://bugs.webkit.org/show_bug.cgi?id=238321
Reviewed by Alan Bujtas.
* style/MatchedDeclarationsCache.h:
2022-03-24 Alan Bujtas <zalan@apple.com>
[IFC][Integration] RenderText::computeCanUseSimplifiedTextMeasuring should take first-line style into account
https://bugs.webkit.org/show_bug.cgi?id=238243
Reviewed by Antti Koivisto.
This is in preparation for using the fast text measuring codepath for legacy line layout content.
* layout/integration/LayoutIntegrationBoxTree.cpp:
(WebCore::LayoutIntegration::BoxTree::buildTree):
* rendering/RenderText.cpp:
(WebCore::RenderText::computeCanUseSimplifiedTextMeasuring const):
2022-03-24 Alan Bujtas <zalan@apple.com>
Devirtualize RenderText::width
https://bugs.webkit.org/show_bug.cgi?id=238285
Reviewed by Antti Koivisto.
RenderCombineText handling is moved to RenderText (we already handle combine text in RenderText::widthFromCache).
* rendering/RenderCombineText.cpp:
(WebCore::RenderCombineText::combineTextIfNeeded): These are all non-text-combine callsites.
(WebCore::RenderCombineText::width const): Deleted.
* rendering/RenderCombineText.h:
* rendering/RenderText.cpp:
(WebCore::combineTextWidth): RenderCombineText::combinedTextWidth returns the same value as RenderCombineText::width.
(WebCore::RenderText::widthFromCache const):
(WebCore::RenderText::width const):
* rendering/RenderText.h:
2022-03-24 Kimmo Kinnunen <kkinnunen@apple.com>
REGRESSION (r287807): WEBGL_multi_draw validation rejecting valid arguments
https://bugs.webkit.org/show_bug.cgi?id=238239
Reviewed by Darin Adler.
Fix off-by-one error causing full buffer multidraws to be
marked as invalid.
Enable the newer WebGL conformance tests that test this.
* html/canvas/WebGLMultiDraw.cpp:
(WebCore::WebGLMultiDraw::validateOffset):
2022-03-24 Antti Koivisto <antti@apple.com>
Allow styles with appearance in matched declaration cache
https://bugs.webkit.org/show_bug.cgi?id=238247
Reviewed by Antoine Quint.
Improve cache efficiency by allowing styles with appearance (typically form controls) to be cached.
In Speedometer this improves the cache hit rate ~75% -> 94%.
* style/MatchedDeclarationsCache.cpp:
(WebCore::Style::MatchedDeclarationsCache::isCacheable):
Remove appearance check.
(WebCore::Style::MatchedDeclarationsCache::add):
Also cache the UA style for styles with appearance.
(WebCore::Style::MatchedDeclarationsCache::remove):
* style/MatchedDeclarationsCache.h:
* style/StyleResolver.cpp:
(WebCore::Style::Resolver::applyMatchedProperties):
Also simplify the case where inherited properties affect resolution of other properties by
kicking out the existing entry. This also makes the second attempt cacheable.
* style/StyleResolver.h:
2022-03-09 Sergio Villar Senin <svillar@igalia.com>
Release assert in Document::updateLayout() via HTMLTextAreaElement::childrenChanged
https://bugs.webkit.org/show_bug.cgi?id=224471
Reviewed by Ryosuke Niwa.
Executing some editing commands in a text area might force the recomputation of things
like caret or the visible selection position and extent. Under some circumstances (like
when the text area has no content and children) we might end up trying to update layout
when it is not safe as a side effect of updating the caret.
In order to fix that, we can switch to a model in which we update the selection asynchronously
in the case of having a non-user triggered change. That way we don't do it inside
a restricted layout scope.
The App Highlight restoration code had to be tuned as well (when restoring and scrolling to reveal
a Quick Note on iOS MacOS). It uses TemporarySelectionChange to select and scroll to reveal the highlight
range; the code assumed that this scrolling happens synchronously, since it reverts the selection to
the original range at the end of `AppHighlightStorage::attemptToRestoreHighlightAndScroll` when the
TemporarySelectionChange falls out of scope. That is however no longer the case. Actually no scrolling
happened after this patch because we end up only scheduling the appearance update timer before setting
the selection back to the original state with `SelectionRevealMode::DoNotReveal`. Since this only happens
when the user interacts in the Notes app, it seems sensible to consider it as a user triggered event.
* Modules/highlight/AppHighlightStorage.cpp:
(WebCore::AppHighlightStorage::attemptToRestoreHighlightAndScroll): Consider the selection change
as user triggered so scrolling actually happens.
* editing/Editor.cpp:
(WebCore::TemporarySelectionChange::setSelection): Check the UserTriggered flags for default options.
* editing/Editor.h: Added a new UserTriggered flag.
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::setSelection): Call scheduleAppearanceUpdateAfterStyleChange() for
!IsUserTriggered changes.
(WebCore::FrameSelection::updateSelectionAppearanceNow): Renamed from updateSelectionByUpdatingLayoutOrStyle.
It does not need the Document& attribute because it was always called with m_document.
(WebCore::FrameSelection::absoluteCaretBounds): Replaced updateSelectionByUpdatingLayoutOrStyle with
updateSelectionAppearanceNow().
(WebCore::FrameSelection::setCaretVisibility): Ditto.
(WebCore::FrameSelection::selectionBounds const): Ditto.
(WebCore::FrameSelection::revealSelection): Call updateSelectionAppearanceNow().
(WebCore::FrameSelection::updateAppearanceIfRevealingSelectionIsNeeded): New method.
(WebCore::updateSelectionByUpdatingLayoutOrStyle): Deleted.
* editing/FrameSelection.h:
* page/EventHandler.cpp:
(WebCore::setSelectionIfNeeded): Set the UserTriggered flag for calling setSelection().
* page/Page.cpp:
(WebCore::Page::doAfterUpdateRendering): Call updateAppearanceAfterLayout().
2022-03-23 Rob Buis <rbuis@igalia.com>
setNeedsLayout() should not be called when changing the SVG properties
https://bugs.webkit.org/show_bug.cgi?id=230296
Reviewed by Said Abou-Hallawa.
Make SVG not call setNeedsLayout() from outside RenderTreeUpdater::updateRenderTree() when an attribute changes.
This ensures there will not be a dirty rendering tree immediately after updating it.
The patch also tries to avoid invalidate wording since this is quite generic.
Based on the initial patch by Said Abou-Hallawa.
* dom/ElementData.h:
(WebCore::ElementData::svgResourcesInAncestorChainAreDirty const):
(WebCore::ElementData::setSVGResourcesInAncestorChainAreDirty const):
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateRenderTree):
* svg/SVGAnimateMotionElement.cpp:
(WebCore::SVGAnimateMotionElement::applyResultsToTarget):
* svg/SVGClipPathElement.cpp:
(WebCore::SVGClipPathElement::svgAttributeChanged):
(WebCore::SVGClipPathElement::childrenChanged):
* svg/SVGComponentTransferFunctionElement.cpp:
(WebCore::SVGComponentTransferFunctionElement::svgAttributeChanged):
* svg/SVGElement.cpp:
(WebCore::SVGElement::setSVGResourcesInAncestorChainAreDirty):
(WebCore::SVGElement::invalidateSVGResourcesInAncestorChainIfNeeded):
* svg/SVGElement.h:
* svg/SVGElementInlines.h:
(WebCore::SVGElement::setPresentationalHintStyleIsDirty):
* svg/SVGFEBlendElement.cpp:
(WebCore::SVGFEBlendElement::svgAttributeChanged):
* svg/SVGFEColorMatrixElement.cpp:
(WebCore::SVGFEColorMatrixElement::svgAttributeChanged):
* svg/SVGFECompositeElement.cpp:
(WebCore::SVGFECompositeElement::svgAttributeChanged):
* svg/SVGFEConvolveMatrixElement.cpp:
(WebCore::SVGFEConvolveMatrixElement::setOrder):
(WebCore::SVGFEConvolveMatrixElement::setKernelUnitLength):
(WebCore::SVGFEConvolveMatrixElement::svgAttributeChanged):
* svg/SVGFEDiffuseLightingElement.cpp:
(WebCore::SVGFEDiffuseLightingElement::svgAttributeChanged):
* svg/SVGFEDisplacementMapElement.cpp:
(WebCore::SVGFEDisplacementMapElement::svgAttributeChanged):
* svg/SVGFEDropShadowElement.cpp:
(WebCore::SVGFEDropShadowElement::setStdDeviation):
(WebCore::SVGFEDropShadowElement::svgAttributeChanged):
* svg/SVGFEGaussianBlurElement.cpp:
(WebCore::SVGFEGaussianBlurElement::setStdDeviation):
(WebCore::SVGFEGaussianBlurElement::svgAttributeChanged):
* svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::buildPendingResource):
(WebCore::SVGFEImageElement::svgAttributeChanged):
* svg/SVGFELightElement.cpp:
(WebCore::SVGFELightElement::childrenChanged):
* svg/SVGFEMergeNodeElement.cpp:
(WebCore::SVGFEMergeNodeElement::svgAttributeChanged):
* svg/SVGFEMorphologyElement.cpp:
(WebCore::SVGFEMorphologyElement::setRadius):
(WebCore::SVGFEMorphologyElement::svgAttributeChanged):
* svg/SVGFEOffsetElement.cpp:
(WebCore::SVGFEOffsetElement::svgAttributeChanged):
* svg/SVGFESpecularLightingElement.cpp:
(WebCore::SVGFESpecularLightingElement::svgAttributeChanged):
* svg/SVGFETileElement.cpp:
(WebCore::SVGFETileElement::svgAttributeChanged):
* svg/SVGFilterElement.cpp:
(WebCore::SVGFilterElement::svgAttributeChanged):
(WebCore::SVGFilterElement::childrenChanged):
* svg/SVGFilterPrimitiveStandardAttributes.cpp:
(WebCore::SVGFilterPrimitiveStandardAttributes::svgAttributeChanged):
(WebCore::SVGFilterPrimitiveStandardAttributes::childrenChanged):
(WebCore::SVGFilterPrimitiveStandardAttributes::invalidateFilterPrimitiveParent):
(WebCore::invalidateFilterPrimitiveParent): Deleted.
* svg/SVGFilterPrimitiveStandardAttributes.h:
(WebCore::SVGFilterPrimitiveStandardAttributes::invalidate): Deleted.
* svg/SVGForeignObjectElement.cpp:
(WebCore::SVGForeignObjectElement::svgAttributeChanged):
* svg/SVGGeometryElement.cpp:
(WebCore::SVGGeometryElement::svgAttributeChanged):
* svg/SVGGradientElement.cpp:
(WebCore::SVGGradientElement::svgAttributeChanged):
(WebCore::SVGGradientElement::childrenChanged):
* svg/SVGGraphicsElement.cpp:
(WebCore::SVGGraphicsElement::svgAttributeChanged):
* svg/SVGImageElement.cpp:
(WebCore::SVGImageElement::svgAttributeChanged):
* svg/SVGLineElement.cpp:
(WebCore::SVGLineElement::svgAttributeChanged):
* svg/SVGLinearGradientElement.cpp:
(WebCore::SVGLinearGradientElement::svgAttributeChanged):
* svg/SVGMarkerElement.cpp:
(WebCore::SVGMarkerElement::svgAttributeChanged):
(WebCore::SVGMarkerElement::childrenChanged):
* svg/SVGMaskElement.cpp:
(WebCore::SVGMaskElement::svgAttributeChanged):
(WebCore::SVGMaskElement::childrenChanged):
* svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::svgAttributeChanged):
* svg/SVGPatternElement.cpp:
(WebCore::SVGPatternElement::svgAttributeChanged):
(WebCore::SVGPatternElement::childrenChanged):
* svg/SVGPolyElement.cpp:
(WebCore::SVGPolyElement::svgAttributeChanged):
* svg/SVGRadialGradientElement.cpp:
(WebCore::SVGRadialGradientElement::svgAttributeChanged):
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::updateCurrentTranslate):
(WebCore::SVGSVGElement::svgAttributeChanged):
* svg/SVGStopElement.cpp:
(WebCore::SVGStopElement::svgAttributeChanged):
* svg/SVGTRefElement.cpp:
(WebCore::SVGTRefElement::svgAttributeChanged):
* svg/SVGTextContentElement.cpp:
(WebCore::SVGTextContentElement::svgAttributeChanged):
* svg/SVGTextPathElement.cpp:
(WebCore::SVGTextPathElement::svgAttributeChanged):
* svg/SVGTextPositioningElement.cpp:
(WebCore::SVGTextPositioningElement::svgAttributeChanged):
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::svgAttributeChanged):
* svg/SVGViewElement.cpp:
(WebCore::SVGViewElement::svgAttributeChanged):
2022-03-23 Sihui Liu <sihui_liu@apple.com>
Add logging for LocalStorage and IndexedDB data migration
https://bugs.webkit.org/show_bug.cgi?id=238169
Reviewed by Chris Dumez.
* platform/sql/SQLiteFileSystem.cpp:
(WebCore::SQLiteFileSystem::moveDatabaseFile):
* platform/sql/SQLiteFileSystem.h:
2022-03-23 Alex Christensen <achristensen@webkit.org>
Add off-by-default experimental feature for app store attribution
https://bugs.webkit.org/show_bug.cgi?id=238294
Reviewed by John Wilander.
In r291735 I landed a way to give SKAdNetwork a way to private report app purchase attribution
which isn't implemented yet. Turn it off in WebKit until the time is right.
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::parsePrivateClickMeasurementForSKAdNetwork const):
2022-03-23 Chris Dumez <cdumez@apple.com>
Prepare JSC for making the String(const char*) constructor explicit
https://bugs.webkit.org/show_bug.cgi?id=238264
Reviewed by Geoff Garen.
* bindings/js/JSDOMGlobalObject.cpp:
* bindings/js/JSDOMWindowBase.cpp:
* bindings/js/JSDOMWindowProperties.cpp:
* bindings/js/JSFileSystemDirectoryHandleIterator.cpp:
* bindings/js/JSIDBSerializationGlobalObject.cpp:
* bindings/js/JSRemoteDOMWindowBase.cpp:
* bindings/js/JSShadowRealmGlobalScopeBase.cpp:
* bindings/js/JSWindowProxy.cpp:
* bindings/js/JSWorkerGlobalScopeBase.cpp:
* bindings/js/JSWorkletGlobalScopeBase.cpp:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bridge/objc/ObjCRuntimeObject.mm:
* bridge/objc/objc_instance.mm:
(JSC::Bindings::ObjcInstance::getMethod):
* bridge/objc/objc_runtime.mm:
* bridge/runtime_array.cpp:
* bridge/runtime_method.cpp:
* bridge/runtime_object.cpp:
2022-03-23 Said Abou-Hallawa <said@apple.com>
[GPU Process] Ensure DisplayList::Recorder and its base class are initialized with the same GraphicsContextState
https://bugs.webkit.org/show_bug.cgi?id=238278
rdar://84602660
Reviewed by Simon Fraser.
DisplayList::RecorderImpl passes the initial GraphicsContextState to its
base class DisplayList::Recorder which pushes it on its stack. But
DisplayList::Recorder does not pass this initial GraphicsContextState to
its base class which is GraphicsContext. So DisplayList::Recorder ends up
having the initial state but the GraphicsContext ends up having the default
state.
DisplayList::Recorder::drawGlyphs() calls DrawGlyphsRecorder::drawGlyphs()
which stores the original fillBrush, strokeBrush and dropShadow. It uses
these original values to restore the owner GraphicsContext when it finishes.
The problem is DrawGlyphsRecorder::drawGlyphs() stores the values in the
state of the GraphicsContext which are the default. So in some cases we
may restore the default state to the drawing GraphicsContext.
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::GraphicsContext):
* platform/graphics/GraphicsContext.h:
* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::Recorder):
2022-03-23 Andres Gonzalez <andresg_22@apple.com>
ITM: Lazy caching of HelpText property that results in a call to textUnderElement().
https://bugs.webkit.org/show_bug.cgi?id=237923
<rdar://problem/90332779>
Reviewed by Chris Fleizach.
Caching HelpText in the initialization of an IsolatedObject properties
for all objects often results in a call to AXRenderObject::textUnderElement,
which can be expensive and makes the creation and update of the isolated
tree costly. With this patch we cache HelpText on first request.
* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::getOrRetrievePropertyValue):
* accessibility/isolatedtree/AXIsolatedObject.h:
* accessibility/isolatedtree/mac/AXIsolatedObjectMac.mm:
(WebCore::AXIsolatedObject::initializePlatformProperties):
(WebCore::AXIsolatedObject::helpTextAttributeValue const):
2022-03-23 Jer Noble <jer.noble@apple.com>
[Cocoa] MSE-backed videos fail to play in Captive Portal mode
https://bugs.webkit.org/show_bug.cgi?id=237787
<rdar://89318047>
Reviewed by Eric Carlson.
Updated test: media/media-source/media-source-allowed-codecs.html
When generating the "codecs" string for a given MSE track, we were previously casting
the FourCC code (a uint32) to a string, and passing that across the GPU process boundary,
and reconstituting the string on the WebContent process side. This caused the codec entry
to be "reversed", (e.g., 'aac ' turned into ' caa'), and fail codec validation.
Instead, use the FourCharCode class to properly create a string from the codec ID.
* platform/graphics/avfoundation/objc/SourceBufferParserAVFObjC.mm:
2022-03-23 Jer Noble <jer.noble@apple.com>
[iOS] WebKit app is sometimes not "Now Playing" during initial playback
https://bugs.webkit.org/show_bug.cgi?id=236993
<rdar://88827167>
Reviewed by Eric Carlson.
Test: media/audio-session-category-at-most-recent-playback.html
Recently, we have added the concept of "preparingToPlay" to PlatformMediaSession to allow
the correct category to be set if updateSessionState() is called after playback is allowed
by the MediaSessionManager, but before playback is actually started by the media element.
However, this depends on updateSessionState() being called synchronously during playback.
We disabled this synchronous update in r269077 due to the large runtime cost when a large
number of media elements are created (but not used) at once.
Relax this asynchronous update in the case where the state is moving to "Playing", which
ensures that the correct AudioSessionCategory is set before playback starts, rather than
immediately afterward.
To support testing that the category was correctly set before playback started, add an
ivar to HTMLMediaElement that is set to the current AudioSessionCategory immediately before
the media element instructs the MediaPlayer to start playback. Expose this ivar to Internals.
Drive-by fixes: AudioSession::CategoryType cannot be forward declared, as it is a public
member of a class. Allow the enum to be forward declared by moving the declaration outside
the class, but allow current uses of the enum to continue by typedefing it inside the class
to the original enum name. Add an IDL enumeration matching the AudioSession one in Interals.idl
and convert the existing audioSessionCategory() call to use the new enumeration.
(Unforunately in the case where USE_AUDIO_SESSION is not set, the enumeration must be re-
declared. This can be removed and the entire implementation wrapped in a USE() check, once
the bindings generator is extended to allow "Conditional="-style attributes for USE checks.)
The added test is flakey due to a previous change which would keep the MediaSession category
in "MediaPlayback" for up to 2s after playback ends. To counteract this flakiness, reset the
state of the PlatformMediaSessionManager between tests.
* html/HTMLMediaElement.cpp:
(WebCore::m_categoryAtMostRecentPlayback):
(WebCore::HTMLMediaElement::playPlayer):
(WebCore::m_logIdentifier): Deleted.
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::categoryAtMostRecentPlayback const):
* platform/audio/AudioSession.h:
* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::sessionStateChanged):
* platform/audio/PlatformMediaSessionManager.h:
(WebCore::PlatformMediaSessionManager::resetSessionState):
* platform/audio/cocoa/MediaSessionManagerCocoa.h:
* platform/audio/cocoa/MediaSessionManagerCocoa.mm:
(WebCore::MediaSessionManagerCocoa::resetSessionState):
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
* testing/Internals.cpp:
(WebCore::Internals::audioSessionCategory const):
(WebCore::Internals::categoryAtMostRecentPlayback const):
* testing/Internals.h:
* testing/Internals.idl:
2022-03-22 Brandon Stewart <brandonstewart@apple.com>
WBR element should set Clear property to None
https://bugs.webkit.org/show_bug.cgi?id=238275
Reviewed by Alan Bujtas.
WBR elements need to have their Clear property automatically set to None.
BR elements do not need this change.
* layout/integration/LayoutIntegrationBoxTree.cpp:
(WebCore::LayoutIntegration::BoxTree::buildTree):
2022-03-23 Kimmo Kinnunen <kkinnunen@apple.com>
After losing context due to too many contexts, getError() does not return CONTEXT_LOST_WEBGL
https://bugs.webkit.org/show_bug.cgi?id=236965
Reviewed by Kenneth Russell.
After generating context lost, getError() is specified to return:
- CONTEXT_LOST_WEBGL for first call
- NO_ERROR for all the next calls.
WEBGL_lose_context is specified to add INVALID_OPERATION errors
even after context lost.
Change the code so that CONTEXT_LOST_WEBGL and WEBGL_lose_context induced
INVALID_OPERATION errors go to error vector in context lost -specific state.
Previously, these errors went into the m_context error vector. This is problematic
especially in the case where context loss happens where the m_context gets destroyed --
the error vector would be gone. This kind of loss happens for example when contexts
get lost due to the process having too many active contexts (least active context is "recycled").
Previously, any synthetized error was potentially obtainable after context lost. This is problematic
as it is not as specified. As mentioned above, only errors allowed after context lost is
- CONTEXT_LOST_WEBGL first after context lost
- WEBGL_lose_context.loseContext() and WEBGL_lose_context.restoreContext() induced INVALID_OPERATIONs
Changes the behavior to not report INVALID_OPERATION error in the theoretical case where we fail to
instantiate a new context. This is not allowed by the spec. Instead, just print an error to the console.
No new tests, updates the expectations of old ones with less failures.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::initializeNewContext):
(WebCore::WebGLRenderingContextBase::getError):
(WebCore::WebGLRenderingContextBase::isContextLost const):
(WebCore::WebGLRenderingContextBase::isContextLostOrPending):
(WebCore::WebGLRenderingContextBase::forceLostContext):
(WebCore::WebGLRenderingContextBase::loseContextImpl):
(WebCore::WebGLRenderingContextBase::forceRestoreContext):
(WebCore::WebGLRenderingContextBase::isContextUnrecoverablyLost const):
(WebCore::WebGLRenderingContextBase::scheduleTaskToDispatchContextLostEvent):
(WebCore::WebGLRenderingContextBase::maybeRestoreContext):
(WebCore::WebGLRenderingContextBase::synthesizeGLError):
(WebCore::WebGLRenderingContextBase::synthesizeLostContextGLError):
* html/canvas/WebGLRenderingContextBase.h:
(WebCore::WebGLRenderingContextBase::ContextLostState::ContextLostState):
2022-03-23 Kimmo Kinnunen <kkinnunen@apple.com>
Context2D drawImage(img, x, y, w, h) should not throw IndexSizeError when width == 0 or height == 0
https://bugs.webkit.org/show_bug.cgi?id=238195
Reviewed by Simon Fraser.
When drawing HTMLImageElement with width == 0 or height==0, do nothing as per spec.
When drawing HTMLCanvasElement with source rectangle width == 0 or height == 0,
do nothing as per spec.
Previously these would throw IndexSizeError. The CanvasDrawImage methods do not throw these.
Spec:
HTML Living Standard — Last Updated 17 March 2022
https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-drawimage
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::drawImage):
2022-03-23 Tyler Wilcock <tyler_w@apple.com>
AccessibilityRenderObject::nextSibling should allow parent differences in the presence of display: contents
https://bugs.webkit.org/show_bug.cgi?id=238184
Reviewed by Andres Gonzalez.
AccessibilityRenderObject::nextSibling currently has this logic to
return nullptr if the computed sibling has a parent different from `this`:
auto* nextObject = objectCache->getOrCreate(nextSibling);
if (nextObject && nextObject->parentObject() != this->parentObject())
return nullptr;
This is problematic in the presence of display: contents since we expect
parent object differences due to the way this property affects the render tree.
Concretely, this breaks the firstChild(), nextSibling() iteration we do throughout
WebKit (e.g. in AccessibilityRenderObject::addChildren), as when we get to an element
with display: contents we get a parent mismatch and iteration stops unnecessarily.
This patch fixes the issue by allowing a parent mismatch when either
object has display: contents, as we account for this difference in the
appropriate places (e.g. AccessibilityObject::insertChild).
Test: accessibility/display-contents-search-traversal.html
* accessibility/AXLogger.cpp:
(WebCore::operator<<):
Log when an object has display: contents. This property affects the
render tree and AX tree, so it's useful to log.
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::hasDisplayContents const): Added.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::nextSibling const):
2022-03-23 Youenn Fablet <youenn@apple.com>
VideoFrame does not need to inherit from MediaSample
https://bugs.webkit.org/show_bug.cgi?id=238071
Reviewed by Eric Carlson.
Update MediaSample, MediaSampleAVFObjC and VideoFrame according the separation.
This is a refactoring, covered by existing tests.
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/MediaSample.h:
* platform/VideoFrame.cpp:
* platform/VideoFrame.h:
* platform/VideoFrame.mm: Added.
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
* platform/graphics/gstreamer/VideoFrameGStreamer.cpp:
* platform/graphics/gstreamer/VideoFrameGStreamer.h:
2022-03-23 Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
REGRESSION(r291611): Fix GTK/WPE build
https://bugs.webkit.org/show_bug.cgi?id=238248
Unreviewed build fix.
* platform/mediastream/libwebrtc/gstreamer/RealtimeIncomingVideoSourceLibWebRTC.cpp:
(WebCore::RealtimeIncomingVideoSourceLibWebRTC::OnFrame):
* platform/mediastream/libwebrtc/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.cpp:
(WebCore::RealtimeOutgoingVideoSourceLibWebRTC::videoFrameAvailable):
2022-03-23 Ziran Sun <zsun@igalia.com>
[InputElement] Add HTMLInputElement::showPicker() method
https://bugs.webkit.org/show_bug.cgi?id=237192
Reviewed by Darin Adler.
At https://github.com/whatwg/html/issues/6909, it proposes to add a
new HTMLInputElement::showPicker() method to show a brower picker for
temporal, color and file input elements.
Chromium has introduced this feature at
https://bugs.chromium.org/p/chromium/issues/detail?id=939561.
This CL imports the changes from Chromium CLs at
https://chromium-review.googlesource.com/c/chromium/src/+/3056920
and
https://chromium-review.googlesource.com/c/chromium/src/+/3310677
The support for temporal input element is not included in this CL. We might
need a bit more investigation on it and hopefully will addess at a later stage.
* html/ColorInputType.cpp:
(WebCore::ColorInputType::handleDOMActivateEvent):
(WebCore::ColorInputType::showPicker):
(WebCore::ColorInputType::allowsShowPickerAcrossFrames):
* html/ColorInputType.h:
* html/FileInputType.cpp:
(WebCore::FileInputType::handleDOMActivateEvent):
(WebCore::FileInputType::showPicker):
(WebCore::FileInputType::allowsShowPickerAcrossFrames):
* html/FileInputType.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::showPicker):
* html/HTMLInputElement.h:
* html/HTMLInputElement.idl:
* html/InputType.cpp:
(WebCore::InputType::allowsShowPickerAcrossFrames):
(WebCore::InputType::showPicker):
* html/InputType.h:
2022-03-23 Youenn Fablet <youenn@apple.com>
Computation of Document siteForCookies is buggy in case document is created by window.open
https://bugs.webkit.org/show_bug.cgi?id=238202
<rdar://88979099>
Reviewed by John Wilander.
For top level navigations, we need to use the security origin to compute siteForCookies as the document
may have the opener security origin.
Add a Document routine to handle this case.
Tests: http/tests/cookies/same-site/popup-from-iframe-same-site-with-post-form.html
http/tests/cookies/same-site/popup-same-site-with-post-form.html
* dom/Document.cpp:
* dom/Document.h:
* loader/FrameLoader.cpp:
2022-03-22 Ben Nham <nham@apple.com>
Only show notification permission prompt on transient activation
https://bugs.webkit.org/show_bug.cgi?id=238188
Reviewed by Youenn Fablet.
In r291427, we changed Notification.requestPermission and PushManager.subscribe to only show
a permission prompt when processing a user gesture. This ended up being too restrictive and
causes compatibility problems with some large sites.
Instead, match Chrome and Firefox by allowing these prompts after a transient activiation,
i.e. a user gesture within the past second.
Per Maciej's suggestion, we also consume the activation to help combat prompt spam.
Covered by new and existing layout tests.
* Modules/notifications/Notification.cpp:
(WebCore::Notification::requestPermission):
* Modules/push-api/PushManager.cpp:
(WebCore::PushManager::subscribe):
2022-03-22 Alex Christensen <achristensen@webkit.org>
Implement PCM to SKAdNetwork bridge
https://bugs.webkit.org/show_bug.cgi?id=237969
<rdar://82988054>
Reviewed by John Wilander.
When clicking on an app store link that has been decorated with the necessary PCM attributes,
we give information about the click to SKAdNetwork to send an anonymous attribution report later
if the user buys the app because of the click. That part has not been implemented yet, so to test
we simply report the information that we are giving to SKAdNetwork in an API test which uses an HTTPS
proxy so we don't actually connect to apps.apple.com when running the test.
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::attributionDestinationURLForPCM const):
(WebCore::HTMLAnchorElement::mainDocumentRegistrableDomainForPCM const):
(WebCore::HTMLAnchorElement::attributionSourceNonceForPCM const):
(WebCore::HTMLAnchorElement::parsePrivateClickMeasurementForSKAdNetwork const):
(WebCore::HTMLAnchorElement::parsePrivateClickMeasurement const):
(WebCore::HTMLAnchorElement::handleClick):
* html/HTMLAnchorElement.h:
* loader/PrivateClickMeasurement.cpp:
(WebCore::PrivateClickMeasurement::appStoreURLAdamID):
* loader/PrivateClickMeasurement.h:
(WebCore::PrivateClickMeasurement::adamID const):
(WebCore::PrivateClickMeasurement::setAdamID):
(WebCore::PrivateClickMeasurement::encode const):
(WebCore::PrivateClickMeasurement::decode):
2022-03-22 Alex Christensen <achristensen@webkit.org>
Add a few more WEBCORE_EXPORT macros
https://bugs.webkit.org/show_bug.cgi?id=238214
Reviewed by Eric Carlson.
These are needed to successfully link when building with -fsanitize=fuzzer,address
* dom/Document.h:
* html/HTMLCollection.h:
* html/HTMLOptionsCollection.h:
* platform/Pasteboard.h:
* platform/mediastream/mac/CoreAudioCaptureSource.h:
2022-03-22 Chris Dumez <cdumez@apple.com>
Use ASCIILiteral in a few more places where it is useful
https://bugs.webkit.org/show_bug.cgi?id=238235
Reviewed by Geoffrey Garen.
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::setValueCommon):
* platform/animation/TimingFunction.cpp:
(WebCore::TimingFunction::cssText const):
2022-03-22 Chris Dumez <cdumez@apple.com>
Add URL::stringWithoutFragmentIdentifier() overload which returns a String instead of a StringView
https://bugs.webkit.org/show_bug.cgi?id=238221
Reviewed by Geoffrey Garen.
* page/History.cpp:
(WebCore::History::stateObjectAdded):
* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::getBlobDataFromURL const):
(WebCore::BlobRegistryImpl::registerBlobURLHandle):
(WebCore::BlobRegistryImpl::unregisterBlobURLHandle):
(WebCore::blobURLWithoutFragment): Deleted.
2022-03-22 Sihui Liu <sihui_liu@apple.com>
Check if origin can access storage in Storage API
https://bugs.webkit.org/show_bug.cgi?id=238158
Reviewed by Chris Dumez.
According to spec https://storage.spec.whatwg.org/#obtain-a-storage-key, origin should not access Storage API if
it's opaque. Also, origin should not access storage if it's blocked by storage policy, so we use
SecurityOrigin::canAccessStorage to perform the origin check, like what we do for the other storage APIs.
Updated expectation for imported tests.
* Modules/storage/StorageManager.cpp:
(WebCore::connectionInfo):
* page/SecurityOrigin.h:
(WebCore::SecurityOrigin::canAccessStorageManager const):
2022-03-22 Alan Bujtas <zalan@apple.com>
[IFC][Integration] Rename InlineIteratorLine.cpp to InlineIteratorLineBox.cpp
https://bugs.webkit.org/show_bug.cgi?id=238219
Unreviewed.
r291548 should have included this rename.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/integration/InlineIteratorLineBox.cpp: Renamed from Source/WebCore/layout/integration/InlineIteratorLine.cpp.
(WebCore::InlineIterator::LineBoxIterator::LineBoxIterator):
(WebCore::InlineIterator::LineBoxIterator::atEnd const):
(WebCore::InlineIterator::LineBoxIterator::traverseNext):
(WebCore::InlineIterator::LineBoxIterator::traversePrevious):
(WebCore::InlineIterator::LineBoxIterator::operator== const):
(WebCore::InlineIterator::firstLineBoxFor):
(WebCore::InlineIterator::lastLineBoxFor):
(WebCore::InlineIterator::LineBox::next const):
(WebCore::InlineIterator::LineBox::previous const):
(WebCore::InlineIterator::LineBox::firstLeafBox const):
(WebCore::InlineIterator::LineBox::lastLeafBox const):
(WebCore::InlineIterator::closestBoxForHorizontalPosition):
2022-03-22 Fujii Hironori <Hironori.Fujii@sony.com>
[WinCairo] RemoteGraphicsContextGL.h(78): error C2027: use of undefined type 'WebCore::GraphicsContextGL'
https://bugs.webkit.org/show_bug.cgi?id=238223
Unreviewed build fix.
r291610 renamed GraphicsContextGLTextureMapper to GraphicsContextGLTextureMapperANGLE.
* platform/graphics/texmap/TextureMapperGCGLPlatformLayer.cpp:
(WebCore::TextureMapperGCGLPlatformLayer::TextureMapperGCGLPlatformLayer):
* platform/graphics/texmap/TextureMapperGCGLPlatformLayer.h:
2022-03-22 Said Abou-Hallawa <said@apple.com>
[GPU Process] Make GraphicsContextState a class
https://bugs.webkit.org/show_bug.cgi?id=238192
Reviewed by Simon Fraser.
This will make the members be private so we have to provide getters for
all of them. This change will prevent changing the members without going
through the setters.
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::GraphicsContext):
* platform/graphics/GraphicsContext.h:
(WebCore::GraphicsContext::GraphicsContext):
(WebCore::GraphicsContext::fillBrush const):
(WebCore::GraphicsContext::fillColor const):
(WebCore::GraphicsContext::fillGradient const):
(WebCore::GraphicsContext::fillGradientSpaceTransform const):
(WebCore::GraphicsContext::fillPattern const):
(WebCore::GraphicsContext::fillRule const):
(WebCore::GraphicsContext::strokeBrush const):
(WebCore::GraphicsContext::strokeColor const):
(WebCore::GraphicsContext::strokeGradient const):
(WebCore::GraphicsContext::strokeGradientSpaceTransform const):
(WebCore::GraphicsContext::strokePattern const):
(WebCore::GraphicsContext::strokeThickness const):
(WebCore::GraphicsContext::strokeStyle const):
(WebCore::GraphicsContext::dropShadow const):
(WebCore::GraphicsContext::compositeMode const):
(WebCore::GraphicsContext::alpha const):
(WebCore::GraphicsContext::textDrawingMode const):
(WebCore::GraphicsContext::imageInterpolationQuality const):
(WebCore::GraphicsContext::shouldAntialias const):
(WebCore::GraphicsContext::shouldSmoothFonts const):
(WebCore::GraphicsContext::shouldSubpixelQuantizeFonts const):
(WebCore::GraphicsContext::shadowsIgnoreTransforms const):
(WebCore::GraphicsContext::drawLuminanceMask const):
(WebCore::GraphicsContext::useDarkAppearance const):
* platform/graphics/GraphicsContextState.cpp:
(WebCore::GraphicsContextState::GraphicsContextState):
(WebCore::GraphicsContextState::containsOnlyInlineChanges const):
(WebCore::GraphicsContextState::mergeChanges):
(WebCore::GraphicsContextState::didBeginTransparencyLayer):
(WebCore::GraphicsContextState::didEndTransparencyLayer):
(WebCore::GraphicsContextState::dump const):
* platform/graphics/GraphicsContextState.h:
(WebCore::GraphicsContextState::GraphicsContextState):
(WebCore::GraphicsContextState::changes const):
(WebCore::GraphicsContextState::didApplyChanges):
(WebCore::GraphicsContextState::fillBrush const):
(WebCore::GraphicsContextState::setFillBrush):
(WebCore::GraphicsContextState::setFillColor):
(WebCore::GraphicsContextState::setFillGradient):
(WebCore::GraphicsContextState::setFillPattern):
(WebCore::GraphicsContextState::fillRule const):
(WebCore::GraphicsContextState::setFillRule):
(WebCore::GraphicsContextState::strokeBrush const):
(WebCore::GraphicsContextState::setStrokeBrush):
(WebCore::GraphicsContextState::setStrokeColor):
(WebCore::GraphicsContextState::setStrokeGradient):
(WebCore::GraphicsContextState::setStrokePattern):
(WebCore::GraphicsContextState::strokeThickness const):
(WebCore::GraphicsContextState::setStrokeThickness):
(WebCore::GraphicsContextState::strokeStyle const):
(WebCore::GraphicsContextState::setStrokeStyle):
(WebCore::GraphicsContextState::compositeMode const):
(WebCore::GraphicsContextState::setCompositeMode):
(WebCore::GraphicsContextState::dropShadow const):
(WebCore::GraphicsContextState::setDropShadow):
(WebCore::GraphicsContextState::alpha const):
(WebCore::GraphicsContextState::setAlpha):
(WebCore::GraphicsContextState::imageInterpolationQuality const):
(WebCore::GraphicsContextState::setImageInterpolationQuality):
(WebCore::GraphicsContextState::textDrawingMode const):
(WebCore::GraphicsContextState::setTextDrawingMode):
(WebCore::GraphicsContextState::shouldAntialias const):
(WebCore::GraphicsContextState::setShouldAntialias):
(WebCore::GraphicsContextState::shouldSmoothFonts const):
(WebCore::GraphicsContextState::setShouldSmoothFonts):
(WebCore::GraphicsContextState::shouldSubpixelQuantizeFonts const):
(WebCore::GraphicsContextState::setShouldSubpixelQuantizeFonts):
(WebCore::GraphicsContextState::shadowsIgnoreTransforms const):
(WebCore::GraphicsContextState::setShadowsIgnoreTransforms):
(WebCore::GraphicsContextState::drawLuminanceMask const):
(WebCore::GraphicsContextState::setDrawLuminanceMask):
(WebCore::GraphicsContextState::useDarkAppearance const):
(WebCore::GraphicsContextState::setUseDarkAppearance):
(WebCore::GraphicsContextState::setProperty):
(WebCore::GraphicsContextState::encode const):
(WebCore::GraphicsContextState::decode):
* platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::FillSource::FillSource):
(WebCore::Cairo::StrokeSource::StrokeSource):
(WebCore::Cairo::ShadowState::ShadowState):
* platform/graphics/cairo/FontCairo.cpp:
(WebCore::FontCascade::drawGlyphs):
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContextCairo::drawNativeImage):
(WebCore::GraphicsContextCairo::didUpdateState):
(WebCore::GraphicsContextCairo::drawGlyphs):
* platform/graphics/cairo/ImageBufferCairoBackend.cpp:
(WebCore::ImageBufferCairoBackend::draw):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::coreInterpolationQuality):
(WebCore::GraphicsContextCG::GraphicsContextCG):
(WebCore::GraphicsContextCG::didUpdateState):
(WebCore::GraphicsContextCG::strokeRect):
(WebCore::GraphicsContextCG::canUseShadowBlur const):
* platform/graphics/coretext/DrawGlyphsRecorderCoreText.cpp:
(WebCore::DrawGlyphsRecorder::populateInternalState):
(WebCore::DrawGlyphsRecorder::populateInternalContext):
* platform/graphics/displaylists/DisplayList.cpp:
(WebCore::DisplayList::DisplayList::shouldDumpForFlags):
* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::endTransparencyLayer):
* platform/graphics/displaylists/DisplayListReplayer.cpp:
(WebCore::DisplayList::applySetStateItem):
* platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp:
(Nicosia::CairoOperationRecorder::didUpdateState):
(Nicosia::CairoOperationRecorder::fillRect):
(Nicosia::CairoOperationRecorder::fillRoundedRect):
(Nicosia::CairoOperationRecorder::drawGlyphs):
(Nicosia::CairoOperationRecorder::drawNativeImage):
(Nicosia::CairoOperationRecorder::drawRect):
(Nicosia::CairoOperationRecorder::drawLine):
(Nicosia::CairoOperationRecorder::drawLinesForText):
(Nicosia::CairoOperationRecorder::drawEllipse):
2022-03-22 Alexey Shvayka <ashvayka@apple.com>
REGRESSION(r288307): instanceof value wrong in MutationObserver callback for Safari extensions
https://bugs.webkit.org/show_bug.cgi?id=237912
<rdar://90333276>
Reviewed by Saam Barati.
ScriptExecutionContext::globalObject() returns stray global object if called on an object
that was created inside a Safari extension. I am unsure whether this is a bug, and if so,
how to promptly fix it, so this patch changes the way callback functions / interfaces
resolve lexical global object, which is used to create DOM wrappers.
Now they rely only on their JSCallbackData, which was proven to return correct
global object for Safari extensions.
For [IsWeakCallback] interfaces, liveness of the callback object is guaranteed
by the canInvokeCallback() check above.
No new tests: Safari extensions are covered in internal repo.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateCallbackImplementationContent):
* bindings/scripts/test/JS/*: Updated.
2022-03-22 Commit Queue <commit-queue@webkit.org>
Unreviewed, reverting r291546.
https://bugs.webkit.org/show_bug.cgi?id=238218
7% regression in Speedometer2/jQuery-TodoMVC
Reverted changeset:
"Fix CSS cascade regarding logical properties"
https://bugs.webkit.org/show_bug.cgi?id=236199
https://commits.webkit.org/r291546
2022-03-22 Chris Dumez <cdumez@apple.com>
REGRESSION (iOS 15.1 / r280824) QuickLook - model not loading when passing extra parameters
https://bugs.webkit.org/show_bug.cgi?id=236069
<rdar://problem/88461772>
Reviewed by Darin Adler.
To extend the lifetime of Blob objects while loading/downloading is pending, we rely to
BlobURLHandle objects, which tell the NetworkProcess that we still need this blob data,
even if the corresponding Blob object gets GC'd by JS. The issue here is that the load
was not using the vanilla blob URL but was intead appending a fragment to the URL. As
a result, BlobRegistryImpl::registerBlobURLHandle() would fail to look up the
corresponding blob data and would fail to extend its lifetime.
To address the issue, BlobRegistryImpl::registerBlobURLHandle() / unregisterBlobURLHandle()
now strip fragments from the blob URL, similarly to what was already done inside
BlobRegistryImpl::getBlobDataFromURL().
Test: fast/files/blob-with-fragment-as-frame-url.html
* platform/network/BlobRegistryImpl.cpp:
(WebCore::blobURLWithoutFragment):
(WebCore::BlobRegistryImpl::registerBlobURLHandle):
(WebCore::BlobRegistryImpl::unregisterBlobURLHandle):
2022-03-22 Per Arne Vollan <pvollan@apple.com>
Enable content filtering in the Network process
https://bugs.webkit.org/show_bug.cgi?id=238156
Reviewed by Geoffrey Garen.
There is no need for sandbox extensions in the WebContent process when content filtering
is taking place in the Network process.
* platform/cocoa/NetworkExtensionContentFilter.h:
* platform/cocoa/NetworkExtensionContentFilter.mm:
(WebCore::NetworkExtensionContentFilter::enabled):
2022-03-22 Jer Noble <jer.noble@apple.com>
YouTube.com - Clicking anywhere on the progress bar pauses the video
https://bugs.webkit.org/show_bug.cgi?id=237750
<rdar://problem/90364846>
Reviewed by Eric Carlson.
Test: media/media-source/media-source-unexpected-pause.html
When calling play() or pause() on a MediaPlayerPrivateMediaSourceAVFObjC, the object will
respond by calling m_player->playbackStateChanged(), which will in turn call
HTMLMediaElement::mediaPlayerPlaybackStateChanged() with the new state. However, HTMLMediaElement
expects this to be called only for unanticipated state changes, not expected state changes. And
when that method is called and the reported state does not match the element's own expected state,
the element calls its own play() or pause() function to update its own state to match the player's.
And because MediaPlayerPrivateMediaSourceAVFObjC calls this method on the next run loop, there is
an opportunity for those states to get out of sync, which happens when YouTube responds to a tap
in its timeline.
Remove the unnecessary "call on next run loop" behavior of MediaPlayerPrivateMediaSourceAVFObjC::
play() and ::pause(). Also, remove the unnecessary notification that the play state has changed. In
the future, this can be accomplished by adding a callback parameter to MediaPlayer::play() rather than
relying on a state change notification.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::play):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::playInternal):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pause):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pauseInternal):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::playAtHostTime):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pauseAtHostTime):
2022-03-22 J Pascoe <j_pascoe@apple.com>
[WebAuthn] Support getAssertion for virtual HID authenticators
https://bugs.webkit.org/show_bug.cgi?id=238154
rdar://problem/90593150
Reviewed by Brent Fulgham.
Virtual authenticators for WebAuthn support different transprots: nfc, usb, internal,
and ble. Currently, we only fully support the internal transport and makeCredential for
usb-transport. The default transport for web-platform-tests is usb. This patch implements
getAssertion for hid-based virtual authneticators.
* Modules/webauthn/WebAuthenticationUtils.cpp:
(WebCore::buildUserEntityMap):
(WebCore::buildCredentialDescriptor):
* Modules/webauthn/WebAuthenticationUtils.h:
* Modules/webauthn/fido/FidoConstants.h:
2022-03-22 Ricky Mondello <rmondello@apple.com>
It should be possible to copy text out of "AutoFilledAndViewable" password fields
https://bugs.webkit.org/show_bug.cgi?id=238160
Reviewed by Geoffrey Garen.
* editing/Editor.cpp:
(WebCore::Editor::canCopy const): Allow copy in AutoFilledAndViewable password fields.
* editing/VisibleSelection.cpp:
(WebCore::VisibleSelection::isInAutoFilledAndViewableField const): Added.
* editing/VisibleSelection.h: Declare member function.
2022-03-22 Jer Noble <jer.noble@apple.com>
Fetching a Blob URL with an unbounded Range header do not generate a Content-Range response header
https://bugs.webkit.org/show_bug.cgi?id=238170
Reviewed by Eric Carlson.
Test: fetch/fetch-blob-unbounded-range.html
Handle the case where the request contains an unbounded range, and property calculate the rangeEnd
to pass into ParsedContentRange.
* platform/network/BlobResourceHandle.cpp:
(WebCore::BlobResourceHandle::notifyResponseOnSuccess):
2022-03-22 Zan Dobersek <zdobersek@igalia.com>
Move TextureMapper member variables, types and code out of GraphicsContextGLANGLE
https://bugs.webkit.org/show_bug.cgi?id=238200
Reviewed by Alejandro G. Castro.
Move member variables and code specific to the TextureMapper-oriented
GraphicsContextGLTextureMapperANGLE class from the parent
GraphicsContextGLANGLE class into GraphicsContextGLTextureMapperANGLE.
This means moving down various member variables and types as well as
friendship declarations. For behavior to remain the same, the
prepareTextureImpl() method is made virtual and overridden in the
TextureMapper class, but otherwise matches the previous behavior.
Nicosia::GCGLANGLELayer is adjusted to operate on a reference to the
derived class, not on the base GraphicsContextGLANGLE.
No new tests as there's no change in behavior.
* platform/graphics/angle/GraphicsContextGLANGLE.cpp:
(WebCore::GraphicsContextGLANGLE::prepareTextureImpl):
* platform/graphics/angle/GraphicsContextGLANGLE.h:
* platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.cpp:
(Nicosia::GCGLANGLELayer::GCGLANGLELayer):
* platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.h:
* platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.cpp:
(WebCore::GraphicsContextGLANGLE::~GraphicsContextGLANGLE):
(WebCore::GraphicsContextGLTextureMapperANGLE::prepareTextureImpl):
(WebCore::GraphicsContextGLTextureMapperANGLE::EGLImageBacking::EGLImageBacking):
(WebCore::GraphicsContextGLTextureMapperANGLE::EGLImageBacking::~EGLImageBacking):
(WebCore::GraphicsContextGLTextureMapperANGLE::EGLImageBacking::format const):
(WebCore::GraphicsContextGLTextureMapperANGLE::EGLImageBacking::stride const):
(WebCore::GraphicsContextGLTextureMapperANGLE::EGLImageBacking::releaseResources):
(WebCore::GraphicsContextGLTextureMapperANGLE::EGLImageBacking::isReleased):
(WebCore::GraphicsContextGLTextureMapperANGLE::EGLImageBacking::reset):
(WebCore::GraphicsContextGLANGLE::EGLImageBacking::EGLImageBacking): Deleted.
(WebCore::GraphicsContextGLANGLE::EGLImageBacking::~EGLImageBacking): Deleted.
(WebCore::GraphicsContextGLANGLE::EGLImageBacking::format const): Deleted.
(WebCore::GraphicsContextGLANGLE::EGLImageBacking::stride const): Deleted.
(WebCore::GraphicsContextGLANGLE::EGLImageBacking::releaseResources): Deleted.
(WebCore::GraphicsContextGLANGLE::EGLImageBacking::isReleased): Deleted.
(WebCore::GraphicsContextGLANGLE::EGLImageBacking::reset): Deleted.
* platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.h:
2022-03-22 Alejandro G. Castro <alex@igalia.com>
[WPE][GTK] VideoFrameGStreamer missing include after -r291610 refactor
https://bugs.webkit.org/show_bug.cgi?id=238199
Reviewed by Žan Doberšek.
We need to add the define we had in the file before the refactor.
* platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.cpp:
2022-03-22 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK][WPE] Remove the ATK implementation
https://bugs.webkit.org/show_bug.cgi?id=238198
Reviewed by Adrian Perez de Castro.
* PlatformGTK.cmake:
* PlatformWPE.cmake:
* SourcesGTK.txt:
* SourcesWPE.txt:
* accessibility/AXObjectCache.h:
* accessibility/AccessibilityList.cpp:
(WebCore::AccessibilityList::childHasPseudoVisibleListItemMarkers):
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::canSetValueAttribute const):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::textIteratorBehaviorForTextRange const):
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityObjectInterface.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::indexForVisiblePosition const):
(WebCore::AccessibilityRenderObject::shouldNotifyActiveDescendant const):
* accessibility/AccessibilityTableColumn.cpp:
(WebCore::AccessibilityTableColumn::computeAccessibilityIsIgnored const):
* accessibility/AccessibilityTableHeaderContainer.cpp:
(WebCore::AccessibilityTableHeaderContainer::computeAccessibilityIsIgnored const):
* accessibility/atk/AXObjectCacheAtk.cpp: Removed.
(WebCore::wrapperParent): Deleted.
(WebCore::AXObjectCache::detachWrapper): Deleted.
(WebCore::AXObjectCache::attachWrapper): Deleted.
(WebCore::AXObjectCache::platformPerformDeferredCacheUpdate): Deleted.
(WebCore::getListObject): Deleted.
(WebCore::notifyChildrenSelectionChange): Deleted.
(WebCore::AXObjectCache::postPlatformNotification): Deleted.
(WebCore::AXObjectCache::nodeTextChangePlatformNotification): Deleted.
(WebCore::AXObjectCache::frameLoadingEventPlatformNotification): Deleted.
(WebCore::AXObjectCache::platformHandleFocusedUIElementChanged): Deleted.
(WebCore::AXObjectCache::handleScrolledToAnchor): Deleted.
* accessibility/atk/AccessibilityObjectAtk.cpp: Removed.
(WebCore::AccessibilityObject::detachPlatformWrapper): Deleted.
(WebCore::AccessibilityObject::accessibilityIgnoreAttachment const): Deleted.
(WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const): Deleted.
(WebCore::AccessibilityObject::allowsTextRanges const): Deleted.
(WebCore::AccessibilityObject::getLengthForTextRange const): Deleted.
* accessibility/atk/WebKitAccessible.cpp: Removed.
(webkitAccessibleGetName): Deleted.
(webkitAccessibleGetDescription): Deleted.
(removeAtkRelationByType): Deleted.
(setAtkRelationSetFromCoreObject): Deleted.
(isRootObject): Deleted.
(webkitAccessibleGetParent): Deleted.
(webkitAccessibleGetNChildren): Deleted.
(webkitAccessibleRefChild): Deleted.
(webkitAccessibleGetIndexInParent): Deleted.
(webkitAccessibleGetAttributes): Deleted.
(atkRole): Deleted.
(webkitAccessibleGetRole): Deleted.
(isTextWithCaret): Deleted.
(setAtkStateSetFromCoreObject): Deleted.
(webkitAccessibleRefStateSet): Deleted.
(webkitAccessibleRefRelationSet): Deleted.
(webkitAccessibleInit): Deleted.
(webkitAccessibleGetObjectLocale): Deleted.
(webkit_accessible_class_init): Deleted.
(roleIsTextType): Deleted.
(interfaceMaskFromObject): Deleted.
(uniqueAccessibilityTypeName): Deleted.
(accessibilityTypeFromObject): Deleted.
(webkitAccessibleNew): Deleted.
(webkitAccessibleGetAccessibilityObject): Deleted.
(webkitAccessibleDetach): Deleted.
(webkitAccessibleIsDetached): Deleted.
(webkitAccessibleCacheAndReturnAtkProperty): Deleted.
* accessibility/atk/WebKitAccessible.h: Removed.
* accessibility/atk/WebKitAccessibleHyperlink.cpp: Removed.
(webkitAccessibleHyperlinkActionDoAction): Deleted.
(webkitAccessibleHyperlinkActionGetNActions): Deleted.
(webkitAccessibleHyperlinkActionGetDescription): Deleted.
(webkitAccessibleHyperlinkActionGetKeybinding): Deleted.
(webkitAccessibleHyperlinkActionGetName): Deleted.
(webkit_accessible_hyperlink_atk_action_interface_init): Deleted.
(webkitAccessibleHyperlinkGetURI): Deleted.
(webkitAccessibleHyperlinkGetObject): Deleted.
(rangeLengthForObject): Deleted.
(webkitAccessibleHyperlinkGetStartIndex): Deleted.
(webkitAccessibleHyperlinkGetEndIndex): Deleted.
(webkitAccessibleHyperlinkIsValid): Deleted.
(webkitAccessibleHyperlinkGetNAnchors): Deleted.
(webkitAccessibleHyperlinkIsSelectedLink): Deleted.
(webkitAccessibleHyperlinkGetProperty): Deleted.
(webkitAccessibleHyperlinkSetProperty): Deleted.
(webkit_accessible_hyperlink_class_init): Deleted.
(webkitAccessibleHyperlinkGetOrCreate): Deleted.
* accessibility/atk/WebKitAccessibleHyperlink.h: Removed.
* accessibility/atk/WebKitAccessibleInterfaceAction.cpp: Removed.
(core): Deleted.
(webkitAccessibleActionDoAction): Deleted.
(webkitAccessibleActionGetNActions): Deleted.
(webkitAccessibleActionGetDescription): Deleted.
(webkitAccessibleActionGetKeybinding): Deleted.
(webkitAccessibleActionGetName): Deleted.
(webkitAccessibleActionInterfaceInit): Deleted.
* accessibility/atk/WebKitAccessibleInterfaceAction.h: Removed.
* accessibility/atk/WebKitAccessibleInterfaceComponent.cpp: Removed.
(atkToContents): Deleted.
(webkitAccessibleComponentRefAccessibleAtPoint): Deleted.
(webkitAccessibleComponentGetExtents): Deleted.
(webkitAccessibleComponentGrabFocus): Deleted.
(webkitAccessibleComponentScrollTo): Deleted.
(webkitAccessibleComponentScrollToPoint): Deleted.
(webkitAccessibleComponentInterfaceInit): Deleted.
* accessibility/atk/WebKitAccessibleInterfaceComponent.h: Removed.
* accessibility/atk/WebKitAccessibleInterfaceDocument.cpp: Removed.
(core): Deleted.
(documentAttributeValue): Deleted.
(webkitAccessibleDocumentGetAttributeValue): Deleted.
(webkitAccessibleDocumentGetAttributes): Deleted.
(webkitAccessibleDocumentGetLocale): Deleted.
(webkitAccessibleDocumentInterfaceInit): Deleted.
* accessibility/atk/WebKitAccessibleInterfaceDocument.h: Removed.
* accessibility/atk/WebKitAccessibleInterfaceEditableText.cpp: Removed.
(core): Deleted.
(webkitAccessibleEditableTextSetRunAttributes): Deleted.
(webkitAccessibleEditableTextSetTextContents): Deleted.
(webkitAccessibleEditableTextInsertText): Deleted.
(webkitAccessibleEditableTextCopyText): Deleted.
(webkitAccessibleEditableTextCutText): Deleted.
(webkitAccessibleEditableTextDeleteText): Deleted.
(webkitAccessibleEditableTextPasteText): Deleted.
(webkitAccessibleEditableTextInterfaceInit): Deleted.
* accessibility/atk/WebKitAccessibleInterfaceEditableText.h: Removed.
* accessibility/atk/WebKitAccessibleInterfaceHyperlinkImpl.cpp: Removed.
(webkitAccessibleHyperlinkImplGetHyperlink): Deleted.
(webkitAccessibleHyperlinkImplInterfaceInit): Deleted.
* accessibility/atk/WebKitAccessibleInterfaceHyperlinkImpl.h: Removed.
* accessibility/atk/WebKitAccessibleInterfaceHypertext.cpp: Removed.
(core): Deleted.
(webkitAccessibleHypertextGetLink): Deleted.
(webkitAccessibleHypertextGetNLinks): Deleted.
(webkitAccessibleHypertextGetLinkIndex): Deleted.
(webkitAccessibleHypertextInterfaceInit): Deleted.
* accessibility/atk/WebKitAccessibleInterfaceHypertext.h: Removed.
* accessibility/atk/WebKitAccessibleInterfaceImage.cpp: Removed.
(core): Deleted.
(webkitAccessibleImageGetImagePosition): Deleted.
(webkitAccessibleImageGetImageDescription): Deleted.
(webkitAccessibleImageGetImageSize): Deleted.
(webkitAccessibleImageInterfaceInit): Deleted.
* accessibility/atk/WebKitAccessibleInterfaceImage.h: Removed.
* accessibility/atk/WebKitAccessibleInterfaceSelection.cpp: Removed.
(core): Deleted.
(listObjectForCoreSelection): Deleted.
(optionFromList): Deleted.
(optionFromSelection): Deleted.
(webkitAccessibleSelectionAddSelection): Deleted.
(webkitAccessibleSelectionClearSelection): Deleted.
(webkitAccessibleSelectionRefSelection): Deleted.
(webkitAccessibleSelectionGetSelectionCount): Deleted.
(webkitAccessibleSelectionIsChildSelected): Deleted.
(webkitAccessibleSelectionRemoveSelection): Deleted.
(webkitAccessibleSelectionSelectAllSelection): Deleted.
(webkitAccessibleSelectionInterfaceInit): Deleted.
* accessibility/atk/WebKitAccessibleInterfaceSelection.h: Removed.
* accessibility/atk/WebKitAccessibleInterfaceTable.cpp: Removed.
(core): Deleted.
(cell): Deleted.
(cellIndex): Deleted.
(cellAtIndex): Deleted.
(webkitAccessibleTableRefAt): Deleted.
(webkitAccessibleTableGetIndexAt): Deleted.
(webkitAccessibleTableGetColumnAtIndex): Deleted.
(webkitAccessibleTableGetRowAtIndex): Deleted.
(webkitAccessibleTableGetNColumns): Deleted.
(webkitAccessibleTableGetNRows): Deleted.
(webkitAccessibleTableGetColumnExtentAt): Deleted.
(webkitAccessibleTableGetRowExtentAt): Deleted.
(webkitAccessibleTableGetColumnHeader): Deleted.
(webkitAccessibleTableGetRowHeader): Deleted.
(webkitAccessibleTableGetCaption): Deleted.
(webkitAccessibleTableGetColumnDescription): Deleted.
(webkitAccessibleTableGetRowDescription): Deleted.
(webkitAccessibleTableInterfaceInit): Deleted.
* accessibility/atk/WebKitAccessibleInterfaceTable.h: Removed.
* accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp: Removed.
(convertToGPtrArray): Deleted.
(core): Deleted.
(webkitAccessibleTableCellGetColumnHeaderCells): Deleted.
(webkitAccessibleTableCellGetRowHeaderCells): Deleted.
(webkitAccessibleTableCellGetColumnSpan): Deleted.
(webkitAccessibleTableCellGetRowSpan): Deleted.
(webkitAccessibleTableCellGetPosition): Deleted.
(webkitAccessibleTableCellGetTable): Deleted.
(webkitAccessibleTableCellInterfaceInit): Deleted.
* accessibility/atk/WebKitAccessibleInterfaceTableCell.h: Removed.
* accessibility/atk/WebKitAccessibleInterfaceText.cpp: Removed.
(core): Deleted.
(baselinePositionForRenderObject): Deleted.
(getAttributeSetForAccessibilityObject): Deleted.
(compareAttribute): Deleted.
(attributeSetDifference): Deleted.
(accessibilityObjectLength): Deleted.
(getAccessibilityObjectForOffset): Deleted.
(getRunAttributesFromAccessibilityObject): Deleted.
(textExtents): Deleted.
(offsetAdjustmentForListItem): Deleted.
(webCoreOffsetToAtkOffset): Deleted.
(atkOffsetToWebCoreOffset): Deleted.
(getNodeForAccessibilityObject): Deleted.
(getSelectionOffsetsForObject): Deleted.
(webkitAccessibleTextGetText): Deleted.
(emptyTextSelectionAtOffset): Deleted.
(webkitAccessibleTextGetChar): Deleted.
(nextWordStartPosition): Deleted.
(previousWordEndPosition): Deleted.
(wordAtPositionForAtkBoundary): Deleted.
(numberOfReplacedElementsBeforeOffset): Deleted.
(webkitAccessibleTextWordForBoundary): Deleted.
(isSentenceBoundary): Deleted.
(isWhiteSpaceBetweenSentences): Deleted.
(sentenceAtPositionForAtkBoundary): Deleted.
(webkitAccessibleTextSentenceForBoundary): Deleted.
(lineAtPositionForAtkBoundary): Deleted.
(webkitAccessibleTextLineForBoundary): Deleted.
(webkitAccessibleTextGetTextForOffset): Deleted.
(webkitAccessibleTextGetTextAfterOffset): Deleted.
(webkitAccessibleTextGetTextAtOffset): Deleted.
(webkitAccessibleTextGetTextBeforeOffset): Deleted.
(webkitAccessibleTextGetCharacterAtOffset): Deleted.
(webkitAccessibleTextGetCaretOffset): Deleted.
(webkitAccessibleTextGetRunAttributes): Deleted.
(webkitAccessibleTextGetDefaultAttributes): Deleted.
(webkitAccessibleTextGetCharacterExtents): Deleted.
(webkitAccessibleTextGetRangeExtents): Deleted.
(webkitAccessibleTextGetCharacterCount): Deleted.
(webkitAccessibleTextGetOffsetAtPoint): Deleted.
(webkitAccessibleTextGetNSelections): Deleted.
(webkitAccessibleTextGetSelection): Deleted.
(webkitAccessibleTextAddSelection): Deleted.
(webkitAccessibleTextSetSelection): Deleted.
(webkitAccessibleTextRemoveSelection): Deleted.
(webkitAccessibleTextSetCaretOffset): Deleted.
(webkitAccessibleTextGetStringAtOffset): Deleted.
(webkitAccessibleTextInterfaceInit): Deleted.
* accessibility/atk/WebKitAccessibleInterfaceText.h: Removed.
* accessibility/atk/WebKitAccessibleInterfaceValue.cpp: Removed.
(core): Deleted.
(webkitAccessibleSetNewValue): Deleted.
(webkitAccessibleGetIncrementValue): Deleted.
(webkitAccessibleGetValueAndText): Deleted.
(webkitAccessibleGetIncrement): Deleted.
(webkitAccessibleSetValue): Deleted.
(webkitAccessibleGetRange): Deleted.
(webkitAccessibleValueGetCurrentValue): Deleted.
(webkitAccessibleValueGetMaximumValue): Deleted.
(webkitAccessibleValueGetMinimumValue): Deleted.
(webkitAccessibleValueSetCurrentValue): Deleted.
(webkitAccessibleValueGetMinimumIncrement): Deleted.
(webkitAccessibleValueInterfaceInit): Deleted.
* accessibility/atk/WebKitAccessibleInterfaceValue.h: Removed.
* accessibility/atk/WebKitAccessibleUtil.cpp: Removed.
(addToAtkAttributeSet): Deleted.
(contentsRelativeToAtkCoordinateType): Deleted.
(titleTagShouldBeUsedInDescriptionField): Deleted.
(accessibilityTitle): Deleted.
(accessibilityDescription): Deleted.
(selectionBelongsToObject): Deleted.
(objectFocusedAndCaretOffsetUnignored): Deleted.
* accessibility/atk/WebKitAccessibleUtil.h: Removed.
* accessibility/atspi/AccessibilityObjectAtspi.cpp:
(WebCore::AccessibilityObjectAtspi::attributes const):
* editing/FrameSelection.h:
* editing/atk/FrameSelectionAtk.cpp: Removed.
(WebCore::emitTextSelectionChange): Deleted.
(WebCore::maybeEmitTextFocusChange): Deleted.
(WebCore::FrameSelection::notifyAccessibilityForSelectionChange): Deleted.
* page/Settings.yaml:
* platform/graphics/PlatformDisplay.cpp:
* platform/graphics/PlatformDisplay.h:
* platform/graphics/x11/PlatformDisplayX11.cpp:
* platform/graphics/x11/PlatformDisplayX11.h:
2022-03-22 Philippe Normand <pnormand@igalia.com>
[GLIB] Use a static string for default application name
https://bugs.webkit.org/show_bug.cgi?id=238124
Reviewed by Xabier Rodriguez-Calvar.
* platform/glib/ApplicationGLib.cpp:
(WebCore::getApplicationName):
* platform/glib/ApplicationGLib.h:
2022-03-22 Youenn Fablet <youenn@apple.com>
Move RealtimeMediaSource::VideoSampleObserver::videoSampleAvailable to VideoFrame
https://bugs.webkit.org/show_bug.cgi?id=237884
Reviewed by Eric Carlson.
Refactoring to do the following:
- Renaming of VideoSampleObserver to VideoFrameObserver, videoSampleAvailable to videoFrameAvailable...
- videoFrameAvailable takes a VideoFrame instead of a MediaSample
- Use VideoFrame::rotation and VideoFrame::isMirrored.
- Use VideoFrame::Rotation instead of MediaSample::VideoRotation
Update code according this renaming.
Move from using MediaSample to VideoFrame where it makes sense.
Prepare for removal of MediaSample as parent class of VideoFrame.
* Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
* html/canvas/WebGLRenderingContextBase.cpp:
* platform/MediaSample.h:
* platform/VideoFrame.cpp:
* platform/VideoFrame.h:
* platform/graphics/avfoundation/SampleBufferDisplayLayer.h:
* platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.h:
* platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.mm:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
* platform/graphics/cocoa/GraphicsContextGLCocoa.mm:
* platform/graphics/cv/ImageRotationSessionVT.h:
* platform/graphics/cv/ImageRotationSessionVT.mm:
* platform/graphics/cv/ImageTransferSessionVT.h:
* platform/graphics/cv/ImageTransferSessionVT.mm:
* platform/graphics/cv/VideoFrameCV.h:
* platform/graphics/cv/VideoFrameCV.mm:
* platform/graphics/gstreamer/VideoFrameGStreamer.cpp:
* platform/graphics/gstreamer/VideoFrameGStreamer.h:
* platform/mediarecorder/MediaRecorderPrivate.h:
* platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp:
* platform/mediarecorder/MediaRecorderPrivateAVFImpl.h:
* platform/mediarecorder/MediaRecorderPrivateMock.cpp:
* platform/mediarecorder/MediaRecorderPrivateMock.h:
* platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
* platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
* platform/mediastream/RealtimeMediaSource.cpp:
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/RealtimeOutgoingVideoSource.cpp:
* platform/mediastream/RealtimeOutgoingVideoSource.h:
* platform/mediastream/RealtimeVideoCaptureSource.cpp:
* platform/mediastream/RealtimeVideoCaptureSource.h:
* platform/mediastream/RealtimeVideoSource.cpp:
* platform/mediastream/RealtimeVideoSource.h:
* platform/mediastream/VideoPreset.h:
* platform/mediastream/cocoa/DisplayCaptureSourceCocoa.cpp:
* platform/mediastream/cocoa/DisplayCaptureSourceCocoa.h:
* platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
* platform/mediastream/gstreamer/MockRealtimeVideoSourceGStreamer.cpp:
* platform/mediastream/gstreamer/MockRealtimeVideoSourceGStreamer.h:
* platform/mediastream/ios/ReplayKitCaptureSource.mm:
* platform/mediastream/libwebrtc/VideoFrameLibWebRTC.cpp:
* platform/mediastream/libwebrtc/VideoFrameLibWebRTC.h:
* platform/mediastream/libwebrtc/gstreamer/RealtimeIncomingVideoSourceLibWebRTC.cpp:
* platform/mediastream/libwebrtc/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.cpp:
* platform/mediastream/libwebrtc/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.h:
* platform/mediastream/mac/AVVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.h:
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h:
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.mm:
* platform/mock/MockRealtimeVideoSource.cpp:
* platform/mock/MockRealtimeVideoSource.h:
* testing/Internals.cpp:
* testing/Internals.h:
2022-03-22 Zan Dobersek <zdobersek@igalia.com>
[TextureMapper] Split GraphicsContextGLTextureMapper into two classes
https://bugs.webkit.org/show_bug.cgi?id=238141
Reviewed by Alejandro G. Castro.
Split GraphicsContextGLTextureMapper into two distinct classes. The
current class unconditionally inherits from GraphicsContextGLOpenGL, and
the new GraphicsContextGLTextureMapperANGLE inherits from
GraphicsContextGLANGLE. This reduces complexity and avoids the
implementation to span across two separate files. The two classes can
also be developed independently, with more changes and cleanups already
planned for the ANGLE variant.
No new tests due to no actual change in behavior.
* platform/TextureMapper.cmake:
* platform/graphics/texmap/GraphicsContextGLTextureMapper.cpp:
(WebCore::createWebProcessGraphicsContextGL):
(WebCore::GraphicsContextGLTextureMapper::create):
(WebCore::GraphicsContextGLTextureMapper::GraphicsContextGLTextureMapper):
(WebCore::GraphicsContextGLTextureMapper::layerContentsDisplayDelegate):
(WebCore::GraphicsContextGLTextureMapper::copyTextureFromMedia):
(WebCore::GraphicsContextGLTextureMapper::paintCompositedResultsToVideoFrame):
(WebCore::GraphicsContextGLTextureMapper::platformInitialize):
* platform/graphics/texmap/GraphicsContextGLTextureMapper.h:
* platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.cpp:
(WebCore::GraphicsContextGLANGLE::~GraphicsContextGLANGLE):
(WebCore::GraphicsContextGLANGLE::platformDisplay const):
(WebCore::GraphicsContextGLANGLE::platformConfig const):
(WebCore::GraphicsContextGLANGLE::makeContextCurrent):
(WebCore::GraphicsContextGLANGLE::checkGPUStatus):
(WebCore::GraphicsContextGLANGLE::platformReleaseThreadResources):
(WebCore::GraphicsContextGLANGLE::readCompositedResults):
(WebCore::createWebProcessGraphicsContextGL):
(WebCore::GraphicsContextGLTextureMapperANGLE::create):
(WebCore::GraphicsContextGLTextureMapperANGLE::GraphicsContextGLTextureMapperANGLE):
(WebCore::GraphicsContextGLTextureMapperANGLE::~GraphicsContextGLTextureMapperANGLE):
(WebCore::GraphicsContextGLTextureMapperANGLE::layerContentsDisplayDelegate):
(WebCore::GraphicsContextGLTextureMapperANGLE::copyTextureFromMedia):
(WebCore::GraphicsContextGLTextureMapperANGLE::paintCompositedResultsToVideoFrame):
(WebCore::GraphicsContextGLTextureMapperANGLE::platformInitializeContext):
(WebCore::GraphicsContextGLTextureMapperANGLE::platformInitialize):
(WebCore::GraphicsContextGLTextureMapperANGLE::setContextVisibility):
(WebCore::GraphicsContextGLTextureMapperANGLE::reshapeDisplayBufferBacking):
(WebCore::GraphicsContextGLTextureMapperANGLE::prepareForDisplay):
(WebCore::GraphicsContextGLTextureMapper::platformInitializeContext): Deleted.
(WebCore::GraphicsContextGLTextureMapper::platformInitialize): Deleted.
(WebCore::GraphicsContextGLTextureMapper::setContextVisibility): Deleted.
(WebCore::GraphicsContextGLTextureMapper::prepareForDisplay): Deleted.
(WebCore::GraphicsContextGLTextureMapper::reshapeDisplayBufferBacking): Deleted.
* platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.h: Copied from Source/WebCore/platform/graphics/texmap/GraphicsContextGLTextureMapper.h.
2022-03-22 Ziran Sun <zsun@igalia.com>
[selection] Change form's selection attribute to unsigned long
https://bugs.webkit.org/show_bug.cgi?id=237951
Reviewed by Chris Dumez.
We should change the type of attribute "selectionStart" and "selectionEnd"
from long to unsigned long. Also "start" and "end" parameters in function
selectionRange() need to be changed correspondingly.
This change is in line with Chromium CL at
https://github.com/chromium/chromium/commit/b6ff6db1c5683b5e564a72b0941ad504b410d1af
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setDefaultSelectionAfterFocus):
(WebCore::HTMLInputElement::selectionStartForBindings const):
(WebCore::HTMLInputElement::setSelectionStartForBindings):
(WebCore::HTMLInputElement::selectionEndForBindings const):
(WebCore::HTMLInputElement::setSelectionEndForBindings):
(WebCore::HTMLInputElement::setSelectionRangeForBindings):
* html/HTMLInputElement.h:
* html/HTMLInputElement.idl:
* html/HTMLTextAreaElement.idl:
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::handleBeforeTextInsertedEvent):
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::HTMLTextFormControlElement):
(WebCore::HTMLTextFormControlElement::setSelectionStart):
(WebCore::HTMLTextFormControlElement::setSelectionEnd):
(WebCore::HTMLTextFormControlElement::select):
(WebCore::HTMLTextFormControlElement::setSelectionRange):
(WebCore::HTMLTextFormControlElement::selectionStart const):
(WebCore::HTMLTextFormControlElement::computeSelectionStart const):
(WebCore::HTMLTextFormControlElement::selectionEnd const):
(WebCore::HTMLTextFormControlElement::computeSelectionEnd const):
* html/HTMLTextFormControlElement.h:
(WebCore::HTMLTextFormControlElement::cacheSelection):
(WebCore::HTMLTextFormControlElement::hasCachedSelection const):
2022-03-22 Diego Pino Garcia <dpino@igalia.com>
Unreviewed, fix non-unified build after r291597
* css/typedom/CSSNumericValue.cpp:
2022-03-22 Frédéric Wang <fwang@igalia.com>
Adjust anchor/focus nodes after removal when LiveRangeSelection is enabled
https://bugs.webkit.org/show_bug.cgi?id=238004
Reviewed by Ryosuke Niwa.
This patch ensures that FrameSelection::nodeWillBeRemoved adjusts m_anchor and m_focus
when corresponding nodes are removed from the DOM tree. There are no behavior changes
when live range is disabled.
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::nodeWillBeRemoved): When live range is enabled,
Ensure that anchor nodes are updated even when the selection is none and pass information
about whether anchor or focus are removed by the node removal.
(WebCore::FrameSelection::respondToNodeModification): Adjust anchor and focus if they
are removed, when live range is enabled.
* editing/FrameSelection.h: Add arguments for anchor and focus.
2022-03-21 Said Abou-Hallawa <said@apple.com>
[GPU Process] Make GraphicsContextState keep track of changes till they are applied
https://bugs.webkit.org/show_bug.cgi?id=238066
rdar://90585183
Reviewed by Simon Fraser.
A member of type GraphicsContextState::ChangeFlags will be added to
GraphicsContextState to keep track of what has changes since it was last
applied. So we can eliminate the struct GraphicsContextStateChange.
We will have to have a single member for every GraphicsContextState::Change.
1. So we will combine the color, the pattern, the gradient and the gradient
space transform in one class called 'SourceBrush'.
2. We will combine the shadow offset, the shadow blurRadius, the shadow
color and the radius mode in one struct called 'DropShadow'
3. And we will combine the CompositeOperator and the BledMode in one struct
called 'CompositeMode'.
GraphicsContextState will handle setting its members, its encoding and
decoding and its streaming to text.
Adding a transparency layer in CG sets the global alpha to 1. We need to
sync the member GraphicsContextState.alpha with the platform alpha when
we beginTransparencyLayer() and when we endTransparencyLayer().
DisplayList::Recorder will keep its stack of GraphicsContextState. The
difference between the state of GraphicsContext and the state of the
Recorder is we eagerly apply the former to the platform context but we
lazily record the changes of the later. Recorder::didUpdateState()
overrides the base class method to just merge the changes from the base
class GraphicsContext::m_state to Recorder::currentState().state.
Recorder::appendStateChangeItem() records the accumulated changes in the
currentState() since the last drawing.
* Headers.cmake:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/BifurcatedGraphicsContext.cpp:
(WebCore::BifurcatedGraphicsContext::beginTransparencyLayer):
(WebCore::BifurcatedGraphicsContext::endTransparencyLayer):
(WebCore::BifurcatedGraphicsContext::didUpdateState):
* platform/graphics/BifurcatedGraphicsContext.h:
* platform/graphics/DrawGlyphsRecorder.h:
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::GraphicsContext):
(WebCore::GraphicsContext::updateState):
(WebCore::GraphicsContext::getShadow const):
(WebCore::GraphicsContext::setStrokeColor): Deleted.
(WebCore::GraphicsContext::setShadow): Deleted.
(WebCore::GraphicsContext::clearShadow): Deleted.
(WebCore::GraphicsContext::setFillColor): Deleted.
(WebCore::GraphicsContext::setStrokePattern): Deleted.
(WebCore::GraphicsContext::setFillPattern): Deleted.
(WebCore::GraphicsContext::setStrokeGradient): Deleted.
(WebCore::GraphicsContext::setFillGradient): Deleted.
(WebCore::GraphicsContext::setCompositeOperation): Deleted.
* platform/graphics/GraphicsContext.h:
(WebCore::GraphicsContext::GraphicsContext):
(WebCore::GraphicsContext::fillColor const):
(WebCore::GraphicsContext::fillGradient const):
(WebCore::GraphicsContext::fillGradientSpaceTransform const):
(WebCore::GraphicsContext::fillPattern const):
(WebCore::GraphicsContext::setFillBrush):
(WebCore::GraphicsContext::setFillColor):
(WebCore::GraphicsContext::setFillGradient):
(WebCore::GraphicsContext::setFillPattern):
(WebCore::GraphicsContext::fillRule const):
(WebCore::GraphicsContext::setFillRule):
(WebCore::GraphicsContext::strokeColor const):
(WebCore::GraphicsContext::strokeGradient const):
(WebCore::GraphicsContext::strokeGradientSpaceTransform const):
(WebCore::GraphicsContext::strokePattern const):
(WebCore::GraphicsContext::setStrokeBrush):
(WebCore::GraphicsContext::setStrokeColor):
(WebCore::GraphicsContext::setStrokeGradient):
(WebCore::GraphicsContext::setStrokePattern):
(WebCore::GraphicsContext::strokeThickness const):
(WebCore::GraphicsContext::setStrokeThickness):
(WebCore::GraphicsContext::strokeStyle const):
(WebCore::GraphicsContext::setStrokeStyle):
(WebCore::GraphicsContext::dropShadow const):
(WebCore::GraphicsContext::shadowOffset const):
(WebCore::GraphicsContext::shadowBlur const):
(WebCore::GraphicsContext::shadowColor const):
(WebCore::GraphicsContext::setDropShadow):
(WebCore::GraphicsContext::setShadow):
(WebCore::GraphicsContext::clearShadow):
(WebCore::GraphicsContext::hasVisibleShadow const):
(WebCore::GraphicsContext::hasBlurredShadow const):
(WebCore::GraphicsContext::hasShadow const):
(WebCore::GraphicsContext::compositeMode const):
(WebCore::GraphicsContext::compositeOperation const):
(WebCore::GraphicsContext::blendMode const):
(WebCore::GraphicsContext::setCompositeMode):
(WebCore::GraphicsContext::setCompositeOperation):
(WebCore::GraphicsContext::alpha const):
(WebCore::GraphicsContext::setAlpha):
(WebCore::GraphicsContext::textDrawingMode const):
(WebCore::GraphicsContext::setTextDrawingMode):
(WebCore::GraphicsContext::imageInterpolationQuality const):
(WebCore::GraphicsContext::setImageInterpolationQuality):
(WebCore::GraphicsContext::setShouldAntialias):
(WebCore::GraphicsContext::setShouldSmoothFonts):
(WebCore::GraphicsContext::setShouldSubpixelQuantizeFonts):
(WebCore::GraphicsContext::shadowsIgnoreTransforms const):
(WebCore::GraphicsContext::setShadowsIgnoreTransforms):
(WebCore::GraphicsContext::setDrawLuminanceMask):
(WebCore::GraphicsContext::setUseDarkAppearance):
(WebCore::GraphicsContext::blendModeOperation const): Deleted.
* platform/graphics/GraphicsContextState.cpp:
(WebCore::GraphicsContextState::GraphicsContextState):
(WebCore::GraphicsContextState::hasOnlyPrimitiveChanges const):
(WebCore::GraphicsContextState::mergeChanges):
(WebCore::GraphicsContextState::didBeginTransparencyLayer):
(WebCore::GraphicsContextState::didEndTransparencyLayer):
(WebCore::stateChangeName):
(WebCore::GraphicsContextState::dump const):
(WebCore::operator<<):
(WebCore::GraphicsContextStateChange::changesFromState const): Deleted.
(WebCore::GraphicsContextStateChange::accumulate): Deleted.
(WebCore::GraphicsContextStateChange::apply const): Deleted.
(WebCore::GraphicsContextStateChange::dump const): Deleted.
* platform/graphics/GraphicsContextState.h:
(WebCore::GraphicsContextState::GraphicsContextState):
(WebCore::GraphicsContextState::changes const):
(WebCore::GraphicsContextState::didApplyChanges):
(WebCore::GraphicsContextState::setFillBrush):
(WebCore::GraphicsContextState::setFillColor):
(WebCore::GraphicsContextState::setFillGradient):
(WebCore::GraphicsContextState::setFillPattern):
(WebCore::GraphicsContextState::setFillRule):
(WebCore::GraphicsContextState::setStrokeBrush):
(WebCore::GraphicsContextState::setStrokeColor):
(WebCore::GraphicsContextState::setStrokeGradient):
(WebCore::GraphicsContextState::setStrokePattern):
(WebCore::GraphicsContextState::setStrokeThickness):
(WebCore::GraphicsContextState::setStrokeStyle):
(WebCore::GraphicsContextState::setCompositeMode):
(WebCore::GraphicsContextState::setDropShadow):
(WebCore::GraphicsContextState::setAlpha):
(WebCore::GraphicsContextState::setImageInterpolationQuality):
(WebCore::GraphicsContextState::setTextDrawingMode):
(WebCore::GraphicsContextState::setShouldAntialias):
(WebCore::GraphicsContextState::setShouldSmoothFonts):
(WebCore::GraphicsContextState::setShouldSubpixelQuantizeFonts):
(WebCore::GraphicsContextState::setShadowsIgnoreTransforms):
(WebCore::GraphicsContextState::setDrawLuminanceMask):
(WebCore::GraphicsContextState::setUseDarkAppearance):
(WebCore::GraphicsContextState::setProperty):
(WebCore::GraphicsContextState::encode const):
(WebCore::GraphicsContextState::decode):
(WebCore::GraphicsContextStateChange::GraphicsContextStateChange): Deleted.
* platform/graphics/GraphicsTypes.cpp:
(WebCore::operator<<):
* platform/graphics/GraphicsTypes.h:
(WebCore::CompositeMode::operator==):
(WebCore::CompositeMode::encode const):
(WebCore::CompositeMode::decode):
(WebCore::DropShadow::isVisible const):
(WebCore::DropShadow::isBlurred const):
(WebCore::DropShadow::hasOutsets const):
(WebCore::operator==):
(WebCore::DropShadow::encode const):
(WebCore::DropShadow::decode):
* platform/graphics/NullGraphicsContext.h:
* platform/graphics/ShadowBlur.cpp:
(WebCore::ShadowBlur::ShadowBlur):
* platform/graphics/ShadowBlur.h:
* platform/graphics/SourceBrush.cpp: Added.
(WebCore::SourceBrush::SourceBrush):
(WebCore::SourceBrush::gradientSpaceTransform const):
(WebCore::SourceBrush::gradient const):
(WebCore::SourceBrush::pattern const):
(WebCore::SourceBrush::setGradient):
(WebCore::SourceBrush::setPattern):
(WebCore::operator<<):
* platform/graphics/SourceBrush.h: Added.
(WebCore::SourceBrush::color const):
(WebCore::SourceBrush::setColor):
(WebCore::SourceBrush::brush const):
(WebCore::SourceBrush::setGradient):
(WebCore::SourceBrush::isPrimitive const):
(WebCore::operator==):
(WebCore::SourceBrush::Brush::LogicalGradient::encode const):
(WebCore::SourceBrush::Brush::LogicalGradient::decode):
(WebCore::SourceBrush::Brush::encode const):
(WebCore::SourceBrush::Brush::decode):
(WebCore::SourceBrush::encode const):
(WebCore::SourceBrush::decode):
* platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::FillSource::FillSource):
(WebCore::Cairo::StrokeSource::StrokeSource):
(WebCore::Cairo::ShadowState::ShadowState):
* platform/graphics/cairo/FontCairo.cpp:
(WebCore::FontCascade::drawGlyphs):
* platform/graphics/cairo/GradientCairo.cpp:
(WebCore::Gradient::fill):
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContextCairo::drawRect):
(WebCore::GraphicsContextCairo::drawLine):
(WebCore::GraphicsContextCairo::drawEllipse):
(WebCore::GraphicsContextCairo::fillRect):
(WebCore::GraphicsContextCairo::drawLinesForText):
(WebCore::GraphicsContextCairo::didUpdateState):
(WebCore::GraphicsContextCairo::drawGlyphs):
* platform/graphics/cairo/GraphicsContextCairo.h:
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContextCG::GraphicsContextCG):
(WebCore::GraphicsContextCG::drawNativeImage):
(WebCore::GraphicsContextCG::applyStrokePattern):
(WebCore::GraphicsContextCG::applyFillPattern):
(WebCore::calculateDrawingMode):
(WebCore::GraphicsContextCG::drawPath):
(WebCore::GraphicsContextCG::fillPath):
(WebCore::GraphicsContextCG::strokePath):
(WebCore::GraphicsContextCG::fillRect):
(WebCore::GraphicsContextCG::fillRoundedRectImpl):
(WebCore::GraphicsContextCG::fillRectWithRoundedHole):
(WebCore::GraphicsContextCG::beginTransparencyLayer):
(WebCore::applyShadowOffsetWorkaroundIfNeeded):
(WebCore::setCGShadow):
(WebCore::GraphicsContextCG::didUpdateState):
(WebCore::GraphicsContextCG::strokeRect):
(WebCore::GraphicsContextCG::fillEllipse):
(WebCore::GraphicsContextCG::strokeEllipse):
* platform/graphics/cg/GraphicsContextCG.h:
* platform/graphics/coretext/DrawGlyphsRecorderCoreText.cpp:
(WebCore::DrawGlyphsRecorder::populateInternalState):
(WebCore::DrawGlyphsRecorder::populateInternalContext):
(WebCore::DrawGlyphsRecorder::concludeInternalContext):
(WebCore::DrawGlyphsRecorder::updateFillBrush):
(WebCore::DrawGlyphsRecorder::updateStrokeBrush):
(WebCore::DrawGlyphsRecorder::updateCTM):
(WebCore::DrawGlyphsRecorder::updateShadow):
(WebCore::DrawGlyphsRecorder::recordDrawGlyphs):
(WebCore::DrawGlyphsRecorder::updateFillColor): Deleted.
(WebCore::DrawGlyphsRecorder::updateStrokeColor): Deleted.
(WebCore::shadowIsCleared): Deleted.
* platform/graphics/displaylists/DisplayList.cpp:
(WebCore::DisplayList::DisplayList::shouldDumpForFlags):
* platform/graphics/displaylists/DisplayListItems.cpp:
(WebCore::DisplayList::SetState::SetState):
(WebCore::DisplayList::SetState::apply):
(WebCore::DisplayList::operator<<):
* platform/graphics/displaylists/DisplayListItems.h:
(WebCore::DisplayList::SetState::state const):
(WebCore::DisplayList::SetState::encode const):
(WebCore::DisplayList::SetState::decode):
(WebCore::DisplayList::SetState::stateChange const): Deleted.
(WebCore::DisplayList::SetState::stateChange): Deleted.
* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::appendStateChangeItem):
(WebCore::DisplayList::Recorder::appendStateChangeItemIfNecessary):
(WebCore::DisplayList::Recorder::state const):
(WebCore::DisplayList::Recorder::didUpdateState):
(WebCore::DisplayList::Recorder::save):
(WebCore::DisplayList::Recorder::restore):
(WebCore::DisplayList::Recorder::beginTransparencyLayer):
(WebCore::DisplayList::Recorder::endTransparencyLayer):
(WebCore::DisplayList::containsOnlyInlineStateChanges): Deleted.
* platform/graphics/displaylists/DisplayListRecorder.h:
(WebCore::DisplayList::Recorder::ContextState::ContextState):
(WebCore::DisplayList::Recorder::ContextState::cloneForTransparencyLayer const):
(WebCore::DisplayList::Recorder::ContextState::cloneForSave const): Deleted.
* platform/graphics/displaylists/DisplayListRecorderImpl.cpp:
(WebCore::DisplayList::RecorderImpl::recordSetState):
* platform/graphics/displaylists/DisplayListRecorderImpl.h:
* platform/graphics/displaylists/DisplayListReplayer.cpp:
(WebCore::DisplayList::applySetStateItem):
* platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp:
(Nicosia::CairoOperationRecorder::didUpdateState):
(Nicosia::CairoOperationRecorder::fillRect):
(Nicosia::CairoOperationRecorder::fillRoundedRect):
(Nicosia::CairoOperationRecorder::drawGlyphs):
(Nicosia::CairoOperationRecorder::drawRect):
(Nicosia::CairoOperationRecorder::drawLine):
(Nicosia::CairoOperationRecorder::drawLinesForText):
(Nicosia::CairoOperationRecorder::drawEllipse):
* platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h:
* rendering/svg/RenderSVGPath.cpp:
(WebCore::useStrokeStyleToFill):
2022-03-21 Tyler Wilcock <tyler_w@apple.com>
AX: AccessibilityObject::visibleCharacterRange is extremely slow when called on objects with lots of text
https://bugs.webkit.org/show_bug.cgi?id=237678
Reviewed by Andres Gonzalez.
AccessibilityObject::visibleCharacterRange is extremely slow when
called on objects with lots of text. For example, trying to enter a
large contenteditable element with VoiceOver causes "Safari not
responding" because WebKit is so slow to return this data.
This patch fixes this in two ways. First, we optimize computation of
the end boundary point by grabbing previous line start positions in
batches and binary searching within each batch to find the correct
value.
I tried to apply this algorithm to the computation of the start
boundary, but that regressed performance for small and medium text
objects, and didn't yield any noticeable improvement for large text
objects. Keeping start boundary computation as-is while changing the
end boundary computation provided the best performance at all text
sizes.
Second, this patch caches visibleCharacterRange results, as the same
inputs to this function will always yield the same output. It's common
for this data to be requested multiple times without any change in
page state (e.g. scrolling), so caching further improves performance
by a lot.
Additional testcases added to accessibility/visible-character-range.html to
ensure behavior is correct.
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::previousLineStartBoundaryPoints const): Added.
(WebCore::AccessibilityObject::lastBoundaryPointContainedInRect const): Added.
(WebCore::AccessibilityObject::boundaryPointsContainedInRect const): Added.
(WebCore::AccessibilityObject::visibleCharacterRange const):
Wraps visibleCharacterRangeInternal to handle caching.
(WebCore::AccessibilityObject::visibleCharacterRangeInternal const):
(WebCore::AccessibilityObject::previousLineStartPositionInternal const): Added.
(WebCore::AccessibilityObject::previousLineStartPosition const):
Wraps previousLineStartPositionInternal to return default
VisualPosition if it returns std::nullopt (existing callers expect this behavior)
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::lastBoundaryPointContainedInRect const): Added.
* dom/BoundaryPoint.cpp:
(WebCore::operator<<):
* dom/BoundaryPoint.h:
Added implementation of operator<< to make debugging boundary points easier.
2022-03-21 Alex Christensen <achristensen@webkit.org>
Implement CSSNumericValue.mul, div, add, sub, max, and min
https://bugs.webkit.org/show_bug.cgi?id=238153
Reviewed by Simon Fraser.
This implements all except the derived units of multiplication and the unit checking of the others.
They are an off-by-default experimental feature right now, part of css-typed-om which is being implemented.
They are covered by wpt tests.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCSSStyleValueCustom.cpp:
(WebCore::toJSNewlyCreated):
* css/typedom/CSSKeywordValue.h:
(WebCore::CSSKeywordValue::value const): Deleted.
(WebCore::CSSKeywordValue::CSSKeywordValue): Deleted.
* css/typedom/CSSNumericValue.cpp:
(WebCore::negate):
(WebCore::invert):
(WebCore::operationOnValuesOfSameUnit):
(WebCore::CSSNumericValue::prependItemsOfTypeOrThis):
(WebCore::CSSNumericValue::addInternal):
(WebCore::CSSNumericValue::add):
(WebCore::CSSNumericValue::sub):
(WebCore::CSSNumericValue::multiplyInternal):
(WebCore::CSSNumericValue::mul):
(WebCore::CSSNumericValue::div):
(WebCore::CSSNumericValue::min):
(WebCore::CSSNumericValue::max):
(WebCore::CSSNumericValue::rectifyNumberish):
(WebCore::CSSNumericValue::toSum):
* css/typedom/CSSNumericValue.h:
(isType):
* css/typedom/CSSStyleValue.h:
(WebCore::isCSSNumericValue):
(WebCore::isCSSMathValue):
* css/typedom/CSSUnitValue.h:
(isType):
* css/typedom/numeric/CSSMathInvert.cpp:
(WebCore::CSSMathInvert::CSSMathInvert):
* css/typedom/numeric/CSSMathInvert.h:
(isType):
(WebCore::CSSMathInvert::value const): Deleted.
* css/typedom/numeric/CSSMathMax.cpp:
(WebCore::CSSMathMax::CSSMathMax):
(WebCore::CSSMathMax::create): Deleted.
* css/typedom/numeric/CSSMathMax.h:
(isType):
* css/typedom/numeric/CSSMathMin.cpp:
(WebCore::CSSMathMin::CSSMathMin):
(WebCore::CSSMathMin::create): Deleted.
* css/typedom/numeric/CSSMathMin.h:
(isType):
* css/typedom/numeric/CSSMathNegate.cpp:
(WebCore::CSSMathNegate::CSSMathNegate):
(WebCore::CSSMathNegate::create): Deleted.
* css/typedom/numeric/CSSMathNegate.h:
(isType):
(WebCore::CSSMathNegate::value const): Deleted.
* css/typedom/numeric/CSSMathProduct.cpp:
(WebCore::CSSMathProduct::CSSMathProduct):
(WebCore::CSSMathProduct::create): Deleted.
* css/typedom/numeric/CSSMathProduct.h:
(isType):
* css/typedom/numeric/CSSMathSum.cpp:
(WebCore::CSSMathSum::CSSMathSum):
(WebCore::CSSMathSum::create): Deleted.
(WebCore::CSSMathSum::values const): Deleted.
* css/typedom/numeric/CSSMathSum.h:
(isType):
* css/typedom/numeric/CSSMathValue.cpp: Removed.
* css/typedom/numeric/CSSMathValue.h:
(WebCore::CSSMathValue::getOperator const): Deleted.
(): Deleted.
(isType): Deleted.
* css/typedom/numeric/CSSNumericArray.cpp:
(WebCore::CSSNumericArray::create):
(WebCore::CSSNumericArray::CSSNumericArray):
* css/typedom/numeric/CSSNumericArray.h:
(WebCore::CSSNumericArray::array const):
* css/typedom/numeric/CSSNumericType.h:
* css/typedom/transform/CSSTransformValue.h:
(WebCore::CSSTransformValue::length const): Deleted.
2022-03-21 Oriol Brufau <obrufau@igalia.com>
[css-cascade] Let revert-layer roll back to preshints
https://bugs.webkit.org/show_bug.cgi?id=237532
Reviewed by Darin Adler.
The patch makes presentational hints use a cascade layer priority of 0.
The priority of the lowest layer is then increased to 1.
This allows 'revert-layer' in author origin revert to the presentational
hints origin, which is between user origin and author origin.
Test: imported/w3c/web-platform-tests/css/css-cascade/presentational-hints-rollback.html
* style/ElementRuleCollector.cpp:
(WebCore::Style::ElementRuleCollector::addElementStyleProperties):
(WebCore::Style::ElementRuleCollector::matchAllRules):
(WebCore::Style::ElementRuleCollector::addElementInlineStyleProperties):
* style/ElementRuleCollector.h:
* style/RuleSetBuilder.cpp:
(WebCore::Style::RuleSetBuilder::updateCascadeLayerPriorities):
2022-03-21 Chris Dumez <cdumez@apple.com>
BroadcastChannel instances in distinct opaque origins can communicate
https://bugs.webkit.org/show_bug.cgi?id=238090
<rdar://problem/90511155>
Reviewed by Alex Christensen.
The issue is that we would use a ClientOrigin to distinguish origins for BroadcastChannel,
which relies on SecurityOriginData internally. A unique/opaque SecurityOrigin becomes an empty
SecurityOriginData upon conversion. As a result, when comparing ClientOrigin objects from
unique SecurityOrigins, they would compare as equal.
To address the issue, I introduced a new PartitionedSecurityOrigin type which is similar
to ClientOrigin but stores SecurityOrigin objects internally, instead of SecurityOriginData
objects. PartitionedSecurityOrigin's operator==() is such that different SecurityOrigins
would not be equal but the same unique SecurityOrigin would be. I then used this new
PartitionedSecurityOrigin type as key in our HashMap on the WebProcess side instead of
ClientOrigin. This allows communication between several BroadcastChannels from the same
unique origin, while preventing communication between distinct opaque origins.
When the PartitionedSecurityOrigin contains an opaque security origin, we don't involve
the Network Process at all since the destination can only be in the same WebProcess.
Test: imported/w3c/web-platform-tests/webmessaging/broadcastchannel/opaque-origin.html
* Headers.cmake:
* WebCore.xcodeproj/project.pbxproj:
* dom/BroadcastChannel.cpp:
(WebCore::shouldPartitionOrigin):
(WebCore::BroadcastChannel::MainThreadBridge::registerChannel):
(WebCore::BroadcastChannel::MainThreadBridge::unregisterChannel):
(WebCore::BroadcastChannel::MainThreadBridge::postMessage):
* dom/BroadcastChannelRegistry.h:
* loader/EmptyClients.cpp:
* page/PartitionedSecurityOrigin.h: Added.
(WebCore::PartitionedSecurityOrigin::PartitionedSecurityOrigin):
(WebCore::PartitionedSecurityOrigin::isHashTableDeletedValue const):
(WebCore::PartitionedSecurityOrigin::isHashTableEmptyValue const):
(WebCore::operator==):
(WTF::add):
(WTF::PartitionedSecurityOriginHash::hash):
(WTF::PartitionedSecurityOriginHash::equal):
(WTF::HashTraits<WebCore::PartitionedSecurityOrigin>::emptyValue):
(WTF::HashTraits<WebCore::PartitionedSecurityOrigin>::constructEmptyValue):
(WTF::HashTraits<WebCore::PartitionedSecurityOrigin>::isEmptyValue):
(WTF::HashTraits<WebCore::PartitionedSecurityOrigin>::peek):
(WTF::HashTraits<WebCore::PartitionedSecurityOrigin>::take):
2022-03-21 Kate Cheney <katherine_cheney@apple.com>
nj.gov: Background color incorrect for 'State Vehicles' section
https://bugs.webkit.org/show_bug.cgi?id=238035
<rdar://problem/84543795>
Reviewed by Aditya Keerthi.
Test: fast/css/non-form-control-element-drop-appearance.html
Update RenderTheme::adjustStyle to drop appearance for non-form
control elements when they are styled by the author.
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::adjustAppearanceForElement const):
(WebCore::RenderTheme::adjustStyle):
(WebCore::RenderTheme::isControlStyled const):
* rendering/RenderTheme.h:
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::borderAndBackgroundEqual const):
* rendering/style/RenderStyle.h:
2022-03-21 Antoine Quint <graouts@webkit.org>
[media-controls] scrubbing on iOS when inline does not work
https://bugs.webkit.org/show_bug.cgi?id=238138
rdar://90046770
Reviewed by Dean Jackson.
This bug is simular to bug 238136. We cannot register pointer events on window on iOS.
* Modules/modern-media-controls/controls/slider.js:
(Slider.prototype._interactionEndTarget):
2022-03-21 Antoine Quint <graouts@webkit.org>
[media-controls] tap gesture recognizer sometimes fails to recognize on iOS
https://bugs.webkit.org/show_bug.cgi?id=238136
Reviewed by Dean Jackson.
While on macOS it's fine to register pointer events handlers on the `window` object,
on iOS it may not be depending on the fullscreen state. However, it's always fine to
use the gesture recognizer's target on iOS, so let's default to that when touches
are supported.
* Modules/modern-media-controls/gesture-recognizers/gesture-recognizer.js:
(GestureRecognizer.prototype.touchesBegan):
(GestureRecognizer.prototype.get _captureTarget):
(GestureRecognizer.prototype._removeTrackingListeners):
2022-03-21 Tyler Wilcock <tyler_w@apple.com>
AX: Include display: contents elements in the AX tree
https://bugs.webkit.org/show_bug.cgi?id=237834
Reviewed by Chris Fleizach.
Because display: contents intentionally prevents a render object from being
generated for the element it's applied to, we don't add it to the AX tree as
part of our normal render tree walk, making these elements inaccessible.
This patch includes these elements as part of the DOM walk that
addHiddenChildren (now renamed to addNodeOnlyChildren) already does.
Also, because display: contents moves the affected element's children up a
level in the render tree, this patch also special cases:
1. AccessibilityRenderObject::parentObject and similar methods to
return their display: contents parent instead of their render tree
parent
2. AccessibilityObject::insertChild to only insert display: contents
children to their display: contents parent, rather than their render
tree parent
Test: accessibility/display-contents-element-roles.html, accessibility/aria-hidden-display-contents-element.html
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::getOrCreate):
Allow creation of AX objects from display: contents `Node`s.
Also, don't create an object for a renderer that is in the process of
being destroyed (prevents display-contents-element-roles.html from crashing in ITM)
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::displayContentsParent const):
(WebCore::AccessibilityObject::insertChild):
If an object has a display: contents parent, and that parent isn't
`this`, return early.
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::parentObjectIfExists const):
(WebCore::AccessibilityRenderObject::parentObject const):
(WebCore::AccessibilityRenderObject::parentObjectUnignored const):
If an object has a display: contents parent, return that instead of
its render tree parent.
(WebCore::AccessibilityRenderObject::addNodeOnlyChildren):
Renamed from addHiddenChildren.
(WebCore::AccessibilityRenderObject::addChildren):
Don't clear m_subtreeDirty until after all children have been added.
Necessary to make aria-hidden-display-contents-element.html pass, as
we were clearing this too early, causing display: contents subtrees to
not be updated after aria-hidden changes.
(WebCore::AccessibilityRenderObject::addHiddenChildren):
Renamed to addNodeOnlyChildren.
* accessibility/AccessibilityRenderObject.h:
2022-03-21 Oriol Brufau <obrufau@igalia.com>
[css-cascade] Don't defer applying text decoration properties
https://bugs.webkit.org/show_bug.cgi?id=238126
Reviewed by Darin Adler.
shouldApplyPropertyInParseOrder() was returning true for these:
- webkit-text-decoration
- text-decoration-line
- text-decoration-style
- text-decoration-color
- text-decoration-skip
- text-decoration-skip-ink
- text-underline-position
- text-underline-offset
- text-decoration-thickness
- text-decoration
This was previously needed for text-decoration-line and text-decoration,
since they were implemented as longhands that shared a computed value.
But that's no longer the case, text-decoration became a shorthand in bug
237175.
AFAIK -webkit-text-decoration has always been a shorthand since it was
implemented in bug 92000, so having it in the list it's pointless,
only longhands matter. And text-decoration-skip became a shorthand in
bug 230244, so it's also pointless.
The other longhands seem unnecessary too, since they don't share a
computed style with other properties.
No test since there should be no observable change in behavior.
* style/PropertyCascade.cpp:
(WebCore::Style::shouldApplyPropertyInParseOrder):
2022-03-21 Youenn Fablet <youenn@apple.com>
Remove unneeded quotes in capture attribution string
https://bugs.webkit.org/show_bug.cgi?id=238132
<rdar://88794701>
Reviewed by Eric Carlson.
* en.lproj/Localizable.strings:
2022-03-21 Kimmo Kinnunen <kkinnunen@apple.com>
Accessing WebGL content crashes in macOS Recovery OS
https://bugs.webkit.org/show_bug.cgi?id=238139
Reviewed by Antti Koivisto.
Add a quick fix trying to circumvent a Recovery OS crash.
Parts of this will be reverted once the true source is found.
* platform/graphics/cocoa/GraphicsContextGLCocoa.mm:
(WebCore::platformSupportsMetal):
2022-03-21 Tim Horton <timothy_horton@apple.com>
Add an addition point for system background color
https://bugs.webkit.org/show_bug.cgi?id=238108
<rdar://problem/90463946>
Reviewed by Aditya Keerthi.
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/ios/WebCoreUIColorExtras.h: Added.
* platform/ios/WebCoreUIColorExtras.mm: Added.
(WebCore::systemBackgroundColor):
Add an addition point.
* rendering/RenderThemeIOS.mm:
(WebCore::CSSValueSystemColorInformation::function):
(WebCore::cssValueSystemColorInformationList):
(WebCore::systemColorFromCSSValueSystemColorInformation):
Adopt it for CSS use of system background color.
2022-03-21 Alex Christensen <achristensen@webkit.org>
Dust off Mac CMake build
https://bugs.webkit.org/show_bug.cgi?id=238121
Reviewed by Yusuke Suzuki.
* CMakeLists.txt:
* PlatformMac.cmake:
* SourcesCocoa.txt:
2022-03-21 Rob Buis <rbuis@igalia.com>
Null check style in Editor::applyParagraphStyle
https://bugs.webkit.org/show_bug.cgi?id=238137
Reviewed by Wenson Hsieh.
Null check style in Editor::applyParagraphStyle.
* editing/Editor.cpp:
(WebCore::Editor::applyParagraphStyle):
2022-03-21 Jonathan Bedard <jbedard@apple.com>
Unreviewed, reverting r291558.
Exceeded GitHub file size limit
Reverted changeset:
"Enable PGO when building for release and production"
https://bugs.webkit.org/show_bug.cgi?id=238119
https://commits.webkit.org/r291558
2022-03-21 Wenson Hsieh <wenson_hsieh@apple.com>
Enable PGO when building for release and production
https://bugs.webkit.org/show_bug.cgi?id=238119
rdar://90182309
Reviewed by Saam Barati.
Add LLVM profiles to the WebCore, JavaScriptCore and WebKit frameworks, collected by running certain benchmarks
on ARM macOS. We then use this data for release and production builds by specifying a `-fprofile-instr-use` in
`OTHER_CPLUSPLUSFLAGS`. Across various configurations of macOS and iOS, this is an ~8% speedup on Speedometer.
---------------------------------------------------------------------------------------------------------
| subtest | ms | ms | b / a | pValue |
---------------------------------------------------------------------------------------------------------
| Elm-TodoMVC |101.721667 |99.571667 |0.978864 | 0.000211 (significant) |
| VueJS-TodoMVC |18.643333 |17.196667 |0.922403 | 0.000000 (significant) |
| EmberJS-TodoMVC |108.763333 |103.306667 |0.949830 | 0.000000 (significant) |
| BackboneJS-TodoMVC |37.951667 |34.693333 |0.914145 | 0.000000 (significant) |
| Preact-TodoMVC |13.586667 |12.818333 |0.943449 | 0.053277 |
| AngularJS-TodoMVC |117.130000 |110.755000 |0.945573 | 0.000000 (significant) |
| Vanilla-ES2015-TodoMVC |58.950000 |52.716667 |0.894261 | 0.000000 (significant) |
| Inferno-TodoMVC |52.660000 |49.571667 |0.941353 | 0.000000 (significant) |
| Flight-TodoMVC |51.551667 |46.230000 |0.896770 | 0.000000 (significant) |
| Angular2-TypeScript-TodoMVC |35.753333 |33.698333 |0.942523 | 0.000000 (significant) |
| VanillaJS-TodoMVC |48.400000 |42.670000 |0.881612 | 0.000000 (significant) |
| jQuery-TodoMVC |218.346667 |200.051667 |0.916211 | 0.000000 (significant) |
| EmberJS-Debug-TodoMVC |304.171667 |291.903333 |0.959666 | 0.000000 (significant) |
| React-TodoMVC |75.475000 |72.761667 |0.964050 | 0.000008 (significant) |
| React-Redux-TodoMVC |126.448333 |120.458333 |0.952629 | 0.000000 (significant) |
| Vanilla-ES2015-Babel-Webpack-TodoMVC |55.643333 |49.665000 |0.892560 | 0.000000 (significant) |
---------------------------------------------------------------------------------------------------------
a mean = 306.08529
b mean = 330.01548
pValue = 0.0000000000
(Bigger means are better.)
1.078 times better
Results ARE significant
* Configurations/Base.xcconfig:
For now, we additionally ignore errors that arise if profiled symbols differ from built symbols; in the future,
we'll need to implement some kind of strategy to detect when enough symbols in the profile data no longer match
symbols that appear in the built binaries, such that it might begin to negate the performance benefit from PGO.
Note that while the profile data was collected on an ARM Mac, performance tests have shown the profile data to
largely generalize well to other architectures and platforms as well (i.e. macOS x86_64 and iOS arm64e). As
such, instead of limiting this profile to ARM macOS, we can just use it everywhere (and perhaps, add platform-
or architecture-specific profile data later, if needed).
* Configurations/WebCore.xcconfig:
* Profiling/WebCore.profdata: Added.
2022-03-21 Ziran Sun <zsun@igalia.com>
[selection] HTMLTextFormControlElement::subtreeHasChanged() shouldn't be called in setRangeText
https://bugs.webkit.org/show_bug.cgi?id=237720
Reviewed by Chris Dumez.
We shouldn't call HTMLTextFormControlElement::subtreeHasChanged() in HTMLTextFormControlElement::setRangeText.
It has been removed in patch for bug 237641. This patch is to further remove unnecessary code.
This change refers and imports some of the changes in chromium CL at
https://codereview.chromium.org/1577243002
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::setRangeText):
2022-03-21 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION(r286955): Rendering Links during search: highlighting fails
https://bugs.webkit.org/show_bug.cgi?id=237816
Reviewed by Simon Fraser.
Since r286955 the same coalesced marked text loop is used for painting the foreground text in case of text with
decorations. StyledMarkedText::coalesceAdjacentWithEqualDecorations() doesn't take into account the text style,
so when selected foreground color is different we end up painting the whole decorated text with the same
foreground color for the selected and non-selected parts.
Test: fast/text/selection-with-text-decorations.html
* rendering/StyledMarkedText.cpp:
(WebCore::StyledMarkedText::coalesceAdjacentWithEqualDecorations): Take into account the text styles too.
* rendering/TextBoxPainter.cpp:
(WebCore::TextBoxPainter::paintForegroundAndDecorations): Do not call
StyledMarkedText::coalesceAdjacentWithEqualForeground() in case of text with decorations, since it's unused.
2022-03-21 Youenn Fablet <youenn@apple.com>
Remove use of MediaSampleAVFObjC from WebRTC pipelines
https://bugs.webkit.org/show_bug.cgi?id=237706
<rdar://problem/90425391>
Reviewed by Eric Carlson.
Replace MediaSampleAVFObjC by VideoFrameCV when handling CVPixelBuffers.
Covered by existing tests.
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
* platform/graphics/cv/ImageRotationSessionVT.mm:
* platform/graphics/cv/ImageTransferSessionVT.h:
* platform/graphics/cv/ImageTransferSessionVT.mm:
* platform/graphics/cv/VideoFrameCV.h:
* platform/graphics/cv/VideoFrameCV.mm:
* platform/mediastream/RealtimeVideoSource.cpp:
* platform/mediastream/RealtimeVideoSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.h:
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
2022-03-20 Diego Pino Garcia <dpino@igalia.com>
[WPE] Unreviewed, fix non-unified build after r291474 and r291508
* css/CSSToLengthConversionData.h:
* html/parser/AtomHTMLToken.h:
2022-03-20 Alan Bujtas <zalan@apple.com>
[IFC][Integration] Rename InlineIterator::Line to LineBox
https://bugs.webkit.org/show_bug.cgi?id=238128
Reviewed by Antti Koivisto.
* dom/Position.cpp:
(WebCore::Position::upstream const):
(WebCore::Position::downstream const):
(WebCore::Position::rendersInDifferentPosition const):
* editing/RenderedPosition.h:
(WebCore::RenderedPosition::lineBox const):
(WebCore::RenderedPosition::line const): Deleted.
* editing/VisiblePosition.cpp:
(WebCore::VisiblePosition::leftVisuallyDistinctCandidate const):
(WebCore::VisiblePosition::rightVisuallyDistinctCandidate const):
(WebCore::VisiblePosition::absoluteSelectionBoundsForLine const):
* editing/VisibleUnits.cpp:
(WebCore::startTextOrLineBreakBox):
(WebCore::endTextOrLineBreakBox):
(WebCore::logicallyPreviousBox):
(WebCore::logicallyNextBox):
(WebCore::startPositionForLine):
(WebCore::endPositionForLine):
(WebCore::absoluteLineDirectionPointToLocalPointInBlock):
(WebCore::previousLinePosition):
(WebCore::nextLinePosition):
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::valueWithHardLineBreaks const):
* layout/integration/InlineIteratorBox.cpp:
(WebCore::InlineIterator::Box::lineBox const):
(WebCore::InlineIterator::Box::style const):
(WebCore::InlineIterator::Box::line const): Deleted.
* layout/integration/InlineIteratorBox.h:
* layout/integration/InlineIteratorLine.cpp:
(WebCore::InlineIterator::LineBoxIterator::LineBoxIterator):
(WebCore::InlineIterator::LineBoxIterator::atEnd const):
(WebCore::InlineIterator::LineBoxIterator::traverseNext):
(WebCore::InlineIterator::LineBoxIterator::traversePrevious):
(WebCore::InlineIterator::LineBoxIterator::operator== const):
(WebCore::InlineIterator::firstLineBoxFor):
(WebCore::InlineIterator::lastLineBoxFor):
(WebCore::InlineIterator::LineBox::next const):
(WebCore::InlineIterator::LineBox::previous const):
(WebCore::InlineIterator::LineBox::firstLeafBox const):
(WebCore::InlineIterator::LineBox::lastLeafBox const):
(WebCore::InlineIterator::closestBoxForHorizontalPosition):
(WebCore::InlineIterator::LineIterator::LineIterator): Deleted.
(WebCore::InlineIterator::LineIterator::atEnd const): Deleted.
(WebCore::InlineIterator::LineIterator::traverseNext): Deleted.
(WebCore::InlineIterator::LineIterator::traversePrevious): Deleted.
(WebCore::InlineIterator::LineIterator::operator== const): Deleted.
(WebCore::InlineIterator::firstLineFor): Deleted.
(WebCore::InlineIterator::lastLineFor): Deleted.
(WebCore::InlineIterator::Line::next const): Deleted.
(WebCore::InlineIterator::Line::previous const): Deleted.
(WebCore::InlineIterator::Line::firstLeafBox const): Deleted.
(WebCore::InlineIterator::Line::lastLeafBox const): Deleted.
* layout/integration/InlineIteratorLine.h:
(WebCore::InlineIterator::LineBox::height const):
(WebCore::InlineIterator::LineBoxIterator::LineBoxIterator):
(WebCore::InlineIterator::LineBoxIterator::operator++):
(WebCore::InlineIterator::LineBoxIterator::operator!= const):
(WebCore::InlineIterator::LineBoxIterator::operator== const):
(WebCore::InlineIterator::LineBoxIterator::operator* const):
(WebCore::InlineIterator::LineBoxIterator::operator-> const):
(WebCore::InlineIterator::previousLineBoxContentBottomOrBorderAndPadding):
(WebCore::InlineIterator::contentStartInBlockDirection):
(WebCore::InlineIterator::LineBox::LineBox):
(WebCore::InlineIterator::LineBox::contentLogicalTop const):
(WebCore::InlineIterator::LineBox::contentLogicalBottom const):
(WebCore::InlineIterator::LineBox::contentLogicalTopAdjustedForPrecedingLineBox const):
(WebCore::InlineIterator::LineBox::contentLogicalBottomAdjustedForFollowingLineBox const):
(WebCore::InlineIterator::LineBox::top const):
(WebCore::InlineIterator::LineBox::bottom const):
(WebCore::InlineIterator::LineBox::contentLogicalLeft const):
(WebCore::InlineIterator::LineBox::contentLogicalRight const):
(WebCore::InlineIterator::LineBox::contentLogicalWidth const):
(WebCore::InlineIterator::LineBox::isHorizontal const):
(WebCore::InlineIterator::LineBox::baselineType const):
(WebCore::InlineIterator::LineBox::containingBlock const):
(WebCore::InlineIterator::LineBox::containingFragment const):
(WebCore::InlineIterator::LineBox::isFirstAfterPageBreak const):
(WebCore::InlineIterator::LineBox::isFirst const):
(WebCore::InlineIterator::Line::lineBoxHeight const): Deleted.
(WebCore::InlineIterator::LineIterator::LineIterator): Deleted.
(WebCore::InlineIterator::LineIterator::operator++): Deleted.
(WebCore::InlineIterator::LineIterator::operator bool const): Deleted.
(WebCore::InlineIterator::LineIterator::operator!= const): Deleted.
(WebCore::InlineIterator::LineIterator::operator== const): Deleted.
(WebCore::InlineIterator::LineIterator::operator* const): Deleted.
(WebCore::InlineIterator::LineIterator::operator-> const): Deleted.
(WebCore::InlineIterator::previousLineContentBottomOrBorderAndPadding): Deleted.
(WebCore::InlineIterator::Line::Line): Deleted.
(WebCore::InlineIterator::Line::contentLogicalTop const): Deleted.
(WebCore::InlineIterator::Line::contentLogicalBottom const): Deleted.
(WebCore::InlineIterator::Line::contentLogicalTopAdjustedForPrecedingLine const): Deleted.
(WebCore::InlineIterator::Line::contentLogicalBottomAdjustedForFollowingLine const): Deleted.
(WebCore::InlineIterator::Line::lineBoxTop const): Deleted.
(WebCore::InlineIterator::Line::lineBoxBottom const): Deleted.
(WebCore::InlineIterator::Line::contentLogicalLeft const): Deleted.
(WebCore::InlineIterator::Line::contentLogicalRight const): Deleted.
(WebCore::InlineIterator::Line::contentLogicalWidth const): Deleted.
(WebCore::InlineIterator::Line::isHorizontal const): Deleted.
(WebCore::InlineIterator::Line::baselineType const): Deleted.
(WebCore::InlineIterator::Line::containingBlock const): Deleted.
(WebCore::InlineIterator::Line::containingFragment const): Deleted.
(WebCore::InlineIterator::Line::isFirstAfterPageBreak const): Deleted.
(WebCore::InlineIterator::Line::isFirst const): Deleted.
* layout/integration/InlineIteratorLineLegacyPath.h:
(WebCore::InlineIterator::LineBoxIteratorLegacyPath::LineBoxIteratorLegacyPath):
(WebCore::InlineIterator::LineBoxIteratorLegacyPath::contentLogicalTopAdjustedForPrecedingLineBox const):
(WebCore::InlineIterator::LineBoxIteratorLegacyPath::contentLogicalBottomAdjustedForFollowingLineBox const):
(WebCore::InlineIterator::LineBoxIteratorLegacyPath::top const):
(WebCore::InlineIterator::LineBoxIteratorLegacyPath::bottom const):
(WebCore::InlineIterator::LineBoxIteratorLegacyPath::operator== const):
(WebCore::InlineIterator::LineIteratorLegacyPath::LineIteratorLegacyPath): Deleted.
(WebCore::InlineIterator::LineIteratorLegacyPath::contentLogicalTop const): Deleted.
(WebCore::InlineIterator::LineIteratorLegacyPath::contentLogicalBottom const): Deleted.
(WebCore::InlineIterator::LineIteratorLegacyPath::contentLogicalTopAdjustedForPrecedingLine const): Deleted.
(WebCore::InlineIterator::LineIteratorLegacyPath::contentLogicalBottomAdjustedForFollowingLine const): Deleted.
(WebCore::InlineIterator::LineIteratorLegacyPath::lineBoxTop const): Deleted.
(WebCore::InlineIterator::LineIteratorLegacyPath::lineBoxBottom const): Deleted.
(WebCore::InlineIterator::LineIteratorLegacyPath::contentLogicalLeft const): Deleted.
(WebCore::InlineIterator::LineIteratorLegacyPath::contentLogicalRight const): Deleted.
(WebCore::InlineIterator::LineIteratorLegacyPath::isHorizontal const): Deleted.
(WebCore::InlineIterator::LineIteratorLegacyPath::baselineType const): Deleted.
(WebCore::InlineIterator::LineIteratorLegacyPath::containingBlock const): Deleted.
(WebCore::InlineIterator::LineIteratorLegacyPath::containingFragment const): Deleted.
(WebCore::InlineIterator::LineIteratorLegacyPath::isFirstAfterPageBreak const): Deleted.
(WebCore::InlineIterator::LineIteratorLegacyPath::traverseNext): Deleted.
(WebCore::InlineIterator::LineIteratorLegacyPath::traversePrevious): Deleted.
(WebCore::InlineIterator::LineIteratorLegacyPath::operator== const): Deleted.
(WebCore::InlineIterator::LineIteratorLegacyPath::atEnd const): Deleted.
(WebCore::InlineIterator::LineIteratorLegacyPath::firstLeafBox const): Deleted.
(WebCore::InlineIterator::LineIteratorLegacyPath::lastLeafBox const): Deleted.
* layout/integration/InlineIteratorLineModernPath.h:
(WebCore::InlineIterator::LineBoxIteratorModernPath::LineBoxIteratorModernPath):
(WebCore::InlineIterator::LineBoxIteratorModernPath::top const):
(WebCore::InlineIterator::LineBoxIteratorModernPath::bottom const):
(WebCore::InlineIterator::LineBoxIteratorModernPath::contentLogicalTopAdjustedForPrecedingLineBox const):
(WebCore::InlineIterator::LineBoxIteratorModernPath::contentLogicalBottomAdjustedForFollowingLineBox const):
(WebCore::InlineIterator::LineBoxIteratorModernPath::operator== const):
(WebCore::InlineIterator::LineIteratorModernPath::LineIteratorModernPath): Deleted.
(WebCore::InlineIterator::LineIteratorModernPath::contentLogicalTop const): Deleted.
(WebCore::InlineIterator::LineIteratorModernPath::contentLogicalBottom const): Deleted.
(WebCore::InlineIterator::LineIteratorModernPath::lineBoxTop const): Deleted.
(WebCore::InlineIterator::LineIteratorModernPath::lineBoxBottom const): Deleted.
(WebCore::InlineIterator::LineIteratorModernPath::contentLogicalTopAdjustedForPrecedingLine const): Deleted.
(WebCore::InlineIterator::LineIteratorModernPath::contentLogicalBottomAdjustedForFollowingLine const): Deleted.
(WebCore::InlineIterator::LineIteratorModernPath::contentLogicalLeft const): Deleted.
(WebCore::InlineIterator::LineIteratorModernPath::contentLogicalRight const): Deleted.
(WebCore::InlineIterator::LineIteratorModernPath::isHorizontal const): Deleted.
(WebCore::InlineIterator::LineIteratorModernPath::baselineType const): Deleted.
(WebCore::InlineIterator::LineIteratorModernPath::containingBlock const): Deleted.
(WebCore::InlineIterator::LineIteratorModernPath::containingFragment const): Deleted.
(WebCore::InlineIterator::LineIteratorModernPath::isFirstAfterPageBreak const): Deleted.
(WebCore::InlineIterator::LineIteratorModernPath::traverseNext): Deleted.
(WebCore::InlineIterator::LineIteratorModernPath::traversePrevious): Deleted.
(WebCore::InlineIterator::LineIteratorModernPath::operator== const): Deleted.
(WebCore::InlineIterator::LineIteratorModernPath::atEnd const): Deleted.
(WebCore::InlineIterator::LineIteratorModernPath::firstLeafBox const): Deleted.
(WebCore::InlineIterator::LineIteratorModernPath::lastLeafBox const): Deleted.
(WebCore::InlineIterator::LineIteratorModernPath::setAtEnd): Deleted.
(WebCore::InlineIterator::LineIteratorModernPath::lines const): Deleted.
(WebCore::InlineIterator::LineIteratorModernPath::line const): Deleted.
* layout/integration/InlineIteratorLogicalOrderTraversal.cpp:
(WebCore::InlineIterator::makeLineLogicalOrderCache):
(WebCore::InlineIterator::updateLineLogicalOrderCacheIfNeeded):
(WebCore::InlineIterator::firstLeafOnLineInLogicalOrder):
(WebCore::InlineIterator::lastLeafOnLineInLogicalOrder):
(WebCore::InlineIterator::firstLeafOnLineInLogicalOrderWithNode):
(WebCore::InlineIterator::lastLeafOnLineInLogicalOrderWithNode):
* layout/integration/InlineIteratorLogicalOrderTraversal.h:
(WebCore::InlineIterator::leafBoxesInLogicalOrder):
* layout/integration/InlineIteratorTextBox.cpp:
(WebCore::InlineIterator::TextBox::selectionRect const):
* layout/integration/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::firstLineBox const):
(WebCore::LayoutIntegration::LineLayout::lastLineBox const):
(WebCore::LayoutIntegration::LineLayout::firstLine const): Deleted.
(WebCore::LayoutIntegration::LineLayout::lastLine const): Deleted.
* layout/integration/LayoutIntegrationLineLayout.h:
* layout/integration/LineSelection.h:
(WebCore::LineSelection::logicalTop):
(WebCore::LineSelection::logicalBottom):
(WebCore::LineSelection::logicalRect):
(WebCore::LineSelection::physicalRect):
(WebCore::LineSelection::logicalTopAdjustedForPrecedingBlock):
(WebCore::LineSelection::selectionState):
* rendering/CaretRectComputation.cpp:
(WebCore::computeCaretRectForLinePosition):
(WebCore::computeCaretRectForText):
(WebCore::computeCaretRectForLineBreak):
(WebCore::computeCaretRectForBox):
* rendering/InlineBoxPainter.cpp:
(WebCore::InlineBoxPainter::InlineBoxPainter):
(WebCore::InlineBoxPainter::paintMask):
(WebCore::InlineBoxPainter::paintDecorations):
(WebCore::InlineBoxPainter::style const):
* rendering/InlineBoxPainter.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::adjustEnclosingTopForPrecedingBlock const):
(WebCore::RenderBlockFlow::inlineSelectionGaps):
(WebCore::RenderBlockFlow::containsNonZeroBidiLevel const):
(WebCore::RenderBlockFlow::findClosestTextAtAbsolutePoint):
(WebCore::RenderBlockFlow::positionForPointWithInlineChildren):
(WebCore::RenderBlockFlow::addFocusRingRectsForInlineChildren):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::getLeadingCorner const):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::paintOutline):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::positionForPoint):
* rendering/RenderText.cpp:
(WebCore::RenderText::positionForPoint):
* rendering/TextBoxPainter.cpp:
(WebCore::TextBoxPainter::TextBoxPainter):
(WebCore::TextBoxPainter::paintBackground):
(WebCore::textPosition):
(WebCore::TextBoxPainter::computePaintRect):
* rendering/svg/SVGRootInlineBox.cpp:
(WebCore::SVGRootInlineBox::reorderValueListsToLogicalOrder):
* style/InlineTextBoxStyle.cpp:
(WebCore::minLogicalTopForTextDecorationLine):
(WebCore::maxLogicalBottomForTextDecorationLine):
(WebCore::computeUnderlineOffset):
2022-03-20 Oriol Brufau <obrufau@igalia.com>
Fix CSS cascade regarding logical properties
https://bugs.webkit.org/show_bug.cgi?id=236199
Reviewed by Darin Adler.
The CSS cascade was trying to resolve logical properties into physical
ones too early. This failed if we still didn't know the direction or
writing-mode, e.g. because they were set to a variable or to a CSS-wide
keyword.
This patch keeps logical properties as-is during the cascade. They are
only resolved when finally applied. Also, both logical properties and
their physical equivalents are now set to apply in parse order, since
'height: 0px; block-size: 1px' and 'block-size: 1px; height: 0px' can be
different, the order matters.
Tests: imported/w3c/web-platform-tests/css/css-logical/animation-004.html
imported/w3c/web-platform-tests/css/css-logical/logicalprops-with-deferred-writing-mode.html
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
* css/CSSProperties.json:
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseValueWithVariableReferences):
* style/PropertyCascade.cpp:
(WebCore::Style::shouldApplyPropertyInParseOrder):
(WebCore::Style::PropertyCascade::PropertyCascade):
(WebCore::Style::PropertyCascade::set):
(WebCore::Style::PropertyCascade::setDeferred):
(WebCore::Style::PropertyCascade::resolveDirectionAndWritingMode const): Deleted.
(WebCore::Style::PropertyCascade::direction const): Deleted.
* style/PropertyCascade.h:
(WebCore::Style::PropertyCascade::areDeferredInOrder const):
* style/StyleBuilder.cpp:
(WebCore::Style::Builder::Builder):
(WebCore::Style::Builder::applyProperty):
(WebCore::Style::directionFromStyle): Deleted.
2022-03-20 Alan Bujtas <zalan@apple.com>
[IFC][Integration] Remove redundant InlineIterator::Line::contentLogicalTopAdjustedForHitTesting
https://bugs.webkit.org/show_bug.cgi?id=238107
Reviewed by Antti Koivisto.
It looks like contentLogicalTopAdjustedForHitTesting is just the combination of
- containingBlock's border and padding before
- LineSelection::logicalTop (which is either the line's content top or the previous line's content bottom)
- line's content top
* layout/integration/InlineIteratorLine.h:
(WebCore::InlineIterator::contentStartInBlockDirection):
(WebCore::InlineIterator::Line::contentLogicalTopAdjustedForHitTesting const): Deleted.
* layout/integration/InlineIteratorLineModernPath.h:
(WebCore::InlineIterator::LineIteratorModernPath::contentLogicalTopAdjustedForPrecedingLine const):
(WebCore::InlineIterator::LineIteratorModernPath::contentLogicalTopAdjustedForHitTesting const): Deleted.
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::positionForPointWithInlineChildren):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::positionForPoint): This seems to be missing the contentLogicalTop check.
* rendering/RenderText.cpp:
(WebCore::RenderText::positionForPoint):
2022-03-20 Philippe Normand <pnormand@igalia.com>
REGRESSION(r289154) [GSTREAMER] webrtc/vp8-then-h264.html is crashing after SDK update to fdo 21.08 and Gstreamer 1.20
https://bugs.webkit.org/show_bug.cgi?id=237872
Reviewed by Adrian Perez de Castro.
* platform/mediastream/libwebrtc/gstreamer/GStreamerVideoDecoderFactory.cpp:
(WebCore::VP8Decoder::Create): Fix typo in decoder factory test.
2022-03-20 Zan Dobersek <zdobersek@igalia.com>
[WPE][GStreamer] media playback broken
https://bugs.webkit.org/show_bug.cgi?id=238110
Reviewed by Philippe Normand.
* platform/graphics/gbm/GBMBufferSwapchain.cpp:
(WebCore::GBMBufferSwapchain::GBMBufferSwapchain):
Fix the assert that's hit when using eight-buffers capacity value. Just
a matter of using the more proper <= operator.
2022-03-19 Chris Dumez <cdumez@apple.com>
Optimize EventTarget::visitJSEventListeners()
https://bugs.webkit.org/show_bug.cgi?id=238116
Reviewed by Darin Adler.
This was confirmed by A/B bots to be a 1-1.5% progression on Speedometer on
iMac 20,1 (Intel).
* dom/EventListenerMap.cpp:
(WebCore::EventListenerMap::clear):
(WebCore::EventListenerMap::replace):
(WebCore::EventListenerMap::add):
(WebCore::EventListenerMap::remove):
(WebCore::EventListenerMap::removeFirstEventListenerCreatedFromMarkup):
(WebCore::EventListenerMap::assertNoActiveIterators const): Deleted.
(WebCore::EventListenerMap::EventListenerMap): Deleted.
(WebCore::EventListenerIterator::EventListenerIterator): Deleted.
(WebCore::EventListenerIterator::~EventListenerIterator): Deleted.
(WebCore::EventListenerIterator::nextListener): Deleted.
* dom/EventListenerMap.h:
(WebCore::EventListenerMap::visitJSEventListeners):
(): Deleted.
(WebCore::EventListenerMap::assertNoActiveIterators const): Deleted.
* dom/EventTarget.cpp:
(WebCore::EventTarget::visitJSEventListeners): Deleted.
* dom/EventTarget.h:
(WebCore::EventTarget::visitJSEventListeners):
2022-03-19 Oriol Brufau <obrufau@igalia.com>
[cssom] Implement border-image serialization
https://bugs.webkit.org/show_bug.cgi?id=238102
Reviewed by Darin Adler.
Add logic for serializing border-image at specified-value time.
Tests: fast/css/parse-border-image-repeat-null-crash.html
imported/w3c/web-platform-tests/css/css-backgrounds/parsing/border-image-valid.html
* css/StyleProperties.cpp:
(WebCore::StyleProperties::getPropertyValue const):
(WebCore::StyleProperties::borderImagePropertyValue const):
(WebCore::StyleProperties::asText const):
* css/StyleProperties.h:
2022-03-19 Oriol Brufau <obrufau@igalia.com>
Fix hasExplicitlySetBorderRadius flag
https://bugs.webkit.org/show_bug.cgi?id=238062
Reviewed by Darin Adler.
The four border-*-radius longhands were sharing the same flag, so the
behavior was broken when setting longhands individually.
This patch splits the flag into 4 different ones, one for each longhand.
Also makes sure to set it properly when a longhand is set to 'initial'.
It's ugly to have all this boilerplate code for the flags, but
https://webkit.org/b/212506 will make it automatically generated.
Test: fast/css/appearance-apple-pay-button-border-radius-longhands.html
* css/CSSProperties.json:
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::RenderStyle):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::hasExplicitlySetBorderBottomLeftRadius const):
(WebCore::RenderStyle::hasExplicitlySetBorderBottomRightRadius const):
(WebCore::RenderStyle::hasExplicitlySetBorderTopLeftRadius const):
(WebCore::RenderStyle::hasExplicitlySetBorderTopRightRadius const):
(WebCore::RenderStyle::hasExplicitlySetBorderRadius const):
(WebCore::RenderStyle::setHasExplicitlySetBorderBottomLeftRadius):
(WebCore::RenderStyle::setHasExplicitlySetBorderBottomRightRadius):
(WebCore::RenderStyle::setHasExplicitlySetBorderTopLeftRadius):
(WebCore::RenderStyle::setHasExplicitlySetBorderTopRightRadius):
(WebCore::RenderStyle::NonInheritedFlags::operator== const):
(WebCore::RenderStyle::NonInheritedFlags::copyNonInheritedFrom):
(WebCore::RenderStyle::setHasExplicitlySetBorderRadius): Deleted.
* style/StyleBuilderCustom.h:
(WebCore::Style::BuilderCustom::applyInitialBorderBottomLeftRadius):
(WebCore::Style::BuilderCustom::applyInheritBorderBottomLeftRadius):
(WebCore::Style::BuilderCustom::applyValueBorderBottomLeftRadius):
(WebCore::Style::BuilderCustom::applyInitialBorderBottomRightRadius):
(WebCore::Style::BuilderCustom::applyInheritBorderBottomRightRadius):
(WebCore::Style::BuilderCustom::applyValueBorderBottomRightRadius):
(WebCore::Style::BuilderCustom::applyInitialBorderTopLeftRadius):
(WebCore::Style::BuilderCustom::applyInheritBorderTopLeftRadius):
(WebCore::Style::BuilderCustom::applyValueBorderTopLeftRadius):
(WebCore::Style::BuilderCustom::applyInitialBorderTopRightRadius):
(WebCore::Style::BuilderCustom::applyInheritBorderTopRightRadius):
(WebCore::Style::BuilderCustom::applyValueBorderTopRightRadius):
2022-03-19 Alan Bujtas <zalan@apple.com>
[IFC][Integration] InlineIterator::Line functions should all return float values
https://bugs.webkit.org/show_bug.cgi?id=238106
Reviewed by Antti Koivisto.
Display structures are supposed to be all float based.
* layout/integration/InlineIteratorLine.h:
(WebCore::InlineIterator::Line::lineBoxHeight const):
(WebCore::InlineIterator::contentStartInBlockDirection):
(WebCore::InlineIterator::Line::contentLogicalTop const):
(WebCore::InlineIterator::Line::contentLogicalBottom const):
(WebCore::InlineIterator::Line::contentLogicalTopAdjustedForPrecedingLine const):
(WebCore::InlineIterator::Line::contentLogicalTopAdjustedForHitTesting const):
(WebCore::InlineIterator::Line::contentLogicalBottomAdjustedForFollowingLine const):
(WebCore::InlineIterator::Line::lineBoxTop const):
(WebCore::InlineIterator::Line::lineBoxBottom const):
* layout/integration/InlineIteratorLineLegacyPath.h:
(WebCore::InlineIterator::LineIteratorLegacyPath::contentLogicalTop const):
(WebCore::InlineIterator::LineIteratorLegacyPath::contentLogicalBottom const):
(WebCore::InlineIterator::LineIteratorLegacyPath::contentLogicalTopAdjustedForPrecedingLine const):
(WebCore::InlineIterator::LineIteratorLegacyPath::contentLogicalTopAdjustedForHitTesting const):
(WebCore::InlineIterator::LineIteratorLegacyPath::contentLogicalBottomAdjustedForFollowingLine const):
(WebCore::InlineIterator::LineIteratorLegacyPath::lineBoxTop const):
(WebCore::InlineIterator::LineIteratorLegacyPath::lineBoxBottom const):
* layout/integration/InlineIteratorLineModernPath.h:
(WebCore::InlineIterator::LineIteratorModernPath::contentLogicalTop const):
(WebCore::InlineIterator::LineIteratorModernPath::contentLogicalBottom const):
(WebCore::InlineIterator::LineIteratorModernPath::lineBoxTop const):
(WebCore::InlineIterator::LineIteratorModernPath::lineBoxBottom const):
(WebCore::InlineIterator::LineIteratorModernPath::contentLogicalTopAdjustedForPrecedingLine const):
(WebCore::InlineIterator::LineIteratorModernPath::contentLogicalTopAdjustedForHitTesting const):
(WebCore::InlineIterator::LineIteratorModernPath::contentLogicalBottomAdjustedForFollowingLine const):
* layout/integration/LineSelection.h:
(WebCore::LineSelection::logicalTop):
(WebCore::LineSelection::logicalBottom):
(WebCore::LineSelection::logicalRect):
(WebCore::LineSelection::physicalRect):
(WebCore::LineSelection::logicalTopAdjustedForPrecedingBlock):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::adjustEnclosingTopForPrecedingBlock const):
(WebCore::RenderBlockFlow::inlineSelectionGaps):
(WebCore::RenderBlockFlow::positionForPointWithInlineChildren):
(WebCore::RenderBlockFlow::addFocusRingRectsForInlineChildren):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::paintOutline):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::positionForPoint):
* rendering/TextBoxPainter.cpp:
(WebCore::TextBoxPainter::paintBackground):
2022-03-19 Alan Bujtas <zalan@apple.com>
[IFC][Integration] Remove redundant InlineIterator::Line::closestBoxForPoint function
https://bugs.webkit.org/show_bug.cgi?id=238103
Reviewed by Antti Koivisto.
1. Rename closestBoxForLogicalLeftPosition to closestBoxForHorizontalPosition and move it off of the Line class.
2. Replace InlineIterator::Line::closestBoxForPoint calls with closestBoxForHorizontalPosition.
3. Tidy up Line class.
* editing/VisibleUnits.cpp:
(WebCore::previousLinePosition):
(WebCore::nextLinePosition):
* layout/integration/InlineIteratorLine.cpp:
(WebCore::InlineIterator::closestBoxForHorizontalPosition):
(WebCore::InlineIterator::Line::closestBoxForPoint const): Deleted.
(WebCore::InlineIterator::Line::closestBoxForLogicalLeftPosition const): Deleted.
* layout/integration/InlineIteratorLine.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::findClosestTextAtAbsolutePoint):
(WebCore::RenderBlockFlow::positionForPointWithInlineChildren):
2022-03-19 Alan Bujtas <zalan@apple.com>
[IFC][Integration] Rename InlineIterator::Line::blockDirectionPointInLine to contentStartInBlockDirection
https://bugs.webkit.org/show_bug.cgi?id=238101
Reviewed by Antti Koivisto.
blockDirectionPointInLine returns the position (vertical or horizontal, depending on the writing mode) where the content
starts (which for flipped writing mode is the bottom of the line).
Let's also move this function out of the Line class and have it as a standalone helper function (and move/rename some private Line
functions to public).
* editing/VisibleUnits.cpp:
(WebCore::absoluteLineDirectionPointToLocalPointInBlock):
* layout/integration/InlineIteratorLine.cpp:
(WebCore::InlineIterator::Line::blockDirectionPointInLine const): Deleted.
* layout/integration/InlineIteratorLine.h:
(WebCore::InlineIterator::contentStartInBlockDirection):
(WebCore::InlineIterator::Line::contentLogicalTopAdjustedForHitTesting const):
(WebCore::InlineIterator::Line::contentLogicalTopForHitTesting const): Deleted.
* layout/integration/InlineIteratorLineLegacyPath.h:
(WebCore::InlineIterator::LineIteratorLegacyPath::contentLogicalTopAdjustedForHitTesting const):
(WebCore::InlineIterator::LineIteratorLegacyPath::contentLogicalTopForHitTesting const): Deleted.
* layout/integration/InlineIteratorLineModernPath.h:
(WebCore::InlineIterator::LineIteratorModernPath::contentLogicalTopAdjustedForHitTesting const):
(WebCore::InlineIterator::LineIteratorModernPath::contentLogicalTopForHitTesting const): Deleted.
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::positionForPointWithInlineChildren):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::positionForPoint):
* rendering/RenderText.cpp:
(WebCore::RenderText::positionForPoint):
2022-03-19 Alan Bujtas <zalan@apple.com>
[IFC][Integration] Use a more descriptive name for InlineIterator::Line::enclosing* functions
https://bugs.webkit.org/show_bug.cgi?id=238094
Reviewed by Antti Koivisto.
Enlcosing essentially means content logical top/bottom here.
* layout/integration/InlineIteratorLine.cpp:
(WebCore::InlineIterator::Line::blockDirectionPointInLine const):
* layout/integration/InlineIteratorLine.h:
(WebCore::InlineIterator::Line::contentLogicalTopAdjustedForPrecedingLine const):
(WebCore::InlineIterator::Line::contentLogicalTopForHitTesting const):
(WebCore::InlineIterator::Line::contentLogicalBottomAdjustedForFollowingLine const):
(WebCore::InlineIterator::Line::enclosingTopAdjustedForPrecedingLine const): Deleted.
(WebCore::InlineIterator::Line::enclosingTopForHitTesting const): Deleted.
(WebCore::InlineIterator::Line::enclosingBottomAdjustedForFollowingLine const): Deleted.
* layout/integration/InlineIteratorLineLegacyPath.h:
(WebCore::InlineIterator::LineIteratorLegacyPath::contentLogicalTopAdjustedForPrecedingLine const):
(WebCore::InlineIterator::LineIteratorLegacyPath::contentLogicalTopForHitTesting const):
(WebCore::InlineIterator::LineIteratorLegacyPath::contentLogicalBottomAdjustedForFollowingLine const):
(WebCore::InlineIterator::LineIteratorLegacyPath::enclosingTopAdjustedForPrecedingLine const): Deleted.
(WebCore::InlineIterator::LineIteratorLegacyPath::enclosingTopForHitTesting const): Deleted.
(WebCore::InlineIterator::LineIteratorLegacyPath::enclosingBottomAdjustedForFollowingLine const): Deleted.
* layout/integration/InlineIteratorLineModernPath.h:
(WebCore::InlineIterator::LineIteratorModernPath::contentLogicalTopAdjustedForPrecedingLine const):
(WebCore::InlineIterator::LineIteratorModernPath::contentLogicalTopForHitTesting const):
(WebCore::InlineIterator::LineIteratorModernPath::contentLogicalBottomAdjustedForFollowingLine const):
(WebCore::InlineIterator::LineIteratorModernPath::enclosingTopAdjustedForPrecedingLine const): Deleted.
(WebCore::InlineIterator::LineIteratorModernPath::enclosingTopForHitTesting const): Deleted.
(WebCore::InlineIterator::LineIteratorModernPath::enclosingBottomAdjustedForFollowingLine const): Deleted.
* layout/integration/LineSelection.h:
(WebCore::LineSelection::logicalTop):
(WebCore::LineSelection::logicalBottom):
(WebCore::LineSelection::logicalRect):
(WebCore::LineSelection::logicalTopAdjustedForPrecedingBlock):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::positionForPointWithInlineChildren):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::positionForPoint):
* rendering/RenderText.cpp:
(WebCore::RenderText::positionForPoint):
2022-03-19 Alan Bujtas <zalan@apple.com>
[IFC][Integration] Rename InlineIterator::Line:top/bottom to contentLogicalTop/contentLogicalBottom
https://bugs.webkit.org/show_bug.cgi?id=238085
Reviewed by Antti Koivisto.
* layout/integration/InlineIteratorLine.h:
(WebCore::InlineIterator::Line::contentLogicalTop const):
(WebCore::InlineIterator::Line::contentLogicalBottom const):
(WebCore::InlineIterator::Line::top const): Deleted.
(WebCore::InlineIterator::Line::bottom const): Deleted.
* layout/integration/InlineIteratorLineLegacyPath.h:
(WebCore::InlineIterator::LineIteratorLegacyPath::contentLogicalTop const):
(WebCore::InlineIterator::LineIteratorLegacyPath::contentLogicalBottom const):
(WebCore::InlineIterator::LineIteratorLegacyPath::top const): Deleted.
(WebCore::InlineIterator::LineIteratorLegacyPath::bottom const): Deleted.
* layout/integration/InlineIteratorLineModernPath.h:
(WebCore::InlineIterator::LineIteratorModernPath::contentLogicalTop const):
(WebCore::InlineIterator::LineIteratorModernPath::contentLogicalBottom const):
(WebCore::InlineIterator::LineIteratorModernPath::enclosingTopAdjustedForPrecedingLine const):
(WebCore::InlineIterator::LineIteratorModernPath::enclosingBottomAdjustedForFollowingLine const):
(WebCore::InlineIterator::LineIteratorModernPath::top const): Deleted.
(WebCore::InlineIterator::LineIteratorModernPath::bottom const): Deleted.
2022-03-19 Alan Bujtas <zalan@apple.com>
[IFC][Integration] InlineIterator::Line::enclosingBottom should read enclosingBottomAdjustedForFollowingLine
https://bugs.webkit.org/show_bug.cgi?id=238084
Reviewed by Antti Koivisto.
* layout/integration/InlineIteratorLine.h:
(WebCore::InlineIterator::Line::enclosingBottomAdjustedForFollowingLine const):
(WebCore::InlineIterator::Line::enclosingBottom const): Deleted.
* layout/integration/InlineIteratorLineLegacyPath.h:
(WebCore::InlineIterator::LineIteratorLegacyPath::enclosingBottomAdjustedForFollowingLine const):
(WebCore::InlineIterator::LineIteratorLegacyPath::enclosingBottom const): Deleted.
* layout/integration/InlineIteratorLineModernPath.h:
(WebCore::InlineIterator::LineIteratorModernPath::enclosingBottomAdjustedForFollowingLine const):
(WebCore::InlineIterator::LineIteratorModernPath::enclosingBottom const): Deleted.
2022-03-19 Alan Bujtas <zalan@apple.com>
[IFC][Integration] Move selection specific code from InlineIterator::Line to LineSelection
https://bugs.webkit.org/show_bug.cgi?id=238083
Reviewed by Antti Koivisto.
* layout/integration/InlineIteratorLine.cpp:
(WebCore::InlineIterator::Line::enclosingTopAdjustedForPrecedingBlock const): Deleted.
(WebCore::InlineIterator::Line::selectionState const): Deleted.
* layout/integration/InlineIteratorLine.h:
(WebCore::InlineIterator::Line::enclosingLogicalRect const): Deleted.
(WebCore::InlineIterator::Line::enclosingPhysicalRect const): Deleted.
* layout/integration/LineSelection.h:
(WebCore::LineSelection::logicalRect):
(WebCore::LineSelection::physicalRect):
(WebCore::LineSelection::logicalTopAdjustedForPrecedingBlock):
(WebCore::LineSelection::selectionState):
2022-03-19 Antoine Quint <graouts@webkit.org>
Dialog element only animates once
https://bugs.webkit.org/show_bug.cgi?id=236274
rdar://88857731
Reviewed by Dean Jackson, Tim Nguyen and Antti Koivisto.
Two issues related to CSS Animation surfaced in this bug which animates both <dialog>
and its ::backdrop as the dialog is open and eventually re-opened.
The first issue was that we didn't clear all CSS Animations state when a <dialog> was
closed and its style was set to `display: none`. We now call setAnimationsCreatedByMarkup
to correctly clear such state both when we identify a Styleable is newly getting
`display: none`. We do the same when cancelDeclarativeAnimations() is called, but also
call setCSSAnimationList() on the associated effect stack since that wasn't done either.
Now both functions do similar cleanup.
This allows us to remove removeCSSAnimationCreatedByMarkup() which did a fair bit of work
to clear CSS Animation state per-animation when we only ever used that function for
_all_ animations.
The second issue was that we never called cancelDeclarativeAnimations() for ::backdrop.
We now do that inside of Element::removeFromTopLayer() at a point where the code in
Styleable::fromRenderer() will still work as the element will still be contained in
Document::topLayerElements().
Finally, we need to be sure that calling Element::setAnimationsCreatedByMarkup() with an
empty list doesn't end up creating an ElementAnimationRareData object if there was no
pre-existing object and the list of animations are empty.
Tests: imported/w3c/web-platform-tests/css/css-animations/dialog-animation.html
imported/w3c/web-platform-tests/css/css-animations/dialog-backdrop-animation.html
* dom/Element.cpp:
(WebCore::Element::removeFromTopLayer):
(WebCore::Element::setAnimationsCreatedByMarkup):
* style/Styleable.cpp:
(WebCore::Styleable::cancelDeclarativeAnimations const):
(WebCore::Styleable::updateCSSAnimations const):
(WebCore::removeCSSAnimationCreatedByMarkup): Deleted.
2022-03-19 Antoine Quint <graouts@webkit.org>
REGRESSION (r285529): Flash of missing text when content on https://ahumanfuture.co animates
https://bugs.webkit.org/show_bug.cgi?id=237972
rdar://90385586
Reviewed by Simon Fraser.
Accelerated animations are added to a CALayer in two different ways.
Transform-related animations are added in a CAAnimationGroup so that we can have control of the
way they interact with each other. We added this system when we added support for individual CSS
transform properties on top of the existing "transform" property. All CAAnimationGroup animations
are timed to start at 1s and thus we subtract that same 1s value from all animations contained
within such groups.
All other animations, such as "opacity" animations, are added as simple leaf animations and their
begin time is not subject to that 1s subtraction.
In r285529, when we introduced leaf animations for transform properties other than transform-related
properties, we took an unfortunate approach to deal with that 1s subtraction. We would *always* subtract
1s for all animations, and for leaf animation add that 1s back when we added them in the
addLeafAnimation() lambda.
However, we *did not* check whether that animation was newly started or if we were merely adding it
again. This meant that every time GraphicsLayerCA::updateAnimations() was called, any leaf animation
would have 1s added to their begin time.
So, if for instance a page ran on a given element a "scale" animation for 1s and an "opacity" animation
for 2s, when the "scale" animation would complete, GraphicsLayerCA::updateAnimations() would be called
to remove that animation, and add 1s to the "opacity" animation begin time.
We now set the begin time, if not already set, in two places: in the addLeafAnimation() lambda for
leaf animations, and in the addAnimationsForProperty() lambda for animations added to groups. We
only ever set the begin time if not already set during a previous update and only subtract the
parent group begin time for animations contained within a group.
Additionally, this means we set the begin times when we iterate over remaining animations after culling
finished animations. As such, we no longer need to iterate over *all* known animations to set their
begin time if needed prior to adding them.
Test: webanimations/accelerated-animation-opacity-animation-begin-time-after-scale-animation-ends.html
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::updateAnimations):
2022-03-19 Philippe Normand <pnormand@igalia.com>
Unreviewed, WPE clang build fix after r291343.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::pushDMABufToCompositor):
2022-03-19 Antti Koivisto <antti@apple.com>
[CSS Container Queries] Add Typed OM support for container units
https://bugs.webkit.org/show_bug.cgi?id=238078
Reviewed by Alan Bujtas.
For completeness, Typed OM is not enabled or fully implemented yet.
* css/DOMCSSNamespace+CSSNumericFactory.idl:
* css/typedom/CSSNumericFactory.h:
* css/typedom/CSSStyleValueFactory.cpp:
(WebCore::CSSStyleValueFactory::reifyValue):
2022-03-19 Alan Bujtas <zalan@apple.com>
[IFC][Integration] Move enclosingHeightAdjustedForPrecedingBlock off of InlineIterator::Line
https://bugs.webkit.org/show_bug.cgi?id=238081
Reviewed by Antti Koivisto.
This function is way too specific to be on InlineIterator::Line (and has only one callsite).
* layout/integration/InlineIteratorLine.cpp:
(WebCore::InlineIterator::Line::enclosingHeightAdjustedForPrecedingBlock const): Deleted.
* layout/integration/LineSelection.h:
(WebCore::LineSelection::logicalTopAdjustedForPrecedingBlock):
(WebCore::LineSelection::logicalHeightAdjustedForPrecedingBlock): Deleted.
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::inlineSelectionGaps):
2022-03-18 Joseph Griego <jgriego@igalia.com>
Fix typo from r291295
https://bugs.webkit.org/show_bug.cgi?id=238087
Reviewed by Chris Dumez.
No new tests (changes only comments)
* bindings/scripts/CodeGeneratorJS.pm:
(IsAlwaysExposedOnInterface):
2022-03-18 Patrick Angle <pangle@apple.com>
Web Inspector: `console.screenshot` has extra transparent pixels at bottom of screenshot on platforms with viewports that are obscured by browser chrome
https://bugs.webkit.org/show_bug.cgi?id=238060
Reviewed by Devin Rousso.
ScrollView::sizeForVisibleRect includes partially-visible portions of the viewport, including in Safari's case
the part of the viewport under the semi-translucent title bar. Because we force an origin of zero, this meant
that we were overshooting the bottom of the viewport by the height of this area when taking a snapshot for
`console.screenshot()`. Instead, we should use unobscured viewport rectangle and provide coordinates in
document-space, not view-space to `WebCore::snapshotFrameRect`.
* page/PageConsoleClient.cpp:
(WebCore::PageConsoleClient::screenshot):
2022-03-18 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(?): Emulate User Gesture doesn't work
https://bugs.webkit.org/show_bug.cgi?id=232584
<rdar://problem/84899576>
Reviewed by Patrick Angle.
Recently some new web APIs have gone a step further by using a new way to detect one-time
user interaction called [transient activation](https://html.spec.whatwg.org/multipage/interaction.html#transient-activation).
In order to support invoking these APIs from Web Inspector, `UserGestureEmulationScope`
needs to be adjusted to support marking the context as having recently been interacted with,
which turns out to just involve plumbing a `Document` through to the `UserGestureIndicator`,
as the rest has already been implemented.
Tests: inspector/debugger/breakpoint-action-emulateUserGesture-hasTransientActiviation.html
inspector/debugger/evaluateOnCallFrame-emulateUserGesture-hasTransientActivation.html
inspector/runtime/callFunctionOn-emulateUserGesture-hasTransientActivation.html
inspector/runtime/evaluate-emulateUserGesture-hasTransientActivation.html
* inspector/agents/page/PageDebuggerAgent.h:
* inspector/agents/page/PageDebuggerAgent.cpp:
(WebCore::PageDebuggerAgent::evaluateOnCallFrame):
(WebCore::PageDebuggerAgent::debuggerWillEvaluate):
(WebCore::PageDebuggerAgent::debuggerDidEvaluate):
* inspector/agents/page/PageRuntimeAgent.cpp:
(WebCore::PageRuntimeAgent::evaluate):
(WebCore::PageRuntimeAgent::callFunctionOn):
* inspector/agents/page/UserGestureEmulationScope.h:
* inspector/agents/page/UserGestureEmulationScope.cpp:
(WebCore::UserGestureEmulationScope::UserGestureEmulationScope):
Derive a `Document` from the `JSGlobalObject` of the relevant `InjectedScript`.
* inspector/InspectorFrontendClientLocal.cpp:
(WebCore::InspectorFrontendClientLocal::openURLExternally):
* inspector/InspectorFrontendHost.cpp:
(WebCore::FrontendMenuProvider::contextMenuItemSelected):
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::navigate):
Drive-by: Pass the relevant `Document` to the `UserGestureIndicator` just in case the Web
Inspector frontend needs it.
* page/DOMWindow.h:
* testing/Internals.idl:
* testing/Internals.h:
* testing/Internals.cpp:
(WebCore::Internals::hasTransientActivation): Added.
Expose `DOMWindow::hasTransientActivation` to tests.
2022-03-18 Nikolaos Mouchtaris <nmouchtaris@apple.com>
Calc() cleanup
https://bugs.webkit.org/show_bug.cgi?id=237982
Reviewed by Simon Fraser.
Small cleanup of CSSCalcExpressionNodeParser and CSSCalcOperationNode needed after
adding more math functions.
* css/calc/CSSCalcExpressionNodeParser.cpp:
(WebCore::CSSCalcExpressionNodeParser::parseCalcFunction):
* css/calc/CSSCalcOperationNode.cpp:
(WebCore::determineCategory):
(WebCore::CSSCalcOperationNode::simplifyNode):
* css/calc/CSSCalcOperationNode.h:
2022-03-18 Eric Carlson <eric.carlson@apple.com>
[iOS] Fix more build breakage from r291361
https://bugs.webkit.org/show_bug.cgi?id=238097
<rdar://problem/90505371>
Unreviewed build fix.
* platform/ios/WebAVPlayerController.mm: Declare AVAssetTrack.
2022-03-18 Commit Queue <commit-queue@webkit.org>
Unreviewed, reverting r291476.
https://bugs.webkit.org/show_bug.cgi?id=238098
Caused Gtk js/weakref-finalizationregistry.html failure
Reverted changeset:
"Remove the 1ms minimum for setTimeout"
https://bugs.webkit.org/show_bug.cgi?id=221124
https://commits.webkit.org/r291476
2022-03-18 Alan Bujtas <zalan@apple.com>
[IFC][Integration] InlineIterator::Line::enclosingTop is really an enclosingTopAdjustedForPrecedingLine
https://bugs.webkit.org/show_bug.cgi?id=238079
Reviewed by Antti Koivisto.
This is used for selection and hittesting.
* layout/integration/InlineIteratorLine.cpp:
(WebCore::InlineIterator::Line::enclosingTopAdjustedForPrecedingBlock const):
* layout/integration/InlineIteratorLine.h:
(WebCore::InlineIterator::Line::enclosingTopAdjustedForPrecedingLine const):
(WebCore::InlineIterator::Line::enclosingLogicalRect const):
(WebCore::InlineIterator::Line::enclosingTop const): Deleted.
* layout/integration/InlineIteratorLineLegacyPath.h:
(WebCore::InlineIterator::LineIteratorLegacyPath::enclosingTopAdjustedForPrecedingLine const):
(WebCore::InlineIterator::LineIteratorLegacyPath::enclosingTop const): Deleted.
* layout/integration/InlineIteratorLineModernPath.h:
(WebCore::InlineIterator::LineIteratorModernPath::enclosingTopAdjustedForPrecedingLine const):
(WebCore::InlineIterator::LineIteratorModernPath::enclosingTopForHitTesting const):
(WebCore::InlineIterator::LineIteratorModernPath::enclosingTop const): Deleted.
* layout/integration/LineSelection.h:
(WebCore::LineSelection::logicalTop):
2022-03-18 Chris Dumez <cdumez@apple.com>
Optimize AtomHTMLToken::initializeAttributes()
https://bugs.webkit.org/show_bug.cgi?id=238074
Reviewed by Geoffrey Garen.
Use a HashSet to find duplicate attributes instead of doing a linear search.
This is a confirmed 1.2% progression on Speedometer on iMac20,1 via A/B bots.
* html/parser/AtomHTMLToken.h:
(WebCore::AtomHTMLToken::initializeAttributes):
2022-03-18 Jonathan Bedard <jbedard@apple.com>
[iOS 15.4] Fix unused variables
https://bugs.webkit.org/show_bug.cgi?id=238089
<rdar://problem/90498642>
Reviewed by Alexey Proskuryakov and Chris Dumez.
Covered by exisiting tests.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::visiblePositionForPoint const): frameView is only used on Mac.
* editing/cocoa/HTMLConverter.mm:
(HTMLConverter::_addAttachmentForElement): Declare ignoreOrientation as unused on iOS family.
* platform/audio/ios/AudioOutputUnitAdaptorIOS.cpp:
(WebCore::AudioOutputUnitAdaptor::configure): Assert that result is unused.
* platform/graphics/coretext/FontCascadeCoreText.cpp:
(WebCore::FontCascade::drawGlyphs): Declare shouldSmoothFonts as unused on iOS family.
2022-03-18 Antti Koivisto <antti@apple.com>
[CSS Container Queries] Ensure container style changes are propagated to descendants
https://bugs.webkit.org/show_bug.cgi?id=238072
Reviewed by Alan Bujtas.
* style/StyleChange.cpp:
(WebCore::Style::determineChange):
Ensure we recompute the descendants when container properties change.
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolveComposedTree):
(WebCore::Style::TreeResolver::updateQueryContainer):
We need to ensure layout is up-to-date also when a query container stops being one.
Remove the unused m_resolvedQueryContainers maps.
* style/StyleTreeResolver.h:
2022-03-18 Per Arne Vollan <pvollan@apple.com>
Fix test failures when enabling content filtering in the Network process
https://bugs.webkit.org/show_bug.cgi?id=237217
Reviewed by Brent Fulgham.
This patch addresses test failures when enabling content filtering in the Network process.
When content filtering is running in the Network process, we need to send the mock content
filter and settings to the Network process to support testing. The mock content filter is
moved from the WebCore test support library target to the WebCore framework, since WebKit
now also will reference the mock content filter when sending it to the Network process.
Previously a compile time guard was used to disable the content filtering code in the
document loader. However, we still need to support content filtering in the document
loader for WK1, so this patch changes that to use a runtime check instead. The rest of
this patch addresses test failures seen when running the layout and API tests. This patch
does not enable the feature.
No new tests, covered by existing tests.
* WebCore.xcodeproj/project.pbxproj:
* loader/ContentFilter.cpp:
(WebCore::ContentFilter::startFilteringMainResource):
(WebCore::ContentFilter::continueAfterDataReceived):
(WebCore::ContentFilter::continueAfterNotifyFinished):
(WebCore::ContentFilter::deliverResourceData):
(WebCore::ContentFilter::url):
(WebCore::ContentFilter::continueAfterSubstituteDataRequest):
* loader/ContentFilter.h:
(WebCore::ContentFilter::setBlockedError):
* loader/ContentFilterClient.h:
* loader/DocumentLoader.cpp:
(WebCore::contentFilterInDocumentLoader):
(WebCore::DocumentLoader::notifyFinished):
(WebCore::DocumentLoader::willSendRequest):
(WebCore::DocumentLoader::responseReceived):
(WebCore::DocumentLoader::dataReceived):
(WebCore::DocumentLoader::detachFromFrame):
(WebCore::DocumentLoader::startLoadingMainResource):
(WebCore::DocumentLoader::clearMainResource):
(WebCore::DocumentLoader::becomeMainResourceClient):
(WebCore::DocumentLoader::dataReceivedThroughContentFilter):
(WebCore::DocumentLoader::contentFilterWillHandleProvisionalLoadFailure):
(WebCore::DocumentLoader::contentFilterHandleProvisionalLoadFailure):
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::setBlockedPageURL):
(WebCore::DocumentLoader::setSubstituteDataFromContentFilter):
* loader/PolicyChecker.cpp:
(WebCore::FrameLoader::PolicyChecker::checkNavigationPolicy):
* platform/ContentFilterUnblockHandler.h:
* platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
(WebCore::ContentFilterUnblockHandler::encode const):
(WebCore::ContentFilterUnblockHandler::decode):
(WebCore::ContentFilterUnblockHandler::canHandleRequest const):
(WebCore::ContentFilterUnblockHandler::requestUnblockAsync const):
(WebCore::ContentFilterUnblockHandler::setUnblockedAfterRequest):
* testing/MockContentFilterManager.cpp: Added.
(WebCore::MockContentFilterManager::singleton):
(WebCore::MockContentFilterManager::setClient):
(WebCore::MockContentFilterManager::notifySettingsChanged const):
* testing/MockContentFilterManager.h: Added.
* testing/MockContentFilterSettings.cpp:
(WebCore::MockContentFilterSettings::reset):
(WebCore::MockContentFilterSettings::setEnabled):
(WebCore::MockContentFilterSettings::setBlockedString):
(WebCore::MockContentFilterSettings::setDecisionPoint):
(WebCore::MockContentFilterSettings::setDecision):
(WebCore::MockContentFilterSettings::setUnblockRequestDecision):
(WebCore::MockContentFilterSettings::setModifiedRequestURL):
* testing/MockContentFilterSettings.h:
(WebCore::MockContentFilterSettings::encode const):
(WebCore::MockContentFilterSettings::decode):
(WebCore::MockContentFilterSettings::setBlockedString): Deleted.
(WebCore::MockContentFilterSettings::setDecisionPoint): Deleted.
(WebCore::MockContentFilterSettings::setDecision): Deleted.
(WebCore::MockContentFilterSettings::setUnblockRequestDecision): Deleted.
(WebCore::MockContentFilterSettings::setModifiedRequestURL): Deleted.
* testing/MockContentFilterSettingsClient.h: Added.
(WebCore::MockContentFilterSettingsClient::~MockContentFilterSettingsClient):
2022-03-18 Nikolaos Mouchtaris <nmouchtaris@apple.com>
Allow history swipe in scroller with overscroll-behavior
https://bugs.webkit.org/show_bug.cgi?id=235851
Reviewed by Simon Fraser.
Re-add code to allow history swipe. Does so by returning unhandled if a horizontal
swipe is used. Also add test to make sure history swipes are allowed in scrolling nodes
with overscroll-behavior.
Test: scrollingcoordinator/mac/latching/horizontal-overflow-back-swipe-overscroll-behavior.html
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::handleWheelEventWithNode):
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::shouldRubberBand const):
(WebCore::ScrollingTreeScrollingNode::computeScrollPropagation const):
(WebCore::ScrollingTreeScrollingNode::shouldBlockScrollPropagation const): Deleted.
* page/scrolling/ScrollingTreeScrollingNode.h:
2022-03-18 Chris Dumez <cdumez@apple.com>
Avoid calls to [CLLocationManager authorizationStatus] & [CLLocationManager locationServicesEnabled]
https://bugs.webkit.org/show_bug.cgi?id=237933
<rdar://89931043>
Reviewed by Geoffrey Garen.
Avoid calls to [CLLocationManager authorizationStatus] & [CLLocationManager locationServicesEnabled]
for performance reasons since those are synchronous, potentially slow and called on the UIProcess
main thread.
Instead, rely on the fact that the locationManagerDidChangeAuthorization always gets called
asynchronously right after constructing the CLLocationManager with the actual authorization.
This simplifies our logic a bit too.
We now only call [CLLocationManager requestWhenInUseAuthorization] when locationManagerDidChangeAuthorization
gets called with kCLAuthorizationStatusNotDetermined asynchronously after construction.
If locationManagerDidChangeAuthorization gets called with an authorized enum value, we
call [CLLocationManager startUpdatingLocation] then (if the client is interested in locations, and not
merely in the authorization).
* platform/cocoa/CoreLocationGeolocationProvider.h:
* platform/cocoa/CoreLocationGeolocationProvider.mm:
(-[WebCLLocationManager initWithWebsiteIdentifier:client:mode:]):
(-[WebCLLocationManager locationManagerDidChangeAuthorization:]):
(WebCore::CoreLocationGeolocationProvider::CoreLocationGeolocationProvider):
(isAuthorizationGranted): Deleted.
(-[WebCLLocationManager initWithWebsiteIdentifier:client:]): Deleted.
(-[WebCLLocationManager start]): Deleted.
(-[WebCLLocationManager requestGeolocationAuthorization]): Deleted.
(WebCore::CoreLocationGeolocationProvider::start): Deleted.
(WebCore::CoreLocationGeolocationProvider::stop): Deleted.
2022-03-18 Chris Dumez <cdumez@apple.com>
Avoid extra pointer dereference in EventListenerMap::m_entries
https://bugs.webkit.org/show_bug.cgi?id=238075
Reviewed by Geoffrey Garen.
This is a confirmed 0.5-0.8% progression on Speedometer according to A/B
bots.
* dom/EventListenerMap.cpp:
(WebCore::EventListenerMap::clear):
(WebCore::EventListenerMap::add):
(WebCore::EventListenerMap::remove):
(WebCore::EventListenerMap::find):
(WebCore::EventListenerMap::removeFirstEventListenerCreatedFromMarkup):
(WebCore::EventListenerMap::copyEventListenersNotCreatedFromMarkupToTarget):
(WebCore::EventListenerIterator::nextListener):
(WebCore::EventListenerMap::find const): Deleted.
* dom/EventListenerMap.h:
(WebCore::EventListenerMap::find const):
2022-03-18 Alex Christensen <achristensen@webkit.org>
Keep a strong reference to session in [WebCoreNSURLSessionDataTask _restart]
https://bugs.webkit.org/show_bug.cgi?id=238061
<rdar://88242622>
Reviewed by Eric Carlson.
_session is a WeakObjCPtr<WebCoreNSURLSession> and since we're not using ARC self.session
returns a raw pointer to an object that may be deallocated and null out its loader on a different thread.
To prevent null crashes, keep a strong reference to the session when using it.
* platform/network/cocoa/WebCoreNSURLSession.mm:
(-[WebCoreNSURLSession dealloc]):
(-[WebCoreNSURLSessionDataTask _restart]):
2022-03-18 Simon Fraser <simon.fraser@apple.com>
REGRESSION (r290628): Scrubber makes a visual trail when scrubbing on tv.youtube.com
https://bugs.webkit.org/show_bug.cgi?id=238047
<rdar://problem/90451319>
Reviewed by Alan Bujtas.
In r290628 I added a call to clearRepaintRects() when changing the backing sharing
target layer for a RenderLayer. However, for a layer using backing sharing, this
gets called twice during a normal compositing update, which has the effect of
clearing the cached repaint rects so that a layer repaint always computes new rects.
Thus, if a layer moved, we'd fail to repaint the old rect.
RenderLayerBacking::setBackingSharingLayers() already has logic to update repaint
rects when state changes, so we don't need this clearing.
Test: compositing/repaint/move-backing-sharing-layer.html
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::setBackingProviderLayer):
2022-03-18 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer] Add stop position to the range request
https://bugs.webkit.org/show_bug.cgi?id=238028
Reviewed by Philippe Normand.
Currently, the range requests performed by WebKitWebSourceGStreamer indicate a range
start position but not a range stop one, even though it's set in the internal
members->stopPosition attribute.
This may not be a problem when WebKitWebSrc is used as a source for the whole video,
but certainly is when it's used as an embedded source inside adaptive demux
(replacing SoupHttpSrc). It causes decoding errors in some MPEG-DASH streams.
See: https://github.com/WebPlatformForEmbedded/WPEWebKit/issues/813
This patch is authored by Eugene Mutavchi <Ievgen_Mutavchi@comcast.com>
See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/814
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: Apply stopPosition to the range request when it's valid.
2022-03-18 Youenn Fablet <youenn@apple.com>
REGRESSION(r290356-r290351?): [ iOS EWS ] 3 imported/w3c/web-platform-tests/service-workers/service-worker/* tests are constant text failures.
https://bugs.webkit.org/show_bug.cgi?id=237160
<rdar://problem/89440067>
Reviewed by Chris Dumez.
When we try reusing a resource in the MemoryCache that was provided by a service worker, we might need to revalidate it.
In that case, we might add revalidation headers that will show up in service workers fetch event request.
To prevent this, we reload instead of revalidating at document level.
The service worker will then be able to revalidate itself the resource since it is probably in its memory cache.
Covered by test that is no longer flaky.
* loader/cache/CachedResourceLoader.cpp:
2022-03-18 Philippe Normand <pnormand@igalia.com>
[GStreamer] Migrate gst-full support to 1.20
https://bugs.webkit.org/show_bug.cgi?id=237772
Reviewed by Xabier Rodriguez-Calvar.
* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::registerWebKitGStreamerElements): GStreamer 1.20 no longer requires manual
initialization of gst-full. It is done during the gst_init().
2022-03-18 Philippe Normand <pnormand@igalia.com>
[GStreamer] Initial import of the GstWebRTC backend
https://bugs.webkit.org/show_bug.cgi?id=236540
Reviewed by Carlos Garcia Campos and Xabier Rodriguez-Calvar.
Initial GstWebRTC backend. A lot of features unimplemented still, but we will incrementally
improve the layout test coverage in follow-up patches. Most notable short-comings currently:
- DataChannel support is incomplete (bug 235879)
- Network traffic not routed through Network process yet
- Stats support incomplete
- DTMF support unimplemented
- ICE restarts not supported yet
- Re-negotiation unlikely to work
- Simulcast not handled yet
- Balanced bundle not supported
- RTX and FEC un-tested, but shouldn't be hard to fix
* Modules/mediastream/MediaDevices.cpp:
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::generateCertificate):
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::create):
* Modules/mediastream/gstreamer/GStreamerDataChannelHandler.cpp: Added.
(WebCore::GStreamerDataChannelHandler::fromRTCDataChannelInit):
(WebCore::GStreamerDataChannelHandler::channelEvent):
(WebCore::GStreamerDataChannelHandler::GStreamerDataChannelHandler):
(WebCore::GStreamerDataChannelHandler::~GStreamerDataChannelHandler):
(WebCore::GStreamerDataChannelHandler::setClient):
(WebCore::GStreamerDataChannelHandler::sendStringData):
(WebCore::GStreamerDataChannelHandler::sendRawData):
(WebCore::GStreamerDataChannelHandler::close):
(WebCore::GStreamerDataChannelHandler::checkState):
(WebCore::GStreamerDataChannelHandler::readyStateChanged):
(WebCore::GStreamerDataChannelHandler::onMessageData):
(WebCore::GStreamerDataChannelHandler::onMessageString):
(WebCore::GStreamerDataChannelHandler::onError):
(WebCore::GStreamerDataChannelHandler::onBufferedAmountLow):
(WebCore::GStreamerDataChannelHandler::postTask):
* Modules/mediastream/gstreamer/GStreamerDataChannelHandler.h: Added.
* Modules/mediastream/gstreamer/GStreamerDtlsTransportBackend.cpp: Added.
(WebCore::GStreamerDtlsTransportBackend::GStreamerDtlsTransportBackend):
(WebCore::GStreamerDtlsTransportBackend::~GStreamerDtlsTransportBackend):
(WebCore::GStreamerDtlsTransportBackend::iceTransportBackend):
(WebCore::GStreamerDtlsTransportBackend::registerClient):
(WebCore::GStreamerDtlsTransportBackend::unregisterClient):
(WebCore::GStreamerDtlsTransportBackend::stateChanged):
* Modules/mediastream/gstreamer/GStreamerDtlsTransportBackend.h: Added.
* Modules/mediastream/gstreamer/GStreamerIceTransportBackend.cpp: Added.
(WebCore::GStreamerIceTransportBackend::GStreamerIceTransportBackend):
(WebCore::GStreamerIceTransportBackend::~GStreamerIceTransportBackend):
(WebCore::GStreamerIceTransportBackend::iceTransportChanged):
(WebCore::GStreamerIceTransportBackend::registerClient):
(WebCore::GStreamerIceTransportBackend::unregisterClient):
(WebCore::GStreamerIceTransportBackend::stateChanged):
(WebCore::GStreamerIceTransportBackend::gatheringStateChanged):
* Modules/mediastream/gstreamer/GStreamerIceTransportBackend.h: Added.
* Modules/mediastream/gstreamer/GStreamerMediaEndpoint.cpp: Added.
(WebCore::GStreamerMediaEndpoint::GStreamerMediaEndpoint):
(WebCore::GStreamerMediaEndpoint::initializePipeline):
(WebCore::GStreamerMediaEndpoint::~GStreamerMediaEndpoint):
(WebCore::GStreamerMediaEndpoint::teardownPipeline):
(WebCore::GStreamerMediaEndpoint::handleMessage):
(WebCore::GStreamerMediaEndpoint::disposeElementChain):
(WebCore::GStreamerMediaEndpoint::setConfiguration):
(WebCore::GStreamerMediaEndpoint::restartIce):
(WebCore::fetchDescription):
(WebCore::fetchSignalingState):
(WebCore::descriptionsFromWebRTCBin):
(WebCore::GStreamerMediaEndpoint::doSetLocalDescription):
(WebCore::GStreamerMediaEndpoint::setRemoteDescriptionSucceeded):
(WebCore::GStreamerMediaEndpoint::doSetRemoteDescription):
(WebCore::SetDescriptionCallData::SetDescriptionCallData):
(WebCore::GStreamerMediaEndpoint::setDescription):
(WebCore::GStreamerMediaEndpoint::storeRemoteMLineInfo):
(WebCore::GStreamerMediaEndpoint::configureAndLinkSource):
(WebCore::GStreamerMediaEndpoint::requestPad):
(WebCore::GStreamerMediaEndpoint::addTrack):
(WebCore::GStreamerMediaEndpoint::removeTrack):
(WebCore::GStreamerMediaEndpoint::doCreateOffer):
(WebCore::GStreamerMediaEndpoint::doCreateAnswer):
(WebCore::GStreamerMediaEndpoint::initiate):
(WebCore::GStreamerMediaEndpoint::getStats):
(WebCore::GStreamerMediaEndpoint::mediaStreamFromRTCStream):
(WebCore::GStreamerMediaEndpoint::addRemoteStream):
(WebCore::GStreamerMediaEndpoint::removeRemoteStream):
(WebCore::GStreamerMediaEndpoint::createTransceiverBackends):
(WebCore::GStreamerMediaEndpoint::addTransceiver):
(WebCore::GStreamerMediaEndpoint::createSourceForTrack):
(WebCore::GStreamerMediaEndpoint::setSenderSourceFromTrack):
(WebCore::GStreamerMediaEndpoint::transceiverBackendFromSender):
(WebCore::GStreamerMediaEndpoint::addIceCandidate):
(WebCore::GStreamerMediaEndpoint::createDataChannel):
(WebCore::GStreamerMediaEndpoint::onDataChannel):
(WebCore::GStreamerMediaEndpoint::close):
(WebCore::GStreamerMediaEndpoint::stop):
(WebCore::GStreamerMediaEndpoint::suspend):
(WebCore::GStreamerMediaEndpoint::resume):
(WebCore::GStreamerMediaEndpoint::onNegotiationNeeded):
(WebCore::GStreamerMediaEndpoint::onIceConnectionChange):
(WebCore::GStreamerMediaEndpoint::onIceGatheringChange):
(WebCore::GStreamerMediaEndpoint::onIceCandidate):
(WebCore::GStreamerMediaEndpoint::createSessionDescriptionSucceeded):
(WebCore::GStreamerMediaEndpoint::createSessionDescriptionFailed):
(WebCore::GStreamerMediaEndpoint::collectTransceivers):
(WebCore::GStreamerMediaEndpoint::gatherStatsForLogging):
(WebCore::RTCStatsLogger::RTCStatsLogger):
(WebCore::RTCStatsLogger::toJSONString const):
(WebCore::GStreamerMediaEndpoint::processStats):
(WebCore::GStreamerMediaEndpoint::onStatsDelivered):
(WebCore::GStreamerMediaEndpoint::startLoggingStats):
(WebCore::GStreamerMediaEndpoint::stopLoggingStats):
(WebCore::GStreamerMediaEndpoint::logChannel const):
(WebCore::GStreamerMediaEndpoint::statsLogInterval const):
(WebCore::GStreamerMediaEndpoint::gatherDecoderImplementationName):
(WTF::LogArgument<WebCore::RTCStatsLogger>::toString):
* Modules/mediastream/gstreamer/GStreamerMediaEndpoint.h: Added.
(WebCore::GStreamerMediaEndpoint::create):
(WebCore::GStreamerMediaEndpoint::isStopped const):
(WebCore::GStreamerMediaEndpoint::isNegotiationNeeded const):
(WebCore::GStreamerMediaEndpoint::pipeline const):
* Modules/mediastream/gstreamer/GStreamerPeerConnectionBackend.cpp: Added.
(WebCore::createGStreamerPeerConnectionBackend):
(WebCore::PeerConnectionBackend::receiverCapabilities):
(WebCore::PeerConnectionBackend::senderCapabilities):
(WebCore::GStreamerPeerConnectionBackend::GStreamerPeerConnectionBackend):
(WebCore::GStreamerPeerConnectionBackend::suspend):
(WebCore::GStreamerPeerConnectionBackend::resume):
(WebCore::GStreamerPeerConnectionBackend::restartIce):
(WebCore::GStreamerPeerConnectionBackend::setConfiguration):
(WebCore::GStreamerPeerConnectionBackend::getStats):
(WebCore::backendFromRTPSender):
(WebCore::GStreamerPeerConnectionBackend::doSetLocalDescription):
(WebCore::GStreamerPeerConnectionBackend::doSetRemoteDescription):
(WebCore::GStreamerPeerConnectionBackend::doCreateOffer):
(WebCore::GStreamerPeerConnectionBackend::doCreateAnswer):
(WebCore::GStreamerPeerConnectionBackend::close):
(WebCore::GStreamerPeerConnectionBackend::doStop):
(WebCore::GStreamerPeerConnectionBackend::doAddIceCandidate):
(WebCore::GStreamerPeerConnectionBackend::createReceiver):
(WebCore::GStreamerPeerConnectionBackend::createDataChannelHandler):
(WebCore::findExistingSender):
(WebCore::GStreamerPeerConnectionBackend::addTrack):
(WebCore::GStreamerPeerConnectionBackend::addTransceiverFromTrackOrKind):
(WebCore::GStreamerPeerConnectionBackend::addTransceiver):
(WebCore::GStreamerPeerConnectionBackend::setSenderSourceFromTrack):
(WebCore::backendFromRTPTransceiver):
(WebCore::GStreamerPeerConnectionBackend::existingTransceiver):
(WebCore::GStreamerPeerConnectionBackend::newRemoteTransceiver):
(WebCore::GStreamerPeerConnectionBackend::collectTransceivers):
(WebCore::GStreamerPeerConnectionBackend::removeTrack):
(WebCore::GStreamerPeerConnectionBackend::applyRotationForOutgoingVideoSources):
(WebCore::GStreamerPeerConnectionBackend::gatherDecoderImplementationName):
(WebCore::GStreamerPeerConnectionBackend::isNegotiationNeeded const):
* Modules/mediastream/gstreamer/GStreamerPeerConnectionBackend.h: Added.
* Modules/mediastream/gstreamer/GStreamerRtpReceiverBackend.cpp: Added.
(WebCore::GStreamerRtpReceiverBackend::getParameters):
(WebCore::GStreamerRtpReceiverBackend::getContributingSources const):
(WebCore::GStreamerRtpReceiverBackend::getSynchronizationSources const):
(WebCore::GStreamerRtpReceiverBackend::createSource):
(WebCore::GStreamerRtpReceiverBackend::rtcRtpTransformBackend):
(WebCore::GStreamerRtpReceiverBackend::dtlsTransportBackend):
* Modules/mediastream/gstreamer/GStreamerRtpReceiverBackend.h: Added.
* Modules/mediastream/gstreamer/GStreamerRtpReceiverTransformBackend.cpp: Added.
(WebCore::mediaTypeFromReceiver):
(WebCore::GStreamerRtpReceiverTransformBackend::GStreamerRtpReceiverTransformBackend):
(WebCore::GStreamerRtpReceiverTransformBackend::~GStreamerRtpReceiverTransformBackend):
(WebCore::GStreamerRtpReceiverTransformBackend::setTransformableFrameCallback):
(WebCore::GStreamerRtpReceiverTransformBackend::requestKeyFrame):
* Modules/mediastream/gstreamer/GStreamerRtpReceiverTransformBackend.h: Added.
* Modules/mediastream/gstreamer/GStreamerRtpSenderBackend.cpp: Added.
(WebCore::updateTrackSource):
(WebCore::GStreamerRtpSenderBackend::startSource):
(WebCore::GStreamerRtpSenderBackend::stopSource):
(WebCore::GStreamerRtpSenderBackend::replaceTrack):
(WebCore::GStreamerRtpSenderBackend::getParameters const):
(WebCore::GStreamerRtpSenderBackend::setParameters):
(WebCore::GStreamerRtpSenderBackend::createDTMFBackend):
(WebCore::GStreamerRtpSenderBackend::rtcRtpTransformBackend):
(WebCore::GStreamerRtpSenderBackend::setMediaStreamIds):
(WebCore::GStreamerRtpSenderBackend::dtlsTransportBackend):
* Modules/mediastream/gstreamer/GStreamerRtpSenderBackend.h: Added.
* Modules/mediastream/gstreamer/GStreamerRtpSenderTransformBackend.cpp: Added.
(WebCore::mediaTypeFromSender):
(WebCore::GStreamerRtpSenderTransformBackend::GStreamerRtpSenderTransformBackend):
(WebCore::GStreamerRtpSenderTransformBackend::~GStreamerRtpSenderTransformBackend):
(WebCore::GStreamerRtpSenderTransformBackend::setTransformableFrameCallback):
(WebCore::GStreamerRtpSenderTransformBackend::requestKeyFrame):
* Modules/mediastream/gstreamer/GStreamerRtpSenderTransformBackend.h: Added.
* Modules/mediastream/gstreamer/GStreamerRtpTransceiverBackend.cpp: Added.
(WebCore::GStreamerRtpTransceiverBackend::GStreamerRtpTransceiverBackend):
(WebCore::GStreamerRtpTransceiverBackend::createReceiverBackend):
(WebCore::GStreamerRtpTransceiverBackend::createSenderBackend):
(WebCore::GStreamerRtpTransceiverBackend::direction const):
(WebCore::GStreamerRtpTransceiverBackend::currentDirection const):
(WebCore::GStreamerRtpTransceiverBackend::setDirection):
(WebCore::GStreamerRtpTransceiverBackend::mid):
(WebCore::GStreamerRtpTransceiverBackend::stop):
(WebCore::GStreamerRtpTransceiverBackend::stopped const):
(WebCore::GStreamerRtpTransceiverBackend::setCodecPreferences):
* Modules/mediastream/gstreamer/GStreamerRtpTransceiverBackend.h: Added.
* Modules/mediastream/gstreamer/GStreamerRtpTransformBackend.cpp: Added.
(WebCore::GStreamerRtpTransformBackend::setInputCallback):
(WebCore::GStreamerRtpTransformBackend::clearTransformableFrameCallback):
(WebCore::GStreamerRtpTransformBackend::processTransformedFrame):
* Modules/mediastream/gstreamer/GStreamerRtpTransformBackend.h: Added.
(WebCore::GStreamerRtpTransformBackend::GStreamerRtpTransformBackend):
* Modules/mediastream/gstreamer/GStreamerSctpTransportBackend.cpp: Added.
(WebCore::toRTCSctpTransportState):
(WebCore::GStreamerSctpTransportBackend::GStreamerSctpTransportBackend):
(WebCore::GStreamerSctpTransportBackend::~GStreamerSctpTransportBackend):
(WebCore::GStreamerSctpTransportBackend::dtlsTransportBackend):
(WebCore::GStreamerSctpTransportBackend::registerClient):
(WebCore::GStreamerSctpTransportBackend::unregisterClient):
(WebCore::GStreamerSctpTransportBackend::stateChanged):
* Modules/mediastream/gstreamer/GStreamerSctpTransportBackend.h: Added.
* Modules/mediastream/gstreamer/GStreamerStatsCollector.cpp: Added.
(WebCore::fillRTCStats):
(WebCore::fillRTCRTPStreamStats):
(WebCore::fillRTCCodecStats):
(WebCore::fillInboundRTPStreamStats):
(WebCore::fillOutboundRTPStreamStats):
(WebCore::fillRTCPeerConnectionStats):
(WebCore::fillRTCTransportStats):
(WebCore::fillReportCallback):
(WebCore::CallbackHolder::CallbackHolder):
(WebCore::GStreamerStatsCollector::getStats):
* Modules/mediastream/gstreamer/GStreamerStatsCollector.h: Added.
(WebCore::GStreamerStatsCollector::create):
(WebCore::GStreamerStatsCollector::setElement):
* Modules/mediastream/gstreamer/GStreamerWebRTCUtils.cpp: Added.
(WebCore::toRTCIceComponent):
(WebCore::toRTCIceProtocol):
(WebCore::toRTCIceTcpCandidateType):
(WebCore::toRTCIceCandidateType):
(WebCore::toRTCError):
(WebCore::toWebRTCBitRatePriority):
(WebCore::fromRTCEncodingParameters):
(WebCore::fromWebRTCBitRatePriority):
(WebCore::toRTCEncodingParameters):
(WebCore::toRTCRtpSendParameters):
(WebCore::ensureDebugCategoryInitialized):
(WebCore::parseIceCandidateSDP):
(WebCore::x509Serialize):
(WebCore::privateKeySerialize):
(WebCore::generateCertificate):
(WebCore::sdpMediaHasAttributeKey):
* Modules/mediastream/gstreamer/GStreamerWebRTCUtils.h: Added.
(WebCore::toRTCRtpTransceiverDirection):
(WebCore::fromRTCRtpTransceiverDirection):
(WebCore::toSessionDescriptionType):
(WebCore::fromSessionDescriptionType):
(WebCore::toSignalingState):
(WebCore::toRTCIceConnectionState):
(WebCore::toRTCDtlsTransportState):
(WebCore::toRTCIceTransportState):
(WebCore::toRTCIceGatheringState):
(WebCore::bundlePolicyFromConfiguration):
(WebCore::iceTransportPolicyFromConfiguration):
(WebCore::toRTCErrorDetailType):
* platform/GStreamer.cmake:
* platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
(WebCore::AudioSourceProviderGStreamer::AudioSourceProviderGStreamer):
(WebCore::AudioSourceProviderGStreamer::~AudioSourceProviderGStreamer):
(WebCore::AudioSourceProviderGStreamer::handleNewDeinterleavePad):
* platform/audio/gstreamer/GStreamerAudioStreamDescription.h:
* platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
(WTF::adoptGRef):
(WTF::refGPtr<GstWebRTCRTPReceiver>):
(WTF::derefGPtr<GstWebRTCRTPReceiver>):
(WTF::refGPtr<GstWebRTCRTPSender>):
(WTF::derefGPtr<GstWebRTCRTPSender>):
(WTF::refGPtr<GstWebRTCRTPTransceiver>):
(WTF::derefGPtr<GstWebRTCRTPTransceiver>):
(WTF::refGPtr<GstWebRTCDataChannel>):
(WTF::derefGPtr<GstWebRTCDataChannel>):
(WTF::refGPtr<GstWebRTCDTLSTransport>):
(WTF::derefGPtr<GstWebRTCDTLSTransport>):
(WTF::refGPtr<GstWebRTCICETransport>):
(WTF::derefGPtr<GstWebRTCICETransport>):
* platform/graphics/gstreamer/GRefPtrGStreamer.h:
* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::capsMediaType):
* platform/graphics/gstreamer/GUniquePtrGStreamer.h:
* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::createAudioSourceProvider):
* platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp:
(WebCore::GStreamerAudioCapturer::GStreamerAudioCapturer):
(WebCore::GStreamerAudioCapturer::createConverter):
* platform/mediastream/gstreamer/GStreamerCapturer.cpp:
(WebCore::GStreamerCapturer::createSource):
* platform/mediastream/gstreamer/GStreamerDTMFSenderBackend.cpp: Added.
(WebCore::GStreamerDTMFSenderBackend::GStreamerDTMFSenderBackend):
(WebCore::GStreamerDTMFSenderBackend::~GStreamerDTMFSenderBackend):
(WebCore::GStreamerDTMFSenderBackend::canInsertDTMF):
(WebCore::GStreamerDTMFSenderBackend::playTone):
(WebCore::GStreamerDTMFSenderBackend::tones const):
(WebCore::GStreamerDTMFSenderBackend::duration const):
(WebCore::GStreamerDTMFSenderBackend::interToneGap const):
(WebCore::GStreamerDTMFSenderBackend::onTonePlayed):
* platform/mediastream/gstreamer/GStreamerDTMFSenderBackend.h: Added.
* platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
(webkitMediaStreamSrcAddTrack):
* platform/mediastream/gstreamer/GStreamerVideoEncoder.cpp:
(webkit_webrtc_video_encoder_class_init):
* platform/mediastream/gstreamer/RealtimeIncomingAudioSourceGStreamer.cpp: Added.
(WebCore::RealtimeIncomingAudioSourceGStreamer::RealtimeIncomingAudioSourceGStreamer):
(WebCore::RealtimeIncomingAudioSourceGStreamer::~RealtimeIncomingAudioSourceGStreamer):
(WebCore::RealtimeIncomingAudioSourceGStreamer::startProducingData):
(WebCore::RealtimeIncomingAudioSourceGStreamer::stopProducingData):
(WebCore::RealtimeIncomingAudioSourceGStreamer::capabilities):
(WebCore::RealtimeIncomingAudioSourceGStreamer::settings):
(WebCore::RealtimeIncomingAudioSourceGStreamer::dispatchSample):
* platform/mediastream/gstreamer/RealtimeIncomingAudioSourceGStreamer.h: Added.
(WebCore::RealtimeIncomingAudioSourceGStreamer::create):
(isType):
* platform/mediastream/gstreamer/RealtimeIncomingSourceGStreamer.cpp: Added.
(WebCore::RealtimeIncomingSourceGStreamer::RealtimeIncomingSourceGStreamer):
(WebCore::RealtimeIncomingSourceGStreamer::lockValve const):
(WebCore::RealtimeIncomingSourceGStreamer::releaseValve const):
(WebCore::RealtimeIncomingSourceGStreamer::registerClient):
* platform/mediastream/gstreamer/RealtimeIncomingSourceGStreamer.h: Added.
(WebCore::RealtimeIncomingSourceGStreamer::bin):
(WebCore::RealtimeIncomingSourceGStreamer::dispatchSample):
* platform/mediastream/gstreamer/RealtimeIncomingVideoSourceGStreamer.cpp: Added.
(WebCore::RealtimeIncomingVideoSourceGStreamer::RealtimeIncomingVideoSourceGStreamer):
(WebCore::RealtimeIncomingVideoSourceGStreamer::startProducingData):
(WebCore::RealtimeIncomingVideoSourceGStreamer::stopProducingData):
(WebCore::RealtimeIncomingVideoSourceGStreamer::capabilities):
(WebCore::RealtimeIncomingVideoSourceGStreamer::settings):
(WebCore::RealtimeIncomingVideoSourceGStreamer::settingsDidChange):
(WebCore::RealtimeIncomingVideoSourceGStreamer::dispatchSample):
* platform/mediastream/gstreamer/RealtimeIncomingVideoSourceGStreamer.h: Added.
(WebCore::RealtimeIncomingVideoSourceGStreamer::create):
(isType):
* platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceGStreamer.cpp: Added.
(WebCore::RealtimeOutgoingAudioSourceGStreamer::RealtimeOutgoingAudioSourceGStreamer):
(WebCore::RealtimeOutgoingAudioSourceGStreamer::setPayloadType):
* platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceGStreamer.h: Added.
* platform/mediastream/gstreamer/RealtimeOutgoingMediaSourceGStreamer.cpp: Added.
(WebCore::RealtimeOutgoingMediaSourceGStreamer::RealtimeOutgoingMediaSourceGStreamer):
(WebCore::RealtimeOutgoingMediaSourceGStreamer::~RealtimeOutgoingMediaSourceGStreamer):
(WebCore::RealtimeOutgoingMediaSourceGStreamer::setSource):
(WebCore::RealtimeOutgoingMediaSourceGStreamer::start):
(WebCore::RealtimeOutgoingMediaSourceGStreamer::stop):
(WebCore::RealtimeOutgoingMediaSourceGStreamer::sourceMutedChanged):
(WebCore::RealtimeOutgoingMediaSourceGStreamer::sourceEnabledChanged):
(WebCore::RealtimeOutgoingMediaSourceGStreamer::initializeFromTrack):
(WebCore::RealtimeOutgoingMediaSourceGStreamer::link):
(WebCore::RealtimeOutgoingMediaSourceGStreamer::setSinkPad):
* platform/mediastream/gstreamer/RealtimeOutgoingMediaSourceGStreamer.h: Added.
(WebCore::RealtimeOutgoingMediaSourceGStreamer::source const):
(WebCore::RealtimeOutgoingMediaSourceGStreamer::allowedCaps const):
(WebCore::RealtimeOutgoingMediaSourceGStreamer::pad const):
(WebCore::RealtimeOutgoingMediaSourceGStreamer::sender const):
(WebCore::RealtimeOutgoingMediaSourceGStreamer::bin const):
(WebCore::RealtimeOutgoingMediaSourceGStreamer::setPayloadType):
* platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceGStreamer.cpp: Added.
(WebCore::RealtimeOutgoingVideoSourceGStreamer::RealtimeOutgoingVideoSourceGStreamer):
(WebCore::RealtimeOutgoingVideoSourceGStreamer::setPayloadType):
* platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceGStreamer.h: Added.
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
(WebCore::Internals::setWebRTCH265Support):
(WebCore::Internals::setWebRTCVP9Support):
(WebCore::Internals::setWebRTCVP9VTBSupport):
(WebCore::Internals::setEnableWebRTCEncryption):
(WebCore::Internals::setUseDTLS10):
2022-03-18 Alan Bujtas <zalan@apple.com>
[IFC][Integration] Rename InlineIterator::Line::closestRun* to closestBoxFor*
https://bugs.webkit.org/show_bug.cgi?id=238064
Reviewed by Antti Koivisto.
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::localCaretRectForCharacterOffset):
* dom/Position.cpp:
(WebCore::Position::upstream const):
(WebCore::Position::downstream const):
(WebCore::Position::rendersInDifferentPosition const):
(WebCore::Position::inlineBoxAndOffset const):
(WebCore::searchAheadForBetterMatch):
(WebCore::Position::inlineRunAndOffset const): Deleted.
* dom/Position.h:
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::directionOfSelection):
* editing/InlineRunAndOffset.h:
* editing/RenderedPosition.cpp:
(WebCore::RenderedPosition::RenderedPosition):
(WebCore::RenderedPosition::previousLeafOnLine const):
(WebCore::RenderedPosition::nextLeafOnLine const):
(WebCore::RenderedPosition::isEquivalent const):
(WebCore::RenderedPosition::bidiLevelOnLeft const):
(WebCore::RenderedPosition::bidiLevelOnRight const):
(WebCore::RenderedPosition::leftBoundaryOfBidiRun):
(WebCore::RenderedPosition::rightBoundaryOfBidiRun):
(WebCore::RenderedPosition::atLeftBoundaryOfBidiRun const):
(WebCore::RenderedPosition::atRightBoundaryOfBidiRun const):
(WebCore::RenderedPosition::absoluteRect const):
* editing/RenderedPosition.h:
(WebCore::RenderedPosition::line const):
(WebCore::RenderedPosition::atLeftmostOffsetInBox const):
(WebCore::RenderedPosition::atRightmostOffsetInBox const):
* editing/VisiblePosition.cpp:
(WebCore::VisiblePosition::leftVisuallyDistinctCandidate const):
(WebCore::VisiblePosition::rightVisuallyDistinctCandidate const):
(WebCore::VisiblePosition::inlineBoxAndOffset const):
(WebCore::VisiblePosition::localCaretRect const):
(WebCore::VisiblePosition::absoluteSelectionBoundsForLine const):
(WebCore::VisiblePosition::inlineRunAndOffset const): Deleted.
* editing/VisiblePosition.h:
* editing/VisibleUnits.cpp:
(WebCore::isTextOrLineBreakBox):
(WebCore::previousTextOrLineBreakBox):
(WebCore::nextTextOrLineBreakBox):
(WebCore::startTextOrLineBreakBox):
(WebCore::endTextOrLineBreakBox):
(WebCore::logicallyPreviousBox):
(WebCore::logicallyNextBox):
(WebCore::wordBreakIteratorForMinOffsetBoundary):
(WebCore::wordBreakIteratorForMaxOffsetBoundary):
(WebCore::visualWordPosition):
(WebCore::startPositionForLine):
(WebCore::endPositionForLine):
(WebCore::previousLinePosition):
(WebCore::nextLinePosition):
(WebCore::isTextOrLineBreakRun): Deleted.
(WebCore::previousTextOrLineBreakRun): Deleted.
(WebCore::nextTextOrLineBreakRun): Deleted.
(WebCore::startTextOrLineBreakRun): Deleted.
(WebCore::endTextOrLineBreakRun): Deleted.
(WebCore::logicallyPreviousRun): Deleted.
(WebCore::logicallyNextRun): Deleted.
* layout/integration/InlineIteratorLine.cpp:
(WebCore::InlineIterator::Line::closestBoxForPoint const):
(WebCore::InlineIterator::Line::closestBoxForLogicalLeftPosition const):
(WebCore::InlineIterator::Line::closestRunForPoint const): Deleted.
(WebCore::InlineIterator::Line::closestRunForLogicalLeftPosition const): Deleted.
* layout/integration/InlineIteratorLine.h:
* rendering/CaretRectComputation.cpp:
(WebCore::computeCaretRectForText):
(WebCore::computeCaretRectForLineBreak):
(WebCore::computeCaretRectForSVGInlineText):
(WebCore::computeCaretRectForBox):
(WebCore::computeCaretRectForBlock):
(WebCore::computeLocalCaretRect):
* rendering/CaretRectComputation.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::positionForRun):
(WebCore::RenderBlockFlow::findClosestTextAtAbsolutePoint):
(WebCore::RenderBlockFlow::positionForPointWithInlineChildren):
* rendering/RenderObject.h:
2022-03-18 Zan Dobersek <zdobersek@igalia.com>
[Linux] GBMDevice as a thread-specific object is problematic
https://bugs.webkit.org/show_bug.cgi?id=237758
<rdar://problem/90476889>
Reviewed by Alejandro G. Castro.
Per-thread GBMDevice instances (and the internal gbm_device objects) can
end up causing trouble if the gbm_bo objects spawned from it are moved
across threads and used after the originating thread (and that thread's
GBMDevice instance) is destroyed. This can happen with a GStreamer
pipeline where repeated playback is possibly moved across different
threads.
The original intention was to preemptively avoid any thread-safety
issues in the libgbm implementations but we haven't seen any yet. That
might change down the line once we adapt against implementations from
different vendors, at which point the most sensible solution would be
to deploy a specific thread on which all libgbm operations would be
handled.
* platform/graphics/gbm/GBMBufferSwapchain.cpp:
(WebCore::GBMBufferSwapchain::getBuffer):
* platform/graphics/gbm/GBMDevice.cpp:
(WebCore::GBMDevice::singleton):
(WebCore::GBMDevice::GBMDevice):
(WebCore::GBMDevice::~GBMDevice):
(WebCore::threadSpecificDevice): Deleted.
(WebCore::GBMDevice::get): Deleted.
* platform/graphics/gbm/GBMDevice.h:
* platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.cpp:
(WebCore::GraphicsContextGLTextureMapper::platformInitialize):
(WebCore::GraphicsContextGLANGLE::EGLImageBacking::reset):
2022-03-18 Kimmo Kinnunen <kkinnunen@apple.com>
Recycling a webgl context when it has been lost and restored causes a crash
https://bugs.webkit.org/show_bug.cgi?id=238024
Reviewed by Geoffrey Garen.
Simulated context lost makes WebGLRenderingContextBase::m_context = nullptr
Real context lost preserves WebGLRenderingContextBase::m_context.
WebGLRenderingContextBase::maybeRestoreContext() used m_context.
The intention was that simulated context lost never invokes maybeRestoreContext()
as the timer to run maybeRestoreContext() is started only on real context lost.
However, it is possible to invoke simulated context lost after a real context lost,
but before the timer triggers maybeRestoreContext().
The sequence would be:
1. Lose the context somehow
2. Wait for webglcontextlost, use event.preventDefault() to request a restore.
3. Before restore happens, lose the context via simulated context lost.
This can be done by creating many contexts or via the WEBGL_lose_context.loseContext().
4. maybeRestoreContext() would query m_context->getGraphicsResetStatusARB() for
console log reasons, trying to explain to the developer why the context was lost.
In case simulated context lost set the m_context == nullptr, this would crash.
getGraphicsResetStatusARB() has likely not been accurate for any platform ever.
For ANGLE, it is unimplemented and cannot pinpoint which context caused the context lost.
Just remove getGraphicsResetStatusARB() use from maybeRestoreContext(), this prevents
the crash. Remove it also from WebKit use altogether, it is never used for anything.
Adds the case to webgl/max-active-contexts-webglcontextlost-prevent-default.html
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::loseContextImpl):
(WebCore::WebGLRenderingContextBase::maybeRestoreContext):
* loader/FrameLoaderClient.h:
* platform/graphics/GraphicsContextGL.h:
* platform/graphics/angle/GraphicsContextGLANGLE.cpp:
* platform/graphics/angle/GraphicsContextGLANGLE.h:
* platform/graphics/opengl/ExtensionsGLOpenGLCommon.cpp:
* platform/graphics/opengl/ExtensionsGLOpenGLCommon.h:
* platform/graphics/opengl/ExtensionsGLOpenGLES.cpp:
* platform/graphics/opengl/ExtensionsGLOpenGLES.h:
* platform/graphics/opengl/GraphicsContextGLOpenGL.cpp:
* platform/graphics/opengl/GraphicsContextGLOpenGL.h:
2022-03-18 Cameron McCormack <heycam@apple.com>
Remove the 1ms minimum for setTimeout
https://bugs.webkit.org/show_bug.cgi?id=221124
<rdar://problem/73852354>
Reviewed by Sam Weinig.
The HTML spec makes no mention of a 1ms minimum for timers. Removing
the 1ms minimum for setTimeout results in a 0.7-2.1% improvement on
Speedometer, depending on platform and hardware.
The WPT added here demonstrates how this change can affect pages: if a
page schedules a 1ms and then a 0ms timeout in the same turn of the
event loop, then with this patch they will now be fired in the reverse
order. Firefox and Chrome do not impose a 1ms minimum, which reduces
the risk of this being a problem.
Not addressing the setTimeout 1ms minimum here, which should likely also
be removed.
While we're here, settle on "one shot" rather rather than "single
shot" as the term for timers that fire once.
Tests: imported/w3c/web-platform-tests/html/webappapis/timers/zero-settimeout.any.html
imported/w3c/web-platform-tests/html/webappapis/timers/zero-settimeout.any.worker.html
* page/DOMTimer.h:
* page/DOMTimer.cpp:
(WebCore::DOMTimer::DOMTimer): We must pass oneShot into
intervalClampedToMinimum, since the way isOneShot determines whether
we are a one shot timer is by checking repeatInterval, which is only
set once startRepeating is called.
(WebCore::DOMTimer::install):
(WebCore::DOMTimer::fired):
(WebCore::DOMTimer::updateTimerIntervalIfNecessary):
(WebCore::DOMTimer::isOneShot const):
(WebCore::DOMTimer::intervalClampedToMinimum const):
2022-03-18 Antti Koivisto <antti@apple.com>
[CSS Container Queries] Basic support for container units
https://bugs.webkit.org/show_bug.cgi?id=238021
Reviewed by Antoine Quint.
Container Relative Lengths: the cqw, cqh, cqi, cqb, cqmin, cqmax units
https://drafts.csswg.org/css-contain-3/#container-lengths
* css/CSSPrimitiveValue.cpp:
(WebCore::isValidCSSUnitTypeForDoubleConversion):
(WebCore::isStringType):
(WebCore::CSSPrimitiveValue::cleanup):
(WebCore::CSSPrimitiveValue::computeNonCalcLengthDouble):
Resolve container units by resolving the query container and computing the value against it.
(WebCore::CSSPrimitiveValue::unitTypeString):
(WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText const):
(WebCore::CSSPrimitiveValue::equals const):
* css/CSSPrimitiveValue.h:
(WebCore::CSSPrimitiveValue::isLength):
* css/CSSToLengthConversionData.cpp:
(WebCore::CSSToLengthConversionData::CSSToLengthConversionData):
* css/CSSToLengthConversionData.h:
(WebCore::CSSToLengthConversionData::element const):
* css/CSSUnits.cpp:
(WebCore::unitCategory):
(WebCore::operator<<):
* css/CSSUnits.h:
* css/ContainerQuery.h:
* css/calc/CSSCalcCategoryMapping.cpp:
(WebCore::calcUnitCategory):
(WebCore::calculationCategoryForCombination):
(WebCore::hasDoubleValue):
* css/parser/CSSParserToken.cpp:
(WebCore::cssPrimitiveValueUnitFromTrie):
Parsing support.
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::LengthRawKnownTokenTypeDimensionConsumer::consume):
* style/ContainerQueryEvaluator.cpp:
(WebCore::Style::ContainerQueryEvaluator::selectContainer const):
(WebCore::Style::ContainerQueryEvaluator::selectContainer):
Factor container selection into static function that can be used from the unit resolution code.
* style/ContainerQueryEvaluator.h:
* style/SelectorMatchingState.h:
2022-03-18 Carlos Garcia Campos <cgarcia@igalia.com>
Add a public build option for PDF.js
https://bugs.webkit.org/show_bug.cgi?id=238023
Reviewed by Michael Catanzaro.
* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocument):
* html/PDFDocument.cpp:
* html/PDFDocument.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::isPDFJSResourceLoad const):
* page/SecurityOrigin.cpp:
(WebCore::shouldTreatAsUniqueOrigin):
* platform/LegacySchemeRegistry.cpp:
(WebCore::builtinSecureSchemes):
2022-03-18 Diego Pino Garcia <dpino@igalia.com>
Unreviewed, fix non-unified build after r291467
* workers/service/context/ServiceWorkerInspectorProxy.cpp:
2022-03-18 Youenn Fablet <youenn@apple.com>
Remove MediaSample usage from canvas capture code
https://bugs.webkit.org/show_bug.cgi?id=238015
Reviewed by Eric Carlson.
Refactoring to use VideoFrame as interface/wrapper around video frames instead of the more generic MediaSample.
Coverd by existing tests.
* Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
(WebCore::CanvasCaptureMediaStreamTrack::Source::captureCanvas):
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::toVideoFrame):
(WebCore::HTMLCanvasElement::toMediaSample): Deleted.
* html/HTMLCanvasElement.h:
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::paintCompositedResultsToVideoFrame):
(WebCore::WebGLRenderingContextBase::paintCompositedResultsToMediaSample): Deleted.
* html/canvas/WebGLRenderingContextBase.h:
* platform/graphics/GraphicsContextGL.h:
* platform/graphics/cocoa/GraphicsContextGLCocoa.h:
* platform/graphics/cocoa/GraphicsContextGLCocoa.mm:
(WebCore::GraphicsContextGLCocoa::paintCompositedResultsToVideoFrame):
(WebCore::GraphicsContextGLCocoa::paintCompositedResultsToMediaSample): Deleted.
* platform/graphics/cv/VideoFrameCV.h:
* platform/graphics/cv/VideoFrameCV.mm:
(WebCore::VideoFrameCV::createFromPixelBuffer):
2022-03-18 Youenn Fablet <youenn@apple.com>
Keep service workers alive when they are inspected even though they should be terminated
https://bugs.webkit.org/show_bug.cgi?id=237827
<rdar://88313935>
Reviewed by Alex Christensen.
Store in SWServerWorker whether a worker is inspected or is processing push events.
In that case, we delay termination of workers until it is no longer inspected or no longer processing push events.
Two code paths are happening:
1. A service worker was triggered with service worker clients, and all service worker clients are removed.
At that point, we were previously terminating service workers after a delay.
Instead, we now only terminate workers that are no longer inspected or no longer processing push events.
We reschedule the timer to continue trying removing the context connection.
2. A service worker is not stopped by removal of service worker clients. In that case, we need to terminate
the service workers when inspected and/or push counter gets back to regular (not inspected, no push counter).
When terminating such a service worker, we try removing the context connection as well.
To make sure SWServerWorker knows whether inspectable or not, we add connection support to transmit whether inspected from WebProcess.
ServiceWorkerInspectorProxy is responsible to update the inspectable value.
Introduce internals API to set inspected state of a service worker.
Covered by new API tests.
* testing/ServiceWorkerInternals.cpp:
* testing/ServiceWorkerInternals.h:
* testing/ServiceWorkerInternals.idl:
* workers/service/context/SWContextManager.cpp:
* workers/service/context/SWContextManager.h:
* workers/service/context/ServiceWorkerInspectorProxy.cpp:
* workers/service/server/SWServer.cpp:
* workers/service/server/SWServer.h:
* workers/service/server/SWServerToContextConnection.cpp:
* workers/service/server/SWServerToContextConnection.h:
* workers/service/server/SWServerWorker.cpp:
* workers/service/server/SWServerWorker.h:
2022-03-17 Matt Woodrow <mattwoodrow@apple.com>
Subgrid items should always be stretched.
https://bugs.webkit.org/show_bug.cgi?id=237628
Reviewed by Alan Bujtas.
Fixes https://drafts.csswg.org/css-grid-2/#subgrid-box-alignment
Test: imported/w3c/web-platform-tests/css/css-grid/subgrid/subgrid-stretch.html
* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeLogicalWidthInFragment const):
(WebCore::RenderBox::hasStretchedLogicalHeight const):
(WebCore::RenderBox::hasStretchedLogicalWidth const):
* rendering/RenderBox.h:
Makes computeLogicalWidthInFragment use the override logical width for grid items
if it's been set, as we already do for height. We don't early return, so that margins
still get computed relative to this width.
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutGridItems):
(WebCore::RenderGrid::availableAlignmentSpaceForChildBeforeStretching const):
(WebCore::RenderGrid::alignSelfForChild const):
(WebCore::RenderGrid::justifySelfForChild const):
(WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded):
(WebCore::RenderGrid::applySubgridStretchAlignmentToChildIfNeeded):
* rendering/RenderGrid.h:
Sets the required override width/height size on subgrid items so that they get
stretched.
2022-03-17 Alan Bujtas <zalan@apple.com>
[IFC][Integration] Introduce LineSelection
https://bugs.webkit.org/show_bug.cgi?id=237997
Reviewed by Antti Koivisto.
Use LineSelection to retrieve line based selection information.
This is in preparation for removing selection/hittesting related functions from InlineIterator::Line.
* WebCore.xcodeproj/project.pbxproj:
* editing/VisiblePosition.cpp:
(WebCore::VisiblePosition::absoluteSelectionBoundsForLine const):
* layout/integration/InlineIteratorLine.h:
* layout/integration/InlineIteratorTextBox.cpp:
(WebCore::InlineIterator::TextBox::selectionRect const):
* layout/integration/LineSelection.h: Added.
(WebCore::LineSelection::logicalTop):
(WebCore::LineSelection::logicalBottom):
(WebCore::LineSelection::logicalRect):
(WebCore::LineSelection::physicalRect):
(WebCore::LineSelection::logicalTopAdjustedForPrecedingBlock):
(WebCore::LineSelection::logicalHeightAdjustedForPrecedingBlock):
(WebCore::LineSelection::selectionState):
* rendering/CaretRectComputation.cpp:
(WebCore::computeCaretRectForLinePosition):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::adjustEnclosingTopForPrecedingBlock const):
(WebCore::RenderBlockFlow::inlineSelectionGaps):
(WebCore::RenderBlockFlow::positionForPointWithInlineChildren):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::collectSelectionGeometries):
* rendering/RenderLineBreak.cpp:
(WebCore::RenderLineBreak::collectSelectionGeometries):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::positionForPoint):
* rendering/RenderText.cpp:
(WebCore::RenderText::positionForPoint):
* rendering/TextBoxPainter.cpp:
(WebCore::TextBoxPainter::paintBackground):
2022-03-17 Devin Rousso <drousso@apple.com>
[Apple Pay] REGRESSION(r283431): `HAVE_PASSKIT_PAYMENT_METHOD_BILLING_ADDRESS` was removed without also removing where it was used
https://bugs.webkit.org/show_bug.cgi?id=238056
<rdar://problem/89940620>
Reviewed by Tim Horton.
* Modules/applepay/cocoa/PaymentMethodCocoa.mm:
(WebCore::convert):
2022-03-17 Chris Dumez <cdumez@apple.com>
Microsoft Teams fails to launch from Safari
https://bugs.webkit.org/show_bug.cgi?id=238045
<rdar://90434296>
Reviewed by Geoffrey Garen.
Extend MS Teams quirk to teams.microsoft.com, not just teams.live.com.
* page/Quirks.cpp:
(WebCore::Quirks::shouldAllowNavigationToCustomProtocolWithoutUserGesture):
2022-03-17 Alejandro G. Castro <alex@igalia.com>
[GTK][WPE] m_compositorThread ASSERT in TextureMapper classes can just be used in debug mode
https://bugs.webkit.org/show_bug.cgi?id=238020
Reviewed by Michael Catanzaro.
This is a build fix for the case where someone compiles release
with asserts activated.
* platform/graphics/texmap/TextureMapperPlatformLayerProxyDMABuf.cpp:
(WebCore::TextureMapperPlatformLayerProxyDMABuf::activateOnCompositingThread):
(WebCore::TextureMapperPlatformLayerProxyDMABuf::invalidate):
* platform/graphics/texmap/TextureMapperPlatformLayerProxyDMABuf.h:
* platform/graphics/texmap/TextureMapperPlatformLayerProxyGL.cpp:
(WebCore::TextureMapperPlatformLayerProxyGL::activateOnCompositingThread):
(WebCore::TextureMapperPlatformLayerProxyGL::invalidate):
* platform/graphics/texmap/TextureMapperPlatformLayerProxyGL.h:
2022-03-17 Alex Christensen <achristensen@webkit.org>
PerformanceNavigationTiming Response Start unavailable when using Service Worker Cache
https://bugs.webkit.org/show_bug.cgi?id=237317
Reviewed by Youenn Fablet.
* Modules/cache/DOMCache.cpp:
(WebCore::createResponse):
* page/PerformanceNavigationTiming.cpp:
(WebCore::PerformanceNavigationTiming::navigationFinished):
* platform/network/NetworkLoadMetrics.cpp:
(WebCore::NetworkLoadMetrics::updateFrom):
(WebCore::NetworkLoadMetrics::NetworkLoadMetrics): Deleted.
* platform/network/NetworkLoadMetrics.h:
2022-03-17 Eric Carlson <eric.carlson@apple.com>
[iOS] Fix build breakage from r291361
https://bugs.webkit.org/show_bug.cgi?id=238043
rdar://90447279
Unreviewed build fix.
* platform/ios/WebAVPlayerController.mm: Declare AVMetadataItem.
2022-03-17 Cameron McCormack <heycam@apple.com>
Avoid calling connectionClosedFromServer on a connection twice when a version change is active
https://bugs.webkit.org/show_bug.cgi?id=215271
Reviewed by Sihui Liu.
Since bug 203690, all IDB work is done on a single background thread.
A consequence of this change is that there are states when
UniqueIDBDatabase::m_versionChangeDatabaseConnection is also in
m_openDatabaseConnections. We should avoid calling
connectionClosedFromServer on the same connection twice, since that
can result in a spurious second error event being sent to the
IDBDatabase JS object if connections are closed while a version chnge
is in progress.
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::immediateClose):
2022-03-17 Ellie Epskamp-Hunt <eepskamphunt@apple.com>
When a “autofilled and obscured” field becomes empty, turn “autofilled and obscured” off
https://bugs.webkit.org/show_bug.cgi?id=235256
Reviewed by Devin Rousso.
Tests: fast/forms/input-autofilled-and-obscured-clear-field-programatically.html
fast/forms/input-autofilled-and-obscured-clear-form-programatically.html
fast/forms/input-autofilled-and-obscured.html
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setValue):
Turn off the property if the page's JavaScript deletes all the text in the field.
(WebCore::HTMLInputElement::setValueFromRenderer):
Turn off the property if the user deletes all the text in the field.
2022-03-17 J Pascoe <j_pascoe@apple.com>
[WebAuthn] Support makeCredential for virtual HID authenticators
https://bugs.webkit.org/show_bug.cgi?id=237984
rdar://problem/90393676
Reviewed by Brent Fulgham.
Virtual authenticators for WebAuthn supports different transports: nfc,usb,internal,ble.
Currently, we support the internal transport, but the default transport used in web platform
tests is usb. This patch implements makeCredential for hid-based virtual authenticators. Virtual
credential information is stored in the VirtualCredential struct as suggested by the spec.
* Modules/webauthn/WebAuthenticationUtils.cpp:
(WebCore::buildAttestationMap):
(WebCore::buildAttestationObject):
* Modules/webauthn/WebAuthenticationUtils.h:
* Modules/webauthn/fido/FidoConstants.h:
2022-03-17 Youenn Fablet <youenn@apple.com>
Make SharedVideoFrameReader use VideoFrameCV instead of MediaSample
https://bugs.webkit.org/show_bug.cgi?id=237596
Reviewed by Eric Carlson.
Update media recorder and display layer to use pixel buffers instead of MediaSample.
This allows migrating to VideoFrameCV.
No change of behavior.
* platform/cocoa/MediaUtilities.cpp:
* platform/cocoa/MediaUtilities.h:
* platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.h:
* platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.mm:
* platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp:
* platform/mediarecorder/MediaRecorderPrivateAVFImpl.h:
* platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
* platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
2022-03-17 Antoine Quint <graouts@webkit.org>
REGRESSION (iOS 15.4 / r287669): Mobile app stopped working due to CSS / angular animation
https://bugs.webkit.org/show_bug.cgi?id=237920
Reviewed by Antti Koivisto.
We refactored the computed style output for the "transition" and "animation" shorthand
properties in r287669 and always returned a CSSValueList, even when the list of transitions
or animations was empty. This meant that for an element without any transition or animation
properties, we'd return the empty string for those properties.
Now we return the computed style for a default animation instead.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::animationShorthandValue):
2022-03-17 Peng Liu <peng.liu6@icloud.com>
PiP on Vimeo freezes when toggled
https://bugs.webkit.org/show_bug.cgi?id=237985
Reviewed by Jer Noble.
Add a quirk for vimeo.com to disable the "webkitendfullscreen" event when a video enters
picture-in-picture from fullscreen.
Tested manually.
* page/Quirks.cpp:
(WebCore::Quirks::shouldDisableEndFullscreenEventWhenEnteringPictureInPictureFromFullscreenQuirk const):
2022-03-17 Chris Dumez <cdumez@apple.com>
Stop returning NodeVector from functions
https://bugs.webkit.org/show_bug.cgi?id=237988
Reviewed by Darin Adler.
Stop returning NodeVector from functions and use a out-parameter instead. While this doesn't look
as modern, this is actually more efficient. This is because NodeVector has a fairly large inline
buffer and is thus not that cheap to "move".
This was causing functions like `ContainerNode::parserAppendChild(Node&)` to spend unnecessary
time under:
`VectorBuffer<Ref<Node, RawPtrTraits<Node>>, 11, FastMalloc>::swap(VectorBuffer<Ref<Node, RawPtrTraits<Node>>, 11, FastMalloc>&, unsigned long, unsigned long)`
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::removeAllChildrenWithScriptAssertion):
(WebCore::executeNodeInsertionWithScriptAssertion):
(WebCore::ContainerNode::removeSelfOrChildNodesForInsertion):
(WebCore::ContainerNode::takeAllChildrenFrom):
(WebCore::ContainerNode::replaceAll):
(WebCore::ContainerNode::removeChildren):
(WebCore::ContainerNode::replaceChildren):
* dom/ContainerNode.h:
(WebCore::collectChildNodes):
* dom/ContainerNodeAlgorithms.cpp:
(WebCore::notifyChildNodeInserted):
* dom/ContainerNodeAlgorithms.h:
* dom/Element.cpp:
(WebCore::Element::addShadowRoot):
(WebCore::Element::insertAdjacentHTML):
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
* editing/ReplaceNodeWithSpanCommand.cpp:
(WebCore::swapInNodePreservingAttributesAndChildren):
2022-03-17 Ben Nham <nham@apple.com>
Only show notification permission prompt on user gesture
https://bugs.webkit.org/show_bug.cgi?id=237946
Reviewed by Geoffrey Garen.
We want to make Notification.requestPermission and PushManager.subscribe only prompt the
user for permission in response to a user gesture. This matches existing behavior in other
browsers.
We use the error string "Push notification prompting can only be done from a user gesture"
since that string was already used by safari.pushNotification.requestPermission.
* Modules/notifications/Notification.cpp:
(WebCore::Notification::requestPermission):
* Modules/push-api/PushManager.cpp:
(WebCore::PushManager::subscribe):
2022-03-17 Alan Bujtas <zalan@apple.com>
[IFC][Integration] Replace enclosingTop/Bottom/height calls with Line::enclosingLogicalRect when applicable
https://bugs.webkit.org/show_bug.cgi?id=237996
Reviewed by Antti Koivisto.
This is in preparation for removing selection/hittesting related functions from InlineIterator::Line.
* layout/integration/InlineIteratorLine.h:
(WebCore::InlineIterator::Line::enclosingHeight const): Deleted.
* layout/integration/InlineIteratorTextBox.cpp:
(WebCore::InlineIterator::TextBox::selectionRect const):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::inlineSelectionGaps):
(WebCore::RenderBlockFlow::positionForPointWithInlineChildren):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::collectSelectionGeometries):
* rendering/TextBoxPainter.cpp:
(WebCore::TextBoxPainter::paintBackground):
2022-03-17 Diego Pino Garcia <dpino@igalia.com>
Unreviewed, fix non-unified build after r291396
* html/HTMLTextFormControlElement.cpp:
2022-03-17 Oriol Brufau <obrufau@igalia.com>
Clarify code for logical-to-physical mappings, and add physical-to-logical mappings
https://bugs.webkit.org/show_bug.cgi?id=237967
Reviewed by Darin Adler.
The code for logical-to-physical mappings wasn't easy to understand, e.g.
mapLogicalSideToPhysicalSide used to cast a LogicalBoxSide enum into a
BoxSide enum, and then maybe casting it into an int and back to BoxSide.
So the code relied on the arbitrary order of the enum values, and it was
hard to grasp what was going on.
This patch makes these mappings much clearer, and also adds the inverse
physical-to-logical mappings. Being able to convert a physical property
into its logical equivalent will be needed for bug 236199.
No new tests because there is no change in behavior.
Tests in imported/w3c/web-platform-tests/css/css-logical/ ensure that
this patch doesn't break logical-to-physical mappings.
Some new API tests ensure that the physical-to-logical mappings
are the correct inverse.
Tests: WritingMode.LogicalBoxSide
WritingMode.BoxSide
WritingMode.LogicalBoxCorner
WritingMode.BoxCorner
WritingMode.LogicalBoxAxis
WritingMode.BoxAxis
* css/CSSProperty.h:
* css/makeprop.pl:
* platform/text/WritingMode.h:
(WebCore::mapLogicalSideToPhysicalSide):
(WebCore::mapPhysicalSideToLogicalSide):
(WebCore::mapLogicalCornerToPhysicalCorner):
(WebCore::mapPhysicalCornerToLogicalCorner):
(WebCore::mapLogicalAxisToPhysicalAxis):
(WebCore::mapPhysicalAxisToLogicalAxis):
(WebCore::isHorizontalPhysicalSide): Deleted.
(WebCore::mirrorPhysicalSide): Deleted.
(WebCore::rotatePhysicalSide): Deleted.
2022-03-17 Nikolas Zimmermann <nzimmermann@igalia.com>
Build broken on macOS Monterey 12.3 - PassKitSPI related error
https://bugs.webkit.org/show_bug.cgi?id=238010
<rdar://problem/90417687>
Reviewed by Antoine Quint.
Unbreak the macOS 12.3 build: assure that 'PKShippingMethod' is declared before used
in the 'PKShippingMethods' interface. Fix various unused variable warnings.
No new tests. No change in functionality.
* platform/audio/mac/AudioOutputUnitAdaptorMac.cpp:
(WebCore::AudioOutputUnitAdaptor::configure):
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
(WebCore::MediaSampleAVFObjC::getRGBAImageData const):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
2022-03-17 Kimmo Kinnunen <kkinnunen@apple.com>
WebGL context lost event is not sent again for contexts that are lost and restored
https://bugs.webkit.org/show_bug.cgi?id=237952
Reviewed by Antti Koivisto.
WebGLRenderingContextBase did not register the GraphicsContextGL::Client
for new contexts after a context lost.
Move the client registration to WebGLRenderingContextBase::setGraphicsContextGL()
which is called always when setting a new context.
Rename the GraphicsContextGL::addClient as GraphicsContextGL::setClient(),
move the shared implementation to the base class GraphicsContextGL.
Remove GraphicsContextGL::Client::recycleContext(), the use was removed in
r290816 "WebGL context count is not limited for GPU process.".
Test: webgl/multiple-context-losses.html
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
(WebCore::WebGLRenderingContextBase::setGraphicsContextGL):
(WebCore::WebGLRenderingContextBase::destroyGraphicsContextGL):
* html/canvas/WebGLRenderingContextBase.h:
* platform/graphics/GraphicsContextGL.cpp:
(WebCore::GraphicsContextGL::markLayerComposited):
(WebCore::GraphicsContextGL::forceContextLost):
(WebCore::GraphicsContextGL::dispatchContextChangedNotification):
* platform/graphics/GraphicsContextGL.h:
(WebCore::GraphicsContextGL::setClient):
* platform/graphics/angle/GraphicsContextGLANGLE.cpp:
* platform/graphics/angle/GraphicsContextGLANGLE.h:
* platform/graphics/opengl/GraphicsContextGLOpenGL.cpp:
* platform/graphics/opengl/GraphicsContextGLOpenGL.h:
2022-03-17 Antti Koivisto <antti@apple.com>
Pass style builder context to CSSToLengthConversionData
https://bugs.webkit.org/show_bug.cgi?id=237963
Reviewed by Antoine Quint.
This is preparation for resolving container units.
Also general cleanups to CSSToLengthConversionData.
* css/CSSGradientValue.cpp:
(WebCore::CSSLinearGradientValue::createGradient):
(WebCore::CSSRadialGradientValue::createGradient):
(WebCore::CSSConicGradientValue::createGradient):
* css/CSSToLengthConversionData.cpp:
(WebCore::CSSToLengthConversionData::CSSToLengthConversionData):
(WebCore::CSSToLengthConversionData::zoom const): Deleted.
* css/CSSToLengthConversionData.h:
(WebCore::CSSToLengthConversionData::zoom const):
(WebCore::CSSToLengthConversionData::copyForFontSizeWithParentStyle const):
(WebCore::CSSToLengthConversionData::copyWithAdjustedZoom const):
(WebCore::CSSToLengthConversionData::copyForLineHeight const):
(WebCore::CSSToLengthConversionData::CSSToLengthConversionData): Deleted.
(WebCore::CSSToLengthConversionData::copyWithAdjustedZoomAndPropertyToCompute const): Deleted.
* css/DOMMatrixReadOnly.cpp:
(WebCore::DOMMatrixReadOnly::parseStringIntoAbstractMatrix):
* css/MediaQueryEvaluator.cpp:
(WebCore::MediaQueryEvaluator::evaluate const):
* css/parser/SizesAttributeParser.cpp:
(WebCore::SizesAttributeParser::computeLength):
(WebCore::SizesAttributeParser::effectiveSizeDefaultValue):
* html/shadow/TextControlInnerElements.cpp:
(WebCore::TextControlInnerElement::resolveCustomStyle):
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::popupInternalPaddingBox const):
(WebCore::applyCommonButtonPaddingToStyle):
Setting the zoom to a weird value here does nothing, ems unit resolution ignores it.
Just don't do it.
(WebCore::RenderThemeIOS::adjustButtonStyle const):
(WebCore::RenderThemeIOS::paintMenuListButtonDecorationsWithFormControlRefresh):
(WebCore::RenderThemeIOS::adjustSearchFieldDecorationPartStyle const):
* style/ContainerQueryEvaluator.cpp:
(WebCore::Style::ContainerQueryEvaluator::selectContainer const):
* style/StyleBuilderConverter.h:
(WebCore::Style::BuilderConverter::convertLineHeight):
* style/StyleBuilderCustom.h:
(WebCore::Style::BuilderCustom::mmLength):
(WebCore::Style::BuilderCustom::inchLength):
(WebCore::Style::BuilderCustom::applyValueFontSize):
* style/StyleBuilderState.cpp:
(WebCore::Style::BuilderState::BuilderState):
2022-03-17 Diego Pino Garcia <dpino@igalia.com>
Unreviewed, non-unified build fix after r291390
* Modules/webaudio/DefaultAudioDestinationNode.cpp:
2022-03-17 Ziran Sun <zsun@igalia.com>
[Selection] Fixes selection range settings for TEXTAREA
https://bugs.webkit.org/show_bug.cgi?id=237641
Reviewed by Chris Dumez.
This CL is to fix the settings of SelectionStart/SelectionEnd for TEXTAREA for non-focused Element. It sets the
caret to the end of the text value except for initializing in most cases. For the case of updating defaultValue
for a non-dirty TEXTAREA, we should following the clamping steps as per spec and it will be addressed in a
follow-up patch.
This CL refers and imports part of the changes in chromium CL at
https://codereview.chromium.org/392573002
TextArea only calls setSelectionRange() for focused element. While for non-focused element, we need to update the caret
except for initializing. Since we are not change text selection for text area in this case, we only cache the selections.
It would be ideal to have a unified function call for both focused and non-focused cases. However, the selectionRange()
function changes focus of the element and the approach we are having here is to avoid the impacts on a good number of
exisiting tests.
This CL also introduces a unified setValue() API in HTMLFormControlElement for HTMLTextAreaElement and HTMLInputElement.
* html/BaseButtonInputType.cpp:
(WebCore::BaseButtonInputType::setValue):
* html/BaseButtonInputType.h:
* html/BaseCheckableInputType.cpp:
(WebCore::BaseCheckableInputType::setValue):
* html/BaseCheckableInputType.h:
* html/BaseDateAndTimeInputType.cpp:
(WebCore::BaseDateAndTimeInputType::setValue):
(WebCore::BaseDateAndTimeInputType::didChangeValueFromControl):
* html/BaseDateAndTimeInputType.h:
* html/ColorInputType.cpp:
(WebCore::ColorInputType::setValue):
* html/ColorInputType.h:
* html/FileInputType.cpp:
(WebCore::FileInputType::setValue):
* html/FileInputType.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setValue):
* html/HTMLInputElement.h:
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::childrenChanged):
(WebCore::HTMLTextAreaElement::reset):
(WebCore::HTMLTextAreaElement::setValue):
(WebCore::HTMLTextAreaElement::setNonDirtyValue):
(WebCore::HTMLTextAreaElement::setValueCommon):
(WebCore::HTMLTextAreaElement::copyNonAttributePropertiesFromElement):
* html/HTMLTextAreaElement.h:
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::setRangeText):
* html/HTMLTextFormControlElement.h:
* html/HiddenInputType.cpp:
(WebCore::HiddenInputType::setValue):
* html/HiddenInputType.h:
* html/InputType.cpp:
(WebCore::InputType::setValue):
* html/InputType.h:
* html/NumberInputType.cpp:
(WebCore::NumberInputType::setValue):
* html/NumberInputType.h:
* html/RangeInputType.cpp:
(WebCore::RangeInputType::setValue):
* html/RangeInputType.h:
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::setValue):
* html/TextFieldInputType.h:
2022-03-17 Antoine Quint <graouts@webkit.org>
[model] some tests under model-element crash on Big Sur bots
https://bugs.webkit.org/show_bug.cgi?id=238011
Reviewed by Cameron McCormack.
The fix for bug 237894 added another place where we might reject the ready
failure, but we didn't check whether it had already been rejected before,
which would cause an assertion failure leading to a crash on debug builds.
We now consistently check whether the ready promise had already been
fulfilled before rejecting it.
* Modules/model-element/HTMLModelElement.cpp:
(WebCore::HTMLModelElement::setSourceURL):
(WebCore::HTMLModelElement::notifyFinished):
(WebCore::HTMLModelElement::modelDidChange):
(WebCore::HTMLModelElement::createModelPlayer):
(WebCore::HTMLModelElement::didFailLoading):
2022-03-17 Nikolas Zimmermann <nzimmermann@igalia.com>
[Xcode] Build broken after r289139
https://bugs.webkit.org/show_bug.cgi?id=238010
Unreviewed build fix: Remove duplicate entry from Xcode project file.
No change of behavior.
* WebCore.xcodeproj/project.pbxproj:
2022-03-17 Zan Dobersek <zdobersek@igalia.com>
[GTK][WPE] Guard libgbm and libdrm code, make them conditional dependencies for GTK
https://bugs.webkit.org/show_bug.cgi?id=237974
Reviewed by Alejandro G. Castro.
Add USE(LIBGBM) guards around GBMDevice and GBMBufferSwapchain code,
and compile against the libgbm and libdrm dependencies only when
USE_LIBGBM is defined. This makes the two dependencies optional if
desired.
* PlatformGTK.cmake:
* PlatformWPE.cmake:
* platform/graphics/gbm/GBMBufferSwapchain.cpp:
* platform/graphics/gbm/GBMBufferSwapchain.h:
* platform/graphics/gbm/GBMDevice.cpp:
* platform/graphics/gbm/GBMDevice.h:
2022-03-17 Youenn Fablet <youenn@apple.com>
AudioContext is suspended on iOS when page is backgrounded
https://bugs.webkit.org/show_bug.cgi?id=237878
Reviewed by Eric Carlson.
On iOS, when the application goes in the background, AudioContext gets suspended.
This is problematic when AudioContext is used to generate audio samples but not play audio samples.
To allow those silent AudioContexts to run even in background, the following is done:
- Override background interruptions in case the audio context default destination is not connected.
- Monitor whether the default destination is connected or not.
- If the default destination gets connected while application is in the background, trigger an interruption to prevent playing audio.
To prevent potential audio burst, we interrupt just before the destination gets connected and not just after.
For that reason, we add m_canOverrideBackgroundPlaybackRestriction to enforce interruption when we now the connection will be connected.
This approach keeps the existing iOS behavior in terms of rendered audio while allowing for not-playing audio contexts to continue in the background.
Tests: webaudio/suspend-context-while-backgrounded.html and API test.
* Modules/webaudio/AudioContext.cpp:
* Modules/webaudio/AudioContext.h:
* Modules/webaudio/AudioNode.cpp:
* Modules/webaudio/AudioSummingJunction.h:
* Modules/webaudio/DefaultAudioDestinationNode.cpp:
* Modules/webaudio/DefaultAudioDestinationNode.h:
* platform/audio/PlatformMediaSessionManager.h:
2022-03-16 Devin Rousso <drousso@apple.com>
[Apple Pay] version values are incorrect, causing incorrect feature detection
https://bugs.webkit.org/show_bug.cgi?id=237989
<rdar://problem/90399356>
Reviewed by Tim Horton.
Version 13 should also be enabled for `ENABLE_APPLE_PAY_SELECTED_SHIPPING_METHOD`, and
`ENABLE_APPLE_PAY_PAYMENT_DETAILS_DATA` really corresponds to Version 14.
* Modules/applepay/cocoa/PaymentAPIVersionCocoa.mm:
(WebCore::PaymentAPIVersion::current):
2022-03-16 Eric Carlson <eric.carlson@apple.com>
[Cocoa] Minor AVVideoCaptureSource cleanup
https://bugs.webkit.org/show_bug.cgi?id=237978
<rdar://problem/90388332>
Reviewed by Jer Noble.
No new tests, no behavior change.
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::setupSession): Use `instancesRespondToSelector:`
instead of `respondsToSelector:` so we don't have to allocate an AVCaptureSession
just to find out how to initialize it.
2022-03-16 Basuke Suzuki <basuke.suzuki@sony.com>
[PlayStation] Fix build break after r291341
https://bugs.webkit.org/show_bug.cgi?id=237971
Unreviewed build fix.
* platform/playstation/MIMETypeRegistryPlayStation.cpp:
(WebCore::MIMETypeRegistry::mimeTypeForExtension):
2022-03-16 Said Abou-Hallawa <said@apple.com>
[GPU Process] Move other classes out of GraphicsContext.h
https://bugs.webkit.org/show_bug.cgi?id=237944
Reviewed by Simon Fraser.
This is a step towards making GraphicsContextState a class and move
more functionalities to it.
* Headers.cmake:
* PlatformAppleWin.cmake:
* PlatformMac.cmake:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/GraphicsContext.cpp:
(WebCore::TextBoxIterator::TextBoxIterator): Deleted.
(WebCore::TextBoxIterator::offset const): Deleted.
(WebCore::TextBoxIterator::increment): Deleted.
(WebCore::TextBoxIterator::atEnd const): Deleted.
(WebCore::TextBoxIterator::current const): Deleted.
(WebCore::TextBoxIterator::direction const): Deleted.
(WebCore::TextBoxIterator::operator== const): Deleted.
(WebCore::TextBoxIterator::operator!= const): Deleted.
(WebCore::GraphicsContextState::GraphicsContextState): Deleted.
(WebCore::GraphicsContextState::mergeChanges): Deleted.
(WebCore::GraphicsContextStateChange::changesFromState const): Deleted.
(WebCore::GraphicsContextStateChange::accumulate): Deleted.
(WebCore::GraphicsContextStateChange::apply const): Deleted.
(WebCore::GraphicsContextStateChange::dump const): Deleted.
(WebCore::operator<<): Deleted.
* platform/graphics/GraphicsContext.h:
(WebCore::DocumentMarkerLineStyle::encode const): Deleted.
(WebCore::DocumentMarkerLineStyle::decode): Deleted.
(WebCore::GraphicsContextStateChange::GraphicsContextStateChange): Deleted.
(WebCore::GraphicsContextStateSaver::GraphicsContextStateSaver): Deleted.
(WebCore::GraphicsContextStateSaver::~GraphicsContextStateSaver): Deleted.
(WebCore::GraphicsContextStateSaver::save): Deleted.
(WebCore::GraphicsContextStateSaver::restore): Deleted.
(WebCore::GraphicsContextStateSaver::context const): Deleted.
(WebCore::TransparencyLayerScope::TransparencyLayerScope): Deleted.
(WebCore::TransparencyLayerScope::beginLayer): Deleted.
(WebCore::TransparencyLayerScope::~TransparencyLayerScope): Deleted.
(WebCore::GraphicsContextStateStackChecker::GraphicsContextStateStackChecker): Deleted.
(WebCore::GraphicsContextStateStackChecker::~GraphicsContextStateStackChecker): Deleted.
(WebCore::InterpolationQualityMaintainer::InterpolationQualityMaintainer): Deleted.
(WebCore::InterpolationQualityMaintainer::~InterpolationQualityMaintainer): Deleted.
* platform/graphics/GraphicsContextState.cpp: Added.
(WebCore::GraphicsContextState::GraphicsContextState):
(WebCore::GraphicsContextState::mergeChanges):
(WebCore::GraphicsContextStateChange::changesFromState const):
(WebCore::GraphicsContextStateChange::accumulate):
(WebCore::GraphicsContextStateChange::apply const):
(WebCore::GraphicsContextStateChange::dump const):
(WebCore::operator<<):
* platform/graphics/GraphicsContextState.h: Added.
(WebCore::GraphicsContextStateChange::GraphicsContextStateChange):
* platform/graphics/GraphicsContextStateSaver.h: Added.
(WebCore::GraphicsContextStateSaver::GraphicsContextStateSaver):
(WebCore::GraphicsContextStateSaver::~GraphicsContextStateSaver):
(WebCore::GraphicsContextStateSaver::save):
(WebCore::GraphicsContextStateSaver::restore):
(WebCore::GraphicsContextStateSaver::context const):
(WebCore::TransparencyLayerScope::TransparencyLayerScope):
(WebCore::TransparencyLayerScope::beginLayer):
(WebCore::TransparencyLayerScope::~TransparencyLayerScope):
(WebCore::GraphicsContextStateStackChecker::GraphicsContextStateStackChecker):
(WebCore::GraphicsContextStateStackChecker::~GraphicsContextStateStackChecker):
(WebCore::InterpolationQualityMaintainer::InterpolationQualityMaintainer):
(WebCore::InterpolationQualityMaintainer::~InterpolationQualityMaintainer):
* platform/graphics/GraphicsTypes.h:
(WebCore::DocumentMarkerLineStyle::encode const):
(WebCore::DocumentMarkerLineStyle::decode):
* platform/graphics/PlatformGraphicsContext.h: Added.
* platform/graphics/TextBoxIterator.h: Added.
(WebCore::TextBoxIterator::TextBoxIterator):
(WebCore::TextBoxIterator::offset const):
(WebCore::TextBoxIterator::increment):
(WebCore::TextBoxIterator::atEnd const):
(WebCore::TextBoxIterator::current const):
(WebCore::TextBoxIterator::direction const):
(WebCore::TextBoxIterator::operator== const):
(WebCore::TextBoxIterator::operator!= const):
* platform/graphics/cg/CGContextStateSaver.h: Added.
(WebCore::CGContextStateSaver::CGContextStateSaver):
(WebCore::CGContextStateSaver::~CGContextStateSaver):
(WebCore::CGContextStateSaver::save):
(WebCore::CGContextStateSaver::restore):
(WebCore::CGContextStateSaver::didSave const):
* platform/graphics/cg/GraphicsContextCG.h:
(WebCore::CGContextStateSaver::CGContextStateSaver): Deleted.
(WebCore::CGContextStateSaver::~CGContextStateSaver): Deleted.
(WebCore::CGContextStateSaver::save): Deleted.
(WebCore::CGContextStateSaver::restore): Deleted.
(WebCore::CGContextStateSaver::didSave const): Deleted.
2022-03-16 Eric Carlson <eric.carlson@apple.com>
[iOS] WebAVMediaSelectionOption should implement -mediaType
https://bugs.webkit.org/show_bug.cgi?id=237966
rdar://89934589
Reviewed by Jer Noble.
WebKit uses AVKit to implement "video fullscreen" on iOS. AVKit can only be used
in the UI process, but WebKit's AVFoundation objects are in the GPU process, so we
create "proxy" objects in the UI process and pass state from them between the two
processes. One such object is WebAVMediaSelectionOption, which proxies for an
AVMediaSelectionOption. This proxy originally only implemented -localizedDisplayName
but AVKit now sometimes uses -mediaType, which causes an assert when it messages the
non-existent selector. Add -mediaType to fix the assert, and add log-only stubs
for every other AVMediaSelectionOption selector to catch future changes.
* page/CaptionUserPreferences.cpp:
(WebCore::CaptionUserPreferences::mediaSelectionOptionForTrack const):
* platform/MediaSelectionOption.h:
(WebCore::MediaSelectionOption::MediaSelectionOption):
(WebCore::MediaSelectionOption::isolatedCopy const):
(WebCore::MediaSelectionOption::isolatedCopy):
(WebCore::MediaSelectionOption::encode const):
(WebCore::MediaSelectionOption::decode):
* platform/ios/PlaybackSessionInterfaceAVKit.mm:
(WebCore::toAVMediaType):
(WebCore::mediaSelectionOptions):
* platform/ios/WebAVPlayerController.h:
* platform/ios/WebAVPlayerController.mm:
(-[WebAVMediaSelectionOption initWithMediaType:displayName:]):
(-[WebAVMediaSelectionOption mediaSubTypes]):
(-[WebAVMediaSelectionOption hasMediaCharacteristic:]):
(-[WebAVMediaSelectionOption isPlayable]):
(-[WebAVMediaSelectionOption extendedLanguageTag]):
(-[WebAVMediaSelectionOption locale]):
(-[WebAVMediaSelectionOption commonMetadata]):
(-[WebAVMediaSelectionOption availableMetadataFormats]):
(-[WebAVMediaSelectionOption metadataForFormat:]):
(-[WebAVMediaSelectionOption associatedMediaSelectionOptionInMediaSelectionGroup:]):
(-[WebAVMediaSelectionOption propertyList]):
(-[WebAVMediaSelectionOption displayNameWithLocale:]):
(-[WebAVMediaSelectionOption mediaCharacteristics]):
(-[WebAVMediaSelectionOption outOfBandSource]):
(-[WebAVMediaSelectionOption outOfBandIdentifier]):
(-[WebAVMediaSelectionOption _isDesignatedDefault]):
(-[WebAVMediaSelectionOption languageCode]):
(-[WebAVMediaSelectionOption track]):
* platform/mac/WebPlaybackControlsManager.mm:
(toAVTouchBarMediaSelectionOptionType):
(mediaSelectionOptions):
2022-03-16 Philippe Normand <pnormand@igalia.com>
Migrate use of MediaSampleGStreamer to VideoFrame in WebRTC pipelines
https://bugs.webkit.org/show_bug.cgi?id=237885
Reviewed by Youenn Fablet.
Introducing VideoFrameGStreamer, meant to be used from mediastream producers and consumers.
The VideoFrame internally manages a GstSample storing the actual video frame data that can
be passed around between RealtimeMediaSources and the mediastream GStreamer source element.
Covered by existing layout tests.
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::toMediaSample):
* platform/GStreamer.cmake:
* platform/graphics/gstreamer/MediaSampleGStreamer.cpp:
(WebCore::MediaSampleGStreamer::MediaSampleGStreamer):
(WebCore::MediaSampleGStreamer::createFakeSample):
(WebCore::MediaSampleGStreamer::createImageSample): Deleted.
(WebCore::MediaSampleGStreamer::initializeFromBuffer): Deleted.
(WebCore::MediaSampleGStreamer::getRGBAImageData const): Deleted.
* platform/graphics/gstreamer/MediaSampleGStreamer.h:
(WebCore::MediaSampleGStreamer::create):
(WebCore::MediaSampleGStreamer::createWrappedSample): Deleted.
(WebCore::MediaSampleGStreamer::createImageSample): Deleted.
* platform/graphics/gstreamer/VideoFrameGStreamer.cpp: Added.
(WebCore::VideoFrameGStreamer::createFromPixelBuffer):
(WebCore::VideoFrameGStreamer::VideoFrameGStreamer):
(WebCore::VideoFrameGStreamer::getRGBAImageData const):
* platform/graphics/gstreamer/VideoFrameGStreamer.h: Added.
* platform/graphics/texmap/GraphicsContextGLTextureMapper.cpp:
(WebCore::GraphicsContextGLTextureMapper::paintCompositedResultsToMediaSample):
* platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
(WebCore::GStreamerVideoCaptureSource::processNewFrame):
(WebCore::GStreamerVideoCaptureSource::newSampleCallback):
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
* platform/mediastream/gstreamer/MockRealtimeVideoSourceGStreamer.cpp:
(WebCore::MockRealtimeVideoSourceGStreamer::updateSampleBuffer):
* platform/mediastream/libwebrtc/gstreamer/RealtimeIncomingVideoSourceLibWebRTC.cpp:
(WebCore::RealtimeIncomingVideoSourceLibWebRTC::OnFrame):
* platform/mediastream/libwebrtc/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.cpp:
(WebCore::RealtimeOutgoingVideoSourceLibWebRTC::videoSampleAvailable):
2022-03-16 Alan Bujtas <zalan@apple.com>
[IFC][Integration] Move firstSelectedBox/lastSelectedBox out of InlineIterator::Line
https://bugs.webkit.org/show_bug.cgi?id=237941
Reviewed by Simon Fraser.
These functions don't belong in InlineIterator::Line (they are standalone functions with only one callsite).
* layout/integration/InlineIteratorLine.cpp:
(WebCore::InlineIterator::Line::firstSelectedBox const): Deleted.
(WebCore::InlineIterator::Line::lastSelectedBox const): Deleted.
* layout/integration/InlineIteratorLine.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::inlineSelectionGaps):
2022-03-16 Chris Fleizach <cfleizach@apple.com>
AX: imported/w3c/web-platform-tests/speech-api/SpeechSynthesis (layout-tests) are constant text failures
https://bugs.webkit.org/show_bug.cgi?id=237881
<rdar://problem/90293806>
Reviewed by Andres Gonzalez.
Keep track of the platform utterances so that we can verify the callbacks are for the ones we are interested in.
This test failure was due to a previous speech job that was canceled (before a new one started). When the callback for
the last one came back, it wiped out the stored new one.
Fixed test: imported/w3c/web-platform-tests/speech-api/SpeechSynthesis-speak-events.html.
* platform/PlatformSpeechSynthesisUtterance.h:
(WebCore::PlatformSpeechSynthesisUtterance::platformSpeechUtteranceWrapper const):
(WebCore::PlatformSpeechSynthesisUtterance::setPlatformSpeechUtteranceWrapper):
* platform/cocoa/PlatformSpeechSynthesizerCocoa.mm:
(-[WebSpeechSynthesisWrapper speakUtterance:]):
(-[WebSpeechSynthesisWrapper speechSynthesizer:didStartSpeechUtterance:]):
(-[WebSpeechSynthesisWrapper speechSynthesizer:didFinishSpeechUtterance:]):
(-[WebSpeechSynthesisWrapper speechSynthesizer:didPauseSpeechUtterance:]):
(-[WebSpeechSynthesisWrapper speechSynthesizer:didContinueSpeechUtterance:]):
(-[WebSpeechSynthesisWrapper speechSynthesizer:didCancelSpeechUtterance:]):
(-[WebSpeechSynthesisWrapper speechSynthesizer:willSpeakRangeOfSpeechString:utterance:]):
2022-03-16 Zan Dobersek <zdobersek@igalia.com>
[GTK][WPE] Provide DMABuf-based composition layers, DMABufVideoSink integration
https://bugs.webkit.org/show_bug.cgi?id=237328
<rdar://problem/90295492>
Reviewed by Alejandro G. Castro.
Introduce TextureMapperPlatformLayerProxyDMABuf, a TextureMapper proxy
implementation that handles platform layers backed by dmabuf objects.
This will be used to handle display of dmabuf producers like GStreamer
pipelines or ANGLE-backed WebGL contexts. The DMABufLayer class is the
platform layer object, handling display of the actual dmabuf. The proxy
itself is tasked with creating and caching such layers for any dmabuf
object that originates from the producer.
For each dmabuf object pushed into the proxy, the according DMABufLayer
object is spawned and cached for future reuse, expecting the producer
to be able to provide dmabufs from a pool or swapchain of these objects.
The cache is emptied whenever dmabufs go unused for a certain amount of
swaps, or if the size of the provided dmabufs changes.
DMABufFormat provides information for different DRM formats, for
instance how different planes for specific formats are formatted and
sized.
DMABufObject is a class that handles a given grouping of dmabufs
according to the specified format. It has an associated handle value,
size, and per-plane dmabuf file descriptors, offsets, strides and
modifiers, along with a DMABufReleaseFlag instance.
DMABufReleaseFlag objects are used as an eventfd-based release mechanism
that indicates to the producer that the given DMABufObject has been
presented and subsequently released and is thus available for reuse.
GBMBufferSwapchain provides a custom swapchain implementation that's
based on libgbm functionality. Each such swapchain has a capacity
specified during construction, with the capacities of four or eight
currently supported. getBuffer() is called by the producer to obtain a
buffer object that's then used for backing of specific content like
ANGLE execution or media's software-decoded video frames. Buffers
obtained this way are moved over to the end of the buffer array, with
the expectation of reusing them once they are released by the
composition engine.
MediaPlayerPrivateGStreamer implementation is enhanced to use the
recently-added WebKitDMABufVideoSink element if its use is enabled
through the development-purpose environment variable and if the
necessary GStreamer facilities are present on the system. When these
conditions are met, the Nicosia::ContentLayer instance is also
constructed with a TextureMapperPlatformLayerProxyDMABuf instance, since
we expect to present the dmabufs through that functionality.
With the WebKitDMABufVideoSink, the incoming samples are either based
on dmabufs (in case of dmabuf-capable hardware decoder) or are just raw
data (most likely coming from a software-based decoder). In case of
dmabufs we can use the GstMemory pointer as the handle through which
the relevant data is cached in TextureMapperPlatformLayerProxyDMABuf,
and upon the first occurrence we retrieve all the relevant dmabuf data
so that it can be used by that proxy implementation to construct a
renderable EGLImage.
In case of software-decoded raw data, we have to use the swapchain
object and copy the data on a per-plane basis for each such sample,
finally pushing the dmabuf data of that swapchain buffer into the
TextureMapperPlatformLayerProxyDMABuf instance.
Changes around TextureMapperPlatformLayerProxyDMABuf and GStreamer
integration are guarded with USE(TEXTURE_MAPPER_DMABUF). No port yet
enables this build guard, but this will be handled later. Similarly,
the code specific to libgbm will also be guarded in a separate set of
changes.
* SourcesGTK.txt:
* SourcesWPE.txt:
* platform/TextureMapper.cmake:
* platform/graphics/gbm/DMABufFormat.h: Added.
(WebCore::DMABufFormatImpl::createFourCC):
(WebCore::DMABufFormat::planeWidth const):
(WebCore::DMABufFormat::planeHeight const):
(WebCore::DMABufFormat::Plane::Plane):
(WebCore::DMABufFormatImpl::createSinglePlaneRGBA):
(WebCore::DMABufFormatImpl::definePlane):
(WebCore::DMABufFormat::instantiate):
(WebCore::DMABufFormat::create):
* platform/graphics/gbm/DMABufObject.h: Added.
(WebCore::DMABufObject::DMABufObject):
(WebCore::DMABufObject::~DMABufObject):
(WebCore::DMABufObject::operator=):
* platform/graphics/gbm/DMABufReleaseFlag.h: Added.
(WebCore::DMABufReleaseFlag::DMABufReleaseFlag):
(WebCore::DMABufReleaseFlag::~DMABufReleaseFlag):
(WebCore::DMABufReleaseFlag::operator=):
(WebCore::DMABufReleaseFlag::dup const):
(WebCore::DMABufReleaseFlag::released const):
(WebCore::DMABufReleaseFlag::release):
* platform/graphics/gbm/GBMBufferSwapchain.cpp: Added.
(WebCore::GBMBufferSwapchain::GBMBufferSwapchain):
(WebCore::GBMBufferSwapchain::getBuffer):
(WebCore::GBMBufferSwapchain::Buffer::Buffer):
(WebCore::GBMBufferSwapchain::Buffer::createDMABufObject const):
(WebCore::GBMBufferSwapchain::Buffer::PlaneData::~PlaneData):
* platform/graphics/gbm/GBMBufferSwapchain.h: Added.
(WebCore::GBMBufferSwapchain::Buffer::handle const):
(WebCore::GBMBufferSwapchain::Buffer::numPlanes const):
(WebCore::GBMBufferSwapchain::Buffer::planeData const):
* platform/graphics/gstreamer/DMABufVideoSinkGStreamer.cpp:
(webKitDMABufVideoSinkIsEnabled):
(webKitDMABufVideoSinkSetMediaPlayerPrivate):
* platform/graphics/gstreamer/DMABufVideoSinkGStreamer.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
(WebCore::MediaPlayerPrivateGStreamer::platformLayer const):
(WebCore::fourccValue):
(WebCore::MediaPlayerPrivateGStreamer::pushDMABufToCompositor):
(WebCore::MediaPlayerPrivateGStreamer::triggerRepaint):
(WebCore::MediaPlayerPrivateGStreamer::createVideoSinkDMABuf):
(WebCore::MediaPlayerPrivateGStreamer::createVideoSink):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
* platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.cpp:
(Nicosia::ContentLayerTextureMapperImpl::createFactory):
* platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.h:
* platform/graphics/texmap/TextureMapperPlatformLayerProxyDMABuf.cpp: Added.
(WebCore::createImageKHR):
(WebCore::destroyImageKHR):
(WebCore::TextureMapperPlatformLayerProxyDMABuf::DMABufLayer::EGLImageData::~EGLImageData):
(WebCore::TextureMapperPlatformLayerProxyDMABuf::activateOnCompositingThread):
(WebCore::TextureMapperPlatformLayerProxyDMABuf::invalidate):
(WebCore::TextureMapperPlatformLayerProxyDMABuf::swapBuffer):
(WebCore::TextureMapperPlatformLayerProxyDMABuf::pushDMABuf):
(WebCore::TextureMapperPlatformLayerProxyDMABuf::DMABufLayer::DMABufLayer):
(WebCore::TextureMapperPlatformLayerProxyDMABuf::DMABufLayer::paintToTextureMapper):
(WebCore::TextureMapperPlatformLayerProxyDMABuf::DMABufLayer::createEGLImageData):
* platform/graphics/texmap/TextureMapperPlatformLayerProxyDMABuf.h: Added.
2022-03-16 Alejandro G. Castro <alex@igalia.com>
[GTK][WPE] Debug build assertion, TextureMapperPlatformLayerProxyGL asserts when going back in the minibrowser
https://bugs.webkit.org/show_bug.cgi?id=237948
We are not initializing m_compositorThread properly with the
invalidation and the ThreadedCompositor is destroyed after a
navigation, and when going back the browser asserts because the
ThreadedCompositor is a different one. This is just for debug
builds.
Reviewed by Carlos Garcia Campos.
Not clear how to reproduce this situation with tests because we
need to navigate back with different origins. I'm opening a bug
connected to this one to check how to do it.
* platform/graphics/texmap/TextureMapperPlatformLayerProxyGL.cpp:
(WebCore::TextureMapperPlatformLayerProxyGL::invalidate):
2022-03-16 Youenn Fablet <youenn@apple.com>
Make MIMETypeRegistry::mimeTypeForPath take a StringView
https://bugs.webkit.org/show_bug.cgi?id=236441
<rdar://problem/89084526>
Reviewed by Chris Dumez.
Passing a StringView is more efficient for some code paths.
Covered by existing tests.
* editing/cocoa/WebArchiveResourceFromNSAttributedString.mm:
(WebCore::if):
* fileapi/File.cpp:
(WebCore::File::computeNameAndContentType):
* loader/cocoa/BundleResourceLoader.mm:
(WebCore::BundleResourceLoader::loadResourceFromBundle):
* platform/MIMETypeRegistry.cpp:
(WebCore::commonMimeTypesMap):
* platform/MIMETypeRegistry.h:
* platform/cocoa/MIMETypeRegistryCocoa.mm:
(WebCore::MIMETypeRegistry::mimeTypeForExtension):
* platform/win/MIMETypeRegistryWin.cpp:
(WebCore::MIMETypeRegistry::mimeTypeForExtension):
* platform/xdg/MIMETypeRegistryXdg.cpp:
(WebCore::MIMETypeRegistry::mimeTypeForExtension):
2022-03-16 Nikolas Zimmermann <nzimmermann@igalia.com>
Extract transform-origin handling out of RenderStyle::applyTransform()
https://bugs.webkit.org/show_bug.cgi?id=237590
Reviewed by Simon Fraser.
RenderStyle::applyTransform() implements the algorithm given in
CSS Transforms Module Level 2 (https://www.w3.org/TR/css-transforms-2/#ctm)
that yields the "current transformation matrix". It is used e.g. in
RenderLayer::updateTransform() to compute the layer transformation
matrix, that's used for rendering.
LBSE wants to re-use the same algorithm, interchanging the individual
CSS transform properties / the CSS transform property with an external
AffineTransform, representing the SVG 2D transform.
Therefore split RenderStyle::applyTransform() into three main methods:
applyTransformOrigin / applyCSSTransform / unapplyTransformOrigin.
LBSE can call applyTransformOrigin(), multiply the TransformationMatrix
with the given SVG 2D AffineTransform and call unapplyTransformOrigin():
auto originTranslate = style.applyTransformOrigin(transform, boundingBox);
transform.multiplyAffineTransform(svgTransform.value());
style.unapplyTransformOrigin(transform, originTranslate);
The LBSE transform changes will follow in a separated patch, this only contains
the general changes. The non-SVG code paths remain unchained, since the applyTransform()
is kept as-is, just refactored to make use of the new (un)applyTransformOrigin() methods.
Covered by existing tests, no change in behaviour.
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::affectedByTransformOrigin const):
(WebCore::RenderStyle::applyTransformOrigin const):
(WebCore::RenderStyle::unapplyTransformOrigin const):
(WebCore::RenderStyle::applyTransform const):
(WebCore::RenderStyle::applyCSSTransform const):
* rendering/style/RenderStyle.h:
2022-03-16 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer] Avoid auto-selection of hole punching player
https://bugs.webkit.org/show_bug.cgi?id=237828
Reviewed by Xabier Rodriguez-Calvar.
The hole punch player private shouldn't be automatically selected when
the mime type is empty or unsupported by that specific player
("video/holepunch" in practice). This patch returns a FormatError
networkState in those cases, forcing the selection algorithm to
discard the hole punch player private.
This patch is authored by Eugene Mutavchi <Ievgen_Mutavchi@comcast.com>
See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/797
* platform/graphics/holepunch/MediaPlayerPrivateHolePunch.cpp: Implement networkState setter. Set FormatError networkState on load when the mime type is empty or unknown.
* platform/graphics/holepunch/MediaPlayerPrivateHolePunch.h: Refactor networkState management. Move load() implementation to cpp file.
2022-03-15 Alan Bujtas <zalan@apple.com>
REGRESSION (r282737): `text-shadow` is clipped
https://bugs.webkit.org/show_bug.cgi?id=237898
<rdar://problem/90320701>
Reviewed by Darin Adler.
Inflate the ink overflow rect with the text shadow values (note that here, in the display builder we work with physical coordinates).
Test: fast/text/text-shadow-ink-overflow-missing.html
* layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp:
(WebCore::Layout::InlineDisplayContentBuilder::appendTextDisplayBox):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::getTextShadowHorizontalExtent const):
(WebCore::RenderStyle::getTextShadowVerticalExtent const):
2022-03-15 Diego Pino Garcia <dpino@igalia.com>
[GLIB] REGRESSION(r291257): Unreviewed, fix build when using ATK
https://bugs.webkit.org/show_bug.cgi?id=237939
r291257 renamed RenderStyle::textDecoration() to
RenderStyle::textDecorationLine() in the ATSPI module, but it missed
to do the same for the ATK module.
ATK is still in use when building with flag -DUSE_ATSPI=OFF, which is
used by Ubuntu 18.04 and Debian Stable bots.
* accessibility/atk/WebKitAccessibleInterfaceText.cpp:
(getAttributeSetForAccessibilityObject):
2022-03-15 Eric Carlson <eric.carlson@apple.com>
Video poster disappears prematurely on play, leaving transparent video element.
https://bugs.webkit.org/show_bug.cgi?id=226960
<rdar://problem/79315114>
Reviewed by Jer Noble.
If a media file has an enabled video track, don't advance readyState to
HAVE_ENOUGH_DATA until we have the first frame so we won't hide the poster image
until AVFoundation has something to render.
Tested manually.
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::mediaPlayerFirstVideoFrameAvailable): Always log.
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::updateStates): Move the test for the
first video frame above the player item status check. If a file has a video track,
don't advance to HAVE_ENOUGH_DATA unless we have the first video frame.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad): Clear m_cachedHasEnabledVideo.
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer): Remove unneeded
local variable.
(WebCore::MediaPlayerPrivateAVFoundationObjC::platformSetVisible): Minro cleanup.
(WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged): Set `hasVideo` if
AVPlayerItem.hasEnabledVideo is true, because it remains stable while AVAssetTracks
sometimes disappear and reappear.
(WebCore::MediaPlayerPrivateAVFoundationObjC::firstFrameAvailableDidChange): Add logging.
(WebCore::MediaPlayerPrivateAVFoundationObjC::hasEnabledAudioDidChange): Ditto
(WebCore::MediaPlayerPrivateAVFoundationObjC::hasEnabledVideoDidChange): New, cache
AVPlayerItem.hasEnabledVideo.
(WebCore::itemKVOProperties):
(-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]): Respond
to @"hasEnabledVideo".
* platform/graphics/avfoundation/objc/VideoLayerManagerObjC.h:
2022-03-15 Per Arne Vollan <pvollan@apple.com>
Crash under HTMLDocumentParser::didBeginYieldingParser()
https://bugs.webkit.org/show_bug.cgi?id=237930
<rdar://45607220>
Reviewed by Geoffrey Garen.
Add null pointer check.
No new tests, unable to reproduce.
* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::didBeginYieldingParser):
(WebCore::HTMLDocumentParser::didEndYieldingParser):
2022-03-15 Sihui Liu <sihui_liu@apple.com>
Add RELEASE_LOG_FAULT to ApplicationCache entry function
https://bugs.webkit.org/show_bug.cgi?id=237866
Reviewed by Alex Christensen.
To help learn remaining ApplicationCache usage.
* html/HTMLHtmlElement.cpp:
(WebCore::HTMLHtmlElement::insertedByParser):
2022-03-15 Chris Dumez <cdumez@apple.com>
Make it clearer in the loading logging when it is for the main frame or not
https://bugs.webkit.org/show_bug.cgi?id=237913
Reviewed by Alex Christensen.
* dom/Document.cpp:
* loader/DocumentLoader.cpp:
* loader/FrameLoader.cpp:
* page/FrameView.cpp:
2022-03-15 Commit Queue <commit-queue@webkit.org>
Unreviewed, reverting r291282.
https://bugs.webkit.org/show_bug.cgi?id=237924
Speedometer2 1-2% regression
Reverted changeset:
"Dialog element only animates once"
https://bugs.webkit.org/show_bug.cgi?id=236274
https://commits.webkit.org/r291282
2022-03-15 Sihui Liu <sihui_liu@apple.com>
Add RELEASE_LOG_FAULT to WebSQL entry functions
https://bugs.webkit.org/show_bug.cgi?id=237865
Reviewed by Geoffrey Garen.
To help learn remaining WebSQL usage.
* Modules/webdatabase/Database.cpp:
(WebCore::Database::transaction):
(WebCore::Database::readTransaction):
2022-03-15 Alan Bujtas <zalan@apple.com>
[IFC][Integration] Rename selection* to enclosing* in InlineIterator::Line
https://bugs.webkit.org/show_bug.cgi?id=237909
Reviewed by Antti Koivisto.
These functions return enclosing (line box and content) geometries which we happen to use to compute selection boundaries (among other things).
* editing/VisiblePosition.cpp:
(WebCore::VisiblePosition::absoluteSelectionBoundsForLine const):
* layout/integration/InlineIteratorLine.cpp:
(WebCore::InlineIterator::Line::blockDirectionPointInLine const):
(WebCore::InlineIterator::Line::enclosingTopAdjustedForPrecedingBlock const):
(WebCore::InlineIterator::Line::enclosingHeightAdjustedForPrecedingBlock const):
(WebCore::InlineIterator::Line::selectionTopAdjustedForPrecedingBlock const): Deleted.
(WebCore::InlineIterator::Line::selectionHeightAdjustedForPrecedingBlock const): Deleted.
* layout/integration/InlineIteratorLine.h:
(WebCore::InlineIterator::Line::enclosingTop const):
(WebCore::InlineIterator::Line::enclosingTopForHitTesting const):
(WebCore::InlineIterator::Line::enclosingBottom const):
(WebCore::InlineIterator::Line::enclosingHeight const):
(WebCore::InlineIterator::Line::enclosingLogicalRect const):
(WebCore::InlineIterator::Line::enclosingPhysicalRect const):
(WebCore::InlineIterator::Line::selectionTop const): Deleted.
(WebCore::InlineIterator::Line::selectionTopForHitTesting const): Deleted.
(WebCore::InlineIterator::Line::selectionBottom const): Deleted.
(WebCore::InlineIterator::Line::selectionHeight const): Deleted.
(WebCore::InlineIterator::Line::selectionLogicalRect const): Deleted.
(WebCore::InlineIterator::Line::selectionPhysicalRect const): Deleted.
* layout/integration/InlineIteratorTextBox.cpp:
(WebCore::InlineIterator::TextBox::selectionRect const):
* rendering/CaretRectComputation.cpp:
(WebCore::computeCaretRectForLinePosition):
* rendering/LegacyRootInlineBox.cpp:
(WebCore::LegacyRootInlineBox::selectionTopAdjustedForPrecedingBlock const):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::adjustEnclosingTopForPrecedingBlock const):
(WebCore::RenderBlockFlow::inlineSelectionGaps):
(WebCore::RenderBlockFlow::positionForPointWithInlineChildren):
(WebCore::RenderBlockFlow::adjustSelectionTopForPrecedingBlock const): Deleted.
* rendering/RenderBlockFlow.h:
* rendering/RenderImage.cpp:
(WebCore::RenderImage::collectSelectionGeometries):
* rendering/RenderLineBreak.cpp:
(WebCore::RenderLineBreak::collectSelectionGeometries):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::positionForPoint):
* rendering/RenderText.cpp:
(WebCore::RenderText::positionForPoint):
* rendering/TextBoxPainter.cpp:
(WebCore::TextBoxPainter::paintBackground):
2022-03-15 Patrick Griffis <pgriffis@igalia.com>
Add initial implementation of Fetch Metadata
https://bugs.webkit.org/show_bug.cgi?id=204744
Reviewed by Youenn Fablet.
Add initial implementation of Fetch Metadata as specified here:
https://w3c.github.io/webappsec-fetch-metadata/
Currently only Fetch-Sec-Mode and Fetch-Sec-Dest are implemented with more
to come in later patches.
Test: http/wpt/fetch/fetch-metadata-same-origin-redirect.html
* loader/CrossOriginAccessControl.cpp:
(WebCore::cleanHTTPRequestHeadersForAccessControl):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::updateHTTPRequestHeaders):
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::updateFetchMetadataHeaders):
* loader/cache/CachedResourceRequest.h:
* platform/network/HTTPHeaderNames.in:
2022-03-15 Zan Dobersek <zdobersek@igalia.com>
REGRESSION(r291270): Changes need better build-time guards
https://bugs.webkit.org/show_bug.cgi?id=237908
Unreviewed, rolling out r291270 and r291294 until proper build guards
and relevant configuration options are introduced.
* SourcesGTK.txt:
* SourcesWPE.txt:
* platform/TextureMapper.cmake:
* platform/graphics/gbm/DMABufFormat.h: Removed.
* platform/graphics/gbm/DMABufObject.h: Removed.
* platform/graphics/gbm/DMABufReleaseFlag.h: Removed.
* platform/graphics/gbm/GBMBufferSwapchain.cpp: Removed.
* platform/graphics/gbm/GBMBufferSwapchain.h: Removed.
* platform/graphics/gstreamer/DMABufVideoSinkGStreamer.cpp:
(webKitDMABufVideoSinkProbePlatform):
(webKitDMABufVideoSinkIsEnabled): Deleted.
* platform/graphics/gstreamer/DMABufVideoSinkGStreamer.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
(WebCore::MediaPlayerPrivateGStreamer::platformLayer const):
(WebCore::MediaPlayerPrivateGStreamer::pushTextureToCompositor):
(WebCore::MediaPlayerPrivateGStreamer::triggerRepaint):
(WebCore::MediaPlayerPrivateGStreamer::createVideoSink):
(WebCore::fourccValue): Deleted.
(WebCore::MediaPlayerPrivateGStreamer::pushDMABufToCompositor): Deleted.
(WebCore::MediaPlayerPrivateGStreamer::createVideoSinkDMABuf): Deleted.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
* platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.cpp:
(Nicosia::ContentLayerTextureMapperImpl::createFactory):
* platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.h:
* platform/graphics/texmap/TextureMapperPlatformLayerProxyDMABuf.cpp: Removed.
* platform/graphics/texmap/TextureMapperPlatformLayerProxyDMABuf.h: Removed.
2022-03-15 Chris Dumez <cdumez@apple.com>
Fix SQL statement in ApplicationCacheStorage::verifySchemaVersion()
https://bugs.webkit.org/show_bug.cgi?id=237905
Reviewed by Geoffrey Garen.
This was leading to the following logging:
`SQLiteDatabase::prepareStatement: Failed to prepare statement PRAGMA user_version=%7`
* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::verifySchemaVersion):
2022-03-15 Antti Koivisto <antti@apple.com>
background-clip:text doesn't work with display:flex
https://bugs.webkit.org/show_bug.cgi?id=169125
<rdar://problem/72432683>
Reviewed by Simon Fraser.
Tests: imported/w3c/web-platform-tests/css/css-backgrounds/background-clip/clip-text-flex.html
* rendering/RenderElement.cpp:
(WebCore::RenderElement::paintAsInlineBlock):
Flexbox children paint as inline blocks. This path didn't support text clip paint phase.
2022-03-15 Alex Christensen <achristensen@webkit.org>
Stop using DYLD_INTERPOSE
https://bugs.webkit.org/show_bug.cgi?id=237867
Reviewed by Anders Carlsson.
It never worked on iOS, and it doesn't work on M1 Macs.
It used to be used for NPAPI and the SecItemShim,
but those have been removed and updated to use other methods that work on M1 Macs.
It is currently only used for tests in editing/secure-input which continue to pass
as much as they did before this change.
* Configurations/WebCoreTestShim.xcconfig: Removed.
* WebCore.xcodeproj/project.pbxproj:
* platform/mac/DynamicLinkerInterposing.h: Removed.
* testing/WebCoreTestShimLibrary.cpp: Removed.
2022-03-15 Antoine Quint <graouts@webkit.org>
[model] model-element/model-element-camera.html is a failure
https://bugs.webkit.org/show_bug.cgi?id=237894
rdar://88982597
Reviewed by Tim Horton.
Ensure we have a non-zero contentSize() and model data before attempting to
create a player. Otherwise, we could end up with a zero frame when calling
into ARKit and the model would fail to load and the ready promise would be
rejected, causing this test to fail.
We can change the existing call site to sizeMayHaveChanged() to no longer
check whether we are using a platform layer since sizeMayHaveChanged() now
takes care of checking whether it has a player.
* Modules/model-element/HTMLModelElement.cpp:
(WebCore::HTMLModelElement::createModelPlayer):
(WebCore::HTMLModelElement::sizeMayHaveChanged):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateConfiguration):
(WebCore::RenderLayerBacking::updateGeometry):
2022-03-15 Brandon Stewart <brandonstewart@apple.com>
Line Builder and Content Breaker out of sync
https://bugs.webkit.org/show_bug.cgi?id=237903
Reviewed by Simon Fraser.
Line builder and content breaker could become out of sync in the case where
the first line style was different than following styles. This could result
in issues with wrapping later on.
* layout/formattingContexts/inline/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::handleInlineContent):
2022-03-15 Jer Noble <jer.noble@apple.com>
[Cocoa] Adopt AVAssetPrefersSandboxedParsingOptionKey
https://bugs.webkit.org/show_bug.cgi?id=237832
<rdar://89029829>
Reviewed by Eric Carlson.
Adopt a AVURLAsset option which would allow the media file parser to run out-of-process.
Because this adoption may have a performance impact (though it should not affect the
functionality of AVURLAsset), add a Setting to disable this adoption at runtime for the
purpose of A/B testing.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::requestInstallMissingPlugins):
* html/HTMLMediaElement.h:
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::mediaPlayerPrefersSandboxedParsing const):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
2022-03-15 Joseph Griego <jgriego@igalia.com>
Expose some web APIs on Shadow Realms and Worklets
https://bugs.webkit.org/show_bug.cgi?id=235736
Reviewed by Yusuke Suzuki.
Mark a handful of web APIs as Exposed=*, making them visible in shadow
realm contexts. The existence of these APIs is checked by new idlharness-shadowrealm
tests in WPT, which have been imported.
Safety: I looked at the implementation of the interfaces that are exposed here and
some of them interact with the scriptExecutionContext() of the calling global scope--
since shadow realms pass that context through unchanged, nothing should go dramatically wrong.
I'm planning on adding more comprehensive testing in WPT shortly.
There's one bug currently which is that AbortSignal.timeout is exposed
on shadow realms but shouldn't be. It will only be exposed when the
incubating realm is a worker or window, which is good since it should still
work there, but it's just not supported in the spec; I'll submit a patch after
this to fix; the problem is that the script execution context in a shadow realm
does not return true for `isShadowRealmGlobalScope`
Also required adjustment to CodeGeneratorJS.pm since it refused to
generate a runtime check when a member is exposed less than the interface it
appears on *and* in more than one scope.
Tests: imported/w3c/web-platform-tests/encoding/idlharness-shadowrealm.window.html
imported/w3c/web-platform-tests/hr-time/idlharness-shadowrealm.window.html
imported/w3c/web-platform-tests/html/dom/idlharness-shadowrealm.window.html
imported/w3c/web-platform-tests/performance-timeline/idlharness-shadowrealm.window.html
imported/w3c/web-platform-tests/streams/idlharness-shadowrealm.window.html
imported/w3c/web-platform-tests/url/idlharness-shadowrealm.window.html
imported/w3c/web-platform-tests/user-timing/idlharness-shadowrealm.window.html
* Modules/streams/ByteLengthQueuingStrategy.idl:
* Modules/streams/CountQueuingStrategy.idl:
* Modules/streams/ReadableByteStreamController.idl:
* Modules/streams/ReadableStream.idl:
* Modules/streams/ReadableStreamBYOBReader.idl:
* Modules/streams/ReadableStreamBYOBRequest.idl:
* Modules/streams/ReadableStreamDefaultController.idl:
* Modules/streams/ReadableStreamDefaultReader.idl:
* Modules/streams/TransformStream.idl:
* Modules/streams/TransformStreamDefaultController.idl:
* Modules/streams/WritableStream.idl:
* Modules/streams/WritableStreamDefaultController.idl:
* Modules/streams/WritableStreamDefaultWriter.idl:
* bindings/scripts/CodeGeneratorJS.pm:
(IsAlwaysExposedOnInterface):
(GenerateRuntimeEnableConditionalStringForExposeScope):
(GenerateRuntimeEnableConditionalStringForExposed):
* bindings/scripts/preprocess-idls.pl: Add SharedWorker to list for Exposed=*
* bindings/scripts/test/JS/JSSharedWorkerGlobalScope.cpp: Fixed after adding SharedWorker to the list for Exposed=*
(WebCore::jsSharedWorkerGlobalScope_ExposedStarConstructorGetter):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
* bindings/scripts/test/SharedWorkerGlobalScopeConstructors.idl: Fixed after adding SharedWorker to the list for Exposed=*
* dom/AbortController.idl:
* dom/AbortSignal.idl:
* dom/CustomEvent.idl:
* dom/ErrorEvent.idl:
* dom/Event.idl:
* dom/EventTarget.idl:
* dom/PromiseRejectionEvent.idl:
* dom/TextDecoder.idl:
* dom/TextDecoderStream.idl:
* dom/TextEncoder.idl:
* dom/TextEncoderStream.idl:
* html/DOMURL.idl:
* html/URLSearchParams.idl:
* page/Performance.idl:
* page/PerformanceEntry.idl:
* page/PerformanceMark.idl:
* page/PerformanceMeasure.idl:
* page/PerformanceObserver.idl:
* page/PerformanceObserverEntryList.idl:
* page/PerformanceResourceTiming.idl:
* page/PerformanceServerTiming.idl:
2022-03-15 Lauro Moura <lmoura@igalia.com>
[GStreamer] Unreviewed, tentative clang build fix after 248419@main
https://bugs.webkit.org/show_bug.cgi?id=237897
Adds static_cast to avoid "non-const-expression cannot be narrowed"
error.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::pushDMABufToCompositor):
2022-03-15 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer] clarify playback errors with MediaError.message
https://bugs.webkit.org/show_bug.cgi?id=237602
Reviewed by Philippe Normand.
This patch is co-authored by Eugene Mutavchi <Ievgen_Mutavchi@comcast.com>
See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/797
* html/HTMLMediaElement.cpp: Use internal last error message from the player, if available.
* platform/graphics/MediaPlayer.cpp: Cache the last error message from the player private and update it when NetworkState changes to an error state. This allows the player private to be regenerated (as it has always been) while providing access to the former player private error after that.
* platform/graphics/MediaPlayer.h: Added lastErrorMessage() method to get the last internal error message from the player private.
* platform/graphics/MediaPlayerPrivate.h: Default lastErrorMessage() empty implementation.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: Detect decryption and no-key errors.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Added errorMessage() to expose the internal error message.
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: Post multiple kind of errors to the GstBus to notify upper layers instead of just logging them.
2022-03-15 Antti Koivisto <antti@apple.com>
CSSConditionRule.conditionText should be readonly
https://bugs.webkit.org/show_bug.cgi?id=237880
Reviewed by Antoine Quint.
Per CSSWG resolution https://github.com/w3c/csswg-drafts/issues/6819#issuecomment-1016695585
This also matches Blink.
* css/CSSConditionRule.h:
* css/CSSConditionRule.idl:
* css/CSSMediaRule.cpp:
(WebCore::CSSMediaRule::setConditionText): Deleted.
* css/CSSMediaRule.h:
* css/CSSSupportsRule.cpp:
(WebCore::CSSSupportsRule::setConditionText): Deleted.
* css/CSSSupportsRule.h:
2022-03-15 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer][MSE] add ac-3,ec-3 and flac codecs gst caps
https://bugs.webkit.org/show_bug.cgi?id=237843
Reviewed by Philippe Normand.
AC-3, EC-3 and FLAC formats should be supported on MSE and EME on those
platforms having the appropriate decoders for them.
This patch adds the appropriate mime types, factories and caps to the
set of codecs whose local support will be tested on MSE.
This patch is authored by Eugene Mutavchi <Ievgen_Mutavchi@comcast.com>
See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/804
* platform/graphics/gstreamer/GStreamerRegistryScanner.cpp: Add support for the codecs, factories and caps.
* platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp: Add support for the caps.
2022-03-15 Antoine Quint <graouts@webkit.org>
Dialog element only animates once
https://bugs.webkit.org/show_bug.cgi?id=236274
Reviewed by Dean Jackson, Tim Nguyen and Antti Koivisto.
Two issues related to CSS Animation surfaced in this bug which animates both <dialog>
and its ::backdrop as the dialog is open and eventually re-opened.
The first issue was that we didn't clear all CSS Animations state when a <dialog> was
closed and its style was set to `display: none`. We now call setAnimationsCreatedByMarkup
to correctly clear such state both when we identify a Styleable is newly getting
`display: none`. We do the same when cancelDeclarativeAnimations() is called, but also
call setCSSAnimationList() on the associated effect stack since that wasn't done either.
Now both functions do similar cleanup.
This allows us to remove removeCSSAnimationCreatedByMarkup() which did a fair bit of work
to clear CSS Animation state per-animation when we only ever used that function for
_all_ animations.
The second issue was that we never called cancelDeclarativeAnimations() for ::backdrop.
We now do that inside of Element::removeFromTopLayer() at a point where the code in
Styleable::fromRenderer() will still work as the element will still be contained in
Document::topLayerElements().
Tests: imported/w3c/web-platform-tests/css/css-animations/dialog-animation.html
imported/w3c/web-platform-tests/css/css-animations/dialog-backdrop-animation.html
* dom/Element.cpp:
(WebCore::Element::removeFromTopLayer):
* style/Styleable.cpp:
(WebCore::Styleable::cancelDeclarativeAnimations const):
(WebCore::Styleable::updateCSSAnimations const):
(WebCore::removeCSSAnimationCreatedByMarkup): Deleted.
2022-03-15 Gabriel Nava Marino <gnavamarino@apple.com>
Crash in KeyframeList.cpp:183 in WebCore::KeyframeList::fillImplicitKeyframes
https://bugs.webkit.org/show_bug.cgi?id=237858
Reviewed by Antoine Quint.
When filling implicit key frames, we iterate through the current keyframes (m_keyframes),
and cache the address of the implicitZeroKeyframe and implicitOneKeyframe.
However, if we're not provided with an existing implicit zero keyframe, we will create a new one
and insert it to the list of current keyframes.
This mutates m_keyframes and the old address for the implicitOneKeyframe would no longer be valid.
Thus we should iterate through the current keyframes, after the insertion, to get the latest address.
Test: animations/fill-implicit-keyframes-crash.html
* rendering/style/KeyframeList.cpp:
(WebCore::KeyframeList::fillImplicitKeyframes):
2022-03-15 Zan Dobersek <zdobersek@igalia.com>
[GTK][WPE] Provide DMABuf-based composition layers, DMABufVideoSink integration
https://bugs.webkit.org/show_bug.cgi?id=237328
Reviewed by Alejandro G. Castro.
Introduce TextureMapperPlatformLayerProxyDMABuf, a TextureMapper proxy
implementation that handles platform layers backed by dmabuf objects.
This will be used to handle display of dmabuf producers like GStreamer
pipelines or ANGLE-backed WebGL contexts. The DMABufLayer class is the
platform layer object, handling display of the actual dmabuf. The proxy
itself is tasked with creating and caching such layers for any dmabuf
object that originates from the producer.
For each dmabuf object pushed into the proxy, the according DMABufLayer
object is spawned and cached for future reuse, expecting the producer
to be able to provide dmabufs from a pool or swapchain of these objects.
The cache is emptied whenever dmabufs go unused for a certain amount of
swaps, or if the size of the provided dmabufs changes.
DMABufFormat provides information for different DRM formats, for
instance how different planes for specific formats are formatted and
sized.
DMABufObject is a class that handles a given grouping of dmabufs
according to the specified format. It has an associated handle value,
size, and per-plane dmabuf file descriptors, offsets, strides and
modifiers, along with a DMABufReleaseFlag instance.
DMABufReleaseFlag objects are used as an eventfd-based release mechanism
that indicates to the producer that the given DMABufObject has been
presented and subsequently released and is thus available for reuse.
GBMBufferSwapchain provides a custom swapchain implementation that's
based on libgbm functionality. Each such swapchain has a capacity
specified during construction, with the capacities of four or eight
currently supported. getBuffer() is called by the producer to obtain a
buffer object that's then used for backing of specific content like
ANGLE execution or media's software-decoded video frames. Buffers
obtained this way are moved over to the end of the buffer array, with
the expectation of reusing them once they are released by the
composition engine.
MediaPlayerPrivateGStreamer implementation is enhanced to use the
recently-added WebKitDMABufVideoSink element if its use is enabled
through the development-purpose environment variable and if the
necessary GStreamer facilities are present on the system. When these
conditions are met, the Nicosia::ContentLayer instance is also
constructed with a TextureMapperPlatformLayerProxyDMABuf instance, since
we expect to present the dmabufs through that functionality.
With the WebKitDMABufVideoSink, the incoming samples are either based
on dmabufs (in case of dmabuf-capable hardware decoder) or are just raw
data (most likely coming from a software-based decoder). In case of
dmabufs we can use the GstMemory pointer as the handle through which
the relevant data is cached in TextureMapperPlatformLayerProxyDMABuf,
and upon the first occurrence we retrieve all the relevant dmabuf data
so that it can be used by that proxy implementation to construct a
renderable EGLImage.
In case of software-decoded raw data, we have to use the swapchain
object and copy the data on a per-plane basis for each such sample,
finally pushing the dmabuf data of that swapchain buffer into the
TextureMapperPlatformLayerProxyDMABuf instance.
* SourcesGTK.txt:
* SourcesWPE.txt:
* platform/TextureMapper.cmake:
* platform/graphics/gbm/DMABufFormat.h: Added.
(WebCore::DMABufFormatImpl::createFourCC):
(WebCore::DMABufFormat::planeWidth const):
(WebCore::DMABufFormat::planeHeight const):
(WebCore::DMABufFormat::Plane::Plane):
(WebCore::DMABufFormatImpl::createSinglePlaneRGBA):
(WebCore::DMABufFormatImpl::definePlane):
(WebCore::DMABufFormat::instantiate):
(WebCore::DMABufFormat::create):
* platform/graphics/gbm/DMABufObject.h: Added.
(WebCore::DMABufObject::DMABufObject):
(WebCore::DMABufObject::~DMABufObject):
(WebCore::DMABufObject::operator=):
* platform/graphics/gbm/DMABufReleaseFlag.h: Added.
(WebCore::DMABufReleaseFlag::DMABufReleaseFlag):
(WebCore::DMABufReleaseFlag::~DMABufReleaseFlag):
(WebCore::DMABufReleaseFlag::operator=):
(WebCore::DMABufReleaseFlag::dup const):
(WebCore::DMABufReleaseFlag::released const):
(WebCore::DMABufReleaseFlag::release):
* platform/graphics/gbm/GBMBufferSwapchain.cpp: Added.
(WebCore::GBMBufferSwapchain::GBMBufferSwapchain):
(WebCore::GBMBufferSwapchain::getBuffer):
(WebCore::GBMBufferSwapchain::Buffer::Buffer):
(WebCore::GBMBufferSwapchain::Buffer::createDMABufObject const):
(WebCore::GBMBufferSwapchain::Buffer::PlaneData::~PlaneData):
* platform/graphics/gbm/GBMBufferSwapchain.h: Added.
(WebCore::GBMBufferSwapchain::Buffer::handle const):
(WebCore::GBMBufferSwapchain::Buffer::numPlanes const):
(WebCore::GBMBufferSwapchain::Buffer::planeData const):
* platform/graphics/gstreamer/DMABufVideoSinkGStreamer.cpp:
(webKitDMABufVideoSinkIsEnabled):
(webKitDMABufVideoSinkSetMediaPlayerPrivate):
* platform/graphics/gstreamer/DMABufVideoSinkGStreamer.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
(WebCore::MediaPlayerPrivateGStreamer::platformLayer const):
(WebCore::fourccValue):
(WebCore::MediaPlayerPrivateGStreamer::pushDMABufToCompositor):
(WebCore::MediaPlayerPrivateGStreamer::triggerRepaint):
(WebCore::MediaPlayerPrivateGStreamer::createVideoSinkDMABuf):
(WebCore::MediaPlayerPrivateGStreamer::createVideoSink):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
* platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.cpp:
(Nicosia::ContentLayerTextureMapperImpl::createFactory):
* platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.h:
* platform/graphics/texmap/TextureMapperPlatformLayerProxyDMABuf.cpp: Added.
(WebCore::createImageKHR):
(WebCore::destroyImageKHR):
(WebCore::TextureMapperPlatformLayerProxyDMABuf::DMABufLayer::EGLImageData::~EGLImageData):
(WebCore::TextureMapperPlatformLayerProxyDMABuf::activateOnCompositingThread):
(WebCore::TextureMapperPlatformLayerProxyDMABuf::invalidate):
(WebCore::TextureMapperPlatformLayerProxyDMABuf::swapBuffer):
(WebCore::TextureMapperPlatformLayerProxyDMABuf::pushDMABuf):
(WebCore::TextureMapperPlatformLayerProxyDMABuf::DMABufLayer::DMABufLayer):
(WebCore::TextureMapperPlatformLayerProxyDMABuf::DMABufLayer::paintToTextureMapper):
(WebCore::TextureMapperPlatformLayerProxyDMABuf::DMABufLayer::createEGLImageData):
* platform/graphics/texmap/TextureMapperPlatformLayerProxyDMABuf.h: Added.
2022-03-15 Youenn Fablet <youenn@apple.com>
Rename VideoSampleMetadata to VideoFrameTimeMetadata
https://bugs.webkit.org/show_bug.cgi?id=237593
Reviewed by Eric Carlson.
We are going to rename videoSampleAvailable to videoFrameAvailable and move from passing MediaSample to VideoFrame.
We rename VideoSampleMetadata to VideoFrameTimeMetadata for consistency.
No change of behavior.
* Headers.cmake:
* Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
(WebCore::CanvasCaptureMediaStreamTrack::Source::captureCanvas):
* WebCore.xcodeproj/project.pbxproj:
* platform/VideoFrameTimeMetadata.h: Renamed from Source/WebCore/platform/VideoSampleMetadata.h.
(WebCore::VideoFrameTimeMetadata::encode const):
(WebCore::VideoFrameTimeMetadata::decode):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::videoSampleAvailable):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::processNewVideoSample):
* platform/graphics/gstreamer/MediaSampleGStreamer.cpp:
(WebCore::MediaSampleGStreamer::MediaSampleGStreamer):
(WebCore::MediaSampleGStreamer::createImageSample):
* platform/graphics/gstreamer/MediaSampleGStreamer.h:
(WebCore::MediaSampleGStreamer::create):
(WebCore::MediaSampleGStreamer::createImageSample):
* platform/graphics/gstreamer/VideoFrameMetadataGStreamer.cpp:
(webkitGstBufferSetVideoFrameTimeMetadata):
(webkitGstBufferSetVideoSampleMetadata): Deleted.
* platform/graphics/gstreamer/VideoFrameMetadataGStreamer.h:
* platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp:
(WebCore::MediaRecorderPrivateAVFImpl::videoSampleAvailable):
* platform/mediarecorder/MediaRecorderPrivateAVFImpl.h:
* platform/mediarecorder/MediaRecorderPrivateGStreamer.h:
* platform/mediarecorder/MediaRecorderPrivateMock.cpp:
(WebCore::MediaRecorderPrivateMock::videoSampleAvailable):
* platform/mediarecorder/MediaRecorderPrivateMock.h:
* platform/mediastream/RealtimeIncomingVideoSource.cpp:
(WebCore::RealtimeIncomingVideoSource::metadataFromVideoFrame):
* platform/mediastream/RealtimeIncomingVideoSource.h:
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::videoSampleAvailable):
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/RealtimeOutgoingVideoSource.h:
* platform/mediastream/RealtimeVideoCaptureSource.cpp:
(WebCore::RealtimeVideoCaptureSource::dispatchMediaSampleToObservers):
* platform/mediastream/RealtimeVideoCaptureSource.h:
* platform/mediastream/RealtimeVideoSource.cpp:
(WebCore::RealtimeVideoSource::videoSampleAvailable):
* platform/mediastream/RealtimeVideoSource.h:
* platform/mediastream/cocoa/DisplayCaptureSourceCocoa.cpp:
(WebCore::DisplayCaptureSourceCocoa::emitFrame):
* platform/mediastream/gstreamer/GStreamerCapturer.cpp:
(WebCore::GStreamerCapturer::createSource):
* platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
* platform/mediastream/gstreamer/MockRealtimeVideoSourceGStreamer.cpp:
(WebCore::MockDisplayCaptureSourceGStreamer::videoSampleAvailable):
(WebCore::MockRealtimeVideoSourceGStreamer::updateSampleBuffer):
* platform/mediastream/gstreamer/MockRealtimeVideoSourceGStreamer.h:
* platform/mediastream/libwebrtc/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.cpp:
(WebCore::RealtimeOutgoingVideoSourceLibWebRTC::videoSampleAvailable):
* platform/mediastream/libwebrtc/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
(WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer):
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
(WebCore::RealtimeOutgoingVideoSourceCocoa::videoSampleAvailable):
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h:
* testing/Internals.cpp:
(WebCore::Internals::videoSampleAvailable):
* testing/Internals.h:
2022-03-15 Youenn Fablet <youenn@apple.com>
Make sure to end any pending AudioSession interruption when activating it
https://bugs.webkit.org/show_bug.cgi?id=237654
<rdar://88405081>
Reviewed by Eric Carlson.
In some cases, we receive audio session interruptions without receiving any end of interruption notification.
In those cases, if we reactivate the audio session, we should end this pending interruption so that our WebCore code
gets its expected end of interruption message. This for instance allows to get back regular autoplay behavior.
Test: platform/ios/mediastream/getUserMedia-override-audio-session-interruption.html
* platform/audio/AudioSession.cpp:
* platform/audio/AudioSession.h:
* testing/Internals.cpp:
* testing/Internals.h:
* testing/Internals.idl:
2022-03-15 Youenn Fablet <youenn@apple.com>
AudioContext stops playing when minimizing or moving the macOS Safari window to the background.
https://bugs.webkit.org/show_bug.cgi?id=231105
<rdar://problem/83889697>
Reviewed by Eric Carlson.
AudioContext was stopped when minimizing windows if not playing audio as a way to reduce CPU usage.
But this is visible to users (if AudioContext produces audio through a track) or to web pages (use of audio worklet or script processor node).
Remove that code.
Small refactoring to remove isOfflineContext checks that can only be false in AudioContext.
Covered by existing tests.
* Modules/webaudio/AudioContext.cpp:
* Modules/webaudio/AudioContext.h:
2022-03-14 Wenson Hsieh <wenson_hsieh@apple.com>
[Mail compose] Allow copied resources with remote (HTTP/HTTPS) URLs to be pasted as attachments
https://bugs.webkit.org/show_bug.cgi?id=237810
rdar://90119983
Reviewed by Devin Rousso.
When creating attachments by pasting subresources with remote URLs, Mail compose in shipping macOS inserts such
subresources as attachments, which are sent as MIME parts alongside the rest of the Mail message. However, when
using the WebKit2 client-side attachment API, we currently leave remote (i.e. HTTP-family) URLs as-is, which
means they don't end up being sent as attachments.
I implemented this current behavior in r226340; back then, we opted to preserve the HTTP/HTTPS URL in pasted
resources over falling back to blob URL conversion. However, in order to match legacy Mail compose behavior, we
should've handled it by propagating the data as attachments to the client layer instead.
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::shouldReplaceSubresourceURL):
2022-03-14 Oriol Brufau <obrufau@igalia.com>
[css-cascade] Fix 'revert' on low-priority properties
https://bugs.webkit.org/show_bug.cgi?id=236272
Reviewed by Darin Adler.
Some CSS properties are low-priority (a.k.a deferred or applied in parse
order). The logic for the 'revert' keyword was not taking these into
account, so it just behaved as 'unset'.
That made elements like <del>, <ins>, <s> and <u> lose the line-through
or underline thet they get in UA origin, when styled with 'all: revert'
or 'text-decoration: revert'.
This patch takes these properties into account so that 'revert' works.
Tests: imported/w3c/web-platform-tests/css/css-cascade/all-prop-revert-layer-noop.html
imported/w3c/web-platform-tests/css/css-cascade/all-prop-revert-noop.html
* style/PropertyCascade.cpp:
(WebCore::Style::PropertyCascade::setDeferred):
* style/PropertyCascade.h:
(WebCore::Style::PropertyCascade::hasDeferredProperty const):
(WebCore::Style::PropertyCascade::deferredProperty const):
* style/StyleBuilder.cpp:
(WebCore::Style::Builder::applyProperty):
2022-03-14 Eric Carlson <eric.carlson@apple.com>
[macOS] Use sRGB colorspace in ScreenCaptureKitCaptureSource
https://bugs.webkit.org/show_bug.cgi?id=237855
<rdar://problem/90273792>
Reviewed by Jer Noble.
* platform/mediastream/mac/ScreenCaptureKitCaptureSource.mm:
(WebCore::ScreenCaptureKitCaptureSource::streamConfiguration): Configure
ScreenCaptureKit to capture in kCGColorSpaceSRGB.
2022-03-14 Oriol Brufau <obrufau@igalia.com>
Rename RenderStyle::textDecoration() to RenderStyle::textDecorationLine()
https://bugs.webkit.org/show_bug.cgi?id=237400
Reviewed by Darin Adler.
Before https://webkit.org/b/237175, the text-decoration-line and
text-decoration properties were 2 longhands that shared a computed
value, accessed via RenderStyle::textDecoration().
But now text-decoration is a proper shorthand of text-decoration-line.
So it doesn't make much sense to continue accessing the line via
textDecoration(), it should be textDecorationLine() instead.
Same for RenderStyle::setTextDecoration(), etc.
No tests since it's just a rename, no change in behavior.
* accessibility/atspi/AccessibilityObjectTextAtspi.cpp:
(WebCore::AccessibilityObjectAtspi::textAttributes const):
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
* css/CSSProperties.json:
* rendering/TextDecorationPainter.cpp:
(WebCore::collectStylesForRenderer):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::RenderStyle):
(WebCore::RenderStyle::changeAffectsVisualOverflow const):
(WebCore::RenderStyle::changeRequiresRepaintIfTextOrBorderOrOutline const):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::textDecorationsInEffect const):
(WebCore::RenderStyle::textDecorationLine const):
(WebCore::RenderStyle::addToTextDecorationsInEffect):
(WebCore::RenderStyle::setTextDecorationsInEffect):
(WebCore::RenderStyle::setTextDecorationLine):
(WebCore::RenderStyle::initialTextDecorationLine):
(WebCore::RenderStyle::InheritedFlags::operator== const):
(WebCore::RenderStyle::textDecoration const): Deleted.
(WebCore::RenderStyle::setTextDecoration): Deleted.
(WebCore::RenderStyle::initialTextDecoration): Deleted.
* rendering/style/RenderStyleConstants.h:
* rendering/style/StyleVisualData.cpp:
(WebCore::StyleVisualData::StyleVisualData):
* rendering/style/StyleVisualData.h:
(WebCore::StyleVisualData::operator== const):
* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::findRendererDefininingTextDecoration):
* style/InlineTextBoxStyle.cpp:
(WebCore::minLogicalTopForTextDecorationLine):
(WebCore::maxLogicalBottomForTextDecorationLine):
(WebCore::enclosingRendererWithTextDecoration):
* style/StyleAdjuster.cpp:
(WebCore::Style::Adjuster::adjust const):
* style/StyleBuilderConverter.h:
(WebCore::Style::BuilderConverter::convertTextDecorationLine):
(WebCore::Style::BuilderConverter::convertTextDecoration): Deleted.
2022-03-14 Antoine Quint <graouts@webkit.org>
[model] <model interactive> doesn't allow model to be rotated on iOS
https://bugs.webkit.org/show_bug.cgi?id=237831
rdar://89698247
Reviewed by Simon Fraser.
A <model> element is *not* interactive by default and the "interactive" HTML attribute
must be set explicitly. We used to mirror this initial disabled state by explicitly
setting "userInteractionEnabled" to NO on WKModelView during its creation, and we would
update that property when HTMLModelElement::isInteractive() would change value.
However, in the case where the attribute was originally set, we would completely
disregard that value.
We now account for it when we create the GraphicsLayer for the <model> element, letting the
existing GraphicsLayer machinery to set the matching "userInteractionEnabled" property on
the WKModelView.
* Modules/model-element/HTMLModelElement.h:
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::setContentsToModel):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setContentsToModel):
* platform/graphics/ca/GraphicsLayerCA.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateConfiguration):
2022-03-14 Oriol Brufau <obrufau@igalia.com>
[css] Implement 'text-decoration' as a shorthand.
https://bugs.webkit.org/show_bug.cgi?id=237175
Reviewed by Darin Adler.
The 'text-decoration' property was considered to be a longhand, sharing
a computed value with 'text-decoration-line'.
This patch switches 'text-decoration' to be shorthand instead.
According to the CSS Text Decoration spec, the longhands should be
'text-decoration-line', 'text-decoration-thickness',
'text-decoration-style' and 'text-decoration-color'.
I tried that in https://commits.webkit.org/r290756, but it got reverted
because of a performance regression. So as a first step, here I'm making
'text-decoration-line' be the only longhand.
There is a bunch of editing code that was getting/setting/removing
'text-decoration' as a longhand, so I'm switching that to instead
use 'text-decoration-line'.
Tests: fast/css/getComputedStyle/computed-style.html
fast/css/getComputedStyle/computed-style-without-renderer.html
fast/css/getComputedStyle/getComputedStyle-text-decoration.html
fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand.html
imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml.html
imported/w3c/web-platform-tests/css/css-variables/variable-presentation-attribute.html
imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree.html
svg/css/getComputedStyle-basic.xhtml
* css/CSSProperties.json:
* css/StyleProperties.cpp:
(WebCore::StyleProperties::getPropertyValue const):
(WebCore::StyleProperties::asText const):
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::CSSPropertyParser::parseShorthand):
* editing/EditingStyle.cpp:
(WebCore::HTMLTextDecorationEquivalent::HTMLTextDecorationEquivalent):
(WebCore::EditingStyle::init):
(WebCore::EditingStyle::styleWithResolvedTextDecorations const):
(WebCore::EditingStyle::collapseTextDecorationProperties):
(WebCore::textDecorationValueList):
(WebCore::EditingStyle::conflictsWithInlineStyleOfElement const):
(WebCore::EditingStyle::styleIsPresentInComputedStyleOfNode const):
(WebCore::EditingStyle::mergeStyle):
(WebCore::reconcileTextDecorationProperties):
(WebCore::StyleChange::StyleChange):
(WebCore::StyleChange::extractTextStyles):
(WebCore::extractPropertiesNotIn):
* editing/cocoa/HTMLConverter.mm:
(HTMLConverterCaches::propertyValueForNode):
(HTMLConverter::computedAttributesForElement):
* editing/ios/EditorIOS.mm:
(WebCore::Editor::removeUnchangeableStyles):
* editing/markup.cpp:
(WebCore::serializePreservingVisualAppearanceInternal):
* style/PropertyAllowlist.cpp:
(WebCore::Style::isValidCueStyleProperty):
2022-03-14 Tim Nguyen <ntim@apple.com>
REGRESSION(r289850): Bundle size has increased
https://bugs.webkit.org/show_bug.cgi?id=237844
Unreviewed, fully revert r289850.
* Makefile:
* WebCore.xcodeproj/project.pbxproj:
2022-03-14 Gabriel Nava Marino <gnavamarino@apple.com>
Don't create a scroll corner without renderer
https://bugs.webkit.org/show_bug.cgi?id=237837
Reviewed by Simon Fraser.
Don't create a scroll corner without renderer, as renderer document is needed to create one.
Also destroy the scroll corner early when RenderView is available.
* page/FrameView.cpp:
(WebCore::FrameView::willBeDestroyed):
(WebCore::FrameView::updateScrollCorner):
2022-03-14 Tyler Wilcock <tyler_w@apple.com>
AX: Move addChildren, addChild, insertChild, canHaveChildren, setNeedsToUpdateChildren, setNeedsToUpdateSubtree, clearChildren, and needsToUpdateChildren out of AXCoreObject interface
https://bugs.webkit.org/show_bug.cgi?id=237801
Reviewed by Andres Gonzalez.
All of these virtual methods are ASSERT_NOT_REACHED no-ops for AXIsolatedObjects,
so this patch moves them to AccessibilityObject.h instead.
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::addChildren):
(WebCore::AccessibilityObject::canHaveChildren const):
(WebCore::AccessibilityObject::setNeedsToUpdateChildren):
(WebCore::AccessibilityObject::setNeedsToUpdateSubtree):
(WebCore::AccessibilityObject::needsToUpdateChildren const):
* accessibility/AccessibilityObjectInterface.h:
* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::addChildren): Deleted.
(WebCore::AXIsolatedObject::addChild): Deleted.
(WebCore::AXIsolatedObject::insertChild): Deleted.
(WebCore::AXIsolatedObject::canHaveChildren const): Deleted.
(WebCore::AXIsolatedObject::setNeedsToUpdateChildren): Deleted.
(WebCore::AXIsolatedObject::setNeedsToUpdateSubtree): Deleted.
(WebCore::AXIsolatedObject::clearChildren): Deleted.
(WebCore::AXIsolatedObject::needsToUpdateChildren const): Deleted.
* accessibility/isolatedtree/AXIsolatedObject.h:
2022-03-14 Antoine Quint <graouts@webkit.org>
[web-animations] marker-start should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237826
Reviewed by Antti Koivisto.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2022-03-14 Antoine Quint <graouts@webkit.org>
[web-animations] marker-mid should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237825
Reviewed by Antti Koivisto.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2022-03-14 Antoine Quint <graouts@webkit.org>
[web-animations] marker-end should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237824
Reviewed by Antti Koivisto.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2022-03-14 Enrique Ocaña González <eocanha@igalia.com>
[MSE][SourceBuffer] Fix removal of paddings from buffered range
https://bugs.webkit.org/show_bug.cgi?id=237780
Reviewed by Jer Noble.
When removing a range ending up in a sample S2 which overlaps slightly with a
previous one S1 but still extends beyond the removal range, the buffered range
computing algorithm can become confused removing the range paddings and
completely skip the S2 sample (instead of accounting it as part of the still
buffered ranges). The sample S2 is leaked and becomes unnoticed in the buffered
ranges.
This patch changes the way in which buffered ranges boundaries are computed in
such cases.
This patch is authored by Eugene Mutavchi <Ievgen_Mutavchi@comcast.com>
See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/797#discussion_r818973424
Test: media/media-source/media-source-remove-overlapped.html
* platform/graphics/SourceBufferPrivate.cpp: End the additionalErasedRanges iterator in removeSamplesFromTrackBuffer() in a sample starting after erasedStart, instead of starting on or after erasedEnd.
2022-03-14 Kimmo Kinnunen <kkinnunen@apple.com>
WebGL context should use discrete gpu if the context is created when the window is on external monitor, ANGLE Metal backend
https://bugs.webkit.org/show_bug.cgi?id=236487
Reviewed by Kenneth Russell.
Add GraphicsContextGLAttributes::windowGPUID which describes the GPU ID
for the window that the context is on.
Create the ANGLE Metal context based on this, unless high-performance GPU
is requested.
Changes the behavior so that new WebGL contexts will use dgpu is always when user has
external display plugged in. The system changes all the windows to the dgpu, so
this is consistent with the system expectation.
Notable difference due to the above is that we get different layout tests for a developer
that has a external monitor than before.
Tested by new unit tests.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create):
* page/Chrome.cpp:
(WebCore::Chrome::createGraphicsContextGL const):
* page/ChromeClient.cpp:
(WebCore::ChromeClient::createGraphicsContextGL const):
* page/ChromeClient.h:
* platform/PlatformScreen.h:
* platform/ScreenProperties.h:
(WebCore::ScreenData::decode):
* platform/graphics/GraphicsContextGLAttributes.h:
(WebCore::GraphicsContextGLAttributes::encode const):
(WebCore::GraphicsContextGLAttributes::decode):
* platform/graphics/cocoa/GraphicsContextGLCocoa.mm:
(WebCore::initializeEGLDisplay):
* platform/mac/PlatformScreenMac.mm:
(WebCore::collectScreenProperties):
(WebCore::primaryGPUID):
(WebCore::gpuIDForDisplay):
(WebCore::gpuIDForDisplayMask):
2022-03-14 Zan Dobersek <zdobersek@igalia.com>
Unreviewed, fixing an incomplete-type build error in InlineIteratorLine
https://bugs.webkit.org/show_bug.cgi?id=237822
* layout/integration/InlineIteratorLine.h:
Add the missing RenderBlockFlow.h include to avoid incomplete-type
error in InlineIterator::Line::selectionPhysicalRect() that might occur
when unified sources are sorted some other way.
2022-03-12 Jean-Yves Avenard <jya@apple.com>
Safari produces scrambled output for some webm videos with vp8 codec.
https://bugs.webkit.org/show_bug.cgi?id=236754
rdar://80869041
Reviewed by Eric Carlson.
The MediaFormatReader plugin and the MSE SourceBufferPrivate are using
a SampleMap to store all the media samples timing information: one sorted
by DTS order and the other in PTS order.
Those SampleMap use the sample's presentation time as unique key.
The VP8 codec can define hidden samples that are to be fed to the decoder
but will not decode into an actual image. Those samples are typically
packed together in the webm container in two or more consecutive blocks
with the same presentation time (similar behaviour can also be found in
webm where multiple frames may be stored with the same presentation
time).
When stored in the SampleMap, only the latest sample added would be kept
after overwriting the previous one with the same time.
To get around this issue, we pack all samples with the same presentation
time in a single MediaSamplesBlock so that they can be stored together in
the map without any losses.
Upon decoding, all those sub-samples will be retrieved and fed to the
decoder.
The CoreMedia MediaFormatReader backend however has a bug where it will
enter in an infinite if we return successive frames with the same
timestamp which will cause memory exhaustion and a crash.
To get around this, we make the grouped samples appear as discrete,
making each hidden sample have a duration of 1us followed by the
visible frames (which will see its duration shorten by 1us).
Tests: media/media-source/media-source-vp8-hiddenframes.html
media/media-vp8-hiddenframes.html
New tests had to be disabled due to bug 236755. We currently have no
way to guarantee which frame is currently displayed after either a seek
operation or reaching the end of playback.
* platform/MediaSample.h:
(WebCore::MediaSamplesBlock::append):
(WebCore::MediaSamplesBlock::clear):
* platform/graphics/cocoa/SourceBufferParserWebM.cpp:
(WebCore::WebMParser::parse):
(WebCore::WebMParser::OnFrame):
(WebCore::WebMParser::flushPendingVideoSamples):
(WebCore::WebMParser::VideoTrackData::resetCompletedFramesState):
(WebCore::WebMParser::VideoTrackData::consumeFrameData):
(WebCore::WebMParser::VideoTrackData::processPendingMediaSamples):
(WebCore::WebMParser::VideoTrackData::flushPendingSamples):
(WebCore::WebMParser::AudioTrackData::consumeFrameData):
* platform/graphics/cocoa/SourceBufferParserWebM.h:
(WebCore::WebMParser::TrackData::consumeFrameData):
(WebCore::WebMParser::TrackData::resetCompletedFramesState):
(WebCore::WebMParser::TrackData::drainPendingSamples):
2022-03-12 Alan Bujtas <zalan@apple.com>
[IFC][Integration] Add InlineIterator::Line::selectionPhysicalRect
https://bugs.webkit.org/show_bug.cgi?id=237796
Reviewed by Antti Koivisto.
Introduce selectionPhysicalRect() so that the clients don't need to convert/flip the logical coords and
also rename selectionRect() to selectionLogicalRect() to clear up any ambiguity.
* editing/VisiblePosition.cpp:
(WebCore::VisiblePosition::absoluteSelectionBoundsForLine const):
* layout/integration/InlineIteratorLine.h:
(WebCore::InlineIterator::Line::selectionLogicalRect const):
(WebCore::InlineIterator::Line::selectionPhysicalRect const):
(WebCore::InlineIterator::Line::selectionRect const): Deleted.
* rendering/CaretRectComputation.cpp:
(WebCore::computeCaretRectForLinePosition):
2022-03-12 Alan Bujtas <zalan@apple.com>
[IFC][Integration] Replace generic InlineIterator::Line::legacyRootInlineBox() with 2 dedicated functions
https://bugs.webkit.org/show_bug.cgi?id=237807
Reviewed by Antti Koivisto.
* layout/integration/InlineIteratorLine.h:
(WebCore::InlineIterator::Line::containingFragment const):
(WebCore::InlineIterator::Line::isFirstAfterPageBreak const):
(WebCore::InlineIterator::Line::legacyRootInlineBox const): Deleted.
* layout/integration/InlineIteratorLineLegacyPath.h:
(WebCore::InlineIterator::LineIteratorLegacyPath::containingFragment const):
(WebCore::InlineIterator::LineIteratorLegacyPath::isFirstAfterPageBreak const):
(WebCore::InlineIterator::LineIteratorLegacyPath::legacyRootInlineBox const): Deleted.
* layout/integration/InlineIteratorLineModernPath.h:
(WebCore::InlineIterator::LineIteratorModernPath::containingFragment const):
(WebCore::InlineIterator::LineIteratorModernPath::isFirstAfterPageBreak const):
(WebCore::InlineIterator::LineIteratorModernPath::legacyRootInlineBox const): Deleted.
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::positionForPointWithInlineChildren):
* rendering/RenderLineBreak.cpp:
(WebCore::RenderLineBreak::collectSelectionGeometries):
2022-03-12 Tim Horton <timothy_horton@apple.com>
Adopt FALLBACK_PLATFORM_NAME in place of FALLBACK_PLATFORM
https://bugs.webkit.org/show_bug.cgi?id=237809
Reviewed by Per Arne Vollan.
* Configurations/SDKVariant.xcconfig:
2022-03-12 Alan Bujtas <zalan@apple.com>
[IFC][Integration] previousLinePosition/nextLinePosition should use Line::lineBoxHeight
https://bugs.webkit.org/show_bug.cgi?id=237788
Reviewed by Antti Koivisto.
Line::lineBoxHeight() should be sufficient for checking if the line is empty for VisualPosition.
* editing/VisibleUnits.cpp:
(WebCore::previousLinePosition):
(WebCore::nextLinePosition):
* layout/integration/InlineIteratorLine.h:
(WebCore::InlineIterator::Line::lineBoxHeight const):
(WebCore::InlineIterator::Line::logicalHeight const): Deleted.
* layout/integration/InlineIteratorLineLegacyPath.h:
(WebCore::InlineIterator::LineIteratorLegacyPath::contentLogicalRight const):
(WebCore::InlineIterator::LineIteratorLegacyPath::logicalHeight const): Deleted.
* layout/integration/InlineIteratorLineModernPath.h:
(WebCore::InlineIterator::LineIteratorModernPath::contentLogicalRight const):
(WebCore::InlineIterator::LineIteratorModernPath::logicalHeight const): Deleted.
2022-03-12 Alan Bujtas <zalan@apple.com>
[IFC][Integration] RenderBlockFlow::findClosestTextAtAbsolutePoint should use root inline box iterator
https://bugs.webkit.org/show_bug.cgi?id=237786
Reviewed by Antti Koivisto.
Let's remove root inline box APIs from the line iterator interface.
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::findClosestTextAtAbsolutePoint): Replace line iterator with root inline box iterator
and check whether the local point is in between these root inline boxes.
2022-03-11 Per Arne Vollan <pvollan@apple.com>
[macOS] Image decoders should be restricted for Mail
https://bugs.webkit.org/show_bug.cgi?id=237717
<rdar://89827733>
Reviewed by Geoffrey Garen.
Use correct prefix for static member.
* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::ImageDecoderCG::enableRestrictedDecoding):
(WebCore::ImageDecoderCG::restrictedDecodingEnabled):
* platform/graphics/cg/ImageDecoderCG.h:
2022-03-11 Wenson Hsieh <wenson_hsieh@apple.com>
Refactor the filter block in DocumentMarkerController::filterMarkers() to return an enum type
https://bugs.webkit.org/show_bug.cgi?id=237794
Reviewed by Megan Gardner.
Change the return value of the `filter` function argument in `filterMarkers()` from a `bool` to a named enum
type with 2 values: `Keep` or `Remove`; this makes it more obvious to call sites whether the return value will
cause document markers to remain or be removed from the document.
* dom/DocumentMarkerController.cpp:
(WebCore::DocumentMarkerController::filterMarkers):
(WebCore::DocumentMarkerController::removeMarkers):
* dom/DocumentMarkerController.h: Remove a FIXME and comment that's no longer needed.
2022-03-11 Alex Christensen <achristensen@webkit.org>
Finish implementing modify-headers actions for WKContentRuleList SPI
https://bugs.webkit.org/show_bug.cgi?id=237784
<rdar://72433048>
Reviewed by Tim Hatcher.
I hadn't implemented regex substitution yet.
* contentextensions/ContentExtensionActions.cpp:
(WebCore::ContentExtensions::RedirectAction::parse):
(WebCore::ContentExtensions::RedirectAction::serialize const):
(WebCore::ContentExtensions::RedirectAction::deserialize):
(WebCore::ContentExtensions::RedirectAction::applyToRequest):
(WebCore::ContentExtensions::RedirectAction::RegexSubstitutionAction::serialize const):
(WebCore::ContentExtensions::RedirectAction::RegexSubstitutionAction::deserialize):
(WebCore::ContentExtensions::makeJSString):
(WebCore::ContentExtensions::RedirectAction::RegexSubstitutionAction::applyToURL const):
* contentextensions/ContentExtensionActions.h:
(WebCore::ContentExtensions::add):
* contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::loadAction):
(WebCore::ContentExtensions::loadRule):
2022-03-11 Nikolaos Mouchtaris <nmouchtaris@apple.com>
[iOS] Fix ovserscroll-behavior for main document
https://bugs.webkit.org/show_bug.cgi?id=237696
Reviewed by Simon Fraser.
Make getters for overscroll behavior public.
Test: fast/scrolling/ios/overscroll-behavior-on-body.html
* page/scrolling/ScrollingTreeScrollingNode.h:
2022-03-11 Per Arne Vollan <pvollan@apple.com>
[macOS] Image decoders should be restricted for Mail
https://bugs.webkit.org/show_bug.cgi?id=237717
<rdar://89827733>
Reviewed by Geoffrey Garen.
Only add restricted decoding flag when it is explicitly requested.
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::createImageSourceOptions):
(WebCore::ImageDecoderCG::enableRestrictedDecoding):
(WebCore::ImageDecoderCG::restrictedDecodingEnabled):
* platform/graphics/cg/ImageDecoderCG.h:
2022-03-11 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Add support for -[UITextInput removeEmojiAlternatives] on WKContentView
https://bugs.webkit.org/show_bug.cgi?id=237742
rdar://89647018
Reviewed by Kate Cheney.
Add plumbing to AlternativeTextUIController and AlternativeTextContextController to replace an existing
DictationContext's NSTextAlternatives; passing in a nil NSTextAlternatives simply removes the DictationContext
and its existing text alternatives.
See WebKit ChangeLog for more details.
Tests: TextAlternatives.AddAndRemoveTextAlternativesWithMatch
TextAlternatives.AddAndRemoveTextAlternativesWithTextAndEmojis
* dom/DocumentMarkerController.h:
Drive-by fix: adjust a comment to reflect the actual behavior in DocumentMarkerController, and also add a FIXME
to replace the `bool` return type with an enum type.
* editing/cocoa/AlternativeTextContextController.h:
* editing/cocoa/AlternativeTextContextController.mm:
(WebCore::AlternativeTextContextController::replaceAlternatives):
* editing/cocoa/AlternativeTextUIController.h:
* editing/cocoa/AlternativeTextUIController.mm:
(WebCore::AlternativeTextUIController::replaceAlternatives):
2022-03-11 J Pascoe <j_pascoe@apple.com>
[WebAuthn] Support authenticatorSelection.residentKey ResidentKeyRequirement
https://bugs.webkit.org/show_bug.cgi?id=237567
rdar://89788378
Reviewed by Brent Fulgham and Chris Dumez.
In Web Authentication level one, relying parties can specify authenticatorSelection.residentKeyRequired,
to signify they require a client-side discoverable credential. However, if the authenticator does not
support client-side discoverable credentials, the rp has no way to clarify they want a client-side
discoverable credential only if available.
This patch implements authenticatorSelection.residentKeyRequired introduced in level 2, which has three
values 'Preferred', 'Required', and 'Discouraged'. This allows RPs to create a client-side discoverable
credential if possible.
* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Modules/webauthn/PublicKeyCredentialCreationOptions.h:
(WebCore::PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::encode const):
(WebCore::PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::decode):
* Modules/webauthn/PublicKeyCredentialCreationOptions.idl:
* Modules/webauthn/ResidentKeyRequirement.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKAuthenticatorSelectionCriteria.mm.
* Modules/webauthn/ResidentKeyRequirement.idl: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKAuthenticatorSelectionCriteria.mm.
* Modules/webauthn/fido/AuthenticatorSupportedOptions.cpp:
(fido::AuthenticatorSupportedOptions::setResidentKeyAvailability):
(fido::convertToCBOR):
(fido::AuthenticatorSupportedOptions::setSupportsResidentKey): Deleted.
* Modules/webauthn/fido/AuthenticatorSupportedOptions.h:
* Modules/webauthn/fido/DeviceRequestConverter.cpp:
(fido::encodeMakeCredenitalRequestAsCBOR):
* Modules/webauthn/fido/DeviceRequestConverter.h:
* Modules/webauthn/fido/DeviceResponseConverter.cpp:
(fido::readCTAPGetInfoResponse):
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
2022-03-11 Ben Nham <nham@apple.com>
Fix WebContent jetsam that occurs when selecting text in a large e-mail
https://bugs.webkit.org/show_bug.cgi?id=237698
Reviewed by Simon Fraser.
When selecting text in a large e-mail in MobileMail, we often jetsam. This is due to this
chain of events:
1. If the selection extends enough to start causing the content to pan (which is easy
to do when zoomed in on the mail content), then AutoscrollController ends up changing
the scroll position of the FrameView to perform the pan.
2. FrameView::requestScrollPositionUpdate tries to prepopulate tiles around the endpoint
of the pan by calling TileController::prepopulateRect with visibleContentRect's size.
The problem is that MobileMail resizes their web view (and therefore FrameView) to match
the size of the content. This causes FrameView's visibleContentRect to be very large (>100k
pts high for some emails). As a result, we end up prepopulating every single tile in the
email, causing a huge spike in IOSurface memory usage that leads to a jetsam.
To fix this, we make FrameView::requestScrollPositionUpdate act more like
RenderLayerCompositor::visibleRectForLayerFlushing. In particular, on iOS, we now use
exposedContentRect instead of visibleContentRect. Since exposedContentRect is derived from
contentOffset/contentSize of the scroll view in the UIProcess, it's more correct and is much
smaller than visibleContentRect in this case.
* page/FrameView.cpp:
(WebCore::FrameView::requestScrollPositionUpdate):
2022-03-11 Brandon Stewart <brandonstewart@apple.com>
Verify values before adding to hash map
https://bugs.webkit.org/show_bug.cgi?id=237781
Reviewed by Simon Fraser.
Verify values before adding to hash map to avoid hash map corruption.
Original patch by John Cunningham
* page/scrolling/ScrollSnapOffsetsInfo.cpp:
(WebCore::updateSnapOffsetsForScrollableArea):
2022-03-11 Antoine Quint <graouts@webkit.org>
[web-animations] shape-rendering should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237767
Reviewed by Antti Koivisto.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2022-03-11 Antoine Quint <graouts@webkit.org>
[web-animations] vector-effect should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237766
Reviewed by Antti Koivisto.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2022-03-11 Alan Bujtas <zalan@apple.com>
[IFC][Integration] Add support for inline table
https://bugs.webkit.org/show_bug.cgi?id=237498
Reviewed by Antti Koivisto.
This patch enables inline tables for IFC
e.g.
<div>inline content with <table style="display: inline-table">table</table></div>
We treat the inline table as any other atomic inline level box with synthetic baseline.
* layout/integration/LayoutIntegrationBoxTree.cpp:
(WebCore::LayoutIntegration::BoxTree::buildTree):
* layout/integration/LayoutIntegrationCoverage.cpp:
(WebCore::LayoutIntegration::canUseForChild):
* layout/integration/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::updateInlineTableDimensions):
(WebCore::LayoutIntegration::LineLayout::updateLayoutBoxDimensions):
* layout/integration/LayoutIntegrationLineLayout.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutModernLines):
2022-03-11 Youenn Fablet <youenn@apple.com>
Do capture video frame downsampling in GPUProcess
https://bugs.webkit.org/show_bug.cgi?id=237316
<rdar://problem/89959777>
Reviewed by Eric Carlson.
To prevent some flakinesses, we now compute the video frame size from MediaSample given to rvfc metadata.
We stop making requestToEnd as virtual by introducing a virtual endProducingData method.
RealtimeMediaSource::end calls the new endProducingData virtual method, which is stop by default.
RealtimeVideoSource::endProducingData is implemented by calling requestToEnd on the underlying source.
This makes sure that ending a source will not end a related cloned source.
Covered by existing tests.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
* platform/mediastream/RealtimeMediaSource.cpp:
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/RealtimeVideoSource.cpp:
* platform/mediastream/RealtimeVideoSource.h:
2022-03-11 Antoine Quint <graouts@webkit.org>
[web-animations] text-anchor should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237765
Reviewed by Antti Koivisto.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2022-03-11 Antoine Quint <graouts@webkit.org>
[web-animations] stroke-linejoin should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237764
Reviewed by Antti Koivisto.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2022-03-11 Antoine Quint <graouts@webkit.org>
[web-animations] stroke-linecap should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237763
Reviewed by Antti Koivisto.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2022-03-11 Rob Buis <rbuis@igalia.com>
Rename invalidation methods in SVGElement
https://bugs.webkit.org/show_bug.cgi?id=237716
Reviewed by Martin Robinson.
Rename invalidation methods in SVGElement to be more specific. This in fact
uses the naming in the underlying ElementData.
* svg/SVGCircleElement.cpp:
(WebCore::SVGCircleElement::svgAttributeChanged):
* svg/SVGElement.cpp:
(WebCore::SVGElement::commitPropertyChange):
* svg/SVGElement.h:
* svg/SVGElementInlines.h:
(WebCore::SVGElement::setAnimatedSVGAttributesAreDirty):
(WebCore::SVGElement::setPresentationalHintStyleIsDirty):
(WebCore::SVGElement::invalidateSVGAttributes): Deleted.
(WebCore::SVGElement::invalidateSVGPresentationalHintStyle): Deleted.
* svg/SVGEllipseElement.cpp:
(WebCore::SVGEllipseElement::svgAttributeChanged):
* svg/SVGFilterElement.cpp:
(WebCore::SVGFilterElement::svgAttributeChanged):
* svg/SVGForeignObjectElement.cpp:
(WebCore::SVGForeignObjectElement::svgAttributeChanged):
* svg/SVGImageElement.cpp:
(WebCore::SVGImageElement::svgAttributeChanged):
* svg/SVGMaskElement.cpp:
(WebCore::SVGMaskElement::svgAttributeChanged):
* svg/SVGPatternElement.cpp:
(WebCore::SVGPatternElement::svgAttributeChanged):
* svg/SVGRectElement.cpp:
(WebCore::SVGRectElement::svgAttributeChanged):
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::svgAttributeChanged):
* svg/properties/SVGAttributeAnimator.cpp:
(WebCore::SVGAttributeAnimator::invalidateStyle):
2022-03-11 Antoine Quint <graouts@webkit.org>
[web-animations] mask-repeat should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237771
Reviewed by Antti Koivisto.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::setMaskRepeatX):
(WebCore::RenderStyle::setMaskRepeatY):
2022-03-11 Antoine Quint <graouts@webkit.org>
[web-animations] mask-mode should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237770
Reviewed by Antti Koivisto.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2022-03-11 Antoine Quint <graouts@webkit.org>
[web-animations] mask-composite should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237769
Reviewed by Antti Koivisto.
Refactor FillLayerFillBoxPropertyWrapper to a templatized DiscreteFillLayerPropertyWrapper
which allows us to support other enum types like CompositeOperator.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2022-03-11 Antoine Quint <graouts@webkit.org>
[web-animations] mask-type should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237768
Reviewed by Antti Koivisto.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2022-03-11 Antoine Quint <graouts@webkit.org>
[web-animations] text-rendering should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237777
Reviewed by Antti Koivisto.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2022-03-11 Antoine Quint <graouts@webkit.org>
[web-animations] refactor discrete FontCascadeDescription to use dedicated animation wrappers
https://bugs.webkit.org/show_bug.cgi?id=237776
Reviewed by Antti Koivisto.
We added getters and setters on RenderStyle for properties exposed on FontCascadeDescription
solely for the purpose of animation support. Instead, we add a couple of dedicated animation
wrapper that removes the methods from RenderStyle and do all the work in
CSSPropertyAnimation.cpp.
The base class DiscreteFontDescriptionWrapper and is used for CSS properties backed by several
FontCascadeDescription methods.
The subclass DiscreteFontDescriptionTypedWrapper is used for CSS properties backed by a single
FontCascadeDescrption method dealing with a simple type.
* animation/CSSPropertyAnimation.cpp:
(WebCore::DiscreteFontDescriptionWrapper::DiscreteFontDescriptionWrapper):
(WebCore::DiscreteFontDescriptionWrapper::propertiesInFontDescriptionAreEqual const):
(WebCore::DiscreteFontDescriptionWrapper::setPropertiesInFontDescription const):
(WebCore::DiscreteFontDescriptionTypedWrapper::DiscreteFontDescriptionTypedWrapper):
(WebCore::DiscreteFontDescriptionTypedWrapper::value const):
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::setFontPalette):
(WebCore::RenderStyle::setFontKerning): Deleted.
(WebCore::RenderStyle::setFontFeatureSettings): Deleted.
(WebCore::RenderStyle::setFontFamilies): Deleted.
(WebCore::RenderStyle::setFontSynthesis): Deleted.
(WebCore::RenderStyle::setFontVariantAlternates): Deleted.
(WebCore::RenderStyle::setFontVariantPosition): Deleted.
(WebCore::RenderStyle::setFontVariantCaps): Deleted.
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::fontPalette const):
(WebCore::RenderStyle::fontKerning const): Deleted.
(WebCore::RenderStyle::fontFeatureSettings const): Deleted.
(WebCore::RenderStyle::fontFamilies const): Deleted.
(WebCore::RenderStyle::fontSynthesis const): Deleted.
(WebCore::RenderStyle::fontVariantAlternates const): Deleted.
(WebCore::RenderStyle::fontVariantPosition const): Deleted.
(WebCore::RenderStyle::fontVariantCaps const): Deleted.
2022-03-11 Philippe Normand <pnormand@igalia.com>
[GStreamer] Allow AOM AV1 decoder and check for hardware AV1 decoders as well
https://bugs.webkit.org/show_bug.cgi?id=237713
Reviewed by Xabier Rodriguez-Calvar.
The AOM AV1 decoder performs better nowadays. Also it seems hardware-accelerated decoders
are appearing, so we should check for this as well.
* platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:
(WebCore::GStreamerRegistryScanner::initializeDecoders):
2022-03-11 Antti Koivisto <antti@apple.com>
[CSS Container Queries] Only apply inline-size containment when it is allowed
https://bugs.webkit.org/show_bug.cgi?id=237761
Reviewed by Antoine Quint.
"Giving an element inline-size containment has no effect if any of the following are true:
if the element does not generate a principal box (as is the case with display: contents or display: none)
if its inner display type is table
if its principal box is an internal table box
if its principal box is an internal ruby box or a non-atomic inline-level box"
https://drafts.csswg.org/css-contain-3/#containment-inline-size
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
Check for valid inline-size containment.
* rendering/RenderObject.cpp:
(WebCore::shouldApplyInlineSizeContainment):
* rendering/RenderObject.h:
* style/ContainerQueryEvaluator.cpp:
(WebCore::Style::ContainerQueryEvaluator::selectContainer const):
Cleanups.
(WebCore::Style::ContainerQueryEvaluator::evaluateSizeFeature const):
Check for valid size containment for the type, evaluate to unknown if it doesn't exist.
Also check layout containment.
2022-03-11 Zan Dobersek <zdobersek@igalia.com>
Unreviewed isInGPUProcess() fix after 248209@main
https://bugs.webkit.org/show_bug.cgi?id=237762
* platform/RuntimeApplicationChecks.h:
(WebCore::isInGPUProcess): Define isInGPUProcess() in all cases but
return false if ENABLE_GPU_PROCESS is disabled.
2022-03-11 Antoine Quint <graouts@webkit.org>
[web-animations] refactor discrete SVG properties to use a dedicated animation wrapper
https://bugs.webkit.org/show_bug.cgi?id=237760
Reviewed by Antti Koivisto.
We added getters and setters on RenderStyle for properties exposed on SVGRenderStyle
solely for the purpose of animation support. Instead, we add a dedicated animation
wrapper that removes the methods from RenderStyle and do all the work in
CSSPropertyAnimation.cpp. This will be beneficial for future SVG properties
with discrete animation support that are yet to be added.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::clipRule const): Deleted.
(WebCore::RenderStyle::setClipRule): Deleted.
(WebCore::RenderStyle::colorInterpolation const): Deleted.
(WebCore::RenderStyle::setColorInterpolation): Deleted.
(WebCore::RenderStyle::colorInterpolationFilters const): Deleted.
(WebCore::RenderStyle::setColorInterpolationFilters): Deleted.
(WebCore::RenderStyle::dominantBaseline const): Deleted.
(WebCore::RenderStyle::setDominantBaseline): Deleted.
(WebCore::RenderStyle::fillRule const): Deleted.
(WebCore::RenderStyle::setFillRule): Deleted.
2022-03-10 Antoine Quint <graouts@webkit.org>
[web-animations] mask-origin should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237733
Reviewed by Antti Koivisto.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2022-03-10 Antoine Quint <graouts@webkit.org>
[web-animations] font-variant-numeric should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237669
Reviewed by Antti Koivisto.
We can also add support for animating the font-variant shorthand since
font-variant-numeric is the last of its longhands that was lacking
animation support.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2022-03-10 Peng Liu <peng.liu6@apple.com>
EnterPictureInPictureEvent event was renamed to PictureInPictureEvent in spec
https://bugs.webkit.org/show_bug.cgi?id=221083
Reviewed by Youenn Fablet.
Some updates based on the spec changes:
- Rename EnterPictureInPictureEvent.idl to PictureInPictureEvent.idl.
- leavepictureinpicture event should be fired with the Picture-in-Picture window.
(https://github.com/w3c/picture-in-picture/issues/188)
Covered by media/picture-in-picture/picture-in-picture-api-events.html.
* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Modules/pictureinpicture/HTMLVideoElementPictureInPicture.cpp:
(WebCore::HTMLVideoElementPictureInPicture::didEnterPictureInPicture):
(WebCore::HTMLVideoElementPictureInPicture::didExitPictureInPicture):
* Modules/pictureinpicture/PictureInPictureEvent.cpp: Renamed from Source/WebCore/Modules/pictureinpicture/EnterPictureInPictureEvent.cpp.
(WebCore::PictureInPictureEvent::create):
(WebCore::PictureInPictureEvent::PictureInPictureEvent):
* Modules/pictureinpicture/PictureInPictureEvent.h: Renamed from Source/WebCore/Modules/pictureinpicture/EnterPictureInPictureEvent.h.
* Modules/pictureinpicture/PictureInPictureEvent.idl: Renamed from Source/WebCore/Modules/pictureinpicture/EnterPictureInPictureEvent.idl.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* dom/EventNames.in:
2022-03-10 Lauro Moura <lmoura@igalia.com>
Unreviewed, non-unified build fix after 248294@main
https://bugs.webkit.org/show_bug.cgi?id=237751
* layout/integration/LayoutIntegrationLineLayout.cpp: Add missing
include.
2022-03-10 Chris Dumez <cdumez@apple.com>
Main document is leaking on haaretz.co.il due to lazy image loading
https://bugs.webkit.org/show_bug.cgi?id=237660
<rdar://problem/90035071>
Reviewed by Geoffrey Garen.
When an HTML image uses `loading=lazy`, ImageLoader::updateFromElement() may get
called twice. If the image is outside the viewport, the first time ImageLoader::updateFromElement()
is called, we'll request a CachedImage but we'll set m_lazyImageLoadState to LazyImageLoadState::Deferred
and not ask the CachedImage to load. Then, later on, if the HTML image approaches the viewport,
ImageLoader::loadDeferredImage() will get called. It will set m_lazyImageLoadState to LazyImageLoadState::LoadImmediately
and call updateFromElement() again. This time however, updateFromElement() will actually ask the CachedImage
to load.
The issue was that the first time ImageLoader::updateFromElement(), we would set m_lazyImageLoadState to Deferred
and not ask the CachedImage to load but still set m_hasPendingLoadEvent to true. This is problematic if the CachedImage
is not already loaded since no was was started and thus no load event is coming (and no load event may ever come if the
image never approaches the viewport). When updatedHasPendingEvent() is called, it will protect the HTMLImageElement if
m_hasPendingLoadEvent is true, to make sure the image element stays alive long enough for us to dispatch the load event.
With lazy loading, this meant that we would protect the HTMLImageElement right away and undefinitely since no load event
may ever come. This meant that when navigating away from a page with images that are lazily loaded (and not loaded yet),
we would leak the HTMLImageElements (and ImageLoaders), which in turn would keep the Document alive too.
To address the issue, we now make sure that m_hasPendingLoadEvent is no longer set to true when updateFromElement()
is called but the CachedImage is not already loaded and not loading (lazy loading case). When updateFromElement() gets
called the second time (when the lazily loaded image approaches the viewport), we make sure that the m_hasPendingLoadEvent
flag gets set to true then.
Test: fast/dom/lazy-image-loading-document-leak.html
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::ImageLoader):
(WebCore::ImageLoader::updateFromElement):
(WebCore::ImageLoader::didUpdateCachedImage):
(WebCore::ImageLoader::didStartLoading):
* loader/ImageLoader.h:
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::load):
* loader/cache/CachedImageClient.h:
(WebCore::CachedImageClient::didStartLoading):
2022-03-10 Michael Saboff <msaboff@apple.com>
Catalyst JavaScriptCore, WebCore, WebKitLegacy, and WebKit shouldn't be copied to the Secondary Path
https://bugs.webkit.org/show_bug.cgi?id=237748
Reviewed by Mark Lam.
Updated the configuration to exclude copying Catalyst build products to the secondary path.
* Configurations/WebCore.xcconfig:
2022-03-10 Alan Bujtas <zalan@apple.com>
[IFC][Integration] Enable RenderListItem and RenderListMarker for IFC
https://bugs.webkit.org/show_bug.cgi?id=237497
Reviewed by Antti Koivisto.
This enables horizontal, RTL, "non-same line nested" list items for IFC.
List markers behave as regular inline level boxes except when it comes to vertical align,
when non-image based list markers are aligned as text. Also outside list markers (list-style-position: outside)
have extra (negative) horizontal margin to place them outside of the containing block's border box.
* layout/formattingContexts/inline/InlineContentBreaker.cpp:
(WebCore::Layout::isWrappableRun):
* layout/formattingContexts/inline/InlineFormattingGeometry.cpp:
(WebCore::Layout::InlineFormattingGeometry::inlineLevelBoxAffectsLineBox const):
* layout/formattingContexts/inline/InlineLevelBox.h:
(WebCore::Layout::InlineLevelBox::isListMarker const):
* layout/formattingContexts/inline/InlineLine.cpp:
(WebCore::Layout::Line::appendTextContent):
(WebCore::Layout::toLineRunType):
(WebCore::Layout::Line::Run::Run):
* layout/formattingContexts/inline/InlineLine.h:
(WebCore::Layout::Line::Run::isBox const):
(WebCore::Layout::Line::Run::isListMarker const):
* layout/formattingContexts/inline/InlineLineBoxBuilder.cpp:
(WebCore::Layout::LineBoxBuilder::setBaselineAndLayoutBounds const):
(WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes):
* layout/formattingContexts/inline/InlineLineBoxBuilder.h:
* layout/formattingContexts/inline/InlineLineBuilder.cpp:
(WebCore::Layout::isAtSoftWrapOpportunity):
* layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp:
(WebCore::Layout::InlineDisplayContentBuilder::processNonBidiContent):
(WebCore::Layout::InlineDisplayContentBuilder::processBidiContent):
* layout/integration/LayoutIntegrationBoxTree.cpp:
(WebCore::LayoutIntegration::BoxTree::buildTree):
* layout/integration/LayoutIntegrationCoverage.cpp:
(WebCore::LayoutIntegration::printReason):
(WebCore::LayoutIntegration::canUseForChild):
(WebCore::LayoutIntegration::canUseForLineLayoutWithReason):
* layout/integration/LayoutIntegrationCoverage.h:
* layout/integration/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::updateListItemDimensions):
(WebCore::LayoutIntegration::LineLayout::updateListMarkerDimensions):
(WebCore::LayoutIntegration::LineLayout::updateLayoutBoxDimensions):
(WebCore::LayoutIntegration::LineLayout::layout):
* layout/integration/LayoutIntegrationLineLayout.h:
* layout/layouttree/LayoutBox.h:
(WebCore::Layout::Box::isListMarker const):
(WebCore::Layout::Box::isInsideListMarker const):
(WebCore::Layout::Box::isOutsideListMarker const):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutModernLines):
* rendering/RenderListMarker.h:
2022-03-10 Elliott Williams <emw@apple.com>
[XCBuild] Fix GeneratedSources dependency validation errors
https://bugs.webkit.org/show_bug.cgi?id=237490
Reviewed by Alexey Proskuryakov.
Declare missing outputs in DerivedSources.make, and merge files from the "Copy Generated
Headers" phase in with the other private headers, since they all go to the same destination.
* DerivedSources-output.xcfilelist: Autogenerated chagnes.
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
2022-03-10 Antoine Quint <graouts@webkit.org>
[web-animations] mask-clip should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237725
Reviewed by Simon Fraser.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2022-03-10 Antoine Quint <graouts@webkit.org>
[web-animations] scroll-behavior should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237723
Reviewed by Antti Koivisto.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2022-03-10 Antoine Quint <graouts@webkit.org>
[web-animations] quotes should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237721
Reviewed by Antti Koivisto.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2022-03-10 Chris Dumez <cdumez@apple.com>
Document is leaking on haaretz.co.il due to an async script
https://bugs.webkit.org/show_bug.cgi?id=237672
<rdar://problem/90050632>
Reviewed by Geoffrey Garen.
I haven't been able to reproduce this in the context of a layout test, however,
I see the https://acdn.adnxs.com/dmp/async_usersync.html document flakily leaking
on haaretz.co.il due to an async script (sometimes the top document too).
From a memgraph, I can see that the cycle is:
HTMLDocument -> ScriptRunner -> PendingScript (via m_scriptsToExecuteSoon) -> HTMLScriptElement -> HTMLDocument (again)
To address the issue, I updated Document::commonTeardown() to clear all its ScriptRunner's pending scripts, right after
we stop all ActiveDOMObjects. At this point, we no longer want to run script and clearing any pending scripts is critical
since they hold a strong reference to the Document.
I have validated the fix on haaretz.co.il since I wasn't able to write an automated
test for this.
* dom/Document.cpp:
(WebCore::Document::commonTeardown):
* dom/ScriptRunner.cpp:
(WebCore::ScriptRunner::clearPendingScripts):
* dom/ScriptRunner.h:
2022-03-10 Chris Fleizach <cfleizach@apple.com>
AX: Support updated WebSpeech API
https://bugs.webkit.org/show_bug.cgi?id=237614
<rdar://problem/89981851>
Reviewed by Andres Gonzalez.
Adopt WebSpeech (18 August 2020) changes from
https://wicg.github.io/speech-api/
Tests Fixed:
imported/w3c/web-platform-tests/speech-api/
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Modules/speech/DOMWindow+SpeechSynthesis.idl:
* Modules/speech/DOMWindowSpeechSynthesis.cpp:
(WebCore::DOMWindowSpeechSynthesis::speechSynthesis):
* Modules/speech/SpeechSynthesis.cpp:
(WebCore::Ref<SpeechSynthesis>SpeechSynthesis::create):
(WebCore::SpeechSynthesis::SpeechSynthesis):
(WebCore::SpeechSynthesis::voicesDidChange):
(WebCore::SpeechSynthesis::fireEvent const):
(WebCore::SpeechSynthesis::fireErrorEvent const):
(WebCore::SpeechSynthesis::handleSpeakingCompleted):
(WebCore::SpeechSynthesis::boundaryEventOccurred):
(WebCore::SpeechSynthesis::didStartSpeaking):
(WebCore::SpeechSynthesis::didPauseSpeaking):
(WebCore::SpeechSynthesis::didResumeSpeaking):
(WebCore::SpeechSynthesis::create): Deleted.
(WebCore::SpeechSynthesis::fireEvent): Deleted.
* Modules/speech/SpeechSynthesis.h:
* Modules/speech/SpeechSynthesis.idl:
* Modules/speech/SpeechSynthesisErrorCode.h: Added.
* Modules/speech/SpeechSynthesisErrorCode.idl: Copied from Source/WebCore/Modules/speech/DOMWindow+SpeechSynthesis.idl.
* Modules/speech/SpeechSynthesisErrorEvent.cpp: Copied from Source/WebCore/Modules/speech/SpeechSynthesisEvent.cpp.
(WebCore::SpeechSynthesisErrorEvent::create):
(WebCore::SpeechSynthesisErrorEvent::SpeechSynthesisErrorEvent):
* Modules/speech/SpeechSynthesisErrorEvent.h: Copied from Source/WebCore/Modules/speech/SpeechSynthesisEvent.h.
* Modules/speech/SpeechSynthesisErrorEvent.idl: Copied from Source/WebCore/Modules/speech/SpeechSynthesisEvent.idl.
* Modules/speech/SpeechSynthesisErrorEventInit.h: Copied from Source/WebCore/Modules/speech/DOMWindow+SpeechSynthesis.idl.
* Modules/speech/SpeechSynthesisErrorEventInit.idl: Copied from Source/WebCore/Modules/speech/DOMWindow+SpeechSynthesis.idl.
* Modules/speech/SpeechSynthesisEvent.cpp:
(WebCore::SpeechSynthesisEvent::create):
(WebCore::SpeechSynthesisEvent::SpeechSynthesisEvent):
* Modules/speech/SpeechSynthesisEvent.h:
(WebCore::SpeechSynthesisEvent::utterance const):
(WebCore::SpeechSynthesisEvent::charLength const):
(): Deleted.
* Modules/speech/SpeechSynthesisEvent.idl:
* Modules/speech/SpeechSynthesisEventInit.h: Copied from Source/WebCore/Modules/speech/SpeechSynthesisEvent.h.
(WebCore::SpeechSynthesisEventInit::SpeechSynthesisEventInit):
* Modules/speech/SpeechSynthesisEventInit.idl: Copied from Source/WebCore/Modules/speech/DOMWindow+SpeechSynthesis.idl.
* Modules/speech/SpeechSynthesisUtterance.cpp:
(WebCore::SpeechSynthesisUtterance::SpeechSynthesisUtterance):
* Modules/speech/SpeechSynthesisUtterance.h:
* Modules/speech/SpeechSynthesisVoice.idl:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/EventNames.h:
* dom/EventNames.in:
* dom/EventTargetFactory.in:
* page/SpeechSynthesisClient.h:
* platform/PlatformSpeechSynthesizer.h:
* platform/cocoa/PlatformSpeechSynthesizerCocoa.mm:
(-[WebSpeechSynthesisWrapper speechSynthesizer:willSpeakRangeOfSpeechString:utterance:]):
(WebCore::PlatformSpeechSynthesizer::initializeVoiceList):
* platform/mock/PlatformSpeechSynthesizerMock.cpp:
(WebCore::PlatformSpeechSynthesizerMock::speak):
2022-03-10 Chris Dumez <cdumez@apple.com>
Optimize further the passing of data across threads
https://bugs.webkit.org/show_bug.cgi?id=237695
Reviewed by Geoffrey Garen.
Optimize further the passing of data across threads by leveraging the optimized
version of isolatedCopy() on r-value references whenever possible.
* Modules/cache/CacheStorageConnection.h:
* Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::queryCache):
* Modules/cache/WorkerCacheStorageConnection.cpp:
(WebCore::toCrossThreadRecordData):
(WebCore::recordsDataFromRecords):
(WebCore::recordsDataOrErrorFromRecords):
(WebCore::WorkerCacheStorageConnection::retrieveRecords):
(WebCore::WorkerCacheStorageConnection::batchPutOperation):
* Modules/cache/WorkerCacheStorageConnection.h:
* Modules/entriesapi/DOMFileSystem.cpp:
(WebCore::DOMFileSystem::listDirectory):
* Modules/mediastream/DetachedRTCDataChannel.h:
(WebCore::DetachedRTCDataChannel::DetachedRTCDataChannel):
(WebCore::DetachedRTCDataChannel::decode):
* Modules/mediastream/RTCDataChannel.cpp:
(WebCore::RTCDataChannel::detach):
* Modules/mediastream/RTCDataChannel.h:
* Modules/notifications/Notification.cpp:
(WebCore::Notification::create):
(WebCore::Notification::Notification):
* Modules/notifications/Notification.h:
* Modules/push-api/PushSubscriptionData.cpp:
(WebCore::PushSubscriptionData::isolatedCopy const):
(WebCore::PushSubscriptionData::isolatedCopy):
* Modules/push-api/PushSubscriptionData.h:
* Modules/storage/DummyStorageProvider.h:
* Modules/storage/StorageConnection.h:
* Modules/storage/StorageManager.cpp:
(WebCore::StorageManager::persisted):
(WebCore::StorageManager::fileSystemAccessGetDirectory):
* Modules/storage/WorkerStorageConnection.cpp:
(WebCore::WorkerStorageConnection::getPersisted):
(WebCore::WorkerStorageConnection::fileSystemGetDirectory):
* Modules/storage/WorkerStorageConnection.h:
* Modules/webdatabase/ChangeVersionWrapper.cpp:
(WebCore::ChangeVersionWrapper::ChangeVersionWrapper):
* Modules/webdatabase/ChangeVersionWrapper.h:
(WebCore::ChangeVersionWrapper::create):
* Modules/webdatabase/Database.cpp:
(WebCore::Database::changeVersion):
* Modules/webdatabase/Database.h:
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::addOpenDatabase):
* Modules/webdatabase/SQLError.h:
(WebCore::SQLError::create):
(WebCore::SQLError::SQLError):
* Modules/websockets/ThreadableWebSocketChannel.h:
* Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
(WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveMessage):
(WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveMessageError):
* Modules/websockets/ThreadableWebSocketChannelClientWrapper.h:
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::didReceiveMessage):
(WebCore::WebSocket::didReceiveMessageError):
* Modules/websockets/WebSocket.h:
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::fail):
(WebCore::WebSocketChannel::didFailSocketStream):
(WebCore::WebSocketChannel::processFrame):
* Modules/websockets/WebSocketChannel.h:
* Modules/websockets/WebSocketChannelClient.h:
* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::WebSocketHandshake::setURL): Deleted.
* Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
(WebCore::WorkerThreadableWebSocketChannel::fail):
(WebCore::WorkerThreadableWebSocketChannel::Peer::fail):
(WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveMessage):
(WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveMessageError):
(WebCore::WorkerThreadableWebSocketChannel::Bridge::connect):
(WebCore::WorkerThreadableWebSocketChannel::Bridge::fail):
* Modules/websockets/WorkerThreadableWebSocketChannel.h:
* dom/ExceptionData.h:
(WebCore::ExceptionData::toException const):
(WebCore::ExceptionData::toException):
* inspector/agents/InspectorWorkerAgent.cpp:
(WebCore::InspectorWorkerAgent::sendMessageFromWorkerToFrontend):
* inspector/agents/InspectorWorkerAgent.h:
* page/CacheStorageProvider.h:
* page/PageDebuggable.cpp:
(WebCore::PageDebuggable::dispatchMessageFromRemote):
* page/PageDebuggable.h:
* workers/WorkerInspectorProxy.cpp:
(WebCore::WorkerInspectorProxy::sendMessageFromWorkerToFrontend):
* workers/WorkerInspectorProxy.h:
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::postMessageToDebugger):
* workers/service/SWClientConnection.cpp:
(WebCore::SWClientConnection::jobRejectedInServer):
(WebCore::SWClientConnection::registrationJobResolvedInServer):
* workers/service/SWClientConnection.h:
* workers/service/ServiceWorkerClientData.cpp:
(WebCore::ServiceWorkerClientData::isolatedCopy const):
(WebCore::ServiceWorkerClientData::isolatedCopy):
* workers/service/ServiceWorkerClientData.h:
* workers/service/ServiceWorkerContextData.h:
(WebCore::ServiceWorkerContextData::ImportedScript::isolatedCopy const):
(WebCore::ServiceWorkerContextData::ImportedScript::isolatedCopy):
* workers/service/ServiceWorkerRegistration.cpp:
(WebCore::ServiceWorkerRegistration::showNotification):
* workers/service/ServiceWorkerRegistration.h:
* workers/service/ServiceWorkerRegistrationOptions.cpp:
(WebCore::ServiceWorkerRegistrationOptions::isolatedCopy const):
(WebCore::ServiceWorkerRegistrationOptions::isolatedCopy):
* workers/service/ServiceWorkerRegistrationOptions.h:
* workers/service/context/ServiceWorkerDebuggable.cpp:
(WebCore::ServiceWorkerDebuggable::dispatchMessageFromRemote):
* workers/service/context/ServiceWorkerDebuggable.h:
* workers/service/context/ServiceWorkerInspectorProxy.cpp:
(WebCore::ServiceWorkerInspectorProxy::sendMessageToWorker):
(WebCore::ServiceWorkerInspectorProxy::sendMessageFromWorkerToFrontend):
* workers/service/context/ServiceWorkerInspectorProxy.h:
* workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::ServiceWorkerThreadProxy::postMessageToDebugger):
(WebCore::ServiceWorkerThreadProxy::startFetch):
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::RegistrationDatabase::importRecords):
2022-03-10 Antoine Quint <graouts@webkit.org>
[web-animations] grid-template-areas should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237712
Reviewed by Antti Koivisto.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2022-03-10 Antoine Quint <graouts@webkit.org>
[web-animations] font-variant-caps should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237662
Reviewed by Myles C. Maxfield.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* platform/text/TextFlags.cpp:
(WebCore::operator<<):
* platform/text/TextFlags.h:
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::setFontVariantAlternates):
(WebCore::RenderStyle::setFontVariantCaps):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::fontVariantCaps const):
2022-03-10 Jer Noble <jer.noble@apple.com>
[iOS] Netflix.com fails to resume after moving app to background during playback
https://bugs.webkit.org/show_bug.cgi?id=237659
<rdar://88775037>
Reviewed by Eric Carlson.
Test: media/media-source/media-source-interruption-with-resume-allowing-play.html
When the MediaPlayerPrivateMediaSourceAVFObjC player is asked to play or pause, it notifies
the client (HTMLMediaElement) that its playback state has changed. HTMLMediaElement will in response
call playInternal() or pauseInternal() to ensure that a state change driven by the MediaPlayer
is reflected up to the DOM. However, when an interruption causes the media element to suspend
and pause playback, this results in an additional call to pauseInternal(), which updates the
"state to resume" after an interruption ends to "Paused".
In mediaPlayerPlaybackStateChanged(), only call pauseInternal() or playInternal() if the reported
player state does not match the HTMLMediaElement's own state.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerPlaybackStateChanged):
2022-03-10 Sihui Liu <sihui_liu@apple.com>
IndexedDB: free memory used by database connection on low-memory warning
https://bugs.webkit.org/show_bug.cgi?id=237673
Reviewed by Chris Dumez.
* Modules/indexeddb/server/IDBBackingStore.h:
* Modules/indexeddb/server/MemoryIDBBackingStore.h:
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::handleLowMemoryWarning):
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::handleLowMemoryWarning):
* Modules/indexeddb/server/UniqueIDBDatabase.h:
2022-03-10 Antoine Quint <graouts@webkit.org>
[web-animations] font-variant-position should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237671
Reviewed by Myles C. Maxfield.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* platform/text/TextFlags.cpp:
(WebCore::operator<<):
* platform/text/TextFlags.h:
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::setFontVariantAlternates):
(WebCore::RenderStyle::setFontVariantPosition):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::fontVariantPosition const):
2022-03-10 Antoine Quint <graouts@webkit.org>
[web-animations] font-variant-ligatures should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237667
Reviewed by Myles C. Maxfield.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2022-03-10 Lauro Moura <lmoura@igalia.com>
Unreviewed, non-unified build fix after 248260@main
https://bugs.webkit.org/show_bug.cgi?id=237715
* css/ContainerQuery.h: Add missing include.
2022-03-10 Philippe Normand <pnormand@igalia.com>
REGRESSION(r284711): [GStreamer] Buffering, seek broken on youtube.com
https://bugs.webkit.org/show_bug.cgi?id=233861
Unreviewed, manual revert of 284711.
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::currentTimeFudgeFactor):
* platform/graphics/SourceBufferPrivate.h:
(WebCore::SourceBufferPrivate::timeFudgeFactor const):
* platform/graphics/gstreamer/GStreamerCommon.h:
(WebCore::toGstClockTime):
* platform/graphics/gstreamer/MediaSampleGStreamer.cpp:
(WebCore::MediaSampleGStreamer::MediaSampleGStreamer):
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::appsinkNewSample):
(WebCore::bufferTimeToStreamTime): Deleted.
2022-03-10 Antoine Quint <graouts@webkit.org>
[web-animations] font-variant-east-asian should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237665
Reviewed by Myles C. Maxfield.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2022-03-10 Rob Buis <rbuis@igalia.com>
Use PropertyRegistry consistently in svgAttributeChanged
https://bugs.webkit.org/show_bug.cgi?id=237604
Reviewed by Martin Robinson.
Use PropertyRegistry consistently in svgAttributeChanged by always checking
PropertyRegistry::isKnownAttribute first thing, before delegating to subclasses.
* svg/SVGFEBlendElement.cpp:
(WebCore::SVGFEBlendElement::svgAttributeChanged):
* svg/SVGFEColorMatrixElement.cpp:
(WebCore::SVGFEColorMatrixElement::svgAttributeChanged):
* svg/SVGFECompositeElement.cpp:
(WebCore::SVGFECompositeElement::svgAttributeChanged):
* svg/SVGFEConvolveMatrixElement.cpp:
(WebCore::SVGFEConvolveMatrixElement::svgAttributeChanged):
* svg/SVGFEDiffuseLightingElement.cpp:
(WebCore::SVGFEDiffuseLightingElement::svgAttributeChanged):
* svg/SVGFEDisplacementMapElement.cpp:
(WebCore::SVGFEDisplacementMapElement::svgAttributeChanged):
* svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::svgAttributeChanged):
* svg/SVGFEMergeNodeElement.cpp:
(WebCore::SVGFEMergeNodeElement::svgAttributeChanged):
* svg/SVGFEMorphologyElement.cpp:
(WebCore::SVGFEMorphologyElement::svgAttributeChanged):
* svg/SVGFESpecularLightingElement.cpp:
(WebCore::SVGFESpecularLightingElement::svgAttributeChanged):
* svg/SVGFETileElement.cpp:
(WebCore::SVGFETileElement::svgAttributeChanged):
* svg/SVGForeignObjectElement.cpp:
(WebCore::SVGForeignObjectElement::svgAttributeChanged):
* svg/SVGGeometryElement.cpp:
(WebCore::SVGGeometryElement::svgAttributeChanged):
* svg/SVGGraphicsElement.cpp:
(WebCore::SVGGraphicsElement::svgAttributeChanged):
* svg/SVGImageElement.cpp:
(WebCore::SVGImageElement::svgAttributeChanged):
* svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::svgAttributeChanged):
* svg/SVGPolyElement.cpp:
(WebCore::SVGPolyElement::svgAttributeChanged):
* svg/SVGStopElement.cpp:
(WebCore::SVGStopElement::svgAttributeChanged):
2022-03-10 Lauro Moura <lmoura@igalia.com>
Add context.roundRect support to OffScreenCanvas
https://bugs.webkit.org/show_bug.cgi?id=232780
<rdar://problem/85366210>
Reviewed by Darin Adler.
Covered by existing tests.
* html/canvas/CanvasPath.cpp:
(WebCore::CanvasPath::roundRect): Added.
* html/canvas/CanvasPath.h:
* html/canvas/CanvasPath.idl: Added roundRect declarations.
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::processArgument): Added stub for the
RadiusVariant as used in roundRect.
* inspector/InspectorCanvasCallTracer.h:
* inspector/agents/InspectorCanvasAgent.cpp: Add include.
* inspector/RecordingSwizzleType.h: Added DOMPointInit type.
2022-03-10 Nikolas Zimmermann <nzimmermann@igalia.com>
Cleanup RenderLayer::currentTransform()
https://bugs.webkit.org/show_bug.cgi?id=237553
Reviewed by Rob Buis.
In preparation for the upcoming SVG/CSS transforms support in LBSE,
the transform related code in RenderLayer is cleaned up, starting
with RenderLayers currentTransform() function.
RenderLayer::currentTransform() has two purposes. It can either be used
to re-compute the existing transformation matrix with different options
(e.g. include or exclude 'transform-origin' induced transformations), or
to retrieve the current transformation matrix from the animatedStyle() of
the associated renderer, if an accelerated transform animation is running
(triggered e.g. via CSS Animations / JS WebAnimations).
Currently the code to compute the transformation matrix is duplicated,
avoid that and unify the two code paths (re-compute CTM if accelerated transform
animations are running / re-compute CTM if transform-origin shall be excluded).
Add two new WPT tests that verify animating 'transform-box' is functional
for both composited & non-composited elements. Currently 'transform-box'
support is ignored for composited elements, as demonstrated by the
transform-box-with-change-transform-layer.html test.
Follow-up patches that fix the bugs depends on this initial cleanup patch.
For now mark the failing test as such until it's fixed.
Tests: imported/w3c/web-platform-tests/css/css-transforms/animation/transform-box-will-change-transform-layer.html
imported/w3c/web-platform-tests/css/css-transforms/animation/transform-box.html
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::currentTransform const):
2022-03-09 Antoine Quint <graouts@webkit.org>
[web-animations] font-variant-alternates should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237661
Reviewed by Myles C. Maxfield.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* platform/text/TextFlags.cpp:
(WebCore::operator<<):
* platform/text/TextFlags.h:
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::setFontFamilies):
(WebCore::RenderStyle::setFontVariantAlternates):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::fontVariantAlternates const):
2022-03-10 Antoine Quint <graouts@webkit.org>
[web-animations] font-synthesis should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237650
Reviewed by Myles C. Maxfield.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::setFontFamilies):
(WebCore::RenderStyle::setFontSynthesis):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::fontSynthesis const):
2022-03-10 Enrique Ocaña González <eocanha@igalia.com>
[MSE][SourceBuffer] Fix creating float PTS/DTS when dividing sample
https://bugs.webkit.org/show_bug.cgi?id=237528
Reviewed by Xabier Rodriguez-Calvar.
The timestamps used for sample division in SourceBuffer aren't being
aligned with the same rounding margin used in
SourceBuffer::sourceBufferPrivateDidReceiveSample().
This patch is authored by Eugene Mutavchi <Ievgen_Mutavchi@comcast.com>
See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/797
* platform/graphics/SourceBufferPrivate.cpp: Extracted roundTowardsTimeScaleWithRoundingMargin lambda as a function and used it from removeCodedFrames(), on top of the current usage from sourceBufferPrivateDidReceiveSample().
2022-03-09 Antoine Quint <graouts@webkit.org>
[web-animations] fill-rule should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237648
Reviewed by Antti Koivisto.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::fillRule const):
(WebCore::RenderStyle::setFillRule):
2022-03-10 Antoine Quint <graouts@webkit.org>
[web-animations] counter-reset should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237644
Reviewed by Antti Koivisto.
Generalize the wrapper added for counter-increment to also handle counter-reset.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2022-03-10 Antti Koivisto <antti@apple.com>
[CSS Container Queries] Implement new container selection algorithm
https://bugs.webkit.org/show_bug.cgi?id=237657
Reviewed by Antoine Quint.
"For each element, the query container to be queried is selected from among the element’s
ancestor query containers that have a valid container-type for all the container features
in the <container-condition>."
https://drafts.csswg.org/css-contain-3/#container-rule
* css/ContainerQuery.cpp:
(WebCore::CQ::requiredAxesForFeature):
* css/ContainerQuery.h:
* css/ContainerQueryParser.cpp:
(WebCore::ContainerQueryParser::consumeFilteredContainerQuery):
Move container name parsing to ContainerQueryParser too.
(WebCore::ContainerQueryParser::consumeSizeQuery):
Collect required axes during parsing.
* css/ContainerQueryParser.h:
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::consumeContainerRule):
* style/ContainerQueryEvaluator.cpp:
(WebCore::Style::ContainerQueryEvaluator::evaluate const):
(WebCore::Style::ContainerQueryEvaluator::selectContainer const):
Select container based on required axes for the features being used.
(WebCore::Style::ContainerQueryEvaluator::evaluateQuery const):
(WebCore::Style::ContainerQueryEvaluator::evaluateCondition const):
(WebCore::Style::ContainerQueryEvaluator::evaluateSizeFeature const):
No need to check axes during evaluation anymore. We only evaluate against containers that support them.
(WebCore::Style::ContainerQueryEvaluator::resolveContainer const): Deleted.
Rename resolveContainer -> selectContainer to match the spec.
* style/ContainerQueryEvaluator.h:
2022-03-07 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK][WPE] Add initial adwaita style for PDF.js
https://bugs.webkit.org/show_bug.cgi?id=237527
Reviewed by Michael Catanzaro.
* Modules/pdfjs-extras/adwaita/style.css: Added.
(#openFile):
(.dropdownToolbarButton > select):
* html/PDFDocument.cpp:
(WebCore::PDFDocument::injectStyleAndContentScript):
2022-03-10 Youenn Fablet <youenn@apple.com>
Remove RemoteVideoSample
https://bugs.webkit.org/show_bug.cgi?id=237592
Reviewed by Eric Carlson.
No change of behavior.
* Headers.cmake:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/RemoteVideoSample.cpp: Removed.
* platform/graphics/RemoteVideoSample.h: Removed.
2022-03-10 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK][WPE] Add initial support for PDF documents using PDF.js
https://bugs.webkit.org/show_bug.cgi?id=237513
Reviewed by Michael Catanzaro.
Add support for loading PDF documents using PDF.js.
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::start):
(WebCore::ResourceLoader::isPDFJSResourceLoad const):
* loader/soup/ResourceLoaderSoup.cpp:
(WebCore::ResourceLoader::loadGResource):
* page/SecurityOrigin.cpp:
(WebCore::shouldTreatAsUniqueOrigin):
* platform/LegacySchemeRegistry.cpp:
(WebCore::builtinSecureSchemes):
2022-03-09 Antoine Quint <graouts@webkit.org>
[web-animations] counter-increment should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237640
Reviewed by Antti Koivisto.
The counter-increment and counter-reset properties are represented via a single data structure
held by RenderStyle. This lays up the groundwork for animation support of counter-reset as well
but right now we only handle counter-increment to keep this patch focused.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2022-03-09 Andres Gonzalez <andresg_22@apple.com>
Remove unused AccessibilityObject member variable.
https://bugs.webkit.org/show_bug.cgi?id=237670
<rdar://problem/90042470>
Reviewed by Chris Fleizach.
AccessibilityObject::m_isolatedTreeNodeInitialized is not used, thus
removing.
* accessibility/AccessibilityObject.h:
2022-03-09 Andres Gonzalez <andresg_22@apple.com>
In isolated tree mode, do not call NSAccessibilityUnregisterUniqueIdForUIElement until the isolated object is detached.
https://bugs.webkit.org/show_bug.cgi?id=237621
<rdar://problem/89992486>
Reviewed by Chris Fleizach.
When the live object is detached from its wrapper on the main thread,
the wrapper may be in the middle of serving a request on the AX thread.
Therefore calling NSAccessibilityUnregisterUniqueIdForUIElement may
interfere with the completiong of the request, or even cause undefined
behavior since many of the internal lookups for objects depend on a data
structure updated by system call. With this patch, we unregister a
wrapper when the isolated object is detached, which happens after the
live object is detached.
* accessibility/mac/WebAccessibilityObjectWrapperBase.h:
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(-[WebAccessibilityObjectWrapperBase initWithAccessibilityObject:]):
(-[WebAccessibilityObjectWrapperBase attachIsolatedObject:]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper detach]):
(-[WebAccessibilityObjectWrapper detachIsolatedObject:]):
(-[WebAccessibilityObjectWrapper unregisterUniqueIdForUIElement]): Deleted.
2022-03-09 Matt Woodrow <mattwoodrow@apple.com>
Empty float rects should remain empty after integrally enclosing them.
https://bugs.webkit.org/show_bug.cgi?id=237507
Reviewed by Alan Bujtas.
Test: compositing/tile-coverage-subpixel-empty-rect.html
* platform/graphics/FloatRect.cpp:
(WebCore::enclosingIntRectPreservingEmptyRects):
* platform/graphics/FloatRect.h:
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::setNeedsDisplayInRect):
(WebCore::TileGrid::dropTilesInRect):
(WebCore::TileGrid::tilesWouldChangeForCoverageRect const):
(WebCore::TileGrid::prepopulateRect):
(WebCore::TileGrid::revalidateTiles):
(WebCore::TileGrid::ensureTilesForRect):
Add a new variant of enclosingIntRect(const Float&) that ensures that empty input rects
always return an empty output rect, even if the x/y position is fractional.
Significant portions of the layout code (including, but not limited to linesBoundingBox()) depend
on the old behavior, so the new behaviour is opt-in and only used by TileGrid.
Fixes the case where TileGrid received an empty coverage rect at a fractional position, and rounded
it out to a 1x1 rect and allocated unnecessary tiles.
2022-03-09 Alex Christensen <achristensen@webkit.org>
Fix AppleWin build
https://bugs.webkit.org/show_bug.cgi?id=236131
* platform/VideoFrame.cpp:
(WebCore::VideoFrame::asVideoFrameCV):
* platform/VideoFrame.h:
2022-03-09 Alex Christensen <achristensen@webkit.org>
Fix AppleWin build
https://bugs.webkit.org/show_bug.cgi?id=236131
* platform/VideoFrame.cpp:
(WebCore::VideoFrame::asVideoFrameCV):
2022-03-09 Antoine Quint <graouts@webkit.org>
[web-animations] dominant-baseline should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237645
Reviewed by Antti Koivisto.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::dominantBaseline const):
(WebCore::RenderStyle::setDominantBaseline):
2022-03-09 Antoine Quint <graouts@webkit.org>
[css-lists] css/css-lists/inherit-overwrites.html and css/css-lists/li-counter-increment-computed-style.html are unique failures
https://bugs.webkit.org/show_bug.cgi?id=237642
Reviewed by Antti Koivisto.
A std::nullopt means the property isn't set, not that it shoudl be 0.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::counterToCSSValue):
2022-03-09 Simon Fraser <simon.fraser@apple.com>
Move RemoteLayerBackingStore::Buffer.isVolatile into ImageBufferBackend
https://bugs.webkit.org/show_bug.cgi?id=237631
Reviewed by Tim Horton.
'isVolatile' is a property of a specific image buffer, so it makes more sense to have it in
ImageBuffer[Backend] than RemoteLayerBackingStore. This also allows GPU Process code to
maintain volatility state in the web process, which reduces the amount of IPC needed when
making the front buffer non-volatile before display.
So ImageBufferBackend gets volatilityState()/setVolatilityState(), accessed via ImageBuffer.
This state is maintained by RemoteRenderingBackendProxy for remote buffers. We set the state
to volatile when we receive the IPC reply for markSurfacesVolatile(), which requires
changing the reply to list buffers for which making volatile was successful.
RemoteLayerWithRemoteRenderingBackingStoreCollection::makeFrontBufferNonVolatile() can now
early return when the buffer is already non-volatile, and we have a backend handle (recall
that we clear backend handles when trying to make a buffer volatile).
* platform/graphics/ConcreteImageBuffer.h:
* platform/graphics/ImageBuffer.h:
* platform/graphics/ImageBufferBackend.h:
(WebCore::ImageBufferBackend::volatilityState const):
(WebCore::ImageBufferBackend::setVolatilityState):
* platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp:
(WebCore::ImageBufferIOSurfaceBackend::setVolatile):
(WebCore::ImageBufferIOSurfaceBackend::setNonVolatile):
(WebCore::ImageBufferIOSurfaceBackend::volatilityState const):
(WebCore::ImageBufferIOSurfaceBackend::setVolatilityState):
* platform/graphics/cg/ImageBufferIOSurfaceBackend.h:
2022-03-09 Youenn Fablet <youenn@apple.com>
Allow to pass webrtc video frame buffers through RealtimeMediaSource based pipelines
https://bugs.webkit.org/show_bug.cgi?id=236131
<rdar://problem/88805580>
Reviewed by Eric Carlson.
Introduce VideoFrameLibWebRTC as a wrapper to libwebrtc video frame buffer.
In case we send VideoFrameLibWebRTC through RealtimeOutgoingVideoSourceCocoa, directly send the video frame buffer.
When receiving libwebrtc video frame buffers in RealtimeIncomingVideoSourceCocoa, make use of VideoFrameLibWebRTC to delay conversion of the video frame buffer in a CVPixelBufferRef.
In most cases, the conversion is unneeded as the video frame buffer will be used for rendering and will be copied to shared memory through SharedVideoFrameWriter.
Fix bugs in handling of YUV conversion libwebrtc routines.
Minor refactoring to have a default asVideoFrameCV method implementatin in VideoFrame.
Covered by existing tests.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/VideoFrame.cpp:
* platform/VideoFrame.h:
* platform/cocoa/SharedVideoFrameInfo.h:
* platform/cocoa/SharedVideoFrameInfo.mm:
* platform/mediastream/libwebrtc/VideoFrameLibWebRTC.cpp: Added.
* platform/mediastream/libwebrtc/VideoFrameLibWebRTC.h: Added.
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.h:
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
2022-03-09 Youenn Fablet <youenn@apple.com>
WebRTC decoded frames are not correctly rotated in case GPU Process DOM rendering flag is set to true
https://bugs.webkit.org/show_bug.cgi?id=237468
<rdar://problem/89807876>
Reviewed by Eric Carlson.
We were creating remote video frames at webrtc decoder level but at that level, we do not know yet the rotation and timestamps of the frame.
We need to set those values when the frame is exposed to RealtimeIncomingVideoSource.
Previous tests did not catch the regression as we were correctly computing the size of the video using the webrtc rotation and not the rotation from the frame.
We should probably migrate to RemoteVideoFrameProxy as a buffer wrapper so that we can easily create remote video frames from a RemoteVideoFrameProxy buffer.
In the meantime, we use const_cast in VideoFrame::initializeCharacteristics.
Covered by updated test.
* platform/VideoFrame.cpp:
* platform/VideoFrame.h:
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
* testing/Internals.cpp:
* testing/Internals.h:
* testing/Internals.idl:
2022-03-09 Fujii Hironori <Hironori.Fujii@sony.com>
[WinCairo] Improve WCTiledBacking and TextureMapperSparseBackingStore
https://bugs.webkit.org/show_bug.cgi?id=237355
Reviewed by Don Olmstead.
* platform/graphics/texmap/TextureMapperSparseBackingStore.cpp:
(WebCore::TextureMapperSparseBackingStore::setSize):
(WebCore::TextureMapperSparseBackingStore::paintToTextureMapper):
(WebCore::TextureMapperSparseBackingStore::drawBorder):
(WebCore::TextureMapperSparseBackingStore::drawRepaintCounter):
(WebCore::TextureMapperSparseBackingStore::updateContents):
(WebCore::TextureMapperSparseBackingStore::removeTile):
(WebCore::TextureMapperSparseBackingStore::TextureMapperSparseBackingStore): Deleted.
(WebCore::TextureMapperSparseBackingStore::removeUncoveredTiles): Deleted.
(WebCore::TextureMapperSparseBackingStore::tileDimension const): Deleted.
* platform/graphics/texmap/TextureMapperSparseBackingStore.h:
* platform/graphics/texmap/TextureMapperTile.h:
2022-03-09 Antoine Quint <graouts@webkit.org>
[web-animations] increase the max number of animatable properties
https://bugs.webkit.org/show_bug.cgi?id=237651
Reviewed by Antti Koivisto.
We've run out of space in m_propertyToIdMap, the limit was 255.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2022-03-09 Antti Koivisto <antti@apple.com>
[CSS Container Queries] Remove size() function syntax
https://bugs.webkit.org/show_bug.cgi?id=237639
Reviewed by Antoine Quint.
Per https://github.com/w3c/csswg-drafts/issues/6870
* css/ContainerQueryParser.cpp:
(WebCore::ContainerQueryParser::consumeContainerQuery):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeSingleContainerName):
Also disallow strings as container names (they need to be identifiers).
2022-03-09 Fujii Hironori <Hironori.Fujii@sony.com>
[WinCairo] SpatialNavigation.h(93): error C2365: 'WebCore::None': redefinition; previous definition was 'enumerator'
https://bugs.webkit.org/show_bug.cgi?id=237647
Unreviewed build fix.
Changed WebCore::RectsAlignment to an enum class.
* page/FocusController.cpp:
(WebCore::updateFocusCandidateIfNeeded):
* page/SpatialNavigation.cpp:
(WebCore::FocusCandidate::FocusCandidate):
(WebCore::alignmentForRects):
(WebCore::distanceDataForNode):
* page/SpatialNavigation.h:
(WebCore::FocusCandidate::FocusCandidate):
(): Deleted.
2022-03-09 Antoine Quint <graouts@webkit.org>
[web-animations] color-interpolation-filters should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237637
Reviewed by Antti Koivisto.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::colorInterpolationFilters const):
(WebCore::RenderStyle::setColorInterpolationFilters):
2022-03-08 Antoine Quint <graouts@webkit.org>
[web-animations] clip-rule should support discrete animations
https://bugs.webkit.org/show_bug.cgi?id=237609
Reviewed by Antti Koivisto.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::clipRule const):
(WebCore::RenderStyle::setClipRule):
2022-03-08 Antoine Quint <graouts@webkit.org>
[web-animations] background-blend-mode should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237607
Reviewed by Antti Koivisto.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::backgroundBlendMode const):
(WebCore::RenderStyle::setBackgroundBlendMode):
2022-03-08 Antoine Quint <graouts@webkit.org>
[web-animations] font-family should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237591
Reviewed by Myles Maxfield.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::setFontPalette):
(WebCore::RenderStyle::setFontFamilies):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::fontFamilies const):
2022-03-08 Antoine Quint <graouts@webkit.org>
[web-animations] font-feature-settings should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237587
Reviewed by Antti Koivisto.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* platform/graphics/FontTaggedSettings.cpp:
(WebCore::operator<<):
* platform/graphics/FontTaggedSettings.h:
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::setFontPalette):
(WebCore::RenderStyle::setFontFeatureSettings):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::fontFeatureSettings const):
2022-03-08 Antoine Quint <graouts@webkit.org>
[web-animations] font-kerning should supporting discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237585
Reviewed by Antti Koivisto.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* platform/text/TextFlags.cpp: Added.
(WebCore::operator<<):
* platform/text/TextFlags.h:
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::setFontPalette):
(WebCore::RenderStyle::setFontKerning):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::fontKerning const):
* style/PropertyAllowlist.cpp:
(WebCore::Style::isValidMarkerStyleProperty):
2022-03-09 Kimmo Kinnunen <kkinnunen@apple.com>
GraphicsContextGLCocoa manages EGL native displays manually
https://bugs.webkit.org/show_bug.cgi?id=237313
Reviewed by Kenneth Russell.
ANGLE now keys the Metal EGL_DEFAULT_DISPLAY on the EGL_PLATFORM_ANGLE_TYPE_ANGLE.
This means that we do not need to use the default a native display for Metal and an
invented native display for OpenGL.
* platform/graphics/GraphicsTypesGL.h:
* platform/graphics/angle/GraphicsContextGLANGLE.cpp:
(WebCore::GraphicsContextGLANGLE::platformInitialize):
(WebCore::GraphicsContextGLANGLE::releaseThreadResources):
* platform/graphics/angle/GraphicsContextGLANGLE.h:
* platform/graphics/cocoa/GraphicsContextGLCocoa.mm:
(WebCore::initializeEGLDisplay):
(WebCore::GraphicsContextGLCocoa::platformInitialize):
* platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.cpp:
(WebCore::GraphicsContextGLTextureMapper::platformInitialize):
2022-03-09 Youenn Fablet <youenn@apple.com>
Scope capture sources by page identifiers
https://bugs.webkit.org/show_bug.cgi?id=237359
Reviewed by Eric Carlson.
Pass PageIdentifier when creating capture sources.
This is used at WebKit layer to better handle creation of mulitple sources.
Since we are now sometimes answering to getUserMedia by cloning sources directly,
fix a bug in RealtimeVideoSource to use the preset aspect ratio to compute missing width or height.
Introduce a way to end immediately a capture source, this is used on GPUProcess side in case starting a capture using a different device.
Covered by existing tests.
* Headers.cmake:
* Modules/mediastream/MediaDevices.cpp:
* Modules/mediastream/MediaStreamTrack.cpp:
* Modules/speech/SpeechRecognitionCaptureSource.cpp:
* Modules/speech/SpeechRecognitionCaptureSource.h:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/PageIdentifier.h: Renamed from Source/WebCore/page/PageIdentifier.h.
* platform/mediastream/MediaStreamRequest.h:
* platform/mediastream/RealtimeMediaSource.cpp:
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/RealtimeMediaSourceCenter.cpp:
* platform/mediastream/RealtimeMediaSourceFactory.cpp: Removed.
* platform/mediastream/RealtimeMediaSourceFactory.h:
* platform/mediastream/RealtimeVideoCaptureSource.cpp:
* platform/mediastream/RealtimeVideoCaptureSource.h:
* platform/mediastream/RealtimeVideoSource.cpp:
* platform/mediastream/cocoa/DisplayCaptureSourceCocoa.cpp:
* platform/mediastream/cocoa/DisplayCaptureSourceCocoa.h:
* platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
* platform/mediastream/gstreamer/MockRealtimeAudioSourceGStreamer.cpp:
* platform/mediastream/gstreamer/MockRealtimeVideoSourceGStreamer.cpp:
* platform/mediastream/ios/CoreAudioCaptureSourceIOS.h:
* platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm:
* platform/mediastream/mac/AVVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
* platform/mediastream/mac/CoreAudioCaptureSource.h:
* platform/mediastream/mac/MockAudioSharedUnit.mm:
* platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
* platform/mock/MockRealtimeAudioSource.cpp:
* platform/mock/MockRealtimeAudioSource.h:
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
* platform/mock/MockRealtimeVideoSource.cpp:
* platform/mock/MockRealtimeVideoSource.h:
2022-03-08 Jean-Yves Avenard <jya@apple.com>
Have MediaFormatReader plugin use WebMParser directly
https://bugs.webkit.org/show_bug.cgi?id=237594
rdar://89960307
Reviewed by Eric Carlson.
Covered by existing tests.
* platform/MediaSample.h:
(WebCore::MediaSample::byteRange const): Have default implementation.
* platform/VideoFrame.cpp:
* platform/VideoFrame.h:
* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
(WebCore::ImageDecoderAVFObjCSample::byteRangeForAttachment const):
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
* platform/graphics/cocoa/CMUtilities.h: Export symbols.
* platform/graphics/cocoa/SourceBufferParserWebM.cpp:
(WebCore::WebMParser::createByteRangeSamples):
(WebCore::WebMParser::OnTrackEntry):
(WebCore::WebMParser::VideoTrackData::consumeFrameData):
(WebCore::WebMParser::AudioTrackData::consumeFrameData):
(WebCore::WebMParser::provideMediaData):
(WebCore::SourceBufferParserWebM::parsedMediaData):
(WebCore::SourceBufferParserWebM::returnSamples):
(WebCore::SourceBufferParserWebM::flushPendingAudioSamples):
* platform/graphics/cocoa/SourceBufferParserWebM.h:
(WebCore::WebMParser::TrackData::createByteRangeSamples):
(WebCore::WebMParser::TrackData::drainPendingSamples):
* platform/graphics/gstreamer/MediaSampleGStreamer.h:
* platform/mock/mediasource/MockSourceBufferPrivate.cpp:
2022-03-08 Chris Dumez <cdumez@apple.com>
IntersectionObserver is causing massive document leaks on haaretz.co.il
https://bugs.webkit.org/show_bug.cgi?id=237619
<rdar://problem/89989815>
Reviewed by Simon Fraser.
On haaretz.co.il, many of the iframe documents (for Google ad frames) were leaking due to
IntersectionObserver. In particular, IntersectionObserver::isReachableFromOpaqueRoots()
was returning true because m_targetsWaitingForFirstObservation was non-empty. This indicates
that the IntersectionObserver is waiting for its first observation since that target was
added. However, the observation is not coming because we navigated away from the document.
To address the issue, I updated Document::commonTeardown() to disconnect all
IntersectionObservers (and the very similar ResizeObservers), right after stopping all
ActiveDOMObject.
Test: fast/dom/intersection-observer-document-leak.html
* dom/Document.cpp:
(WebCore::Document::commonTeardown):
* dom/Document.h:
* page/IntersectionObserver.cpp:
(WebCore::IntersectionObserver::disconnect):
No longer return early if hasObservationTargets() returns false. This is because
2022-03-08 Eric Carlson <eric.carlson@apple.com>
[Cocoa] metadata cue endTime may not be updated
https://bugs.webkit.org/show_bug.cgi?id=237630
rdar://88690874
Reviewed by Jer Noble.
Data cues have a start time but not an explicit duration, a data cue ends when
the next data cue from the same track starts. This means we don’t know the
duration of cue #1 until cue #2 is delivered, so when cue #1 is delivered it is
given the end time of the media file’s duration and the actual end time is updated
when cue #2 arrives.
http://webkit.org/b/229924 refactored text, audio, and video tracks to not depend
on HTMLMediaElement. Because InbandDataTextTrack could no longer access the
HTMLMediaElement to get its duration, a duration property was added to TextTrackList
that InbandDataTextTrack uses to set the duration of temporary cues.
TextTrackList.duration is set when it is created and updated when the media player
reports a duration change.
This means that if the media file’s duration is not known when the text track list
is created, and the file's duration never changes, the text track list never has a
valid duration and data cues were not added to the temporary list.
Fix this by updating TextTrackList.duration when a HTMLMediaElement reaches HAVE_METADATA.
Test: http/tests/media/hls/track-in-band-hls-metadata-cue-duration.html
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::durationChanged): Update m_textTracks.duration and post
the 'durationchange' event.
(WebCore::HTMLMediaElement::setReadyState): Call durationChanged.
(WebCore::HTMLMediaElement::mediaPlayerDurationChanged): Ditto.
* html/HTMLMediaElement.h:
* html/track/InbandDataTextTrack.cpp:
(WebCore::InbandDataTextTrack::addDataCue): Add cues to the incomplete cue map
even if the track list doesn't have duration.
2022-03-08 Cameron McCormack <heycam@apple.com>
Skip scheduling lazy UA shadow tree creation if already created or not needed
https://bugs.webkit.org/show_bug.cgi?id=237546
<rdar://problem/89922896>
Reviewed by Aditya Keerthi.
Bug 236747 made <input> element UA shadow trees get created lazily.
HTMLInputElement::insertedIntoAncestor now schedules the UA shadow tree
to be created the next time style is flushed. We currently do this every
time an <input> element is inserted into the document, but there's only
a need to do this if the particular input type needs a shadow tree and
we haven't already created it.
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::insertedIntoAncestor):
2022-03-08 Jean-Yves Avenard <jya@apple.com>
Split SourceBufferParserWebM and have platform agnostic WebMParser
https://bugs.webkit.org/show_bug.cgi?id=237472
rdar://problem/89810969
Reviewed by Eric Carlson.
Split raw WebMParser from SourceBufferParserWebM and introduce platform
agnostic MediaSamplesBlock objects and TrackInfo
* PlatformMac.cmake:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/MediaSample.h:
(WebCore::MediaSample::dump const):
(WebCore::TrackInfo::isAudio const):
(WebCore::TrackInfo::isVideo const):
(WebCore::TrackInfo::type const):
(WebCore::TrackInfo::operator== const):
(WebCore::TrackInfo::operator!= const):
(WebCore::TrackInfo::TrackInfo):
(WebCore::VideoInfo::create):
(WebCore::VideoInfo::VideoInfo):
(WebCore::AudioInfo::create):
(WebCore::AudioInfo::AudioInfo):
(WebCore::MediaSamplesBlock::setInfo):
(WebCore::MediaSamplesBlock::info const):
(WebCore::MediaSamplesBlock::isVideo const):
(WebCore::MediaSamplesBlock::isAudio const):
(WebCore::MediaSamplesBlock::type const):
(WebCore::MediaSamplesBlock::append):
(WebCore::MediaSamplesBlock::size const):
(WebCore::MediaSamplesBlock::isEmpty const):
(WebCore::MediaSamplesBlock::clear):
(WebCore::MediaSamplesBlock::takeSamples):
(WebCore::MediaSamplesBlock::operator[] const):
(WebCore::MediaSamplesBlock::first const):
(WebCore::MediaSamplesBlock::last const):
(WebCore::MediaSamplesBlock::begin const):
(WebCore::MediaSamplesBlock::end const):
(isType):
* platform/audio/cocoa/AudioFileReaderCocoa.cpp:
(WebCore::AudioFileReader::demuxWebMData const):
* platform/graphics/PlatformVideoColorPrimaries.h:
* platform/graphics/PlatformVideoMatrixCoefficients.h:
* platform/graphics/PlatformVideoTransferCharacteristics.h:
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
* platform/graphics/cocoa/CMUtilities.h: Copied from Source/WebCore/platform/graphics/PlatformVideoColorPrimaries.h.
* platform/graphics/cocoa/CMUtilities.mm: Added.
(WebCore::createAudioFormatDescription):
(WebCore::convertToCMColorPrimaries):
(WebCore::convertToCMTransferFunction):
(WebCore::convertToCMYCbCRMatrix):
(WebCore::createFormatDescriptionFromTrackInfo):
* platform/graphics/cocoa/SourceBufferParserWebM.cpp:
(WebCore::segmentReadErrorToWebmStatus):
(WebCore::WebMParser::WebMParser):
(WebCore::WebMParser::~WebMParser):
(WebCore::WebMParser::resetState):
(WebCore::WebMParser::reset):
(WebCore::WebMParser::parse):
(WebCore::WebMParser::setLogger):
(WebCore::WebMParser::invalidate):
(WebCore::WebMParser::trackDataForTrackNumber):
(WebCore::WebMParser::OnElementBegin):
(WebCore::WebMParser::OnElementEnd):
(WebCore::WebMParser::OnEbml):
(WebCore::WebMParser::OnSegmentBegin):
(WebCore::WebMParser::OnInfo):
(WebCore::WebMParser::OnClusterBegin):
(WebCore::WebMParser::OnTrackEntry):
(WebCore::WebMParser::OnBlockBegin):
(WebCore::WebMParser::OnBlockEnd):
(WebCore::WebMParser::OnSimpleBlockBegin):
(WebCore::WebMParser::OnSimpleBlockEnd):
(WebCore::WebMParser::OnBlockGroupBegin):
(WebCore::WebMParser::OnBlockGroupEnd):
(WebCore::WebMParser::OnFrame):
(WebCore::WebMParser::TrackData::contiguousCompleteBlockBuffer const):
(WebCore::WebMParser::TrackData::readFrameData):
(WebCore::WebMParser::VideoTrackData::resetCompletedFramesState):
(WebCore::WebMParser::VideoTrackData::consumeFrameData):
(WebCore::WebMParser::AudioTrackData::resetCompletedFramesState):
(WebCore::WebMParser::AudioTrackData::consumeFrameData):
(WebCore::WebMParser::isSupportedVideoCodec):
(WebCore::WebMParser::isSupportedAudioCodec):
(WebCore::SourceBufferParserWebM::SourceBufferParserWebM):
(WebCore::SourceBufferParserWebM::isWebMFormatReaderAvailable):
(WebCore::SourceBufferParserWebM::isContentTypeSupported):
(WebCore::SourceBufferParserWebM::create):
(WebCore::WebMParser::provideMediaData):
(WebCore::SourceBufferParserWebM::parsedInitializationData):
(WebCore::SourceBufferParserWebM::parsedMediaData):
(WebCore::SourceBufferParserWebM::returnSamples):
(WebCore::SourceBufferParserWebM::parsedTrimmingData):
(WebCore::SourceBufferParserWebM::contentKeyRequestInitializationDataForTrackID):
(WebCore::SourceBufferParserWebM::flushPendingAudioSamples):
(WebCore::SourceBufferParserWebM::appendData):
(WebCore::SourceBufferParserWebM::flushPendingMediaData):
(WebCore::SourceBufferParserWebM::setShouldProvideMediaDataForTrackID):
(WebCore::SourceBufferParserWebM::shouldProvideMediadataForTrackID):
(WebCore::SourceBufferParserWebM::invalidate):
(WebCore::SourceBufferParserWebM::setLogger):
(WebCore::SourceBufferParserWebM::setMinimumAudioSampleDuration):
* platform/graphics/cocoa/SourceBufferParserWebM.h:
(WebCore::WebMParser::Callback::parsedTrimmingData):
(WebCore::WebMParser::Callback::canDecrypt const):
(WebCore::WebMParser::Callback::contentKeyRequestInitializationDataForTrackID):
(WebCore::WebMParser::loggerPtr const):
(WebCore::WebMParser::logIdentifier const):
(WebCore::WebMParser::TrackData::create):
(WebCore::WebMParser::TrackData::TrackData):
(WebCore::WebMParser::TrackData::trackType const):
(WebCore::WebMParser::TrackData::formatDescription const):
(WebCore::WebMParser::TrackData::setFormatDescription):
(WebCore::WebMParser::TrackData::parser const):
(WebCore::WebMParser::TrackData::consumeFrameData):
(WebCore::WebMParser::TrackData::resetCompletedFramesState):
(WebCore::WebMParser::TrackData::drainPendingSamples):
(WebCore::WebMParser::VideoTrackData::create):
(WebCore::WebMParser::VideoTrackData::VideoTrackData):
(WebCore::WebMParser::AudioTrackData::create):
(WebCore::WebMParser::AudioTrackData::AudioTrackData):
(WebCore::SourceBufferParserWebM::type const):
(WebCore::SourceBufferParserWebM::appendData):
(WebCore::SourceBufferParserWebM::setDidParseTrimmingDataCallback):
(WebCore::SourceBufferParserWebM::loggerPtr const):
(WebCore::SourceBufferParserWebM::logIdentifier const):
(isType):
* platform/graphics/cocoa/VP9UtilitiesCocoa.h:
* platform/graphics/cocoa/VP9UtilitiesCocoa.mm:
(WebCore::convertToPlatformVideoColorPrimaries):
(WebCore::convertToPlatformVideoTransferCharacteristics):
(WebCore::convertToPlatformVideoMatrixCoefficients):
(WebCore::createVideoInfoFromVPCodecConfigurationRecord):
(WebCore::createVideoInfoFromVP9HeaderParser):
(WebCore::createVideoInfoFromVP8Header):
* platform/graphics/cocoa/WebMAudioUtilitiesCocoa.h:
* platform/graphics/cocoa/WebMAudioUtilitiesCocoa.mm:
(WebCore::createAudioInfoForFormat):
(WebCore::parseOpusPrivateData):
(WebCore::createOpusAudioInfo):
(WebCore::createVorbisAudioInfo):
2022-03-08 Jean-Yves Avenard <jya@apple.com>
Have SourceBufferParserWebM use SharedBuffer internally
https://bugs.webkit.org/show_bug.cgi?id=237078
rdar://89348752
Reviewed by Eric Carlson.
This is a refactor to allow SourceBufferParser to return SharedBuffer
rather than CMBlockBuffer.
No change in observable behaviours.
Covered by existing tests.
* platform/graphics/SourceBufferPrivate.cpp:
(WebCore::SourceBufferPrivate::reenqueueMediaForTime): Fly-by fix: typo.
(WebCore::SourceBufferPrivate::didReceiveSample): Fly-by fix, exit early
if end time is lower than start time which can happen if the duration is
smaller than contiguousFrameTolerance.
* platform/graphics/cocoa/SourceBufferParserWebM.cpp:
(WebCore::SourceBufferParserWebM::TrackData::contiguousCompleteBlockBuffer const):
(WebCore::SourceBufferParserWebM::TrackData::readFrameData):
(WebCore::SourceBufferParserWebM::TrackData::createSampleBuffer):
(WebCore::SourceBufferParserWebM::VideoTrackData::resetCompleted):
(WebCore::SourceBufferParserWebM::VideoTrackData::consumeFrameData):
(WebCore::SourceBufferParserWebM::VideoTrackData::postProcess):
(WebCore::SourceBufferParserWebM::AudioTrackData::resetCompleted):
(WebCore::SourceBufferParserWebM::AudioTrackData::consumeFrameData):
(WebCore::SourceBufferParserWebM::flushPendingAudioBuffers):
* platform/graphics/cocoa/SourceBufferParserWebM.h:
(WebCore::SourceBufferParserWebM::TrackData::resetCompleted):
(WebCore::SourceBufferParserWebM::TrackData::reset):
(WebCore::SourceBufferParserWebM::TrackData::drainPendingSamples):
(WebCore::SourceBufferParserWebM::TrackData::postProcess):
* platform/graphics/cocoa/VP9UtilitiesCocoa.h:
* platform/graphics/cocoa/VP9UtilitiesCocoa.mm:
(WebCore::parseVP8FrameHeader): Make methods const.
2022-03-08 J Pascoe <j_pascoe@apple.com>
[WebAuthn] Using WebAuthn within cross-origin iframe elements
https://bugs.webkit.org/show_bug.cgi?id=222240
rdar://problem/74830748
Reviewed by Brent Fulgham.
This patch relaxes the requirement to perform a Web Authentication assertion
inside an i-frame with the "publickey-credentials-get" feature policy from
'same-site' to 'cross-origin with consent'.
There is an additional requirement that there is only a single cross-origin
parent to present to the user in the prompt. If we can't display the updated
prompt, then cross-origin assertions are not allowed.
Test: http/wpt/webauthn/public-key-credential-cross-origin.https.html
* Modules/credentialmanagement/CredentialsContainer.cpp:
(WebCore::CredentialsContainer::scopeAndSingleParent):
(WebCore::CredentialsContainer::get):
(WebCore::CredentialsContainer::isCreate):
(WebCore::CredentialsContainer::scope): Deleted.
* Modules/credentialmanagement/CredentialsContainer.h:
* Modules/webauthn/AuthenticatorCoordinator.cpp:
(WebCore::AuthenticatorCoordinator::discoverFromExternalSource const):
* Modules/webauthn/AuthenticatorCoordinator.h:
* Modules/webauthn/AuthenticatorCoordinatorClient.h:
2022-03-08 Chris Dumez <cdumez@apple.com>
Rename allow-custom-protocols-navigation to allow-top-navigation-to-custom-protocols
https://bugs.webkit.org/show_bug.cgi?id=237605
Reviewed by Darin Adler.
Rename allow-custom-protocols-navigation sandbox flag to allow-top-navigation-to-custom-protocols as per:
- https://github.com/whatwg/html/pull/7654#issuecomment-1054219407
There is no backward compatibility risk since support for this flag was added very recently
in r290958.
* dom/SecurityContext.cpp:
(WebCore::SecurityContext::isSupportedSandboxPolicy):
(WebCore::SecurityContext::parseSandboxPolicy):
* dom/SecurityContext.h:
2022-03-08 Alex Christensen <achristensen@webkit.org>
Fix Windows debug build
https://bugs.webkit.org/show_bug.cgi?id=237617
Reviewed by Fujii Hironori.
* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::parseHeader):
2022-03-08 Antoine Quint <graouts@webkit.org>
[web-animations] color-interpolation should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237610
Reviewed by Tim Nguyen.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::colorInterpolation const):
(WebCore::RenderStyle::setColorInterpolation):
2022-03-08 Chris Dumez <cdumez@apple.com>
Optimize further the passing of data across threads
https://bugs.webkit.org/show_bug.cgi?id=237568
Reviewed by Geoffrey Garen.
Optimize further the passing of data across threads by leveraging more broadly the optimized
versions of isolatedCopy() on r-value references.
* Modules/entriesapi/DOMFileSystem.cpp:
(WebCore::DOMFileSystem::listDirectory):
(WebCore::DOMFileSystem::getParent):
(WebCore::DOMFileSystem::getEntry):
(WebCore::DOMFileSystem::getFile):
* Modules/filesystemaccess/WorkerFileSystemStorageConnection.cpp:
(WebCore::WorkerFileSystemStorageConnection::isSameEntry):
(WebCore::WorkerFileSystemStorageConnection::getFileHandle):
(WebCore::WorkerFileSystemStorageConnection::getDirectoryHandle):
(WebCore::WorkerFileSystemStorageConnection::removeEntry):
(WebCore::WorkerFileSystemStorageConnection::resolve):
(WebCore::WorkerFileSystemStorageConnection::getFile):
(WebCore::WorkerFileSystemStorageConnection::createSyncAccessHandle):
(WebCore::WorkerFileSystemStorageConnection::closeSyncAccessHandle):
(WebCore::WorkerFileSystemStorageConnection::getHandleNames):
(WebCore::WorkerFileSystemStorageConnection::getHandle):
(WebCore::WorkerFileSystemStorageConnection::move):
* Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
* Modules/indexeddb/shared/IndexKey.cpp:
(WebCore::IndexKey::isolatedCopy const):
(WebCore::IndexKey::isolatedCopy):
* Modules/indexeddb/shared/IndexKey.h:
* Modules/storage/StorageManager.cpp:
(WebCore::StorageManager::fileSystemAccessGetDirectory):
* Modules/storage/WorkerStorageConnection.cpp:
(WebCore::WorkerStorageConnection::fileSystemGetDirectory):
* Modules/webaudio/AudioWorkletGlobalScope.cpp:
(WebCore::AudioWorkletGlobalScope::registerProcessor):
* crypto/CryptoAlgorithm.cpp:
(WebCore::dispatchAlgorithmOperation):
* dom/ExceptionOr.h:
* fileapi/ThreadableBlobRegistry.cpp:
(WebCore::ThreadableBlobRegistry::registerBlobURL):
* fileapi/ThreadableBlobRegistry.h:
* workers/service/SWClientConnection.cpp:
(WebCore::SWClientConnection::startScriptFetchForServer):
* workers/service/SWClientConnection.h:
* workers/service/ServiceWorkerClients.cpp:
(WebCore::ServiceWorkerClients::get):
(WebCore::ServiceWorkerClients::matchAll):
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
(WebCore::ServiceWorkerContainer::notifyFailedFetchingScript):
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerJobClient.h:
* workers/service/WorkerSWClientConnection.cpp:
(WebCore::WorkerSWClientConnection::registerServiceWorkerClient):
(WebCore::WorkerSWClientConnection::finishFetchingScriptInServer):
(WebCore::WorkerSWClientConnection::scheduleUnregisterJobInServer):
(WebCore::WorkerSWClientConnection::subscribeToPushService):
(WebCore::WorkerSWClientConnection::unsubscribeFromPushService):
(WebCore::WorkerSWClientConnection::getPushSubscription):
(WebCore::WorkerSWClientConnection::getPushPermissionState):
* workers/service/WorkerSWClientConnection.h:
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::RegistrationDatabase::doPushChanges):
* worklets/Worklet.cpp:
(WebCore::Worklet::addModule):
2022-03-08 Sihui Liu <sihui_liu@apple.com>
UniqueIDBDatabase::didFireVersionChangeEvent should capture identifier of UniqueIDBDatabaseConnection
https://bugs.webkit.org/show_bug.cgi?id=236950
rdar://problem/89218299
Reviewed by Chris Dumez.
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::didFireVersionChangeEvent):
2022-03-08 Peng Liu <peng.liu6@apple.com>
[iOS] Flash media controls when a fullscreen video resets its source
https://bugs.webkit.org/show_bug.cgi?id=237493
Reviewed by Jer Noble.
Some pages reset the fullscreen video's source when a user rotates the device.
The screen will become black for a while, and users might think the player is broken.
With this patch, the player will show the media controls for 1 second when the source
is changed, so that users will know the player is working.
* platform/ios/VideoFullscreenInterfaceAVKit.h:
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
`_presentingViewController` is only used for watchOS.
(-[WebAVPlayerViewController flashPlaybackControlsWithDuration:]):
(VideoFullscreenInterfaceAVKit::setPlayerIdentifier):
2022-03-08 Alex Christensen <achristensen@webkit.org>
WebSocket.send() should synchronously update bufferedAmount
https://bugs.webkit.org/show_bug.cgi?id=235707
Reviewed by Chris Dumez.
This matches the behavior of Chrome and Firefox and is covered by web platform tests.
* Modules/websockets/ThreadableWebSocketChannel.h:
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::send):
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::send):
(WebCore::WebSocketChannel::enqueueTextFrame):
* Modules/websockets/WebSocketChannel.h:
* Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
(WebCore::WorkerThreadableWebSocketChannel::send):
(WebCore::WorkerThreadableWebSocketChannel::Peer::send):
(WebCore::WorkerThreadableWebSocketChannel::Bridge::send):
* Modules/websockets/WorkerThreadableWebSocketChannel.h:
2022-03-08 Kate Cheney <katherine_cheney@apple.com>
REGRESSION (r290853): CrashTracer: com.apple.WebKit.WebContent.Development at com.apple.WebCore: WebCore::FrameLoader::clear
https://bugs.webkit.org/show_bug.cgi?id=237565
<rdar://problem/88356074>
Reviewed by Chris Dumez.
No new tests. Fixes crashing test: accessibility/mac/value-change/value-change-user-info-textarea.html
newDocument may be the frame's document. We should make it a RefPtr
because it could get set to null in this function.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::clear):
* loader/FrameLoader.h:
2022-03-08 Michael Catanzaro <mcatanzaro@gnome.org>
[GTK] Sync gtk-overlay-scrolling setting to web process
https://bugs.webkit.org/show_bug.cgi?id=236476
Reviewed by Adrian Perez de Castro.
* platform/adwaita/ScrollbarThemeAdwaita.cpp:
(WebCore::ScrollbarThemeAdwaita::usesOverlayScrollbars const):
* platform/gtk/GtkUtilities.cpp:
(WebCore::shouldUseOverlayScrollbars):
* platform/gtk/GtkUtilities.h:
* platform/gtk/RenderThemeScrollbar.cpp:
(WebCore::RenderThemeScrollbar::RenderThemeScrollbar):
* platform/gtk/ScrollbarThemeGtk.cpp:
(WebCore::ScrollbarThemeGtk::ScrollbarThemeGtk):
2022-03-08 Xabier Rodriguez Calvar <calvaris@igalia.com>
[EME][Thunder] Disable hasBrokenEncryptedMediaAPISupportQuirk
https://bugs.webkit.org/show_bug.cgi?id=237595
Reviewed by Philippe Normand.
Hulu and YouTube work fine with Thunder, no need for this quirk.
Patch based on one by Eugene Mutavchi <Ievgen_Mutavchi@comcast.com>.
* page/Quirks.cpp:
(WebCore::Quirks::hasBrokenEncryptedMediaAPISupportQuirk const):
Return false if Thunder build is enabled.
2022-03-08 Youenn Fablet <youenn@apple.com>
Add a preference to mute video capture in case audio capture gets interrupted
https://bugs.webkit.org/show_bug.cgi?id=237524
<rdar://78421282>
Reviewed by Eric Carlson.
In case we detect that a microphone track source gets muted due to interruption, we mute
capture video tracks based if allowed by the new MuteCameraOnMicrophoneInterruptionEnabled setting.
Add support for mock microphone interruption and remove previous in process internals API.
Test: fast/mediastream/media-stream-video-track-interrupted-from-audio.html
* Modules/mediastream/MediaStreamTrack.cpp:
* Modules/mediastream/MediaStreamTrack.h:
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
* platform/mediastream/mac/CoreAudioCaptureSource.h:
* platform/mock/MockRealtimeAudioSource.cpp:
(WebCore::MockRealtimeAudioSource::setIsInterrupted):
* platform/mock/MockRealtimeAudioSource.h:
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::MockRealtimeMediaSourceCenter::setMockCaptureDevicesInterrupted):
(WebCore::MockRealtimeMediaSourceCenter::setMockCameraIsInterrupted): Deleted.
* platform/mock/MockRealtimeMediaSourceCenter.h:
2022-03-08 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer] Handle gst pad error as format error
https://bugs.webkit.org/show_bug.cgi?id=237526
Reviewed by Xabier Rodriguez-Calvar.
This patch is authored by Eugene Mutavchi <Ievgen_Mutavchi@comcast.com>
See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/797
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2022-03-08 Carlos Garcia Campos <cgarcia@igalia.com>
PDF.js content script is adding custom cocoa style unconditionally
https://bugs.webkit.org/show_bug.cgi?id=237516
Reviewed by Tim Nguyen.
Add the custom style from the WebKit code instead of injected content script to make it easier to add the style
depending on the platform. Move current cocoa specific style files to a cocoa directory.
* Modules/pdfjs-extras/cocoa/arrow.down.circle@2x.png: Renamed from Source/WebCore/Modules/pdfjs-extras/arrow.down.circle@2x.png.
* Modules/pdfjs-extras/cocoa/minus.magnifyingglass@2x.png: Renamed from Source/WebCore/Modules/pdfjs-extras/minus.magnifyingglass@2x.png.
* Modules/pdfjs-extras/cocoa/plus.magnifyingglass@2x.png: Renamed from Source/WebCore/Modules/pdfjs-extras/plus.magnifyingglass@2x.png.
* Modules/pdfjs-extras/cocoa/style.css: Renamed from Source/WebCore/Modules/pdfjs-extras/style-cocoa.css.
* Modules/pdfjs-extras/content-script.js:
(const.PDFJSContentScript.injectStyle): Deleted.
(const.PDFJSContentScript.init): Deleted.
* html/PDFDocument.cpp:
(WebCore::PDFDocumentEventListener::handleEvent):
(WebCore::PDFDocument::injectStyleAndContentScript):
(WebCore::PDFDocument::injectContentScript): Deleted.
* html/PDFDocument.h:
2022-03-08 Fujii Hironori <Hironori.Fujii@sony.com>
[WinCairo] GraphicsContextGL should have one more output texture for double buffering WebGL
https://bugs.webkit.org/show_bug.cgi?id=237460
Reviewed by Žan Doberšek.
WinCairo's GraphicsContextGL had only a single output texture. If the
page was interactive WebGL, the user interaction was causing the
rendering to the texture while the compositor is running.
Coordinated Graphics has another output texture m_compositorTexture.
This change reuses the code for WinCairo.
* platform/graphics/angle/GraphicsContextGLANGLE.cpp:
(WebCore::GraphicsContextGLANGLE::prepareTextureImpl):
* platform/graphics/angle/GraphicsContextGLANGLE.h:
* platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.cpp:
(WebCore::GraphicsContextGLTextureMapper::platformInitialize):
(WebCore::GraphicsContextGLANGLE::~GraphicsContextGLANGLE):
(WebCore::GraphicsContextGLTextureMapper::reshapeDisplayBufferBacking):
* platform/graphics/texmap/TextureMapperGCGLPlatformLayer.cpp:
(WebCore::TextureMapperGCGLPlatformLayer::paintToTextureMapper):
2022-03-08 Youenn Fablet <youenn@apple.com>
Improve WebRTC VPX media capabilities accuracy
https://bugs.webkit.org/show_bug.cgi?id=237462
Reviewed by Eric Carlson.
Reuse VPx decoder media capabilities routines for WebRTC.
Use caseless string comparison for content type.
Covered by updated tests.
* platform/graphics/cocoa/VP9UtilitiesCocoa.h:
* platform/graphics/cocoa/VP9UtilitiesCocoa.mm:
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
2022-03-07 Simon Fraser <simon.fraser@apple.com>
Rename VolatilityState to SetNonVolatileResult
https://bugs.webkit.org/show_bug.cgi?id=237562
Reviewed by Tim Horton.
Pure rename. I want to use VolatilityState to actually reflect state.
* platform/graphics/ConcreteImageBuffer.h:
* platform/graphics/ImageBuffer.h:
* platform/graphics/ImageBufferBackend.h:
(WebCore::ImageBufferBackend::setNonVolatile):
* platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp:
(WebCore::ImageBufferIOSurfaceBackend::setNonVolatile):
* platform/graphics/cg/ImageBufferIOSurfaceBackend.h:
* platform/graphics/cocoa/IOSurface.h:
* platform/graphics/cocoa/IOSurface.mm:
(WebCore::IOSurface::state const):
(WebCore::IOSurface::setVolatile):
(WebCore::operator<<):
2022-03-07 Tim Horton <timothy_horton@apple.com>
Fix the build
* platform/graphics/GraphicsContext.h:
2022-03-07 Per Arne Vollan <pvollan@apple.com>
Preconnecting after process swap is a page load time improvement on some devices
https://bugs.webkit.org/show_bug.cgi?id=237055
<rdar://problem/89638872>
Reviewed by Geoffrey Garen.
Export method.
* platform/network/NetworkLoadMetrics.h:
2022-03-07 Jean-Yves Avenard <jya@apple.com>
Add ability to convert FragmentedSharedBuffer to CMBlockBuffer
https://bugs.webkit.org/show_bug.cgi?id=237075
rdar://89338447
Reviewed by Jer Noble.
Add FragmentedSharedBuffer::getContiguousData and
FragmentedSharedBuffer::createCMBlockBuffer methods.
API tests added for getContiguousData.
createCMBlockBuffer will be used in a follow-up patch.
* platform/SharedBuffer.cpp:
(WebCore::FragmentedSharedBuffer::getContiguousData const):
* platform/SharedBuffer.h:
* platform/cocoa/SharedBufferCocoa.mm:
(WebCore::FreeSharedBuffer):
(WebCore::FragmentedSharedBuffer::createCMBlockBuffer const):
2022-03-07 Andres Gonzalez <andresg_22@apple.com>
Fix for <select> elements in isolated tree mode.
https://bugs.webkit.org/show_bug.cgi?id=237483
rdar://89530022
Reviewed by Chris Fleizach.
Test: accessibility/dropdown-value.html
AXObjectCache was not updating the isolated tree for
AXMenuListValueChanged notifications. Added handleMenuListValueChanged()
for this purpose.
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::performDeferredCacheUpdate):
(WebCore::AXObjectCache::handleMenuListValueChanged):
(WebCore::AXObjectCache::updateIsolatedTree):
* accessibility/AXObjectCache.h:
2022-03-07 Jean-Yves Avenard <jya@apple.com>
MediaTime::invalidTime() conversion to CMTime incorrectly creates a valid time.
https://bugs.webkit.org/show_bug.cgi?id=237473
rdar://problem/89814921
Reviewed by Jer Noble.
Fly-by fix: update call to AVOutputContextOutputDevicesDidChangeNotification
now that the access macro got fixed.
API Test added.
* platform/audio/ios/MediaSessionHelperIOS.mm:
(-[WebMediaSessionHelper startMonitoringAirPlayRoutes]):
* platform/graphics/avfoundation/objc/AVRoutePickerViewTargetPicker.mm:
(WebCore::AVRoutePickerViewTargetPicker::outputContextInternal):
(WebCore::AVRoutePickerViewTargetPicker::routeDetector):
(WebCore::AVRoutePickerViewTargetPicker::invalidatePlaybackTargets):
(-[WebAVRoutePickerViewHelper notificationHandler:]):
2022-03-07 Chris Dumez <cdumez@apple.com>
allow-custom-protocols-navigation sandbox flag.
https://bugs.webkit.org/show_bug.cgi?id=237269
<rdar://problem/89899736>
Reviewed by Geoffrey Garen.
Add support for allow-custom-protocols-navigation iframe sandbox flag to allow sandboxed iframes
to navigate to custom protocols, as per:
- https://github.com/whatwg/html/pull/7654
We recently started preventing sandboxed iframes from navigating to custom protocols, which broke
Microsoft Teams. We added a quirk for Microsoft Teams which we should be able to drop once they
adopt this new sandbox flag.
* dom/SecurityContext.cpp:
(WebCore::SecurityContext::isSupportedSandboxPolicy):
(WebCore::SecurityContext::parseSandboxPolicy):
* dom/SecurityContext.h:
2022-03-07 Chris Dumez <cdumez@apple.com>
Optimize the passing of data across threads
https://bugs.webkit.org/show_bug.cgi?id=237502
Reviewed by Geoff Garen.
Add more isolatedCopy() overloads that work on r-value references when the implementation
can be optimized. Also call isolatedCopy() / crossThreadCopy() on a r-value reference
whenever possible to leverage these optimizations.
* Modules/cache/CacheQueryOptions.h:
(WebCore::CacheQueryOptions::isolatedCopy const):
(WebCore::CacheQueryOptions::isolatedCopy):
* Modules/cache/DOMCacheEngine.cpp:
(WebCore::DOMCacheEngine::isolateCacheInfo): Deleted.
(WebCore::DOMCacheEngine::CacheInfos::isolatedCopy): Deleted.
* Modules/cache/DOMCacheEngine.h:
(WebCore::DOMCacheEngine::CacheInfo::isolatedCopy const):
(WebCore::DOMCacheEngine::CacheInfo::isolatedCopy):
(WebCore::DOMCacheEngine::CacheInfos::isolatedCopy const):
(WebCore::DOMCacheEngine::CacheInfos::isolatedCopy):
* Modules/cache/RetrieveRecordsOptions.h:
(WebCore::RetrieveRecordsOptions::isolatedCopy const):
(WebCore::RetrieveRecordsOptions::isolatedCopy):
* Modules/cache/WorkerCacheStorageConnection.cpp:
(WebCore::WorkerCacheStorageConnection::retrieveCaches):
(WebCore::WorkerCacheStorageConnection::batchDeleteOperation):
* Modules/entriesapi/DOMFileSystem.cpp:
(WebCore::ListedChild::isolatedCopy const):
(WebCore::ListedChild::isolatedCopy):
(WebCore::DOMFileSystem::listDirectory):
* Modules/indexeddb/IDBDatabaseIdentifier.cpp:
(WebCore::IDBDatabaseIdentifier::isolatedCopy const):
(WebCore::IDBDatabaseIdentifier::isolatedCopy):
* Modules/indexeddb/IDBDatabaseIdentifier.h:
* Modules/indexeddb/IDBGetResult.cpp:
(WebCore::IDBGetResult::isolatedCopy):
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::requestGetAllObjectStoreRecords):
(WebCore::IDBTransaction::requestGetAllIndexRecords):
* Modules/indexeddb/server/MemoryObjectStore.cpp:
(WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords):
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::updateOneIndexForAddRecord):
* Modules/indexeddb/shared/IDBDatabaseNameAndVersion.h:
(WebCore::IDBDatabaseNameAndVersion::isolatedCopy const):
(WebCore::IDBDatabaseNameAndVersion::isolatedCopy):
* Modules/indexeddb/shared/IDBError.cpp:
(WebCore::IDBError::isolatedCopy const): Deleted.
* Modules/indexeddb/shared/IDBError.h:
(WebCore::IDBError::isolatedCopy const):
(WebCore::IDBError::isolatedCopy):
* Modules/indexeddb/shared/IDBIndexInfo.cpp:
(WebCore::IDBIndexInfo::isolatedCopy const):
(WebCore::IDBIndexInfo::isolatedCopy):
* Modules/indexeddb/shared/IDBIndexInfo.h:
* Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
(WebCore::IDBObjectStoreInfo::isolatedCopy const):
(WebCore::IDBObjectStoreInfo::isolatedCopy):
* Modules/indexeddb/shared/IDBObjectStoreInfo.h:
* Modules/web-locks/WebLockManagerSnapshot.h:
(WebCore::WebLockManagerSnapshot::Info::isolatedCopy const):
(WebCore::WebLockManagerSnapshot::Info::isolatedCopy):
(WebCore::WebLockManagerSnapshot::isolatedCopy const):
(WebCore::WebLockManagerSnapshot::isolatedCopy):
* Modules/webaudio/AudioParamDescriptor.h:
(WebCore::AudioParamDescriptor::isolatedCopy const):
(WebCore::AudioParamDescriptor::isolatedCopy):
* Modules/webaudio/AudioWorkletGlobalScope.cpp:
(WebCore::AudioWorkletGlobalScope::registerProcessor):
* Modules/webaudio/AudioWorkletThread.cpp:
(WebCore::AudioWorkletThread::AudioWorkletThread):
* Modules/webaudio/AudioWorkletThread.h:
(WebCore::AudioWorkletThread::create):
* Modules/webdatabase/DatabaseTask.cpp:
(WebCore::DatabaseOpenTask::doPerformTask):
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::origins):
(WebCore::DatabaseTracker::addOpenDatabase):
(WebCore::DatabaseTracker::originLockFor):
* Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
(WebCore::WorkerThreadableWebSocketChannel::Peer::didConnect):
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* contentextensions/ContentExtensionActions.cpp:
(WebCore::ContentExtensions::ModifyHeadersAction::isolatedCopy const):
(WebCore::ContentExtensions::ModifyHeadersAction::isolatedCopy):
(WebCore::ContentExtensions::ModifyHeadersAction::ModifyHeaderInfo::isolatedCopy const):
(WebCore::ContentExtensions::ModifyHeadersAction::ModifyHeaderInfo::isolatedCopy):
(WebCore::ContentExtensions::RedirectAction::isolatedCopy const):
(WebCore::ContentExtensions::RedirectAction::isolatedCopy):
(WebCore::ContentExtensions::RedirectAction::URLTransformAction::isolatedCopy const):
(WebCore::ContentExtensions::RedirectAction::URLTransformAction::isolatedCopy):
(WebCore::ContentExtensions::RedirectAction::URLTransformAction::QueryTransform::isolatedCopy const):
(WebCore::ContentExtensions::RedirectAction::URLTransformAction::QueryTransform::isolatedCopy):
(WebCore::ContentExtensions::RedirectAction::URLTransformAction::QueryTransform::QueryKeyValue::isolatedCopy const): Deleted.
* contentextensions/ContentExtensionActions.h:
(WebCore::ContentExtensions::ActionWithStringMetadata::isolatedCopy const):
(WebCore::ContentExtensions::ActionWithStringMetadata::isolatedCopy):
* contentextensions/ContentExtensionCompiler.cpp:
(WebCore::ContentExtensions::compileRuleList):
* contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::loadTrigger):
* contentextensions/ContentExtensionRule.cpp:
(WebCore::ContentExtensions::Trigger::isolatedCopy const):
(WebCore::ContentExtensions::Trigger::isolatedCopy):
(WebCore::ContentExtensions::Action::isolatedCopy const):
(WebCore::ContentExtensions::Action::isolatedCopy):
* contentextensions/ContentExtensionRule.h:
(WebCore::ContentExtensions::Trigger::checkValidity):
(WebCore::ContentExtensions::ContentExtensionRule::isolatedCopy const):
(WebCore::ContentExtensions::ContentExtensionRule::isolatedCopy):
(WebCore::ContentExtensions::Trigger::~Trigger): Deleted.
* dom/Exception.h:
(WebCore::Exception::isolatedCopy const):
(WebCore::Exception::isolatedCopy):
(WebCore::isolatedCopy): Deleted.
* dom/ExceptionData.cpp: Removed.
(WebCore::ExceptionData::isolatedCopy const): Deleted.
* dom/ExceptionData.h:
(WebCore::ExceptionData::isolatedCopy const):
(WebCore::ExceptionData::isolatedCopy):
* dom/ExceptionOr.h:
(WebCore::isolatedCopy): Deleted.
* html/DirectoryFileListCreator.cpp:
(WebCore::FileInformation::isolatedCopy const):
(WebCore::FileInformation::isolatedCopy):
* html/FileInputType.cpp:
(WebCore::FileInputType::receiveDroppedFilesWithImageTranscoding):
* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::updatePredictedBaseURL):
* loader/CrossOriginOpenerPolicy.cpp:
(WebCore::CrossOriginOpenerPolicy::isolatedCopy const):
(WebCore::CrossOriginOpenerPolicy::isolatedCopy):
* loader/CrossOriginOpenerPolicy.h:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::handleContentFilterDidBlock):
* loader/FetchOptions.h:
(WebCore::FetchOptions::isolatedCopy const):
(WebCore::FetchOptions::isolatedCopy):
* loader/PolicyContainer.h:
(WebCore::PolicyContainer::isolatedCopy const):
(WebCore::PolicyContainer::isolatedCopy):
* loader/PrivateClickMeasurement.cpp:
(WebCore::PrivateClickMeasurement::UnlinkableToken::isolatedCopy const):
(WebCore::PrivateClickMeasurement::UnlinkableToken::isolatedCopy):
(WebCore::PrivateClickMeasurement::isolatedCopy const):
(WebCore::PrivateClickMeasurement::isolatedCopy):
(WebCore::PrivateClickMeasurement::SecretToken::isolatedCopy const): Deleted.
(WebCore::PrivateClickMeasurement::SourceSecretToken::isolatedCopy const): Deleted.
(WebCore::PrivateClickMeasurement::DestinationSecretToken::isolatedCopy const): Deleted.
(WebCore::PrivateClickMeasurement::EphemeralNonce::isolatedCopy const): Deleted.
(WebCore::PrivateClickMeasurement::SourceUnlinkableToken::isolatedCopy const): Deleted.
(WebCore::PrivateClickMeasurement::DestinationUnlinkableToken::isolatedCopy const): Deleted.
* loader/PrivateClickMeasurement.h:
(WebCore::PrivateClickMeasurement::SourceSite::isolatedCopy const):
(WebCore::PrivateClickMeasurement::SourceSite::isolatedCopy):
(WebCore::PrivateClickMeasurement::AttributionDestinationSite::isolatedCopy const):
(WebCore::PrivateClickMeasurement::AttributionDestinationSite::isolatedCopy):
(WebCore::PrivateClickMeasurement::EphemeralNonce::isolatedCopy const):
(WebCore::PrivateClickMeasurement::EphemeralNonce::isolatedCopy):
(WebCore::PrivateClickMeasurement::SourceUnlinkableToken::isolatedCopy const):
(WebCore::PrivateClickMeasurement::SourceUnlinkableToken::isolatedCopy):
(WebCore::PrivateClickMeasurement::DestinationUnlinkableToken::isolatedCopy const):
(WebCore::PrivateClickMeasurement::DestinationUnlinkableToken::isolatedCopy):
(WebCore::PrivateClickMeasurement::SecretToken::isolatedCopy const):
(WebCore::PrivateClickMeasurement::SecretToken::isolatedCopy):
(WebCore::PrivateClickMeasurement::SourceSecretToken::isolatedCopy const):
(WebCore::PrivateClickMeasurement::SourceSecretToken::isolatedCopy):
(WebCore::PrivateClickMeasurement::DestinationSecretToken::isolatedCopy const):
(WebCore::PrivateClickMeasurement::DestinationSecretToken::isolatedCopy):
* loader/ResourceTiming.cpp:
(WebCore::ResourceTiming::isolatedCopy const):
(WebCore::ResourceTiming::isolatedCopy):
* loader/ResourceTiming.h:
* loader/ServerTiming.cpp:
(WebCore::ServerTiming::isolatedCopy const):
(WebCore::ServerTiming::isolatedCopy):
* loader/ServerTiming.h:
* loader/WorkerThreadableLoader.cpp:
* page/ClientOrigin.h:
(WebCore::ClientOrigin::isolatedCopy const):
(WebCore::ClientOrigin::isolatedCopy):
* page/ProcessWarming.cpp:
(WebCore::ProcessWarming::prewarmWithInformation):
* page/ProcessWarming.h:
* page/csp/ContentSecurityPolicyResponseHeaders.cpp:
(WebCore::ContentSecurityPolicyResponseHeaders::isolatedCopy const):
(WebCore::ContentSecurityPolicyResponseHeaders::isolatedCopy):
* page/csp/ContentSecurityPolicyResponseHeaders.h:
* platform/FileChooser.h:
(WebCore::FileChooserFileInfo::isolatedCopy const):
(WebCore::FileChooserFileInfo::isolatedCopy):
* platform/MediaSelectionOption.h:
(WebCore::MediaSelectionOption::isolatedCopy const):
(WebCore::MediaSelectionOption::isolatedCopy):
* platform/RegistrableDomain.h:
(WebCore::RegistrableDomain::isolatedCopy const):
(WebCore::RegistrableDomain::isolatedCopy):
* platform/graphics/FontCache.cpp:
(WebCore::FontCache::prewarm):
* platform/graphics/FontCache.h:
(WebCore::FontCache::PrewarmInformation::isolatedCopy const):
(WebCore::FontCache::PrewarmInformation::isolatedCopy):
* platform/graphics/FontGenericFamilies.cpp:
(WebCore::FontGenericFamilies::isolatedCopy const):
(WebCore::FontGenericFamilies::isolatedCopy):
* platform/graphics/FontGenericFamilies.h:
* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::startAsyncDecodingQueue):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontDatabase::collectionForFamily):
(WebCore::FontCache::prewarm):
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(VideoFullscreenControllerContext::audioMediaSelectionOptionsChanged):
(VideoFullscreenControllerContext::legibleMediaSelectionOptionsChanged):
(isolatedCopy): Deleted.
* platform/mediacapabilities/AudioConfiguration.h:
(WebCore::AudioConfiguration::isolatedCopy const):
(WebCore::AudioConfiguration::isolatedCopy):
* platform/mediacapabilities/MediaConfiguration.h:
(WebCore::MediaConfiguration::isolatedCopy const):
(WebCore::MediaConfiguration::isolatedCopy):
* platform/mediacapabilities/VideoConfiguration.h:
(WebCore::VideoConfiguration::isolatedCopy const):
(WebCore::VideoConfiguration::isolatedCopy):
* platform/mediastream/RTCDataChannelHandler.h:
(WebCore::RTCDataChannelInit::isolatedCopy const):
(WebCore::RTCDataChannelInit::isolatedCopy):
* platform/mediastream/mac/AVCaptureDeviceManager.mm:
(WebCore::AVCaptureDeviceManager::refreshCaptureDevices):
* platform/network/HTTPHeaderMap.cpp:
(WebCore::HTTPHeaderMap::isolatedCopy const):
(WebCore::HTTPHeaderMap::isolatedCopy):
* platform/network/HTTPHeaderMap.h:
(WebCore::HTTPHeaderMap::CommonHeader::isolatedCopy const):
(WebCore::HTTPHeaderMap::CommonHeader::isolatedCopy):
(WebCore::HTTPHeaderMap::UncommonHeader::isolatedCopy const):
(WebCore::HTTPHeaderMap::UncommonHeader::isolatedCopy):
* workers/service/ServiceWorkerClients.cpp:
(WebCore::ServiceWorkerClients::claim):
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::RegistrationDatabase::schedulePushChanges):
* worklets/WorkletParameters.h:
(WebCore::WorkletParameters::isolatedCopy const):
(WebCore::WorkletParameters::isolatedCopy):
2022-03-07 Chris Dumez <cdumez@apple.com>
Make "true" count as truthy in window.open()'s boolean features
https://bugs.webkit.org/show_bug.cgi?id=237530
Reviewed by Alex Christensen.
Make "true" count as truthy in window.open()'s boolean features, as per:
- https://github.com/whatwg/html/pull/7425
Test: imported/w3c/web-platform-tests/html/browsers/the-window-object/window-open-windowfeatures-values.html
* page/WindowFeatures.cpp:
(WebCore::setWindowFeature):
2022-03-07 Antoine Quint <graouts@webkit.org>
[web-animations] animating "fill" and "stroke" to or from "currentColor" should work
https://bugs.webkit.org/show_bug.cgi?id=237531
Reviewed by Antti Koivisto.
Invalid colors should use the value for the "color" property on the provided RenderStyle.
* animation/CSSPropertyAnimation.cpp:
2022-03-07 Antoine Quint <graouts@webkit.org>
Transition on text-decoration-color from currentColor jumps
https://bugs.webkit.org/show_bug.cgi?id=236992
<rdar://problem/89382835>
Reviewed by Antti Koivisto.
We need to use the MaybeInvalidColor tag to identify that this property can work with `currentColor`.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2022-03-07 Antoine Quint <graouts@webkit.org>
[web-animations] text-emphasis shorthand should be animatable
https://bugs.webkit.org/show_bug.cgi?id=237529
Reviewed by Antti Koivisto.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::valueForTextEmphasisStyle):
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
2022-03-07 Peng Liu <peng.liu6@apple.com>
Small cleanups of media code
https://bugs.webkit.org/show_bug.cgi?id=237496
Reviewed by Xabier Rodriguez-Calvar.
No new tests. No behavior change.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updatePlayState): `schedulePlaybackControlsManagerUpdate()` is
called in both branches.
2022-03-07 Antoine Quint <graouts@webkit.org>
[web-animations] text-emphasis-style should support discrete animations
https://bugs.webkit.org/show_bug.cgi?id=237514
Reviewed by Antti Koivisto.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
2022-03-07 Antoine Quint <graouts@webkit.org>
[web-animations] text-emphasis-color should support non-discrete animations
https://bugs.webkit.org/show_bug.cgi?id=237518
Reviewed by Antti Koivisto.
This property was mistakenly added as a discrete property when it was unprefixed.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2022-03-07 Antoine Quint <graouts@webkit.org>
[web-animations] text-decoration-skip-ink should support discrete animations
https://bugs.webkit.org/show_bug.cgi?id=237512
Reviewed by Antti Koivisto.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2022-03-07 Antoine Quint <graouts@webkit.org>
[web-animations] line-break should support discrete animations
https://bugs.webkit.org/show_bug.cgi?id=237520
Reviewed by Antti Koivisto.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2022-03-07 Antoine Quint <graouts@webkit.org>
Parsing of list-style shorthand is incorrect
https://bugs.webkit.org/show_bug.cgi?id=237515
Reviewed by Antti Koivisto.
The spec at https://drafts.csswg.org/css-lists/#list-style-property says the order of the properties
in the "list-style" shorthand is <'list-style-position'> || <'list-style-image'> || <'list-style-type'>.
Additionally, the "none" value needs special handling such that it sets "list-style-type".
* css/CSSProperties.json:
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseShorthand):
2022-03-07 Alberto Garcia <berto@igalia.com>
makeprop.pl breaks reproducible builds
https://bugs.webkit.org/show_bug.cgi?id=237521
Reviewed by Carlos Garcia Campos.
* css/makeprop.pl: Sort hash elements so the output file is always
the same across different builds.
2022-03-07 Nikolas Zimmermann <nzimmermann@igalia.com>
Add hasTransformOrPerspective() helper to RenderObject
https://bugs.webkit.org/show_bug.cgi?id=237469
Reviewed by Darin Adler.
Avoid duplicating the logic to test if a renderer is transformed in
multiple places. Currently RenderGeometryMap duplicates the logic to add
one extra condition, the presence of a 'perspective' property.
While I was at it: remove the redundant offsetPath() check in
RenderObject::hasTransform(), since RenderStyle::hasTransform()
already returns true if offsetPath() is non-null.
LBSE wants to extend hasTransform() by a new condition: hasSVGTransform().
Before this patch, the place in RenderGeometryMap was easy to miss, fix that,
by centralizing the logic in one place.
Covered by existing tests, no change in behaviour.
* rendering/RenderGeometryMap.cpp:
(WebCore::canMapBetweenRenderersViaLayers): Use RenderObject::hasTransformOrPespective().
* rendering/RenderObject.h:
(WebCore::RenderObject::hasTransform const): Remove redundant offsetPath() check.
(WebCore::RenderObject::hasTransformOrPespective const): Add new helper.
2022-03-07 Nikolas Zimmermann <nzimmermann@igalia.com>
[LBSE] Begin layer-aware RenderSVGTransformableContainer implementation
https://bugs.webkit.org/show_bug.cgi?id=237024
Reviewed by Rob Buis.
Create RenderSVGContainer based on the downstream LBSE implementation.
This patch does not yet enable the creation of RenderSVGContainer
renderers if LBSE is enabled, since the derived classes, such as
RenderSVGHiddenContainer / RenderSVGViewportContainer / ..., are still
missing in LBSE.
Covered by existing tests, no change in behaviour.
* Sources.txt: Add RenderSVGTransformableContainer.* to build.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* rendering/RenderObject.h:
(WebCore::RenderObject::isSVGTransformableContainer const):
* rendering/svg/RenderSVGTransformableContainer.cpp: Added.
(WebCore::RenderSVGTransformableContainer::RenderSVGTransformableContainer):
(WebCore::associatedUseElement):
(WebCore::RenderSVGTransformableContainer::additionalContainerTranslation const):
(WebCore::RenderSVGTransformableContainer::calculateViewport):
(WebCore::RenderSVGTransformableContainer::layoutChildren):
(WebCore::RenderSVGTransformableContainer::updateFromStyle):
(WebCore::RenderSVGTransformableContainer::applyTransform const):
(WebCore::RenderSVGTransformableContainer::styleWillChange):
(WebCore::RenderSVGTransformableContainer::graphicsElement const):
* rendering/svg/RenderSVGTransformableContainer.h: Added.
* rendering/svg/SVGContainerLayout.cpp:
(WebCore::SVGContainerLayout::transformToRootChanged):
* svg/SVGElement.cpp: Create renderer for <g> elements in LBSE mode.
(WebCore::createSVGLayerAwareElementSet):
* svg/SVGGElement.cpp: Ditto.
(WebCore::SVGGElement::createElementRenderer):
2022-03-07 Matt Woodrow <mattwoodrow@apple.com>
Compute correct containing block override size for items that are subgridden in one dimension only.
https://bugs.webkit.org/show_bug.cgi?id=236951
Reviewed by Dean Jackson.
Items that are subgridded in one dimension will be included in the track sizing algorithm of the
outer grid for that dimension. When measuring their size in the subgridded dimension, we need to
set their containing block size in the other (non-subgridded) dimension, which is only available
from the subgrid's track sizing, not the outer track sizes.
This recurses up to set the override size on the subgrid element instead, and forces a layout
there, which should copy down subgrid track sizes and compute the other dimension, making it
available on the inner item we need.
Test: imported/w3c/web-platform-tests/css/css-grid/subgrid/auto-track-sizing-002.html
* rendering/GridLayoutFunctions.cpp:
(WebCore::GridLayoutFunctions::extraMarginForSubgridAncestors):
* rendering/GridLayoutFunctions.h:
* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrackSizingAlgorithmStrategy::updateOverridingContainingBlockContentSizeForChild const):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::isSubgridOf):
* rendering/RenderGrid.h:
2022-03-07 Frédéric Wang <fwang@igalia.com>
Release_Assert | WebCore::Document::addTopLayerElement()
https://bugs.webkit.org/show_bug.cgi?id=237307
Reviewed by Chris Dumez.
setBooleanAttribute() call in HTMLDialogElement::showModal() dispatches a DOMSubtreeModified
event. Postpone it so that listeners cannot disconnect the dialog element.
* html/HTMLDialogElement.cpp:
(WebCore::HTMLDialogElement::showModal): Add a queue to postpone event.
2022-03-06 Eric Carlson <eric.carlson@apple.com>
Push HTMLMediaElement renderer's contentBox rect to GPU process
https://bugs.webkit.org/show_bug.cgi?id=237444
rdar://84869202
Reviewed by Jer Noble.
No new tests. This is a speculative fix, with new logging, for an issue I haven't
been able to reproduce.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updateRenderer): Push mediaPlayerContentBoxRect to the
media player.
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::playerContentBoxRectChanged): Pass rect to platform player.
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::playerContentBoxRectChanged):
2022-03-05 Simon Fraser <simon.fraser@apple.com>
Replace IntRectExtent with RectEdges<int>
https://bugs.webkit.org/show_bug.cgi?id=237495
Reviewed by Sam Weinig.
IntRectExtent was just like RectEdges<int>, so remove it.
Add operator+= for RectEdges<>, and helpers to convert from RectEdges<int> to RectEdges<LayoutUnit>.
Code that previously added a IntRectExtent to a rect now uses .expand().
For some reason initializing a RectEdges<T> with arguments std::max<T> fails to
compile, so use intermediate variables in two places.
* Headers.cmake:
* WebCore.xcodeproj/project.pbxproj:
* platform/LengthBox.cpp:
(WebCore::operator<<):
* platform/LengthBox.h:
(WebCore::toLayoutBoxExtent):
* platform/RectEdges.h:
(WebCore::RectEdges::isZero const):
(WebCore::operator+=):
* platform/graphics/IntRectExtent.h: Removed.
* platform/graphics/filters/FEDropShadow.cpp:
(WebCore::FEDropShadow::outsets const):
* platform/graphics/filters/FilterFunction.h:
* platform/graphics/filters/FilterOperations.cpp:
(WebCore::FilterOperations::outsets const):
* platform/graphics/filters/FilterOperations.h:
* rendering/CSSFilter.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::setFilterBackendNeedsRepaintingInRect):
(WebCore::transparencyClipBox):
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayerFilters.cpp:
(WebCore::RenderLayerFilters::beginFilterEffect):
2022-03-05 Alan Bujtas <zalan@apple.com>
Remove non-standard display:block UA stylesheet rule for <layer>
https://bugs.webkit.org/show_bug.cgi?id=236730
<rdar://problem/89372670>
Reviewed by Antti Koivisto.
This looks to be an old WebKit (khtml?) quirk.
See also https://bugs.chromium.org/p/chromium/issues/detail?id=1298197
* css/html.css:
(address, article, aside, div, footer, header, hgroup, main, nav, section):
(address, article, aside, div, footer, header, hgroup, layer, main, nav, section): Deleted.
2022-03-05 Mark Lam <mark.lam@apple.com>
Fix broken SuspendExceptionScope and remove redundant VM::DeferExceptionScope.
https://bugs.webkit.org/show_bug.cgi?id=237441
<rdar://problem/89769627>
Reviewed by Yusuke Suzuki.
* inspector/InspectorFrontendAPIDispatcher.cpp:
(WebCore::InspectorFrontendAPIDispatcher::evaluateExpression):
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::evaluateScriptInExtensionTab):
2022-03-05 Alan Bujtas <zalan@apple.com>
[IFC][Integration] Do not bail out on IFC content with floats inside.
https://bugs.webkit.org/show_bug.cgi?id=237494
Reviewed by Antti Koivisto.
We have support for such content now.
(This gives a noticeable coverage boost on PLT5 content.)
* layout/integration/LayoutIntegrationCoverage.cpp:
(WebCore::LayoutIntegration::canUseForChild):
2022-03-05 Antti Koivisto <antti@apple.com>
Resolve ::first-line style eagerly
https://bugs.webkit.org/show_bug.cgi?id=237362
Reviewed by Alan Bujtas.
Compute ::first-line style during style resolution instead of lazily in render tree.
This fixes bugs and clarifies the architecture in ways that a helpful for features like
container queries.
As a side effect it also makes ::first-line style animatable.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::firstLineBlock const): Deleted.
* rendering/RenderBlock.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::RenderElement):
(WebCore::RenderElement::firstLineStyle const):
(WebCore::RenderElement::styleWillChange):
(WebCore::RenderElement::computeFirstLineStyle const): Deleted.
(WebCore::RenderElement::invalidateCachedFirstLineStyle): Deleted.
* rendering/RenderElement.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::firstLineBlock const): Deleted.
* rendering/RenderObject.h:
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::firstLineBlock const): Deleted.
* rendering/RenderRubyRun.h:
* rendering/RenderTable.cpp:
(WebCore::RenderTable::firstLineBlock const): Deleted.
* rendering/RenderTable.h:
* rendering/RenderText.cpp:
(WebCore::RenderText::findByDisplayContentsInlineWrapperCandidate): Deleted.
* rendering/RenderText.h:
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::getCachedPseudoStyle const):
* rendering/style/RenderStyle.h:
(WebCore::generatesBox):
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::firstLineBlock const): Deleted.
* rendering/svg/RenderSVGText.h:
* rendering/updating/RenderTreeUpdaterGeneratedContent.cpp:
(WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolveElement):
(WebCore::Style::TreeResolver::resolvePseudoElement):
(WebCore::Style::TreeResolver::resolveInheritedFirstLinePseudoElement):
(WebCore::Style::TreeResolver::makeResolutionContextForInheritedFirstLine):
(WebCore::Style::TreeResolver::boxGeneratingParent const const):
(WebCore::Style::TreeResolver::parentBoxStyle const):
(WebCore::Style::TreeResolver::resolveComposedTree):
(WebCore::Style::TreeResolver::resolvePseudoStyle): Deleted.
* style/StyleTreeResolver.h:
2022-03-05 Alan Bujtas <zalan@apple.com>
[LFC][Integration] RenderInline should use ADD_REASONS_AND_RETURN_IF_NEEDED
https://bugs.webkit.org/show_bug.cgi?id=237492
Reviewed by Antti Koivisto.
Content inside RenderInline should be accounted for when collecting coverage information.
(This patch also has a bit of a printModernLineLayoutCoverage&co refactoring.)
* layout/integration/LayoutIntegrationCoverage.cpp:
(WebCore::LayoutIntegration::printTextForSubtree):
(WebCore::LayoutIntegration::contentLengthForSubtreeStayWithinBlockFlow):
(WebCore::LayoutIntegration::contentLengthForBlockFlow):
(WebCore::LayoutIntegration::printModernLineLayoutBlockList):
(WebCore::LayoutIntegration::printModernLineLayoutCoverage):
(WebCore::LayoutIntegration::canUseForChild):
(WebCore::LayoutIntegration::textLengthForSubtree): Deleted.
(WebCore::LayoutIntegration::collectNonEmptyLeafRenderBlockFlows): Deleted.
(WebCore::LayoutIntegration::collectNonEmptyLeafRenderBlockFlowsForCurrentPage): Deleted.
2022-03-05 Youenn Fablet <youenn@apple.com>
Implement remote-inbound-rtp packetsLost
https://bugs.webkit.org/show_bug.cgi?id=237443
Reviewed by Eric Carlson.
Take benefit of latest backend to expose RemoteInboundRtpStreamStats values inherited from ReceivedRtpStreamStats.
Covered by updated test.
* Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp:
(WebCore::fillReceivedRtpStreamStats):
(WebCore::fillInboundRtpStreamStats):
(WebCore::fillRemoteInboundRtpStreamStats):
2022-03-05 Oriol Brufau <obrufau@igalia.com>
[css-cascade] Let 'revert-layer' in lowest layer roll back to user styles
https://bugs.webkit.org/show_bug.cgi?id=237486
Reviewed by Antti Koivisto.
When 'revert-layer' was used in the lowest @layer, then it would behave
as 'unset'. This patch fixes ensureRollbackCascadeForRevertLayer() to
not return nullptr and instead return ensureRollbackCascadeForRevert()
in that case. This imples that 'revert-layer' will behave like 'revert'
and roll back to user (or UA) styles.
Test: imported/w3c/web-platform-tests/css/css-cascade/all-prop-revert-layer-noop.html
* style/StyleBuilder.cpp:
(WebCore::Style::Builder::ensureRollbackCascadeForRevertLayer):
2022-03-04 Simon Fraser <simon.fraser@apple.com>
Optimize the padding in StyleRareInheritedData
https://bugs.webkit.org/show_bug.cgi?id=237488
Reviewed by Cameron McCormack.
Shrink StyleRareInheritedData from 280 bytes to 264 bytes on macOS.
Also fix a missing comparison of wordSpacing in operator==.
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator== const):
* rendering/style/StyleRareInheritedData.h:
2022-03-04 Tyler Wilcock <tyler_w@apple.com>
AX: Protect incoming object with Ref in AXObjectCache::textChanged
https://bugs.webkit.org/show_bug.cgi?id=237475
Reviewed by Chris Fleizach.
This is better practice as ascending the hierarchy could cause
the object to get deleted.
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::textChanged):
2022-03-04 Tyler Wilcock <tyler_w@apple.com>
AX: [WebAccessibilityObjectWrapperMac AXAttributeStringSetFont] crashes when given a font with a nil postscript name, font family, or display name
https://bugs.webkit.org/show_bug.cgi?id=237373
Reviewed by Chris Fleizach and Andres Gonzalez.
[WebAccessibilityObjectWrapperMac AXAttributeStringSetFont] crashes when given a font with a
nil postscript name, font family, or display name. This can be
triggered with a custom SVG @font-face -- for example:
@font-face {
font-family: 'Litherum';
src: url("resources/Litherum.svg") format(svg);
}
* { font-family: 'Litherum'; }
We fix this by checking if these values are nil before trying to add
them to a dictionary.
This patch also centralizes application of fonts to attributed strings
by moving AXAttributeStringSetFont to the base wrapper. In doing so,
we fix a bug where if [WebAccessibilityObjectWrapperBase AXAttributeStringSetStyle] was
called from a Mac-context, it set iOS font properties (e.g.
UIAccessibilityTokenFontFamily instead of NSAccessibilityFontFamilyKey).
Test: accessibility/svg-font-face.html
* accessibility/mac/WebAccessibilityObjectWrapperBase.h:
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(AXAttributedStringRangeIsValid): Added.
(AXAttributedStringSetFont): Added.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(AXAttributeStringSetStyle):
(AXAttributedStringAppendText):
(AXAttributedStringRangeIsValid):
Moved to base wrapper.
(AXAttributeStringSetFont):
Moved to base wrapper.
2022-03-04 Patrick Angle <pangle@apple.com>
REGRESSION (r284472): [ Monterey ] http/tests/websocket/tests/hybi/inspector/send-and-recieve-debugger.html is failing
https://bugs.webkit.org/show_bug.cgi?id=237280
Reviewed by Devin Rousso.
Covered by existing http/tests/websocket/tests/hybi/inspector/* test cases.
On macOS Monterey we use NSURLSession-based WebSockets by default, unlike earlier versions of macOS. The channel
for these sockets is implemented in `WebKit::WebSocketChannel`. The non-NSURLSession WebSockets channel (at
least on Cocoa platforms) is implemented in `WebCore::WebSocketChannel`.
As of r284472 the logic to delay the dispatch of received WebSocket message on platforms using
NSURLSession-based WebSockets is handled by `WebCore::WebSocket`, not the `WebKit::WebSocketChannel`.
`WebKit::WebSocketChannel` now immediately does the work it needs to, and only the delegated work to `WebSocket`
is queued and taken care of when the socket has resumed. This resulted in some of the instrumentation in
`WebKit::WebSocketChannel` being able to be called while the socket was suspended leading to events being logged
in the frontend "in the future" (e.g. before the paused script would have been able to be aware of them). To
correct this the `WebKit::WebSocketChannel` now provides a hook into its helper `WebSocketChannelInspector`
object to allow the `WebCore::WebSocket` to notify Web Inspector of events at the same time it is being
logically handled by the page.
Other `ThreadableWebSocketChannel` implementations will instead provide `nullptr` in place of a pointer to a
`WebInspectorChannelInspector`. `WebCore::WebSocketChannel` was not affected by the changes in r284472 as it has
a different way to guarantee that the methods containing InspectorInstrumentation were not called while the
channel was suspended (and enforced with numerous `ASSERT(!m_suspended)` checks).
* Modules/websockets/ThreadableWebSocketChannel.h:
(WebCore::ThreadableWebSocketChannel::channelInspector const):
* Modules/websockets/WebSocketChannelClient.h:
- Add `reason` for error messages so they can be sent to Web Inspector.
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::didReceiveMessage):
(WebCore::WebSocket::didReceiveBinaryData):
(WebCore::WebSocket::didReceiveMessageError):
(WebCore::WebSocket::didClose):
* Modules/websockets/WebSocket.h:
- Move inspector instrumentation calls from `WebKit::WebSocketChannel` to here so that they are not called until
the socket is resumed.
- We also now wrap these instrumentation calls in an unlikely check for frontends to avoid allocating the
simulated call frames when Web Inspector isn't even open.
* Modules/websockets/WebSocketChannelInspector.cpp:
(WebCore::WebSocketChannelInspector::WebSocketChannelInspector):
(WebCore::WebSocketChannelInspector::didCreateWebSocket const):
(WebCore::WebSocketChannelInspector::willSendWebSocketHandshakeRequest const):
(WebCore::WebSocketChannelInspector::didReceiveWebSocketHandshakeResponse const):
(WebCore::WebSocketChannelInspector::didCloseWebSocket const):
(WebCore::WebSocketChannelInspector::didReceiveWebSocketFrame const):
(WebCore::WebSocketChannelInspector::didSendWebSocketFrame const):
(WebCore::WebSocketChannelInspector::didReceiveWebSocketFrameError const):
(WebCore::WebSocketChannelInspector::createFrame):
(WebCore::WebSocketChannelInspector::didCreateWebSocket): Deleted.
(WebCore::WebSocketChannelInspector::willSendWebSocketHandshakeRequest): Deleted.
(WebCore::WebSocketChannelInspector::didReceiveWebSocketHandshakeResponse): Deleted.
(WebCore::WebSocketChannelInspector::didCloseWebSocket): Deleted.
(WebCore::WebSocketChannelInspector::didReceiveWebSocketFrame): Deleted.
(WebCore::WebSocketChannelInspector::didSendWebSocketFrame): Deleted.
(WebCore::WebSocketChannelInspector::didReceiveWebSocketFrameError): Deleted.
* Modules/websockets/WebSocketChannelInspector.h:
- Update to keep a WeakRef to the `Document` to reduce the amount of plumbing necessary to call these methods
from `WebSocket`.
- Move static utility method `createFrame` here from `WebKit::WebSocketChannel` since it is only used for
inspector instrumentation.
* Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
(WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveMessageError):
(WebCore::WorkerThreadableWebSocketChannel::Bridge::connect):
* Modules/websockets/WorkerThreadableWebSocketChannel.h:
* Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
(WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveMessageError):
* Modules/websockets/ThreadableWebSocketChannelClientWrapper.h:
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::fail):
(WebCore::WebSocketChannel::didFailSocketStream):
* Modules/websockets/WebSocketChannel.h:
- Update these classes to pass along a reason, if available, for errors.
2022-03-04 Chris Dumez <cdumez@apple.com>
Modernize OriginLock
https://bugs.webkit.org/show_bug.cgi?id=237485
Reviewed by Darin Adler.
OriginLock subclasses ThreadSafeRefCounted. As a result, it should have a create()
factory function instead of an error-prone public constructor. Its functions should
also take String parameters by const reference instead of by value.
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::originLockFor):
* Modules/webdatabase/DatabaseTracker.h:
* Modules/webdatabase/OriginLock.cpp:
(WebCore::lockFileNameForPath):
(WebCore::OriginLock::OriginLock):
(WebCore::OriginLock::deleteLockFile):
(WebCore::OriginLock::lockFileNameForPath): Deleted.
* Modules/webdatabase/OriginLock.h:
(WebCore::OriginLock::create):
2022-03-04 Kate Cheney <katherine_cheney@apple.com>
about:blank iframes do not always inherit parent CSP
https://bugs.webkit.org/show_bug.cgi?id=236347
<rdar://problem/88669147>
Reviewed by Brent Fulgham.
Test: http/tests/security/contentSecurityPolicy/block-eval-onload-in-nested-about-blank-iframe.html
Usually we initialize CSP for window when we create a jsWindowProxy
for that frame. In this case, we load an about:blank iframe that
attempts to run eval() in the onload function of its own nested
iframe. Since we never run script in frame, we don't initialize a
jsWindowProxy and thus never propogate its CSP.
This fix checks the document's CSP in FrameLoader::clear when we
initialize a new JSGlobalObject and sets the eval value in the window
accordingly to properly enforce CSP.
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::enableEval):
* bindings/js/ScriptController.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::clear):
* page/csp/ContentSecurityPolicy.h:
(WebCore::ContentSecurityPolicy::evalErrorMessage const):
2022-03-04 Myles C. Maxfield <mmaxfield@apple.com>
[iOS] Books ASSERTs upon opening a book with a debug build of WebKit
https://bugs.webkit.org/show_bug.cgi?id=237445
<rdar://problem/89776531>
Reviewed by Alex Christensen.
* platform/sql/SQLiteDatabase.cpp:
(WebCore::SQLiteDatabase::open):
2022-03-04 Chris Dumez <cdumez@apple.com>
Home link on weather.gov is not working
https://bugs.webkit.org/show_bug.cgi?id=237451
<rdar://60409277>
Reviewed by Geoff Garen.
According to the HTML specification [1], when history.back() is called, we are supposed to
resolve the history entry based on the delta (-1), then we're supposed to queue a task to
traverse the history to that particular entry.
However, WebKit was merely scheduling a task to navigate the history with a delta of -1.
We only resolve the target history entry once the scheduled task runs asynchronously.
As a result, we could end up navigating to a different history entry than we'd expect if
the history list changes between the call to history.back() and the actual execution of
the task to traverse the history list. In particular, fragment navigations can cause
synchronous navigations and thus add new history entries.
On weather.gov, the "HOME" anchor looks like so:
`<a href="#" onclick="history.back();">HOME</a>`
Per the DOM specification, when clicking the anchor, we'd first call `history.back()` and
then run the anchor activation behavior that would do a fragment navigation to "#".
The `history.back()` call would schedule to task to navigate back, then we'd navigate to
"#" synchronously, which would add a new history entry. Once the task to navigate back
would run asynchronously, we would navigate back to the same page (but without the fragment)
instead of going back to the home page.
[1] https://html.spec.whatwg.org/multipage/history.html#traverse-the-history-by-a-delta
Test: imported/w3c/web-platform-tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/tentative/anchor-fragment-history-back-on-click.html
* history/BackForwardClient.h:
* history/BackForwardController.cpp:
(WebCore::BackForwardController::containsItem const):
* history/BackForwardController.h:
* loader/EmptyClients.cpp:
* loader/NavigationScheduler.cpp:
(WebCore::ScheduledHistoryNavigation::ScheduledHistoryNavigation):
(WebCore::NavigationScheduler::scheduleHistoryNavigation):
2022-03-04 Simon Fraser <simon.fraser@apple.com>
Use an OptionSet<> for GraphicsContextCGFlags
https://bugs.webkit.org/show_bug.cgi?id=237482
Reviewed by Wenson Hsieh.
Mechanical change to use an OptionSet<> for GraphicsContextCG::m_contextFlags.
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContextCG::setIsCALayerContext):
(WebCore::GraphicsContextCG::isCALayerContext const):
(WebCore::GraphicsContextCG::setIsAcceleratedContext):
(WebCore::GraphicsContextCG::renderingMode const):
* platform/graphics/cg/GraphicsContextPlatformPrivateCG.h:
(WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
(): Deleted.
2022-03-04 Dan Glastonbury <djg@apple.com>
Support constants in IDL namespaces.
https://bugs.webkit.org/show_bug.cgi?id=232557
<radr://problem/85142162>
Reviewed by Sam Weinig.
Test: bindings/script/test/TestNamespaceConst.idl
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateConstructorHelperMethods):
If namespace contains only constants, globalObject is unused
produces a compile error. Add UNUSED_PARAM to quiet error.
* bindings/scripts/IDLAttributes.json:
* bindings/scripts/IDLParser.pm:
(convertNamespaceToInterface): Copy namespace constants to new interface.
(applyTypedefs): Apply typedefs to namespace constants.
(parseNamespace): Added parsed constants to namespace's list of constants.
(parseNamespaceMember): Accept constants as namespace members.
* bindings/scripts/test/BindingTestGlobalConstructors.idl:
* bindings/scripts/test/JS/*: Updated.
* bindings/scripts/test/SupplementalDependencies.dep:
* bindings/scripts/test/TestNamespaceConst.idl: Added.
2022-03-04 Chris Dumez <cdumez@apple.com>
Load event never firing after form is submitted
https://bugs.webkit.org/show_bug.cgi?id=235407
<rdar://problem/87831049>
Reviewed by Geoffrey Garen.
In Document::implicitClose(), we early return (and thus don't fire the load
event) if there is a location change pending. To determine if there is a
location change pending, we rely on NavigationScheduler::locationChangePending()
which checks if there is a schedule navigation or not. This usually works fine.
However, when a form gets submitted with a target that is "_blank",
FrameLoader::submitForm() is not able to find the target frame (since we'll need
to create one) and it ends up using the current frame's scheduler. The idea is
that once the navigation actually triggers, FrameLoader::loadFrameRequest() will
check the target and create the new Frame.
The issue is that as a result of this, NavigationScheduler::locationChangePending()
returns true for the submitter's frame while such form submission is scheduled,
even though the navigation will actually happen in another (new) frame. To address
the issue, I updated NavigationScheduler::locationChangePending() to check that
the pending navigation is actually for the current frame.
Test: http/tests/loading/form-submission-no-load-event.html
* loader/NavigationScheduler.cpp:
(WebCore::ScheduledNavigation::targetIsCurrentFrame const):
(WebCore::NavigationScheduler::locationChangePending):
(WebCore::ScheduledFormSubmission::ScheduledFormSubmission): Deleted.
2022-03-04 Said Abou-Hallawa <said@apple.com>
[GPU Process] Canvas compositing buffer should be created through its GraphicsContext
https://bugs.webkit.org/show_bug.cgi?id=237260
rdar://89196918
Reviewed by Simon Fraser.
If the backend of the underlying ImageBuffer of the canvas is remote the
compositing ImageBuffer will also be remote. This will transfer the whole
compositing operation to GPUProcess.
The layout test fast/canvas/canvas-composite-canvas.html crashes because
of this bug on the GPUP layout bots.
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::fullCanvasCompositedDrawImage):
(WebCore::CanvasRenderingContext2DBase::createCompositingBuffer): Deleted.
* html/canvas/CanvasRenderingContext2DBase.h:
2022-03-04 Dan Glastonbury <djg@apple.com>
"OffscreenCanvas" in IDLs doesn't seem to be able to be compiled
https://bugs.webkit.org/show_bug.cgi?id=232733
<rdar://problem/85318653>
Reviewed by Sam Weinig.
OffscreenCanvas is controlled by ENABLE flags. Add conditional
compilation to handle OffscreenCanvas to the WebGPU IDL bindings
when the OffscreenCanvas feature is enabled.
* Modules/WebGPU/GPUCanvasContext.cpp:
(WebCore::GPUCanvasContext::canvas):
* Modules/WebGPU/GPUCanvasContext.h:
* Modules/WebGPU/GPUCanvasContext.idl:
Add OffscreenCanvas to canvas attribute when it is enabled.
* Modules/WebGPU/GPUImageCopyExternalImage.h:
* Modules/WebGPU/GPUImageCopyExternalImage.idl:
Add OffscreenCanvas to source attribute when it is enabled.
2022-03-04 Eric Carlson <eric.carlson@apple.com>
[Cocoa] Crash in MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL
https://bugs.webkit.org/show_bug.cgi?id=237456
rdar://80407863
Reviewed by Jer Noble.
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::enableInheritURIQueryComponent const): Create
and use a static, never destroyed, AtomString instead of creating one every time
a AVURLAsset is created. New method used by both AVF media players.
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::MediaPlayerPrivateAVFoundationCF::createAVAssetForURL): Call enableInheritURIQueryComponent.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Ditto.
2022-03-04 Sihui Liu <sihui_liu@apple.com>
IDB serialization thread should pass isolated copy of IndexIDToIndexKeyMap to storage thread
https://bugs.webkit.org/show_bug.cgi?id=237455
Reviewed by Chris Dumez.
* Modules/indexeddb/server/MemoryObjectStore.cpp:
(WebCore::IDBServer::MemoryObjectStore::addRecord):
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::putOrAdd):
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::generateIndexKeyMapForValueIsolatedCopy):
(WebCore::generateIndexKeyMapForValue): Deleted.
* bindings/js/IDBBindingUtilities.h:
2022-03-04 Aditya Keerthi <akeerthi@apple.com>
[iOS] Unable to scroll to a found text range when there is an existing selection
https://bugs.webkit.org/show_bug.cgi?id=237407
rdar://89653213
Reviewed by Wenson Hsieh.
Scrolling to a found text range is performed by creating a
`TemporarySelectionChange` and using the `RevealSelectionBounds`
`TemporarySelectionOption`. When a `TemporarySelectionChange` is
destroyed, the original selection is restored.
Currently, the selection is restored using the same set of selection
options used to make the temporary selection. Consequently, whenever a
"reveal" option is specified, WebKit scrolls to reveal the temporary
selection, and then scrolls again to reveal the original selection.
This behavior means that an attempt to scroll to a found text range
will fail if the document has an existing selection.
To fix, do not add any of the "reveal" options to the set of selection
options when restoring the original selection during a
`TemporarySelectionChange`. The only other features that use
`TemporarySelectionChange` with "reveal" options are App Highlights
and Scroll To Text Fragment. Neither of these features require WebKit
to scroll to the original selection.
* editing/Editor.cpp:
(WebCore::TemporarySelectionChange::TemporarySelectionChange):
(WebCore::TemporarySelectionChange::~TemporarySelectionChange):
(WebCore::TemporarySelectionChange::setSelection):
* editing/Editor.h:
2022-03-04 Tyler Wilcock <tyler_w@apple.com>
AX ITM: Updating m_pendingLoadingProgress can cause deadlock on AXIsolatedTree::m_changeLogLock
https://bugs.webkit.org/show_bug.cgi?id=237402
Reviewed by Chris Fleizach.
AXIsolatedTree::m_pendingLoadingProgress is currently guarded by
AXIsolatedTree::m_changeLogLock. Because loading can happen at any time,
deadlocks can happen in this sequence:
1. AXIsolatedTree::updateLoadingProgress is called on the main thread while
the secondary thread holds the lock
2. The secondary thread is holding the lock to service an AX request, and said
AX request does something to call into the main thread (e.g. AXLOGs an isolated object,
which causes a dispatch to the main thread as part of AXIsolatedObject::outerHTML).
3. Deadlock
This patch fixes this by making m_loadingProgress threadsafe
via std::atomic<double> and removing m_pendingLoadingProgress.
This patch also removes an unnecessary acquisition of m_changeLogLock
in AXIsolatedTree::focusedNode(). This function is only called on the
secondary-thread, and only accesses secondary-thread safe functions
and member variables (nodeForID, m_focusedNodeID), so we don't need the lock.
* accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::focusedNode):
Removed unnecessary m_changeLogLock acquisition.
(WebCore::AXIsolatedTree::updateLoadingProgress):
Update m_loadingProgress directly instead of the now deleted intermediary
m_pendingLoadingProgress.
(WebCore::AXIsolatedTree::applyPendingChanges):
* accessibility/isolatedtree/AXIsolatedTree.h:
Remove m_pendingLoadingProgress.
2022-03-04 Rob Buis <rbuis@igalia.com>
Top layers should not be moved
https://bugs.webkit.org/show_bug.cgi?id=237305
Reviewed by Tim Nguyen.
Top layers are always children of RenderView and should not be moved.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::moveLayers):
2022-03-04 Antoine Quint <graouts@webkit.org>
[web-animations] "inherit" values should trigger keyframe recomputation if any previous effect has changed that property
https://bugs.webkit.org/show_bug.cgi?id=237471
Reviewed by Antti Koivisto.
When we fixed 237371 we only looked at the unanimated style, but we should account for any previous keyframe effect
modifying a property set to "inherit" for the current effect.
* animation/KeyframeEffectStack.cpp:
(WebCore::KeyframeEffectStack::applyKeyframeEffects):
2022-03-04 Kate Cheney <katherine_cheney@apple.com>
CSP report does not get sent to the document in the case of a detached element
https://bugs.webkit.org/show_bug.cgi?id=237440
<rdar://problem/89081463>
Reviewed by Chris Dumez.
Test: http/tests/security/contentSecurityPolicy/report-violation-to-document-after-element-has-been-detached.html
Only send a violation report to the element if it is connected. Check
right before dispatching in case the element gets detached after the
security policy violation has been created. If the element is not
connected in this case, we send the report to the document.
* dom/Element.cpp:
(WebCore::Element::enqueueSecurityPolicyViolationEvent):
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::reportViolation const):
Also sets the composed value on the violation event as per the spec.
2022-03-04 Kimmo Kinnunen <kkinnunen@apple.com>
Iteration to search for least active WebGLRenderingContextBase could use min_element
https://bugs.webkit.org/show_bug.cgi?id=237464
Reviewed by Antti Koivisto.
Apply review comments after landing bug 222411 r290816.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::addActiveContext):
2022-03-02 Antoine Quint <graouts@webkit.org>
[web-animations] keyframe values set to "inherit" should recompute their values when the inherited value changes
https://bugs.webkit.org/show_bug.cgi?id=237371
Reviewed by Antti Koivisto.
We now keep track of properties set to "inherit" in keyframes such that we may determine when the
computed value may have changed when resolving animations.
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::processKeyframes):
* animation/KeyframeEffect.h:
(WebCore::KeyframeEffect::inheritedProperties const):
* animation/KeyframeEffectStack.cpp:
(WebCore::KeyframeEffectStack::applyKeyframeEffects):
2022-03-04 Sihui Liu <sihui_liu@apple.com>
SQLiteDatabase::open should return early if journal mode cannot be set
https://bugs.webkit.org/show_bug.cgi?id=237130
<rdar://83130954>
Reviewed by Darin Adler.
Add early return in SQLiteDatabase::open if key operation fails; also make sure error is properly set and
database is closed in the case.
* platform/sql/SQLiteDatabase.cpp:
(WebCore::SQLiteDatabase::open):
(WebCore::SQLiteDatabase::useWALJournalMode):
(WebCore::SQLiteDatabase::close):
* platform/sql/SQLiteDatabase.h:
2022-03-04 Youenn Fablet <youenn@apple.com>
webrtc/canvas-to-peer-connection.html is flakily failing a test assertion
https://bugs.webkit.org/show_bug.cgi?id=237423
Reviewed by Eric Carlson.
Make sure the rotation session size is matching the buffer size.
Covered by updated test.
* platform/graphics/cocoa/GraphicsContextGLCocoa.h:
* platform/graphics/cocoa/GraphicsContextGLCocoa.mm:
(WebCore::GraphicsContextGLCocoa::paintCompositedResultsToMediaSample):
2022-03-04 Youenn Fablet <youenn@apple.com>
AVVideoCaptureSource should reuse CaptureDevice label
https://bugs.webkit.org/show_bug.cgi?id=237363
<rdar://88301613>
Reviewed by Eric Carlson.
We are getting AV device name through AVCaptureDevice.localizedName, first in UIProcess, then in GPUProcess.
To make sure we always use the ones from UIProcess (which are the ones exposed through mediaDevices.enumerateDevices),
We make sure to use CaptureDevice.label when creating an AVVideoCaptureSource.
Manually tested.
* platform/mediastream/mac/AVVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::create):
(WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
2022-03-03 Kimmo Kinnunen <kkinnunen@apple.com>
WebGL context count is not limited for GPU process
https://bugs.webkit.org/show_bug.cgi?id=222411
Reviewed by Kenneth Russell.
Move the context limit from the GraphicsContextGL implementation
level to WebGLRenderingContext level. This way the limit
is applied to the GPUP implementation too.
Recycle the context with the earliest activity (draw, readpixels)
instead of the creation order.
Stores the WebGL contexts to per-thread set and limits the size of the set.
The set is per-thread to support WebGL contexts in DOM as well as
offscreen canvas use-cases. Offscreen canvas is not implemented for Cocoa
but other ports may enable it.
Tested by:
LayoutTests/webgl/lose-context-after-context-lost.html
LayoutTests/webgl/many-contexts-access-after-loss.html
LayoutTests/webgl/many-contexts.html
LayoutTests/webgl/max-active-contexts-console-warning.html
LayoutTests/webgl/max-active-contexts-gc.html
LayoutTests/webgl/max-active-contexts-oldest-context-lost.html
LayoutTests/webgl/max-active-contexts-webglcontextlost-prevent-default.html
* Headers.cmake:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::activeContexts):
(WebCore::addActiveContext):
(WebCore::removeActiveContext):
(WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
(WebCore::WebGLRenderingContextBase::setGraphicsContextGL):
(WebCore::WebGLRenderingContextBase::destroyGraphicsContextGL):
(WebCore::WebGLRenderingContextBase::clearIfComposited):
(WebCore::WebGLRenderingContextBase::maybeRestoreContext):
(WebCore::WebGLRenderingContextBase::updateActiveOrdinal):
* html/canvas/WebGLRenderingContextBase.h:
(WebCore::WebGLRenderingContextBase::activeOrdinal const):
* platform/graphics/angle/GraphicsContextGLANGLE.cpp:
* platform/graphics/cocoa/GraphicsContextGLCocoa.mm:
(WebCore::GraphicsContextGLANGLE::~GraphicsContextGLANGLE):
* platform/graphics/cocoa/WebProcessGraphicsContextGLCocoa.mm:
(WebCore::createWebProcessGraphicsContextGL):
* platform/graphics/opengl/GraphicsContextGLOpenGL.cpp:
(WebCore::GraphicsContextGLOpenGL::~GraphicsContextGLOpenGL):
* platform/graphics/opengl/GraphicsContextGLOpenGLManager.cpp: Removed.
* platform/graphics/opengl/GraphicsContextGLOpenGLManager.h: Removed.
* platform/graphics/texmap/GraphicsContextGLTextureMapper.cpp:
(WebCore::createWebProcessGraphicsContextGL):
* platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.cpp:
(WebCore::GraphicsContextGLANGLE::~GraphicsContextGLANGLE):
2022-03-03 Ben Nham <nham@apple.com>
Enforce silent push quota
https://bugs.webkit.org/show_bug.cgi?id=236863
Reviewed by Brady Eidson.
All PushSubscriptions are created with the userVisibleOnly flag set. This means that all
push events should result in a user-facing notification.
To enforce this, we use a quota system. A push subscription can process up to three silent
pushes. After three silent pushes, we remove the push subscription. To continue to receive
pushes, the user must navigate back to the website and the site must request permission to
send pushes again.
Originally we were going to use a more complicated quota system that moved subscriptions
from waking to non-waking before finally unsubscribing, but this seemed like it could lead
to subscriptions being in a partially-working state that would be hard to explain and reason
about. As a result, I've removed the wakeState column from PushDatabase and replaced it
a silentPushCount column.
To track whether or not a service worker has shown a notification while processing a push
event, we use a boolean flag on ServiceWorkerGlobalScope. This should be sufficient because
we currently only process one push event at a time.
Covered by existing and new API tests.
* Modules/push-api/PushDatabase.cpp:
(WebCore::PushRecord::isolatedCopy const):
(WebCore::PushRecord::isolatedCopy):
(WebCore::PushDatabase::insertRecord):
(WebCore::makePushRecordFromRow):
(WebCore::PushDatabase::getRecordByTopic):
(WebCore::PushDatabase::getRecordByBundleIdentifierAndScope):
(WebCore::PushDatabase::getTopics):
(WebCore::PushDatabase::incrementSilentPushCount):
(WebCore::PushDatabase::removeRecordsByBundleIdentifierAndSecurityOrigin):
* Modules/push-api/PushDatabase.h:
* workers/service/ServiceWorkerGlobalScope.h:
* workers/service/ServiceWorkerRegistration.cpp:
(WebCore::ServiceWorkerRegistration::showNotification):
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::queueTaskToFirePushEvent):
2022-03-03 Devin Rousso <drousso@apple.com>
[GPU Process] dont load Apple Pay button/logo PDFs in the WebProcess
https://bugs.webkit.org/show_bug.cgi?id=237177
Reviewed by Simon Fraser.
* platform/graphics/SystemImage.h: Added.
(WebCore::SystemImage::draw const):
(WebCore::SystemImage::SystemImage):
Introduce a new extendable class `SystemImage` that represents a collection of arguments
and methodology (that uses those arguments) to draw something from the system.
This patch introduces two concrete uses:
- `ApplePayButtonSystemImage` uses PassKit SPI to draw an Apple Pay button.
- `ApplePayLogoSystemImage` loads a PDF file of the Apple Pay logo from inside PassKit.
This architecture was chosen so that `GraphicsContext` doesn't have to know about Apple Pay
specific things, instead only dealing with a very generic interface (whos subclasses know
more specifically what to do with the data they're given).
* Modules/applepay/ApplePayButtonSystemImage.h: Added.
(WebCore::ApplePayButtonSystemImage::create):
(WebCore::ApplePayButtonSystemImage::ApplePayButtonSystemImage):
(WebCore::ApplePayButtonSystemImage::encode const):
(WebCore::ApplePayButtonSystemImage::decode):
(isType):
* Modules/applepay/ApplePayButtonSystemImage.mm: Added.
(WebCore::toPKPaymentButtonType):
(WebCore::toPKPaymentButtonStyle):
(WebCore::ApplePayButtonSystemImage::draw const):
* css/CSSPrimitiveValueMappings.h:
* rendering/style/RenderStyle.h:
* rendering/style/RenderStyleConstants.cpp:
* rendering/style/RenderStyleConstants.h:
Drive-by: Move `ApplePayButtonStyle` and `ApplePayButtonType` to `ApplePayButtonSystemImage.h`
so they can be used elsewhere (e.g. GPUProcess) without having to include everything else.
* Modules/applepay/ApplePayLogoSystemImage.h: Added.
(WebCore::ApplePayLogoSystemImage::create):
(WebCore::ApplePayLogoSystemImage::ApplePayLogoSystemImage):
(WebCore::ApplePayLogoSystemImage::encode const):
(WebCore::ApplePayLogoSystemImage::decode):
(isType):
* Modules/applepay/ApplePayLogoSystemImage.mm: Added.
(WebCore::passKitBundle):
(WebCore::loadPassKitPDFPage):
(WebCore::applePayLogoWhite):
(WebCore::applePayLogoBlack):
(WebCore::applePayLogoForStyle):
(WebCore::ApplePayLogoSystemImage::draw const):
Add a new `ApplePayLogoStyle` so that the WebProcess isn't able to provide an arbitrary PDF
to load when rendering `-webkit-named-image(apple-pay-logo-[white,black])`.
* platform/cocoa/ThemeCocoa.mm:
(WebCore::ThemeCocoa::drawNamedImage const):
(WebCore::fitContextToBox): Deleted.
(WebCore::passKitBundle): Deleted.
(WebCore::loadPassKitPDFPage): Deleted.
(WebCore::applePayButtonLogoBlack): Deleted.
(WebCore::applePayButtonLogoWhite): Deleted.
(WebCore::drawApplePayButton): Deleted.
* rendering/RenderThemeCocoa.mm:
(WebCore::RenderThemeCocoa::paintApplePayButton):
(WebCore::toPKPaymentButtonStyle): Deleted.
(WebCore::toPKPaymentButtonType): Deleted.
Move the logic that draws the Apple Pay button to a method on `GraphicsContext` so that it
can hook into the various GPUProcess flags/systems.
* platform/graphics/GraphicsContext.h:
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::drawSystemImage): Added.
* platform/graphics/BifurcatedGraphicsContext.h:
* platform/graphics/BifurcatedGraphicsContext.cpp:
(WebCore::BifurcatedGraphicsContext::drawSystemImage): Added.
* platform/graphics/NullGraphicsContext.h:
(WebCore::NullGraphicsContext::drawSystemImage): Added.
* platform/graphics/displaylists/DisplayList.cpp:
(WebCore::DisplayList::DisplayList::append):
* platform/graphics/displaylists/DisplayListItemBuffer.cpp:
(WebCore::DisplayList::ItemHandle::apply):
(WebCore::DisplayList::ItemHandle::destroy):
(WebCore::DisplayList::ItemHandle::safeCopy const):
* platform/graphics/displaylists/DisplayListItemType.h:
* platform/graphics/displaylists/DisplayListItemType.cpp:
(WebCore::DisplayList::sizeOfItemInBytes):
(WebCore::DisplayList::isDrawingItem):
(WebCore::DisplayList::isInlineItem):
* platform/graphics/displaylists/DisplayListItems.h:
(WebCore::DisplayList::DrawSystemImage::DrawSystemImage): Added.
(WebCore::DisplayList::DrawSystemImage::systemImage const): Added.
(WebCore::DisplayList::DrawSystemImage::destination const): Added.
(WebCore::DisplayList::DrawSystemImage::globalBounds const): Added.
(WebCore::DisplayList::DrawSystemImage::localBounds const): Added.
(WebCore::DisplayList::DrawSystemImage::encode const): Added.
(WebCore::DisplayList::DrawSystemImage::decode): Added.
* platform/graphics/displaylists/DisplayListItems.cpp:
(WebCore::DisplayList::DrawSystemImage::apply const): Added.
(WebCore::DisplayList::operator<<):
* platform/graphics/displaylists/DisplayListRecorder.h:
* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::drawSystemImage): Added.
* platform/graphics/displaylists/DisplayListRecorderImpl.h:
* platform/graphics/displaylists/DisplayListRecorderImpl.cpp:
(WebCore::DisplayList::RecorderImpl::recordDrawSystemImage): Added.
Add new `DrawSystemImage` display list item to handle GPUProcess drawing of `SystemImage`.
* Headers.cmake:
* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* Modules/model-element/scenekit/SceneKitModelLoaderUSD.mm:
Drive-by: Unified sources build fix.
2022-03-03 Simon Fraser <simon.fraser@apple.com>
Element with position: sticky after sticking, starts to move incorrectly when scrolling
https://bugs.webkit.org/show_bug.cgi?id=231953
<rdar://84662329>
Reviewed by Sam Weinig.
Sometimes we'd fail to push new StickyPositionViewportConstraints to the scrolling
tree, because operator== failed to compare m_constrainingRectAtLastLayout. This breaks
the requirement that the "last committed scroll position" for the overflow scrolling
node has to be updated in the same commit as the "constraining-rect-at-last-layout"
on the sticky node.
Test: scrollingcoordinator/scrolling-tree/sticky-in-overflow-stale-constraints.html
* page/scrolling/ScrollingConstraints.cpp:
(WebCore::operator<<):
* page/scrolling/ScrollingConstraints.h:
(WebCore::StickyPositionViewportConstraints::operator== const):
2022-03-03 Sihui Liu <sihui_liu@apple.com>
Text manipulation does not observe updated title element
https://bugs.webkit.org/show_bug.cgi?id=237435
rdar://87318842
Reviewed by Wenson Hsieh.
TextManipulationController now monitors two types of nodes (after first-time manipulation):
(1) manipulated nodes with content update
(2) non-manipulated nodes (newly displayed or newly added)
We should make sure title element gets added to set (1) if it's newly created, and gets added to set (2) if its
text content is updated.
New test: TextManipulation.CompleteTextManipulationForTitleElement
* dom/Document.cpp:
(WebCore::Document::setTitle):
* dom/Text.cpp:
(WebCore::Text::setDataAndUpdate):
* editing/TextManipulationController.cpp:
(WebCore::TextManipulationController::didUpdateContentForNode):
(WebCore::TextManipulationController::didAddOrCreateRendererForNode):
(WebCore::TextManipulationController::scheduleObservationUpdate):
(WebCore::TextManipulationController::replace):
(WebCore::TextManipulationController::didCreateRendererForElement): Deleted.
(WebCore::TextManipulationController::didUpdateContentForText): Deleted.
(WebCore::TextManipulationController::didCreateRendererForTextNode): Deleted.
* editing/TextManipulationController.h:
* html/HTMLTitleElement.cpp:
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::createRenderer):
(WebCore::RenderTreeUpdater::createTextRenderer):
2022-03-03 Michael Saboff <msaboff@apple.com>
Copy WebKit frameworks and XPC processes to Secondary Path
https://bugs.webkit.org/show_bug.cgi?id=237394
Reviewed by Saam Barati.
Added build configuration variables and scripts to copy the built Framework to the SYSTEM_SECONDARY_CONTENT_PATH
when it is set.
* Configurations/WebCore.xcconfig:
* Scripts/copy-frameworks-to-secondary-path.sh: Added.
* WebCore.xcodeproj/project.pbxproj:
2022-03-03 Dan Glastonbury <djg@apple.com>
Allow [SecureContext] extended attribute on namespaces.
https://bugs.webkit.org/show_bug.cgi?id=237401
Reviewed by Alexey Shvayka.
* bindings/scripts/IDLAttributes.json:
Enable SecureContext as a valid extended attribute on namespace.
* bindings/scripts/test/BindingTestGlobalConstructors.idl:
* bindings/scripts/test/JS/*: Updated
* bindings/scripts/test/TestNamespaceObject.idl:
Added [SecureContext] to namespace
2022-03-03 Simon Fraser <simon.fraser@apple.com>
nasa.gov page with fixed backgrounds paints incorrectly on scroll
https://bugs.webkit.org/show_bug.cgi?id=237405
<rdar://66568551>
Reviewed by Antti Koivisto.
https://www.nasa.gov/specials/artemis/ shows an issue where elements with background-attachment:fixed
don't repaint on scroll. This page has scrollable <html> and <body>, and the elements with fixed
backgrounds are composited, so this reveals that we fail to repaint composited children
of an overflow scroll in this case.
Fix by having RenderLayerScrollableArea::scrollTo() do repaints on slow repaint objects
which are scrolled by the current scroller.
Do some unrelated cleanup in code that I was going to use in this patch but turned out
not to need: rename hasFixedBackgroundImage() to hasAnyFixedBackground() for clarity,
and share the implementation with hasAnyLocalBackground().
Test: fast/repaint/background-attachment-fixed-in-composited-scroll.html
* rendering/RenderElement.cpp:
(WebCore::RenderElement::styleWillChange):
(WebCore::RenderElement::willBeDestroyed):
* rendering/RenderLayer.cpp:
* rendering/RenderLayerScrollableArea.cpp:
(WebCore::RenderLayerScrollableArea::scrollTo):
* rendering/style/FillLayer.cpp:
(WebCore::FillLayer::hasImageWithAttachment const):
(WebCore::FillLayer::hasFixedImage const): Deleted.
* rendering/style/FillLayer.h:
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::hasAnyLocalBackground const): Deleted.
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::hasBackgroundImage const):
(WebCore::RenderStyle::hasAnyFixedBackground const):
(WebCore::RenderStyle::hasAnyLocalBackground const):
(WebCore::RenderStyle::hasFixedBackgroundImage const): Deleted.
2022-03-03 Alan Bujtas <zalan@apple.com>
A text node longer than 65,535 characters following another text node is invisible in a scrolling context
https://bugs.webkit.org/show_bug.cgi?id=237330
<rdar://problem/89645522>
Reviewed by Antti Koivisto.
1. We split text content at 65536 characters (see Text::createWithLengthLimit)
2. InlineTextBox can only hold up to 65534 (max short unsigned) characters (unsigned short m_len { 0 };)
Arithmetic overflow produces 0 length inline text boxes and they get removed at
LegacyLineLayout::computeBlockDirectionPositionsForLine as redundant boxes.
Test: fast/text/text-overflow-over-64k.html
* rendering/LegacyInlineTextBox.h: Let's just use unsigned. At this point we don't have that many
legacy inline text boxes anyway.
2022-03-03 Dan Glastonbury <djg@apple.com>
Update IDLParser to support trailing commas in enums.
https://bugs.webkit.org/show_bug.cgi?id=232607
<rdar://problem/85189036>
Reviewed by Sam Weinig.
Now compatible with the grammar specified by [1].
[1] https://webidl.spec.whatwg.org/#prod-EnumValueListComma
* bindings/scripts/IDLParser.pm:
(parseEnumValues):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertEnumerationToString):
(WebCore::convertEnumerationToJS):
(WebCore::parseEnumeration<TestObj::EnumTrailingComma>):
(WebCore::expectedEnumerationValues<TestObj::EnumTrailingComma>):
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/TestObj.idl:
2022-03-03 Antti Koivisto <antti@apple.com>
Simplify pseudo element resolution
https://bugs.webkit.org/show_bug.cgi?id=237413
Reviewed by Antoine Quint.
Remove ElementUpdates struct with a map that contains pseudo element updates.
Instead use a single ElementUpdate struct and pass the pseudo element styles
as cached pseudo styles of the element RenderStyle. Previously RenderTreeUpdater
would move them there.
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::Parent::Parent):
(WebCore::RenderTreeUpdater::updateRenderTree):
(WebCore::RenderTreeUpdater::pushParent):
(WebCore::RenderTreeUpdater::popParent):
(WebCore::RenderTreeUpdater::updateBeforeDescendants):
(WebCore::RenderTreeUpdater::updateAfterDescendants):
(WebCore::RenderTreeUpdater::updateElementRenderer):
* rendering/updating/RenderTreeUpdater.h:
* rendering/updating/RenderTreeUpdaterGeneratedContent.cpp:
(WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
(WebCore::RenderTreeUpdater::GeneratedContent::needsPseudoElement):
* rendering/updating/RenderTreeUpdaterGeneratedContent.h:
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::computeDescendantsToResolve):
(WebCore::Style::TreeResolver::resolveElement):
(WebCore::Style::TreeResolver::shouldResolveElement):
(WebCore::Style::TreeResolver::resetDescendantStyleRelations):
(WebCore::Style::TreeResolver::resolveComposedTree):
(WebCore::Style::computeDescendantsToResolve): Deleted.
(WebCore::Style::shouldResolveElement): Deleted.
(WebCore::Style::resetDescendantStyleRelations): Deleted.
* style/StyleTreeResolver.h:
* style/StyleUpdate.cpp:
(WebCore::Style::Update::elementUpdate const):
(WebCore::Style::Update::elementUpdate):
(WebCore::Style::Update::elementStyle const):
(WebCore::Style::Update::elementStyle):
(WebCore::Style::Update::addElement):
(WebCore::Style::Update::elementUpdates const): Deleted.
(WebCore::Style::Update::elementUpdates): Deleted.
* style/StyleUpdate.h:
2022-03-03 Youenn Fablet <youenn@apple.com>
macOS Safari 15.2 Audio Echo Issue after camera pause/unpause
https://bugs.webkit.org/show_bug.cgi?id=235544
<rdar://problem/88297045>
Reviewed by Eric Carlson.
After https://commits.webkit.org/r275600, the muted state of MediaPlayer would be set to the page muted state
without taking into consideration HTMLMediaElement.muted.
Update the call site to use effectiveMuted instead.
Add internals API to write a corresponding layout test.
Test: fast/mediastream/mediastreamtrack-audiovideo-mutepage.html
* html/HTMLMediaElement.cpp:
* testing/Internals.cpp:
* testing/Internals.h:
* testing/Internals.idl:
2022-03-03 Chris Dumez <cdumez@apple.com>
REGRESSION(r290356-r290351?): [ iOS EWS ] 3 imported/w3c/web-platform-tests/service-workers/service-worker/* tests are constant text failures.
https://bugs.webkit.org/show_bug.cgi?id=237160
<rdar://problem/89440067>
Reviewed by Youenn Fablet.
In r290352, I made a change so that the service worker is more likely to launch in the WebContent
process that caused it to launch. This is beneficial for performance and memory usage.
The partitioned-service-worker*.html service worker tests are relying on an ID variable that is
randomly generated inside the service worker and they expect this ID to not change during the
duration of the test. This means that if the service worker exits / relaunches, those tests start
failing because the ID changes.
The issue is that we have logic in WebProcessProxy::didStartProvisionalLoadForMainFrame() that
terminates the service workers running inside the WebProcess if a new eTLD+1 page is loaded inside
the process. We do so to try and achieve better process isolation between different sites. The
issue is that those tests launch a service worker and then open a new cross-site popup. When the
cross-site popup loads inside the same process, we'd make the decision to terminate the service
workers in this process and relaunch them in a new clean one, causing the tests to fail.
While it is true per the specification that service workers can be terminated / relaunched at
almost any point, there are exceptions. In particular, we should keep a service worker running
if it still has pending extendable events. For this reason, the tests rely on FetchEvent.waitUntil()
to keep the service worker running. Sadly, we would not obey that in this case.
To address the issue, we no longer unconditionally close the service worker context connection
when a WebProcess loads a new eTLD+1. Instead, we tell the network process to close that connection
as soon as possible. When the network process receives this IPC, it terminates the context
connection ONLY if the service workers using the connection have no pending events. If we cannot
close the context connection right away, we set a flag on the context connection to indicate that
we should close it as soon as possible. Currently, this flag is only used to close the connection
right away (no 10 second delay) once the connection no longer has any clients. I think that, ideally,
we'd close the connection as soon as the service workers no longer have pending events. However,
this adds complexity and is error-prone so I didn't implement it in this patch and merely added a
FIXME comment. As it stands, my patch STILL relaunches service workers in origin-clean processes
in the common case. It only fails to do so in the case where there are pending service worker
events which is a case where we had the correctness bug anyway.
No new tests, unskipped existing tests.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::forEachServiceWorker const):
(WebCore::SWServer::terminateContextConnectionWhenPossible):
(WebCore::SWServer::unregisterServiceWorkerClient):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerToContextConnection.cpp:
(WebCore::SWServerToContextConnection::SWServerToContextConnection):
(WebCore::SWServerToContextConnection::server const):
(WebCore::SWServerToContextConnection::terminateWhenPossible):
* workers/service/server/SWServerToContextConnection.h:
(WebCore::SWServerToContextConnection::shouldTerminateWhenPossible const):
2022-03-03 Adrian Perez de Castro <aperez@igalia.com>
Non-unified build fixes, early March 2022 edition
https://bugs.webkit.org/show_bug.cgi?id=237420
Unreviewed non-unified build fixes.
* inspector/agents/InspectorDOMDebuggerAgent.h: Add forward declaration for ScriptExecutionContext.
2022-03-03 Alan Bujtas <zalan@apple.com>
REGRESSION (r290512): imported/blink/fast/table/crash-output-element-as-column-group.html asserts sometimes
https://bugs.webkit.org/show_bug.cgi?id=237393
Reviewed by Simon Fraser.
Merging https://chromium.googlesource.com/chromium/src/+/1cfc9b9c37f43567529b09a9824d6d3a7bd9abb6%5E%21/#F2
The reason why crash-output-element-as-column-group.html crashes after r290512 is because
now we allow colgroup after the table content (thead, tbody) -prior to r290512, this test was pretty much a no-op.
* rendering/RenderTableCol.cpp:
(WebCore::RenderTableCol::updateFromElement):
2022-03-03 Commit Queue <commit-queue@webkit.org>
Unreviewed, reverting r290756.
https://bugs.webkit.org/show_bug.cgi?id=237412
Speedometer2
Reverted changeset:
"[css] Implement 'text-decoration' as a shorthand."
https://bugs.webkit.org/show_bug.cgi?id=237175
https://commits.webkit.org/r290756
2022-03-02 Rob Buis <rbuis@igalia.com>
Treat empty intersection correctly in RenderLayer::getRectToExpose
https://bugs.webkit.org/show_bug.cgi?id=237189
Reviewed by Simon Fraser.
The case where the target rect to reveal had zero height and was outside of the visible rect, the
classification was wrongly that the target was visible, fix this to classify as hidden instead.
Test: imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-050.html
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::getRectToExpose const):
2022-03-02 Andres Gonzalez <andresg_22@apple.com>
ITM: Checkbox state change is not updated in isolated tree
https://bugs.webkit.org/show_bug.cgi?id=237381
rdar://89529486
Reviewed by Chris Fleizach.
Fixes the following test in isolated tree mode:
accessibility/mac/checked-status-tree-items.html
accessibility/aria-switch-checked.html
* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::initializeAttributeData):
Properly initializes the properties SupportsCheckedState, IsChecked and
ButtonState.
(WebCore::AXIsolatedObject::getOrRetrievePropertyValue):
Uses the new template method propertyValue(PropertyName).
* accessibility/isolatedtree/AXIsolatedObject.h:
(WebCore::AXIsolatedObject::propertyValue const):
* accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::updateNodeProperty):
Updates both IsChecked and ButtonState.
* accessibility/isolatedtree/AXIsolatedTree.h:
2022-03-02 Dan Glastonbury <djg@apple.com>
[WebGPU] Implement GPUDeviceDescriptor.requiredLimits
https://bugs.webkit.org/show_bug.cgi?id=232741
<rdar://problem/85325316>
Reviewed by Myles C. Maxfield.
Implement IDL bindings for requiredLimits attribute of
GPUDeviceDescriptor.
* Modules/WebGPU/GPUDeviceDescriptor.h:
(WebCore::GPUDeviceDescriptor::convertToBacking const):
* Modules/WebGPU/GPUDeviceDescriptor.idl:
2022-03-02 Simon Fraser <simon.fraser@apple.com>
Rendering issues with many dynamically-added sticky elements inside overflow scroll
https://bugs.webkit.org/show_bug.cgi?id=237378
<rdar://83745510>
Reviewed by Cameron McCormack.
A bug was filed describing a symptom where position:sticky elements would eventually
fail to render when many of them were dynamically added inside a non-stacking context
overflow scroll.
Debugging showed that CALayers were accumulating, causing us to hit per-process IOSurface
limits, at which point content fails to render (this is being fixed via rdar://89640915).
Further debugging showed that these layers were unparented, and being entrained by
ScrollingStateStickyNodes, which were accumulating in ScrollingStateTree's m_unparentedNodes.
This happened because with this scrolling configuration, each ScrollingStateStickyNode
is parented via a ScrollingStateOverflowScrollProxyNode which is referenced by entries
in RenderLayerBacking's m_ancestorClippingStack. On cleanup, the ScrollingStateOverflowScrollProxyNode
was unparented first, leaving the ScrollingStateStickyNode in m_unparentedNodes.
The fix is to have ScrollingStateTree::unparentChildrenAndDestroyNode() remove nodes
from m_unparentedNodes.
To test, add a m_unparentedNodes count to scrollingStateTreeAsText output, which means
having scrollingStateTreeAsText() as a member function on ScrollingStateTree.
Test: scrollingcoordinator/scrolling-tree/accumulated-unparented-sticky-nodes.html
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::scrollingStateTreeAsText const):
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode):
(WebCore::ScrollingStateTree::scrollingStateTreeAsText const):
* page/scrolling/ScrollingStateTree.h:
2022-03-02 Oriol Brufau <obrufau@igalia.com>
[css] Implement 'text-decoration' as a shorthand.
https://bugs.webkit.org/show_bug.cgi?id=237175
Reviewed by Darin Adler.
The 'text-decoration' property was considered to be a longhand, sharing
a computed value with 'text-decoration-line'.
This patch switches 'text-decoration' into a shorthand of the following
longhands: 'text-decoration-line', 'text-decoration-thickness',
'text-decoration-style' and 'text-decoration-color'. This is according
to https://www.w3.org/TR/css-text-decor-4/#text-decoration-property
For now I'm keeping the grammar as-is, so 'text-decoration' will only
accept values that are valid in 'text-decoration-line', but will set
the other longhands to the initial value. This should probably change
in a follow-up.
I'm also keeping '-webkit-text-decoration' as-is, as a shorthand of
'text-decoration-{line,style,color}', not including thickness for some
obscure reason. '-webkit-text-decoration' should probably be removed
anyways.
There is a bunch of editing code that was getting/setting/removing
'text-decoration' as a longhand, so I'm switching that to:
- Use 'text-decoration-line' when getting values.
- Use 'text-decoration' when setting values, and use a string for the
value, this parses it and sets each longhand to the correct value.
- Use 'text-decoration' get removing declarations, effectively removing
all longhands.
This preserves the previous behavior as much as possible.
Tests: fast/css/getComputedStyle/computed-style.html
fast/css/getComputedStyle/computed-style-without-renderer.html
fast/css/getComputedStyle/getComputedStyle-text-decoration.html
fast/css/style-enumerate-properties.html
fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand.html
fast/css3-text/css3-text-decoration/text-decoration-dashed.html
fast/css3-text/css3-text-decoration/text-decoration-dotted-dashed.html
fast/css3-text/css3-text-decoration/text-decoration-dotted.html
imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml.html
imported/w3c/web-platform-tests/css/css-variables/variable-presentation-attribute.html
imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree.html
svg/css/getComputedStyle-basic.xhtml
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
* css/CSSProperties.json:
* css/StyleProperties.cpp:
(WebCore::StyleProperties::getPropertyValue const):
(WebCore::StyleProperties::asText const):
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::CSSPropertyParser::parseShorthand):
* editing/EditingStyle.cpp:
(WebCore::EditingStyle::styleWithResolvedTextDecorations const):
(WebCore::EditingStyle::collapseTextDecorationProperties):
(WebCore::textDecorationValueList):
(WebCore::EditingStyle::conflictsWithInlineStyleOfElement const):
(WebCore::EditingStyle::styleIsPresentInComputedStyleOfNode const):
(WebCore::EditingStyle::mergeStyle):
(WebCore::EditingStyle::removeEquivalentProperties):
(WebCore::reconcileTextDecorationProperties):
(WebCore::StyleChange::StyleChange):
(WebCore::setTextDecorationProperty):
(WebCore::StyleChange::extractTextStyles):
(WebCore::diffTextDecorations):
(WebCore::extractPropertiesNotIn):
* editing/cocoa/HTMLConverter.mm:
(HTMLConverterCaches::propertyValueForNode):
(HTMLConverter::computedAttributesForElement):
* editing/markup.cpp:
(WebCore::serializePreservingVisualAppearanceInternal):
* style/PropertyAllowlist.cpp:
(WebCore::Style::isValidCueStyleProperty):
2022-03-02 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Copy context menu action should be titled "Copy Link" when long pressing a non-image link
https://bugs.webkit.org/show_bug.cgi?id=237367
rdar://77397886
Reviewed by Devin Rousso.
Add a localizable string for "Copy Link". See WebKit/ChangeLog for more details.
* en.lproj/Localizable.strings:
2022-03-02 Antoine Quint <graouts@webkit.org>
[web-animations] setting the composite property on a keyframe effect should invalidate the target style
https://bugs.webkit.org/show_bug.cgi?id=237356
Reviewed by Dean Jackson.
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::setComposite):
* animation/KeyframeEffect.h:
(WebCore::KeyframeEffect::setComposite): Deleted.
2022-03-02 Tyler Wilcock <tyler_w@apple.com>
AX: Handle null FileList in RenderFileUploadControl::fileTextValue()
https://bugs.webkit.org/show_bug.cgi?id=237349
Reviewed by Chris Fleizach.
In rare circumstances, it's possible for the FileList associated
with RenderFileUploadControl::inputElement (HTMLInputElement::files())
to be null. This causes a crash in RenderFileUploadControl::fileTextValue().
In this patch, we avoid this crash by handling a null `FileList`
and returning a null `String`.
* rendering/RenderFileUploadControl.cpp:
(WebCore::RenderFileUploadControl::fileTextValue const):
Handle null `input.files()` and return a null `String` rather than `ASSERT`ing.
2022-03-02 Antoine Quint <graouts@webkit.org>
Outline-width with transition don't animate correctly
https://bugs.webkit.org/show_bug.cgi?id=173708
Reviewed by Antti Koivisto.
Account for a change in outline size when checking whether a style change affects
visual overflow.
No new test for this, I'm not sure how to write one since the issue is failing to
repaint during an animation but WKTR seems to force a repaint for reftests.
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeAffectsVisualOverflow const):
2022-03-02 Alan Bujtas <zalan@apple.com>
[RTL] Image alt text has incorrect bidi reordering
https://bugs.webkit.org/show_bug.cgi?id=237366
<rdar://problem/89687229>
Reviewed by Antti Koivisto.
Test: fast/images/alt-text-with-right-to-left-inline-direction-reordering.html
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintReplaced): Enable bidi reordering.
2022-03-02 Youenn Fablet <youenn@apple.com>
Rename MediaSampleAVFObjC::createImageSample to MediaSampleAVFObjC::createFromPixelBuffer
https://bugs.webkit.org/show_bug.cgi?id=237354
Reviewed by Eric Carlson.
No change of behavior, this is a renaming.
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::toMediaSample):
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
(WebCore::MediaSampleAVFObjC::createFromPixelBuffer):
(WebCore::MediaSampleAVFObjC::createImageSample): Deleted.
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
(WebCore::MediaSampleAVFObjC::createFromPixelBuffer):
(WebCore::MediaSampleAVFObjC::createImageSample): Deleted.
* platform/graphics/cocoa/GraphicsContextGLCocoa.mm:
(WebCore::GraphicsContextGLCocoa::paintCompositedResultsToMediaSample):
* platform/mediastream/RealtimeVideoSource.cpp:
(WebCore::RealtimeVideoSource::adaptVideoSample):
2022-03-02 Antoine Quint <graouts@webkit.org>
[web-animations] changes to font-size should recompute keyframes
https://bugs.webkit.org/show_bug.cgi?id=237357
Reviewed by Antti Koivisto.
When we compute keyframes, it's possible that some values are specified using "em" units
and thus dependent on the current value for font-size. If the font-size changes over time,
we must recompute keyframes to ensure that any such value is updated.
To ensure that we correctly determine when the font-size changed, we pass a pointer to the
style seen when we last udpated animations so that we only consider a change in font-size
provided we've ever resolved animations.
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::propertyAffectingKeyframeResolutionDidChange):
(WebCore::KeyframeEffect::propertyAffectingLogicalPropertiesDidChange): Deleted.
* animation/KeyframeEffect.h:
* animation/KeyframeEffectStack.cpp:
(WebCore::KeyframeEffectStack::applyKeyframeEffects):
* animation/KeyframeEffectStack.h:
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::createAnimatedElementUpdate):
* style/Styleable.h:
(WebCore::Styleable::applyKeyframeEffects const):
2022-03-02 Oriol Brufau <obrufau@igalia.com>
[css-cascade] Support 'revert-layer' in @keyframes
https://bugs.webkit.org/show_bug.cgi?id=237152
Reviewed by Antti Koivisto.
In @keyframes, 'revert-layer' should roll back the cascaded value to
author origin. Resolver::styleForKeyframe already has the base style of
the element, so we only need to avoid applying properties with the
'revert-layer' value.
Test: imported/w3c/web-platform-tests/css/css-cascade/revert-layer-010.html.html
* style/StyleBuilder.cpp:
(WebCore::Style::Builder::applyProperty):
* style/StyleBuilderState.h:
(WebCore::Style::BuilderState::setIsBuildingKeyframeStyle):
* style/StyleResolver.cpp:
(WebCore::Style::Resolver::styleForKeyframe):
2022-03-02 Michael Catanzaro <mcatanzaro@gnome.org>
[GTK] setDragImage ignores offset
https://bugs.webkit.org/show_bug.cgi?id=237292
Reviewed by Carlos Garcia Campos.
To fix this, I need DataTransfer to expose its dragLocation, which is the offset passed to
setDragImage.
* dom/DataTransfer.h:
(WebCore::DataTransfer::dragLocation const):
2022-03-02 Alan Bujtas <zalan@apple.com>
[RTL] Incorrect alt text position in right to left context
https://bugs.webkit.org/show_bug.cgi?id=237352
<rdar://problem/89657704>
Reviewed by Simon Fraser.
Take the inline direction into account when computing the alt text location.
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintReplaced): This is mostly moving things around/modernizing it.
2022-03-02 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION(r216096): [GTK] Test accessibility/gtk/menu-list-unfocused-notifications.html is failing since r216096
https://bugs.webkit.org/show_bug.cgi?id=171598
Reviewed by Adrian Perez de Castro.
Enable accessibility when a WTR observer is added.
* accessibility/atspi/AccessibilityAtspi.cpp:
(WebCore::AccessibilityAtspi::addNotificationObserver):
2022-03-01 Youenn Fablet <youenn@apple.com>
Remove RemoteVideoSample support from ImageTransferSessionVT
https://bugs.webkit.org/show_bug.cgi?id=237318
Reviewed by Eric Carlson.
No change of behavior.
* platform/graphics/cv/ImageTransferSessionVT.h:
* platform/graphics/cv/ImageTransferSessionVT.mm:
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/RealtimeVideoCaptureSource.cpp:
2022-03-01 Fujii Hironori <Hironori.Fujii@sony.com>
Fix deprecations for ERB.new in GenerateSettings.rb
https://bugs.webkit.org/show_bug.cgi?id=237237
Reviewed by Don Olmstead.
Ruby 3.1.0 reported the following warning:
> GenerateSettings.rb:283: warning: Passing safe_level with the 2nd argument of ERB.new is deprecated. Do not use it, and specify other arguments as keyword arguments.
> GenerateSettings.rb:283: warning: Passing trim_mode with the 3rd argument of ERB.new is deprecated. Use keyword argument like ERB.new(str, trim_mode: ...) instead.
r290104 and r290331 fixed the same problem for
GeneratePreferences.rb, but forgot GenerateSettings.rb.
* Scripts/GenerateSettings.rb: Use the keyword argument for ERB.new for Ruby 2.6+.
2022-03-01 Andres Gonzalez <andresg_22@apple.com>
Unnecessary copy of Vector of children IDs in AXIsolatedTree::updateChildren.
https://bugs.webkit.org/show_bug.cgi?id=237338
<rdar://problem/89633856>
Reviewed by Chris Fleizach.
Changed the copy of this Vector to a move.
* accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::updateChildren):
2022-03-01 Alan Bujtas <zalan@apple.com>
REGRESSION(r285232) https://alvaromontoro.github.io/almond.css/demo/ looks wrong in Safari, ok in Chrome and Firefox
https://bugs.webkit.org/show_bug.cgi?id=237276
<rdar://problem/89566459>
Reviewed by Simon Fraser.
r285232 introduced the isFixed() check as a resolvable preferred width type, but percent values are also resolvable as
block layout gets the horizontal constraint from the containing block chain (unlike the height percent values) -i.e. 'width: 50%' can be resolved during preferred width computation.
Test: fast/css-grid-layout/ascpect-ratio-with-percent-width.html
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::availableLogicalHeightForPercentageComputation const):
2022-03-01 Michael Catanzaro <mcatanzaro@gnome.org>
Misc compiler warnings, late Feb 2022 edition
https://bugs.webkit.org/show_bug.cgi?id=237275
Reviewed by Adrian Perez de Castro.
Remove a redundant move. Sprinkle RELEASE_ASSERT_NOT_REACHED() as required to avoid
-Wreturn-type warnings.
* Modules/push-api/PushDatabase.cpp:
(WebCore::openAndMigrateDatabaseImpl):
* style/ContainerQueryEvaluator.cpp:
(WebCore::Style::ContainerQueryEvaluator::evaluateCondition const):
(WebCore::Style::ContainerQueryEvaluator::evaluateSizeFeature const):
* style/ContainerQueryEvaluator.h:
(WebCore::Style::operator!):
* style/StyleScope.cpp:
(WebCore::Style::Scope::updateQueryContainerState):
2022-03-01 Said Abou-Hallawa <said@apple.com>
[macOS][REGRESSION] (r289518): Form controls are scaled twice on Retina display
https://bugs.webkit.org/show_bug.cgi?id=237128
rdar://89064642
Reviewed by Darin Adler.
Using the name GraphicsContext::createImageBuffer() for different behaviors
was a mistake in r289518. To clean this up, the createImageBuffer() version
which scales the GraphicsContext of the ImageBuffer will be renamed
createScaledImageBuffer(). and the existing createCompatibleImageBuffer()
will be renamed createAlignedImageBuffer(). So we will have these three
methods in GraphicsContext:
1) createImageBuffer(): The default behavior of this method is to create
an ImageBuffer similar to the underlying ImageBuffer of GraphicsContext.
But it gives ability to change the renderingMode and the renderingMethod.
It can be forced to create a non-accelerated local ImageBuffer for example.
The caller of this method usually uses a framework to draw some custom
drawing and it just needs a scratch buffer to be drawn in the place of
a render object. The caller does not require any transformation to be
applied to the GraphicsContext of the ImageBuffer before starting its
custom drawing. Drawing the form controls using AppKit is an example
of such case.
2) createScaledImageBuffer(): This is similar to createImageBuffer() but
it always creates the ImageBuffer with resolutionScale = 1 so it has
to scale the size by the scaleFactor before calling createImageBuffer().
It also scales the GraphicsContext of the created ImageBuffer with the
scaleFactor and it translates its coordinates origin for the FloatRect
version. It also handles the clamping if needed.
This method is suitable for cases when the overall scaleFatcor
(device ScaleFactor + clamping ScaleFactor) has be known to the caller
in advance. No clamping will be required in this case. SVG filter,
masker, clipper and gradient are the callers to this function.
3) createAlignedImageBuffer(): This is similar to createScaledImageBuffer()
but it does not take a scaling factor argument. It inherits it from
the GraphicsContext.
Usually the purpose of this method is to transfer the drawing from a
layer to a scratch ImageBuffer temporarily then draw the scratch
ImageBuffer in the place of the original drawing. Drawing a PDFDocument
image, for example, requires using this method.
To fix this bug:
Form controls have to use the first version of createImageBuffer() which
still has the same name instead of using the second version which will
be renamed createScaledImageBuffer().
Another cleaning is to pass RenderingMethod as an std::optional argument
the three methods. This means we do not need the value "Default" since
passing std::nullopt will have the same meaning.
Test: fast/hidpi/hidpi-form-controls-drawing-size.html
* html/CustomPaintCanvas.cpp:
(WebCore::CustomPaintCanvas::replayDisplayList const):
* html/CustomPaintImage.cpp:
(WebCore::CustomPaintImage::drawPattern):
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::drawImage):
(WebCore::CanvasRenderingContext2DBase::drawTextUnchecked):
* platform/cocoa/ThemeCocoa.mm:
(WebCore::drawApplePayButton):
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::drawPattern):
* platform/graphics/GradientImage.cpp:
(WebCore::GradientImage::drawPattern):
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::createImageBuffer const):
(WebCore::GraphicsContext::createScaledImageBuffer const):
(WebCore::GraphicsContext::createAlignedImageBuffer const):
(WebCore::GraphicsContext::createCompatibleImageBuffer const): Deleted.
* platform/graphics/GraphicsContext.h:
(WebCore::GraphicsContext::createScaledImageBuffer):
(WebCore::GraphicsContext::createImageBuffer): Deleted.
* platform/graphics/ImageBuffer.cpp:
(WebCore::ImageBuffer::clone const):
* platform/graphics/NamedImageGeneratedImage.cpp:
(WebCore::NamedImageGeneratedImage::drawPattern):
* platform/graphics/cg/PDFDocumentImage.cpp:
(WebCore::PDFDocumentImage::updateCachedImageIfNeeded):
(WebCore::PDFDocumentImage::draw):
* platform/graphics/coretext/DrawGlyphsRecorderCoreText.cpp:
(WebCore::DrawGlyphsRecorder::drawOTSVGRun):
* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::createImageBuffer const):
* platform/graphics/displaylists/DisplayListRecorder.h:
* platform/mac/ThemeMac.mm:
(WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
* rendering/RenderLayerBacking.cpp:
(WebCore::patternForDescription):
* rendering/RenderLayerFilters.cpp:
(WebCore::RenderLayerFilters::allocateBackingStoreIfNeeded):
* rendering/RenderThemeCocoa.mm:
(WebCore::RenderThemeCocoa::paintApplePayButton):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintListButtonForInput):
(WebCore::RenderThemeMac::paintProgressBar):
* rendering/svg/RenderSVGResourceClipper.cpp:
(WebCore::RenderSVGResourceClipper::applyClippingToContext):
* rendering/svg/RenderSVGResourceFilter.cpp:
(WebCore::RenderSVGResourceFilter::applyResource):
* rendering/svg/RenderSVGResourceGradient.cpp:
(WebCore::createMaskAndSwapContextForTextGradient):
* rendering/svg/RenderSVGResourceMasker.cpp:
(WebCore::RenderSVGResourceMasker::applyResource):
* rendering/svg/RenderSVGResourcePattern.cpp:
(WebCore::RenderSVGResourcePattern::createTileImage const):
* rendering/svg/SVGRenderingContext.cpp:
(WebCore::SVGRenderingContext::bufferForeground):
2022-03-01 Eric Carlson <eric.carlson@apple.com>
[Cocoa] HLS stream currentTime sometimes jumps backwards
https://bugs.webkit.org/show_bug.cgi?id=235087
rdar://83831093
Reviewed by Dean Jackson.
Test: http/tests/media/hls/hls-non-zero-start-time.html
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updateActiveTextTrackCues): Drive-by: pass log identifier
to lambda so the method name will be logged correctly.
(WebCore::HTMLMediaElement::currentMediaTime const): Remove LOG_CACHED_TIME_WARNINGS
build flag, always log time drift warnings when log level is DEBUG.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): Log when periodic
time observer is passed unexpected values.
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem): Use
NSKeyValueObservingOptionInitial KVO option for "@duration" property because we
sometimes don't get a duration changed event for HLS streams, so m_cachedDuration
remains invalid.
(WebCore::MediaPlayerPrivateAVFoundationObjC::currentMediaTimeDidChange const):
Drive-by: fix use-after-move.
2022-03-01 Per Arne Vollan <pvollan@apple.com>
Remove release assert when UI process is blocking IOSurface IOKit access
https://bugs.webkit.org/show_bug.cgi?id=237278
<rdar://problem/89585043>
Unreviewed, address review comments.
Log error instead of creating CrashTracer reports.
* platform/graphics/cocoa/IOSurface.mm:
(WebCore::IOSurface::bytesPerRowAlignment):
2022-03-01 Matt Woodrow <mattwoodrow@apple.com>
Use static position relative to parent for abs-pos items within nested grids.
https://bugs.webkit.org/show_bug.cgi?id=236957
Reviewed by Dean Jackson.
In the case where an absolutely positioned element's parent and containing block
are both grid container, but they are not the same grid container, then the static position
of the abs-pos item should be relative to the parent, not the CB.
Existing subgrid tests marked as passing.
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::setLogicalOffsetForChild const):
2022-03-01 Alan Bujtas <zalan@apple.com>
[IFC][Integration] Add InlineIterator::Box::visualRect
https://bugs.webkit.org/show_bug.cgi?id=237309
Reviewed by Antti Koivisto.
This is the final, flipped version of the box rect.
* layout/integration/InlineIteratorBox.h:
(WebCore::InlineIterator::Box::visualRect const):
* rendering/InlineBoxPainter.cpp:
(WebCore::InlineBoxPainter::paintMask):
(WebCore::InlineBoxPainter::paintDecorations):
* rendering/TextBoxPainter.cpp:
(WebCore::TextBoxPainter::computePaintRect):
2022-03-01 Patrick Angle <pangle@apple.com>
Web app fails only when dev tools is open
https://bugs.webkit.org/show_bug.cgi?id=235017
Reviewed by Devin Rousso.
Using the `ScriptExecutionContext` from `event.target()->scriptExecutionContext()` can result the either having a
different script context from the one used when calling `willHandleEvent`, or the event target's context could be
`nullptr`. This can occur when handling the event in `EventTarget::innerInvokeEventListeners` results in a
context change for the event's target, like a MessagePort that has been `disentangle`d, which sets the script
execution context to `nullptr`. Because we only need the script execution context to get the correct injected
script, and the correct injected script for the action below will always be the same injected script used in
`willHandleEvent`, we ignore the current script execution context of the event's target and use the context the
event's target had when it began invoking event listeners.
This change protects us both from the reported crash, as well as leaving an injected script in a bad state
because we did not call `setEventValue` and `clearEventValue` on matching injected scripts for a single event.
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::willHandleEventImpl):
(WebCore::InspectorInstrumentation::didHandleEventImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::willHandleEvent):
(WebCore::InspectorInstrumentation::didHandleEvent):
* inspector/agents/InspectorDOMDebuggerAgent.cpp:
(WebCore::InspectorDOMDebuggerAgent::willHandleEvent):
(WebCore::InspectorDOMDebuggerAgent::didHandleEvent):
* inspector/agents/InspectorDOMDebuggerAgent.h:
2022-03-01 Martin Robinson <mrobinson@webkit.org>
When interpolating between transform lists partial prefix matches should not use matrix interpolation
https://bugs.webkit.org/show_bug.cgi?id=235757
<rdar://problem/88477922>
Reviewed by Dean Jackson.
No new tests. This is covered by existing WPT tests.
When interpolation between keyframes in transform animations, interpolate prefixes of
compatible transform functions directly. For instance if there are three keyframes:
1. transform: rotateX(...) translateY(...) skew(...)
2. transform: rotateY(...) translateY(...)
3. transform: rotateZ(...) translateZ(...) matrix3d(...)
There will be a directly interpolated rotation animation, a directly interpolated
translation animation, and finally a matrix animation for the remaining functions.
This is important for preserving transforms (such as full rotations) that are lost
during matrix decompose and recompose operations.
This change adds a new helper class SharedPrimitivesPrefix which is used to calculate
the prefix of shared primitives that are shared between keyframes.
Currently, the Core Animation backend only supports animation transformation primitives
across the entire animation, so shared primitive prefixes must span the entire animation
if an animation is accelerated. In the case that an animation is rendered in software,
this prefix can simply be between the current next and previous keyframes.
TransformOperations::blend is extended to blend any two TransformationOperations, which
makes it the only blend function necessary for software animations, computed CSS values,
and for the Nicosia backend, simplifying the interpolation code path.
* animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc):
* animation/CSSPropertyBlendingClient.h:
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::checkForMatchingTransformFunctionLists):
(WebCore::KeyframeEffect::computeExtentOfTransformAnimation const):
* animation/KeyframeEffect.h:
* platform/graphics/GraphicsLayer.cpp:
(WebCore::operationsAt): Deleted.
(WebCore::GraphicsLayer::getSharedPrimitivesForTransformKeyframes): Deleted.
* platform/graphics/GraphicsLayer.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
(WebCore::GraphicsLayerCA::setTransformAnimationKeyframes):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/nicosia/NicosiaAnimation.cpp:
(Nicosia::applyTransformAnimation):
(Nicosia::Animation::Animation):
(Nicosia::Animation::operator=):
(Nicosia::Animation::applyInternal):
* platform/graphics/nicosia/NicosiaAnimation.h:
* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayerTextureMapper::addAnimation):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::addAnimation):
* platform/graphics/transforms/TransformOperations.cpp:
(WebCore::SharedPrimitivesPrefix::update):
(WebCore::TransformOperations::blend const):
(WebCore::TransformOperations::createBlendedMatrixOperationFromOperationsSuffix const):
(WebCore::TransformOperations::operationsMatch const): Deleted.
(WebCore::TransformOperations::updateSharedPrimitives const): Deleted.
(WebCore::TransformOperations::blendByMatchingOperations const): Deleted.
(WebCore::TransformOperations::blendByUsingMatrixInterpolation const): Deleted.
* platform/graphics/transforms/TransformOperations.h:
(WebCore::TransformOperations::apply const):
(WebCore::SharedPrimitivesPrefix::hadIncompatibleTransformFunctions):
(WebCore::SharedPrimitivesPrefix::primitives):
2022-03-01 Commit Queue <commit-queue@webkit.org>
Unreviewed, reverting r290619.
https://bugs.webkit.org/show_bug.cgi?id=237337
Introduced build failure
Reverted changeset:
"[iOS] Weak link AVPictureInPictureController"
https://bugs.webkit.org/show_bug.cgi?id=237227
https://commits.webkit.org/r290619
2022-03-01 Antoine Quint <graouts@webkit.org>
[web-animations] ::placeholder should not be a valid pseudo-element for a KeyframeEffect target
https://bugs.webkit.org/show_bug.cgi?id=237334
Reviewed by Dean Jackson.
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::setPseudoElement):
2022-03-01 Alex Christensen <achristensen@webkit.org>
[AppleWin] Start using Visual Studio 2022
https://bugs.webkit.org/show_bug.cgi?id=234933
Reviewed by Maciej Stachowiak.
* WebCore.vcxproj/WebCore.proj:
2022-03-01 Antoine Quint <graouts@webkit.org>
[web-animations] add support for passing an optional timeline to Element.animate()
https://bugs.webkit.org/show_bug.cgi?id=237312
Reviewed by Dean Jackson.
* animation/KeyframeAnimationOptions.h:
* animation/KeyframeAnimationOptions.idl:
* dom/Element.cpp:
(WebCore::Element::animate):
2022-03-01 Commit Queue <commit-queue@webkit.org>
Unreviewed, reverting r290325.
https://bugs.webkit.org/show_bug.cgi?id=237326
Broken patch
Reverted changeset:
"[GStreamer] Switch media player to playbin3"
https://bugs.webkit.org/show_bug.cgi?id=236884
https://commits.webkit.org/r290325
2022-03-01 Alan Bujtas <zalan@apple.com>
[IFC][Integration] InlineIterator::Box::rect() returns the unflipped visual rect
https://bugs.webkit.org/show_bug.cgi?id=237304
Reviewed by Antti Koivisto.
Rename InlineIterator::Box::rect() to visualRectIgnoringBlockDirection().
This is the unflipped version of the visual rect. It's no longer logical but
when the writing mode sets right-to-left/bottom-to-top block direction, it's not yet visual either.
It'll help to indentify callsites where we actually need the flipped version of this visual rect.
* layout/formattingContexts/inline/display/InlineDisplayBox.h:
(WebCore::InlineDisplay::Box::unflippedVisualRect const):
(WebCore::InlineDisplay::Box::top const):
(WebCore::InlineDisplay::Box::bottom const):
(WebCore::InlineDisplay::Box::left const):
(WebCore::InlineDisplay::Box::right const):
(WebCore::InlineDisplay::Box::width const):
(WebCore::InlineDisplay::Box::height const):
(WebCore::InlineDisplay::Box::moveVertically):
(WebCore::InlineDisplay::Box::moveHorizontally):
(WebCore::InlineDisplay::Box::setLeft):
(WebCore::InlineDisplay::Box::setRight):
(WebCore::InlineDisplay::Box::setTop):
(WebCore::InlineDisplay::Box::setBottom):
(WebCore::InlineDisplay::Box::setRect):
(WebCore::InlineDisplay::Box::Box):
(WebCore::InlineDisplay::Box::truncate):
(WebCore::InlineDisplay::Box::rect const): Deleted.
* layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp:
(WebCore::Layout::InlineDisplayContentBuilder::adjustVisualGeometryForDisplayBox):
* layout/integration/InlineIteratorBox.h:
(WebCore::InlineIterator::Box::logicalTop const):
(WebCore::InlineIterator::Box::logicalBottom const):
(WebCore::InlineIterator::Box::logicalLeft const):
(WebCore::InlineIterator::Box::logicalRight const):
(WebCore::InlineIterator::Box::logicalWidth const):
(WebCore::InlineIterator::Box::logicalHeight const):
(WebCore::InlineIterator::Box::unflippedVisualRect const):
(WebCore::InlineIterator::Box::rect const): Deleted.
* layout/integration/InlineIteratorBoxLegacyPath.h:
(WebCore::InlineIterator::BoxLegacyPath::unflippedVisualRect const):
(WebCore::InlineIterator::BoxLegacyPath::rect const): Deleted.
* layout/integration/InlineIteratorBoxModernPath.h:
(WebCore::InlineIterator::BoxModernPath::unflippedVisualRect const):
(WebCore::InlineIterator::BoxModernPath::createTextRun const):
(WebCore::InlineIterator::BoxModernPath::rect const): Deleted.
* layout/integration/LayoutIntegrationBoxTree.cpp:
(WebCore::LayoutIntegration::showInlineContent):
* layout/integration/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::firstInlineBoxRect const):
(WebCore::LayoutIntegration::LineLayout::collectInlineBoxRects const):
(WebCore::LayoutIntegration::LineLayout::hitTest):
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::showInlineTreeAndRuns):
* rendering/InlineBoxPainter.cpp:
(WebCore::InlineBoxPainter::paintMask):
(WebCore::InlineBoxPainter::paintDecorations):
(WebCore::InlineBoxPainter::paintFillLayer):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::addFocusRingRectsForInlineChildren):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintMaskForTextFillBox):
(WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry const):
(WebCore::pixelSnapBackgroundImageGeometryForPainting): Deleted.
* rendering/RenderInline.cpp:
(WebCore::RenderInline::paintOutline):
* rendering/RenderLineBreak.cpp:
(WebCore::RenderLineBreak::linesBoundingBox const):
(WebCore::RenderLineBreak::absoluteRects const):
(WebCore::RenderLineBreak::absoluteQuads const):
* rendering/RenderText.cpp:
(WebCore::RenderText::absoluteRects const):
(WebCore::boundariesForTextRun):
(WebCore::localQuadForTextRun):
(WebCore::RenderText::firstRunLocation const):
(WebCore::RenderText::linesBoundingBox const):
* rendering/RenderTreeAsText.cpp:
(WebCore::write):
* rendering/TextBoxPainter.cpp:
(WebCore::TextBoxPainter::computePaintRect):
2022-03-01 Wenson Hsieh <wenson_hsieh@apple.com>
focus({preventScroll: true}) does not prevent scrolling on iOS
https://bugs.webkit.org/show_bug.cgi?id=236584
rdar://88911184
Reviewed by Simon Fraser.
Plumb `FocusOptions` through `Element::dispatchFocusEvent()` as well as the chrome client hooks for
`elementDidRefocus` and `elementDidFocus`, instead of just a `FocusDirection` flag.
* dom/Document.cpp:
(WebCore::Document::setFocusedElement):
* dom/Element.cpp:
(WebCore::Element::focus):
(WebCore::Element::dispatchFocusEvent):
* dom/Element.h:
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::dispatchFocusEvent):
* html/HTMLSelectElement.h:
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::dispatchFocusEvent):
* html/HTMLTextFormControlElement.h:
* loader/EmptyClients.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::elementDidFocus):
(WebCore::ChromeClient::elementDidRefocus):
* page/FocusController.cpp:
(WebCore::dispatchEventsOnWindowAndFocusedElement):
(WebCore::FocusController::setFocusedElement):
2022-03-01 Alan Bujtas <zalan@apple.com>
REGRESSION (r273129): Text contents in <span> with opacity not repainting/updating when sibling element has "will-change: transform"
https://bugs.webkit.org/show_bug.cgi?id=236876
<rdar://problem/89180092>
Reviewed by Simon Fraser.
This patch implements a slightly naive repaint for inline boxes with self painting layers.
1. Mark the line when it gains an inline box (RenderInline) with self painting layer (e.g. <span style="position: relative">this has dedicated layer</span>)
2. Issue repaint at the end of the line layout on such renderers.
Test: fast/repaint/inline-box-with-self-paint-layer.html
* rendering/LegacyInlineFlowBox.cpp:
(WebCore::LegacyInlineFlowBox::addToLine):
* rendering/LegacyInlineFlowBox.h:
(WebCore::LegacyInlineFlowBox::LegacyInlineFlowBox):
(WebCore::LegacyInlineFlowBox::hasSelfPaintInlineBox const):
* rendering/LegacyLineLayout.cpp:
(WebCore::repaintSelfPaintInlineBoxes):
(WebCore::LegacyLineLayout::layoutRunsAndFloats):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::clippedOverflowRect const): expand the ASSERT to enclsing inline boxes too.
2022-03-01 Antoine Quint <graouts@webkit.org>
[web-animations] web-animations/interfaces/Animatable/getAnimations-iframe.html is a unique failure
https://bugs.webkit.org/show_bug.cgi?id=237314
Reviewed by Antti Koivisto.
We need to update the layout of a potential owner document in case some layout-dependent media queries
trigger declarative animations.
* dom/Document.cpp:
(WebCore::Document::matchingAnimations):
* dom/Element.cpp:
(WebCore::Element::getAnimations):
2022-03-01 Kimmo Kinnunen <kkinnunen@apple.com>
WebGL GPUP OpenGL context is not used even if WebGL via Metal is deselected
https://bugs.webkit.org/show_bug.cgi?id=236505
Reviewed by Myles C. Maxfield.
Encode, decode also `useMetal` property.
Tests: webgl/webgl-via-metal-flag-off.html
webgl/webgl-via-metal-flag-on.html
* platform/graphics/GraphicsContextGLAttributes.h:
(WebCore::GraphicsContextGLAttributes::encode const):
(WebCore::GraphicsContextGLAttributes::decode):
2022-03-01 Kimmo Kinnunen <kkinnunen@apple.com>
GraphicsContextGL related includes are inconsistent, slowing the build
https://bugs.webkit.org/show_bug.cgi?id=237270
Reviewed by Alexey Proskuryakov.
Remove include "GraphicsContextGL.h" from files not needing that.
Most notably, add ChromeClient.cpp and move the non-trivial
ChromeClient::createGraphicsContextGL() function to .cpp file, so
that ChromeClient.h does not need to include GraphicsContextGL.h.
This makes incremental compiles better, as not all changes to
GraphicsContextGL.h and its dependencies force big rebuilds.
GraphicsContextGL.h and dependents maintainance:
Remove unneeded forward declarations. Types referenced by overridden virtual
functions must already be declared. Remove forward declarartion ExtensionsGL,
the class was removed
Use forward declares instead of includes (MediaPlayer).
Remove RemoteGraphicsContextGLProxyBase.cpp/h, the use was removed.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* html/canvas/WebGLActiveInfo.h:
* html/canvas/WebGLShaderPrecisionFormat.h:
* inspector/InspectorShaderProgram.cpp:
* page/ChromeClient.cpp: Renamed from Source/WebCore/platform/graphics/RemoteGraphicsContextGLProxyBase.cpp.
(WebCore::ChromeClient::createGraphicsContextGL const):
* page/ChromeClient.h:
* platform/HostWindow.h:
* platform/graphics/GraphicsContextGL.h:
* platform/graphics/GraphicsContextGLState.h:
* platform/graphics/RemoteGraphicsContextGLProxyBase.h: Removed.
* platform/graphics/angle/GraphicsContextGLANGLE.h:
* platform/graphics/cocoa/IOSurface.mm:
* platform/graphics/opengl/ExtensionsGLOpenGL.h:
* platform/xr/openxr/OpenXRSwapchain.h:
* platform/xr/openxr/PlatformXROpenXR.cpp:
* platform/xr/openxr/PlatformXROpenXR.h:
2022-03-01 Tim Nguyen <ntim@apple.com>
Explicitly disable style sharing for form controls
https://bugs.webkit.org/show_bug.cgi?id=237236
Reviewed by Antti Koivisto.
There was a typo introduced in bug 153768 and bug 138769, which essentially disables
style sharing completely for form controls. Let's make that explicit.
* style/StyleSharingResolver.cpp:
(WebCore::Style::SharingResolver::canShareStyleWithControl): Removed.
(WebCore::Style::SharingResolver::canShareStyleWithElement const):
2022-03-01 Cameron McCormack <heycam@apple.com>
Make input element UA shadow tree creation lazy
https://bugs.webkit.org/show_bug.cgi?id=236747
Reviewed by Aditya Keerthi.
We currently delay InputType creation for parser inserted elements until
just after the attributes have been set, so that we don't wastefully
create an InputType and the UA shadow tree creation if a non-text
type="" was specified on the tag. We don't do anything similar for
script inserted input elements. We could make the InputType creation
lazy, but most of the wasted time is due to the shadow tree creation.
This patch makes InputType shadow tree creation lazy by delaying it
until one of the following happens:
1. the element is inserted into the document
2. the type="" or value="" attributes are changed before the element
is inserted into the document
3. any DOM methods that need access to the innerTextElement() are
called on the element before the element is inserted into the
document
Not all places where we call innerTextElement() on the
HTMLInputElement are safe to lazily create the shadow trees, so we
have two accessors:
- innerTextElement() returns the inner text element if it's been
created already
- innerTextElementCreatingShadowSubtreeIfNeeded will perform the lazy
shadow tree construction if it hasn't already been done
Since the existing
createShadowSubtreeAndUpdateInnerTextElementEditability function has
more responsibility than just creating the subtree and ensuring the
editability is set appropriately, it's renamed to a more manageable
createShadowSubtree.
This change is a 0.5% progression on Speedometer 2.
Test: fast/forms/lazy-shadow-tree-creation.html
* html/BaseDateAndTimeInputType.h:
* html/BaseDateAndTimeInputType.cpp:
(WebCore::BaseDateAndTimeInputType::createShadowSubtree):
(WebCore::BaseDateAndTimeInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
* html/ColorInputType.h:
* html/ColorInputType.cpp:
(WebCore::ColorInputType::createShadowSubtree):
(WebCore::ColorInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
* html/FileInputType.h:
* html/FileInputType.cpp:
(WebCore::FileInputType::createShadowSubtree):
(WebCore::FileInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
* html/InputType.cpp:
(WebCore::InputType::createShadowSubtree):
(WebCore::InputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
* html/RangeInputType.h:
* html/RangeInputType.cpp:
(WebCore::RangeInputType::createShadowSubtree):
(WebCore::RangeInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
* html/SearchInputType.h:
* html/SearchInputType.cpp:
(WebCore::SearchInputType::createShadowSubtree):
(WebCore::SearchInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
Renamed createShadowSubtreeAndUpdateInnerTextElementEditability to
createShadowSubtree and remove the "isInnerTextElementEditable"
argument, since we can ask the element() for its value if needed.
createShadowSubtree is now also responsible for creating the shadow
root.
* html/TextFieldInputType.h:
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::createShadowSubtree):
(WebCore::TextFieldInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
Renamed. Ensure all shadow tree state is up to date now that it can be
created later.
* html/InputType.h:
* html/InputType.cpp:
(WebCore::InputType::createShadowSubtree):
(WebCore::InputType::hasCreatedShadowSubtree const):
New functions to create the shadow subtree if it hasn't been done
already, and to query whether it's been done.
* html/HTMLInputElement.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::innerTextElementCreatingShadowSubtreeIfNeeded):
* html/HTMLTextAreaElement.h:
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::innerTextElementCreatingShadowSubtreeIfNeeded):
* html/HTMLTextFormControlElement.h:
* html/InputType.h:
* html/InputType.cpp:
(WebCore::InputType::innerTextElementCreatingShadowSubtreeIfNeeded):
New functions to first create the shadow subtree before returning
innerTextElement(). HTMLTextAreaElement never lazily creates its
shadow subtree and so just returns innerTextElement().
* html/HTMLInputElement.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::createShadowSubtreeAndUpdateInnerTextElementEditability):
Deleted. Just call through to m_inputType->createShadowTree()
directly.
(WebCore::HTMLInputElement::HTMLInputElement):
(WebCore::HTMLInputElement::create):
(WebCore::HTMLInputElement::initializeInputType):
(WebCore::HTMLInputElement::updateType):
Don't immediately create the shadow tree.
(WebCore::HTMLInputElement::didFinishInsertingNode):
Create the shadow subtree now that the element's been inserted. No
need to call dataListMayHaveChanged since
TextFieldInputType::createShadowSubtree will now do this.
* html/BaseDateAndTimeInputType.cpp:
(WebCore::BaseDateAndTimeInputType::updateInnerTextValue):
Ensure the shadow subtree is created since we need to poke at it.
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::forwardEvent):
Don't forward the event if the shadow tree hasn't been created yet.
(WebCore::HTMLTextFormControlElement::setSelectionRange):
Ensure the shadow tree has been created. This is needed if the
selection APIs are called on the input element before it's inserted
into the document.
(WebCore::HTMLTextFormControlElement::visiblePositionForIndex const):
Assert that the shadow tree has been created, since editing
functionality should only be needed if the element's been inserted
into the document.
(WebCore::HTMLTextFormControlElement::setInnerTextValue):
Ensure the shadow tree has been created.
* html/RangeInputType.cpp:
(WebCore::RangeInputType::handleMouseDownEvent):
(WebCore::RangeInputType::handleTouchEvent):
Ensure the shadow tree has been created in case the event will change
the value.
(WebCore::RangeInputType::sliderTrackElement const):
Only return the element if it's been created.
(WebCore::RangeInputType::typedSliderThumbElement const):
Assert that the element has been created.
(WebCore::RangeInputType::dataListMayHaveChanged):
Only try to re-layout if the shadow tree has been created.
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::isEmptyValue const):
Avoid creating the shadow subtree.
(WebCore::TextFieldInputType::forwardEvent):
Move the element assertion up to be consistent with other functions.
(WebCore::TextFieldInputType::innerTextElement const):
Don't assert, since this now can legitimately return null.
* html/FileInputType.cpp:
(WebCore::FileInputType::disabledStateChanged):
(WebCore::FileInputType::attributeChanged):
* html/RangeInputType.cpp:
(WebCore::RangeInputType::disabledStateChanged):
(WebCore::RangeInputType::attributeChanged):
(WebCore::RangeInputType::setValue):
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::disabledStateChanged):
(WebCore::TextFieldInputType::readOnlyStateChanged):
(WebCore::TextFieldInputType::updatePlaceholderText):
(WebCore::TextFieldInputType::updateAutoFillButton):
(WebCore::TextFieldInputType::dataListMayHaveChanged):
Don't update the shadow tree contents if it hasn't been created yet.
createShadowTree is responsible for ensuring it creates the shadow
tree contents reflecting the current state.
2022-03-01 Ziran Sun <zsun@igalia.com>
[Selection] Selection Range should be clamped by the current value length
https://bugs.webkit.org/show_bug.cgi?id=237210
Reviewed by Darin Adler.
As per https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#set-the-selection-range,
if start or end "is greater than the length of the relevant value of the text control, then set it to
the length of the relevant value of the text control".
This CL makes selection range clamp to the current value length.
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::setSelectionRange):
2022-03-01 Matt Woodrow <mattwoodrow@apple.com>
Handle perpendicular containing blocks when computing available logical height.
https://bugs.webkit.org/show_bug.cgi?id=236953
Reviewed by Dean Jackson.
Handles the case where the containing block uses a perpendicular writing mode
to the current box, and we need to check the containing block's width in order
to determine height.
Existing subgrid tests marked as passing.
These subgrid reftests were failing because the -expected files were rendering incorrectly
(which don't use subgrid).
* rendering/RenderBox.cpp:
(WebCore::RenderBox::availableLogicalHeightUsing const):
2022-03-01 Carlos Garcia Campos <cgarcia@igalia.com>
[ATSPI] Remove layout tests checking children added/removed notifications
https://bugs.webkit.org/show_bug.cgi?id=237272
Reviewed by Adrian Perez de Castro.
Do not send children-changed notifications to WTR observers.
* accessibility/atspi/AccessibilityAtspi.cpp:
(WebCore::AccessibilityAtspi::childrenChanged):
(WebCore::AccessibilityAtspi::notifyChildrenChanged const): Deleted.
* accessibility/atspi/AccessibilityAtspi.h:
2022-02-28 Diego Pino Garcia <dpino@igalia.com>
[GTK] Unreviewed, non-unified build fix after 247791@main
* platform/graphics/gbm/GBMDevice.h:
2022-02-28 Tyler Wilcock <tyler_w@apple.com>
AX: WebKit should ignore empty modals rather than trapping focus inside them
https://bugs.webkit.org/show_bug.cgi?id=237163
Reviewed by Chris Fleizach and Andres Gonzalez.
Given this markup:
<div role="dialog" aria-modal="true">
<div aria-hidden="true">
<button>Close modal (inside modal)</button>
</div>
</div>
There is no accessible content inside this modal, but WebKit traps user focus inside,
making the rest of the page completely inaccessible.
With this patch we ignore modals that don't have accessible content.
We do this by walking the DOM to find any non-AX-ignored objects.
Because determining whether or not an element is ignored is dependent
on modals present on the page, this patch moves the call to `ignoredFromModalPresence`
out of `AccessibilityObject::defaultObjectInclusion`, as this function is
downstream of `computeAccessibilityIsIgnored`, and we need to call
that on objects inside modal candidates. Without this move, we would
recurse infinitely in `AXObjectCache::modalElementHasAccessibleContent`.
We now check whether an object is ignored due to modal presence in
`AccessibilityObject::accessibilityIsIgnored()`, so that function should
be used as the final say in determining whether an object is ignored.
Test: accessibility/ignore-modals-without-any-content.html
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::modalElementHasAccessibleContent):
(WebCore::AXObjectCache::currentModalNode):
* accessibility/AXObjectCache.h:
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::defaultObjectInclusion const):
(WebCore::AccessibilityObject::accessibilityIsIgnored const):
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::computeAccessibilityIsIgnored const):
2022-02-28 Simon Fraser <simon.fraser@apple.com>
Compositing/paint invalidation with transforms
https://bugs.webkit.org/show_bug.cgi?id=233421
<rdar://problem/85814854>
Reviewed by Alan Bujtas.
When changing transform from something like `translate(0)` to `translate3d(0, 0, 0)
scale(0.5, 0.5)`, we trigger compositing, and thus need to repaint the previous rect of the
layer in its old repaint container. However, the existing code would take the new transform
into account when computing that rect, thus dirtying a rect that is too small.
To fix this, we need to use the cached repaint rects on RenderLayer for this repaint.
However, doing so revealed a bug (via
compositing/shared-backing/repaint-into-shared-backing.html) in how we compute repaint
cached repaint rects in the presence of shared backing. During a compositing update, if a
layer's composited state changed, we'd call computeRepaintRectsIncludingDescendants(), which
computes rect relative to the layer's repaint container. But at this time, the state of
backing sharing in BackingSharingState is in flux (we essentially don't know yet if a layer
can use shared backing). So we may compute and cache repaint rects relative to the wrong
container.
To fix this, leverage the existing m_layersPendingRepaint logic, and delay computing the
repaint rects until we've established our final backing sharing configuration.
Tests: compositing/repaint/composite-and-scale-change.html
compositing/shared-backing/repaint-into-shared-backing-become-composited.html
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::setBackingProviderLayer):
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::BackingSharingState::issuePendingRepaints):
(WebCore::RenderLayerCompositor::updateBacking):
2022-02-28 Simon Fraser <simon.fraser@apple.com>
No animation when scroll snap scroller is navigated with the keyboard
https://bugs.webkit.org/show_bug.cgi?id=236244
Reviewed by Tim Horton.
Keyboard-driven scrolls in overflow didn't animate, simply because scrollAnimatorEnabled()
wasn't implemented for RenderLayerScrollableArea.
I could not figure out a reliable way to test that we animated the scroll.
* rendering/RenderLayerScrollableArea.cpp:
(WebCore::RenderLayerScrollableArea::scrollAnimatorEnabled const):
* rendering/RenderLayerScrollableArea.h:
2022-02-28 Jer Noble <jer.noble@apple.com>
[Cocoa] Adopt -streamDataParser:didProvideContentKeySpecifier:forTrackID: delegate callback
https://bugs.webkit.org/show_bug.cgi?id=236109
<rdar://problem/88785844>
Reviewed by Eric Carlson.
Re-land support after a rollout in r290311, this time with an off-by-default Experimental Feature
flag.
In addition to checking whether the renderer classes support AVContentKeySession, also check whether
the RuntimeSetting has been enabled. This requires passing that setting through to the
MediaSessionManagerCocoa singleton, so it can be accessed from platform/.
If the renderer support check succeeds and the setting is enabled, only then should the delegate for
AVStreamDataParser include support for the new -didProvideContentKeySpecifier callback. Subclass the
WebAVStreamDataParserListener into a new WebAVStreamDataParserWithKeySpecifierListener object, and
instantiate one or the other according to the support checks above.
* page/RuntimeEnabledFeatures.cpp:
(WebCore::RuntimeEnabledFeatures::setSampleBufferContentKeySessionSupportEnabled):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::sampleBufferContentKeySessionSupportEnabled const):
* platform/audio/cocoa/MediaSessionManagerCocoa.h:
* platform/audio/cocoa/MediaSessionManagerCocoa.mm:
(WebCore::MediaSessionManagerCocoa::setSampleBufferContentKeySessionSupportEnabled):
(WebCore::MediaSessionManagerCocoa::sampleBufferContentKeySessionSupportEnabled):
* platform/graphics/avfoundation/objc/SourceBufferParserAVFObjC.mm:
(-[WebAVStreamDataParserWithKeySpecifierListener streamDataParser:didProvideContentKeySpecifier:forTrackID:]):
(WebCore::SourceBufferParserAVFObjC::SourceBufferParserAVFObjC):
(-[WebAVStreamDataParserListener streamDataParser:didProvideContentKeySpecifier:forTrackID:]): Deleted.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::sampleBufferRenderersSupportKeySession):
2022-02-28 Per Arne Vollan <pvollan@apple.com>
[iOS] Weak link AVPictureInPictureController
https://bugs.webkit.org/show_bug.cgi?id=237227
<rdar://76011860>
Reviewed by Brent Fulgham.
Weak linking instead of soft linking should be a small performance improvement.
* Configurations/WebCore.xcconfig:
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(WebCore::supportsPictureInPicture):
2022-02-28 Per Arne Vollan <pvollan@apple.com>
Remove release assert when UI process is blocking IOSurface IOKit access
https://bugs.webkit.org/show_bug.cgi?id=237278
Reviewed by Darin Adler.
Remove release assert in IOSurface::bytesPerRowAlignment() when UI process is blocking IOSurface IOKit access.
Instead, log this event, and return an appropriate value.
* platform/graphics/cocoa/IOSurface.mm:
(WebCore::IOSurface::bytesPerRowAlignment):
2022-02-28 Chris Dumez <cdumez@apple.com>
Unreviewed, address feedback from Darin regarding r290610.
* platform/graphics/Color.h:
(WebCore::add):
2022-02-28 Rob Buis <rbuis@igalia.com>
Handle widow relayout differently
https://bugs.webkit.org/show_bug.cgi?id=235519
Reviewed by Alan Bujtas.
Handle widow relayout differently to prevent function call recursion.
Test: fast/multicol/widow-many-relayouts-crash.html
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutBlock):
(WebCore::RenderBlockFlow::relayoutToAvoidWidows): Deleted.
* rendering/RenderBlockFlow.h:
(WebCore::RenderBlockFlow::didBreakAtLineToAvoidWidow const):
2022-02-28 Devin Rousso <drousso@apple.com>
Web Inspector: [Flexbox] Add options to show each area's CSS `order` and/or DOM index in the parent flex container
https://bugs.webkit.org/show_bug.cgi?id=237215
Reviewed by Patrick Angle.
This will help developers better understand how CSS `order` and the DOM index of each flex
item interact and result in what's eventually rendered.
* inspector/agents/InspectorDOMAgent.h:
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::showFlexOverlay):
Pass along the optional boolean parameter `showOrderNumbers`.
* inspector/InspectorOverlay.h:
(WebCore::InspectorOverlay::Highlight::FlexHighlightOverlay::encode const):
(WebCore::InspectorOverlay::Highlight::FlexHighlightOverlay::decode):
Add member `bool` for `showOrderNumbers` to `Flex::Config`.
Add member `Vector<InspectorOverlayLabel>` to `FlexHighlightOverlay` for drawing labels.
* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::drawFlexOverlay):
(WebCore::InspectorOverlay::buildFlexOverlay):
Use `showOrderNumbers` to (when enabled) add items to `Vector<InspectorOverlayLabel>` for
each flex item's computed CSS `order` and DOM index in the parent flex container.
2022-02-28 Chris Dumez <cdumez@apple.com>
Adopt the modern Hasher more widely
https://bugs.webkit.org/show_bug.cgi?id=237262
Reviewed by Sam Weinig.
* dom/MessagePortIdentifier.h:
(WebCore::add):
(WTF::MessagePortIdentifierHash::hash):
(WebCore::MessagePortIdentifier::hash const): Deleted.
* history/BackForwardItemIdentifier.h:
(WebCore::add):
(WTF::BackForwardItemIdentifierHash::hash):
(WebCore::BackForwardItemIdentifier::hash const): Deleted.
* loader/ResourceCryptographicDigest.h:
(WebCore::add):
(WTF::DefaultHash<WebCore::ResourceCryptographicDigest>::hash):
* platform/graphics/Color.h:
(WebCore::add):
(WebCore::Color::hash const): Deleted.
* platform/graphics/ColorHash.h:
(WTF::ColorHash::hash):
* platform/graphics/Font.cpp:
(WebCore::add):
(WebCore::CharacterFallbackMapKeyHash::hash):
* platform/graphics/FontCache.cpp:
(WebCore::add):
(WebCore::FontPlatformDataCacheKeyHash::hash):
(WebCore::FontCascadeCacheKeyHash::hash): Deleted.
* platform/graphics/FontCache.h:
(WebCore::add):
(WebCore::FontCascadeCacheKeyHash::hash):
* platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
(WebCore::add):
(WebCore::FontFamilySpecificationKeyHash::hash):
* platform/graphics/cocoa/SystemFontDatabaseCoreText.h:
(WebCore::add):
(WebCore::SystemFontDatabaseCoreText::CascadeListParameters::Hash::hash):
(WebCore::SystemFontDatabaseCoreText::CascadeListParameters::hash const): Deleted.
* platform/graphics/freetype/FontCacheFreeType.cpp:
(WebCore::add):
(WebCore::FallbackFontDescriptionKeyHash::hash):
2022-02-28 Aditya Keerthi <akeerthi@apple.com>
[macOS] Unable to upload ".pages" files to file inputs accepting ".pages" and ".jpeg" files
https://bugs.webkit.org/show_bug.cgi?id=237219
rdar://89482882
Reviewed by Tim Horton and Said Abou-Hallawa.
In r264286, WebKit began transcoding images of an unsupported format
to a supported format, for file inputs that accepted image types. For
example, selecting a HEIF image in an input that accepts JPEG images
would transcode the selected image to a JPEG image.
In order to determine when attempt transcoding, the logic added in
r264286 obtains the MIME type corresponding to the selected file's
extension, and compares that to the list of accepted MIME types.
If there is a mismatch, transcoding is attempted.
The ".pages" extension does not have a well-defined MIME type in
NSURLFileTypeMappings. This is due to the fact that a the extension
maps to both a file and a package type. Consequently, the retrieved
MIME type for ".pages" files is an empty string. Following r227051,
when the file input also accepts an image type, WebKit attempts to
transcode these files, and any others that do not have a well-defined
MIME type.
While the aforementioned behavior can be considered strange, it is not
an issue in practice, since WebKit will attempt to transcode the
image, fail to do so, and upload the original file. The failure is
detected in CGImageDestinationFinalize, which returns false if an image
was not successfully written. However, a recent regression in the
ImageIO framework is causing CGImageDestinationFinalize to return true,
even if image transcoding fails. This results in WebKit uploading a
zero byte JPEG file, when a user attempts to upload ".pages" files to
file inputs accepting ".pages" and ".jpeg" files.
Ideally, the described issue would be resolved by a fix in ImageIO.
However, a more immediate solution exists in WebKit: only attempt to
transcode files to an accepted image type, if the file selected is
image. ".pages" files are not images, and WebKit should not attempt
to transcode them. See below for further explanation of the solution.
Test: fast/forms/file/entries-api/pages-jpeg-open-panel.html
* platform/graphics/cg/ImageUtilitiesCG.cpp:
(WebCore::transcodeImage):
Prior to using ImageIO to perform transcoding, WebKit obtains a Uniform
Type Identifier for the selected file using CGImageSourceCreateWithURL
and CGImageSourceGetType. If the file is not an image, a null string is
returned. WebKit can use this information to avoid the transcoding
attempt, and avoid calls to ImageIO methods further down this method.
Specifically, this solution works around the ImageIO bug by avoiding
the call to CGImageDestinationFinalize for non-images. The solution is
also an overall improvement, as WebKit now avoids unnecessary calls to
multiple ImageIO methods, in cases where we know transcoding will fail.
2022-02-28 Simon Fraser <simon.fraser@apple.com>
Revert r290548
It caused three tests to start failing.
* rendering/RenderLayerScrollableArea.cpp:
(WebCore::RenderLayerScrollableArea::scrollAnimatorEnabled const): Deleted.
* rendering/RenderLayerScrollableArea.h:
2022-02-28 Antoine Quint <graouts@webkit.org>
[web-animations] web-animations/interfaces/Animatable/getAnimations.html is a unique failure
https://bugs.webkit.org/show_bug.cgi?id=237271
Reviewed by Dean Jackson.
Our computation for the relevant state did not account for the playback rate. We rewrite
the function to match the spec exactly.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::computeRelevance):
2022-02-28 Pascal Abresch <nep@packageloss.eu>
FTP EPLF does not handle directory
https://bugs.webkit.org/show_bug.cgi?id=45113
Reviewed by Darin Adler.
The code used "!result.type" to check for an invalid type. However,
the first type in the FTPEntryType enum is FTPDirectoryEntry, so this
was actually returning true for directories, turning them into "junk"
entries which would not be listed.
Since the code for EPLF can only result in either files, directories,
or uninitialized/junk entries, the check can be removed, returning
result.type is the correct thing to do in all 3 cases.
Test: http/tests/misc/ftp-eplf-directory.py
* loader/FTPDirectoryParser.cpp:
(WebCore::parseOneFTPLine):
2022-02-28 Youenn Fablet <youenn@apple.com>
Ensure RemoteMediaPlayerProxy sets its resource owner to pixel buffers created by its player
https://bugs.webkit.org/show_bug.cgi?id=237200
Reviewed by Eric Carlson.
Add API to set the resource owner for a player private.
In case player private is running in GPUProcess, use resource owner to mark pixel buffers as owned by the resource owner.
Covered by existing tests.
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::setResourceOwner):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastPixelBuffer):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::updateLastPixelBuffer):
2022-02-28 Carlos Garcia Campos <cgarcia@igalia.com>
[ATSPI] Always expose table cells (layout and CSS) that have rendered text content
https://bugs.webkit.org/show_bug.cgi?id=237204
Reviewed by Adrian Perez de Castro.
* accessibility/atspi/AccessibilityObjectAtspi.cpp:
(WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
2022-02-28 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK][a11y] Test accessibility/gtk/xml-roles-exposed.html is failing since ATSPI switch
https://bugs.webkit.org/show_bug.cgi?id=237202
Reviewed by Adrian Perez de Castro.
Handle the special case of form item having unknown aria role to be exposed as landmark.
* accessibility/atspi/AccessibilityObjectAtspi.cpp:
(WebCore::AccessibilityObjectAtspi::effectiveRole const):
2022-02-28 Antoine Quint <graouts@webkit.org>
[web-animations] web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument-001.html is a unique failure
https://bugs.webkit.org/show_bug.cgi?id=237259
Reviewed by Dean Jackson.
We incorrectly threw when processing a null or undefined value when an iterable was provided to setKeyframes().
We now correctly insert an empty keyframe if such a value is provided.
* animation/KeyframeEffect.cpp:
(WebCore::processIterableKeyframes):
2022-02-27 Said Abou-Hallawa <said@apple.com>
[GPU Process] Deleted unneeded constructors from DisplayList::Recorder classes
https://bugs.webkit.org/show_bug.cgi?id=237261
Reviewed by Wenson Hsieh.
This should have been done in r289594.
* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::Recorder):
* platform/graphics/displaylists/DisplayListRecorder.h:
2022-02-27 Commit Queue <commit-queue@webkit.org>
Unreviewed, reverting r290577.
https://bugs.webkit.org/show_bug.cgi?id=237264
Breaks ios-wk2 layout test.
Reverted changeset:
"Compute correct containing block override size for items that
are subgridden in one dimension only."
https://bugs.webkit.org/show_bug.cgi?id=236951
https://commits.webkit.org/r290577
2022-02-27 Wenson Hsieh <wenson_hsieh@apple.com>
Invoking "Markup Image" should preserve the existing selection range
https://bugs.webkit.org/show_bug.cgi?id=237242
Reviewed by Darin Adler.
Move the implementation of `replaceNodeFromPasteboard` out of the macOS-specific implementation file and into
EditorCocoa instead, so that we can use it on both iOS and macOS to handle the "Markup Image" action. See WebKit
ChangeLog for more details.
* editing/Editor.h:
* editing/cocoa/EditorCocoa.mm:
(WebCore::maybeCopyNodeAttributesToFragment):
(WebCore::Editor::replaceNodeFromPasteboard):
Also make a few minor adjustments while we're moving this code:
- Make this take a reference instead of a pointer (the method always expects a non-null Node pointer anyways).
- Add a FIXME mentioning that we can just delete `setInsertionPasteboard` altogether once Mail compose on
macOS uses WebKit2.
- Unconditionally pass `false` for whether or not we should enable smart paste when replacing the node. This
prevents us from inserting spaces around the replacement image element when triggering the "Markup Image"
item.
- Use `makeRangeSelectingNode` instead of `makeRangeSelectingNodeContents` when selecting the node to replace.
This allows us to handle the case where the node to replace cannot contain children for editing (in
particular, image elements).
Note that this codepath (`replaceNodeFromPasteboard`) is currently only exercised by WebKitLegacy service
controls code that was originally intended for use by Mail compose, but never ended up being used.
* editing/mac/EditorMac.mm:
(WebCore::Editor::pasteWithPasteboard):
(WebCore::maybeCopyNodeAttributesToFragment): Deleted.
(WebCore::Editor::replaceNodeFromPasteboard): Deleted.
2022-02-27 Matt Woodrow <mattwoodrow@apple.com>
Compute correct containing block override size for items that are subgridden in one dimension only.
https://bugs.webkit.org/show_bug.cgi?id=236951
Reviewed by Dean Jackson.
Items that are subgridded in one dimension will be included in the track sizing algorithm of the
outer grid for that dimension. When measuring their size in the subgridded dimension, we need to
set their containing block size in the other (non-subgridded) dimension, which is only available
from the subgrid's track sizing, not the outer track sizes.
This recurses up to set the override size on the subgrid element instead, and forces a layout
there, which should copy down subgrid track sizes and compute the other dimension, making it
available on the inner item we need.
Test: imported/w3c/web-platform-tests/css/css-grid/subgrid/auto-track-sizing-002.html
* rendering/GridLayoutFunctions.cpp:
(WebCore::GridLayoutFunctions::extraMarginForSubgridAncestors):
* rendering/GridLayoutFunctions.h:
* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrackSizingAlgorithmStrategy::updateOverridingContainingBlockContentSizeForChild const):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::isSubgridOf):
* rendering/RenderGrid.h:
2022-02-27 Matt Woodrow <mattwoodrow@apple.com>
Convert grid direction to be relative to subgrid when accounting for extra margin.
https://bugs.webkit.org/show_bug.cgi?id=236954
Reviewed by Dean Jackson.
|direction| is passed as a direction relative to |grid|, so we need to convert it
to be a direction relative to the subgrid item in order to account for margin on
the correct edge.
Marks existing test orthogonal-writing-mode-003.html as passing.
* rendering/GridLayoutFunctions.cpp:
(WebCore::GridLayoutFunctions::marginLogicalSizeForChild):
2022-02-27 Chris Dumez <cdumez@apple.com>
Omit template parameter for SetForScope<> variables
https://bugs.webkit.org/show_bug.cgi?id=237258
Reviewed by Darin Adler.
* Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
(WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::performDeferredCacheUpdate):
* bindings/js/JSCustomElementRegistryCustom.cpp:
(WebCore::JSCustomElementRegistry::define):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::evaluateInWorld):
(WebCore::ScriptController::evaluateModule):
(WebCore::ScriptController::callInWorld):
(WebCore::ScriptController::executeJavaScriptURL):
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::addFontFaceRule):
* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumeCompoundSelector):
* dom/CustomElementReactionQueue.cpp:
(WebCore::CustomElementQueue::invokeAll):
* dom/Document.cpp:
(WebCore::Document::updateRenderTree):
(WebCore::Document::styleForElementIgnoringPendingStylesheets):
(WebCore::Document::destroyRenderTree):
(WebCore::Document::hitTest):
* dom/EventTarget.cpp:
(WebCore::EventTarget::fireEventListeners):
* dom/Microtasks.cpp:
(WebCore::MicrotaskQueue::performMicrotaskCheckpoint):
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::forEachActiveDOMObject const):
* dom/Traversal.cpp:
(WebCore::NodeIteratorBase::acceptNode):
* editing/Editor.cpp:
(WebCore::Editor::cut):
(WebCore::Editor::copy):
(WebCore::Editor::copyFont):
(WebCore::Editor::paste):
(WebCore::Editor::pasteAsPlainText):
(WebCore::Editor::pasteAsQuotation):
(WebCore::Editor::pasteFont):
* history/BackForwardCache.cpp:
(WebCore::BackForwardCache::pruneToSizeNow):
(WebCore::BackForwardCache::removeAllItemsForPage):
* html/DOMTokenList.cpp:
(WebCore::DOMTokenList::updateAssociatedAttributeFromTokens):
* html/HTMLButtonElement.cpp:
(WebCore::HTMLButtonElement::defaultEventHandler):
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::focusAndShowValidationMessage):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::reset):
(WebCore::HTMLFormElement::constructEntryList):
* html/HTMLTrackElement.cpp:
(WebCore::HTMLTrackElement::scheduleLoad):
* html/parser/CSSPreloadScanner.cpp:
(WebCore::CSSPreloadScanner::scan):
* html/shadow/TextControlInnerElements.cpp:
(WebCore::SearchFieldResultsButtonElement::resolveCustomStyle):
* html/track/LoadableTextTrack.cpp:
(WebCore::LoadableTextTrack::scheduleLoad):
* loader/ContentFilter.cpp:
(WebCore::ContentFilter::handleProvisionalLoadFailure):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::load):
(WebCore::FrameLoader::clearProvisionalLoadForPolicyCheck):
(WebCore::FrameLoader::dispatchBeforeUnloadEvent):
(WebCore::FrameLoader::loadDifferentDocumentItem):
* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::updateBuffer):
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::pruneLiveResourcesToSize):
(WebCore::MemoryCache::pruneDeadResourcesToSize):
* page/Chrome.cpp:
(WebCore::Chrome::runModal const):
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::handleContextMenuEvent):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::suspendForBackForwardCache):
* page/DragController.cpp:
(WebCore::DragController::performDragOperation):
* page/EventSource.cpp:
(WebCore::EventSource::doExplicitLoadCancellation):
* page/FrameView.cpp:
(WebCore::FrameView::applyRecursivelyWithVisibleRect):
(WebCore::FrameView::updateEmbeddedObjects):
(WebCore::FrameView::autoSizeIfEnabled):
* page/FrameViewLayoutContext.cpp:
(WebCore::FrameViewLayoutContext::layout):
(WebCore::FrameViewLayoutContext::runAsynchronousTasks):
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::didReceiveHeaders):
* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::tryToBeginDragAtPoint):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::commitTreeState):
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::handleWheelEventAfterMainThread):
* platform/PreviewConverter.cpp:
(WebCore::PreviewConverter::iterateClients):
(WebCore::PreviewConverter::replayToClient):
* platform/audio/PlatformMediaSession.cpp:
(WebCore::PlatformMediaSession::clientWillBeginPlayback):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
(WebCore::GraphicsLayerCA::commitLayerChangesAfterSublayers):
* platform/graphics/mac/WebLayer.mm:
(-[WebSimpleLayer renderInContext:]):
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGL::drawTexture):
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::paintSelfAndChildrenWithReplica):
(WebCore::TextureMapperLayer::paintIntoSurface):
(WebCore::TextureMapperLayer::paintWithIntermediateSurface):
(WebCore::TextureMapperLayer::paintRecursive):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
* platform/ios/LegacyTileLayer.mm:
(-[LegacyTileLayer renderInContext:]):
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::ScrollbarThemeMac::paint):
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::applyStretchAlignmentToChild):
* rendering/RenderGeometryMap.cpp:
(WebCore::RenderGeometryMap::pushMappingsToAncestor):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::computeVisibleRectInContainer const):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::flushPendingLayerChanges):
* rendering/RenderLayerScrollableArea.cpp:
(WebCore::RenderLayerScrollableArea::updateScrollbarsAfterLayout):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::layout):
* rendering/svg/LegacyRenderSVGRoot.cpp:
(WebCore::LegacyRenderSVGRoot::layout):
* rendering/svg/RenderSVGResourceContainer.cpp:
(WebCore::RenderSVGResourceContainer::markAllClientsForInvalidation):
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::layout):
* storage/StorageMap.cpp:
(WebCore::StorageMap::setItemIgnoringQuota):
* style/StyleBuilder.cpp:
(WebCore::Style::Builder::applyCustomProperty):
(WebCore::Style::Builder::applyCascadeProperty):
* style/StyleInvalidator.cpp:
(WebCore::Style::Invalidator::invalidateWithMatchElementRuleSets):
* style/StyleScope.cpp:
(WebCore::Style::Scope::createDocumentResolver):
(WebCore::Style::Scope::createOrFindSharedShadowTreeResolver):
(WebCore::Style::Scope::updateResolver):
* svg/SVGPathBlender.cpp:
(WebCore::SVGPathBlender::addAnimatedPath):
* workers/WorkerThread.cpp:
(WebCore::WorkerThread::evaluateScriptIfNecessary):
2022-02-27 Cameron McCormack <heycam@apple.com>
Add a mechanism to request a UA shadow tree update before style
https://bugs.webkit.org/show_bug.cgi?id=237224
Reviewed by Antti Koivisto.
SVG <use> elements register themselves with the document when their
shadow tree contents need updating, and this updating is done in
Document::resolveStyle. For lazy HTML <input> element UA shadow trees
(in bug 236747) we need something similar.
* dom/Document.cpp:
(WebCore::Document::resolveStyle):
(WebCore::Document::addElementWithPendingUserAgentShadowTreeUpdate):
(WebCore::Document::removeElementWithPendingUserAgentShadowTreeUpdate):
* dom/Document.h:
* dom/Element.h:
(WebCore::Element::updateUserAgentShadowTree):
* svg/SVGDocumentExtensions.cpp:
(WebCore::SVGDocumentExtensions::~SVGDocumentExtensions): Deleted.
(WebCore::SVGDocumentExtensions::addUseElementWithPendingShadowTreeUpdate): Deleted.
(WebCore::SVGDocumentExtensions::removeUseElementWithPendingShadowTreeUpdate): Deleted.
* svg/SVGDocumentExtensions.h:
(WebCore::SVGDocumentExtensions::useElementsWithPendingShadowTreeUpdate const): Deleted.
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::insertedIntoAncestor):
(WebCore::SVGUseElement::removedFromAncestor):
(WebCore::SVGUseElement::updateUserAgentShadowTree):
(WebCore::SVGUseElement::invalidateShadowTree):
(WebCore::SVGUseElement::updateShadowTree): Deleted.
* svg/SVGUseElement.h:
2022-02-27 Antoine Quint <graouts@webkit.org>
[web-animations] web-animations/timing-model/animations/setting-the-timeline-of-an-animation.html is a unique failure
https://bugs.webkit.org/show_bug.cgi?id=237257
Reviewed by Dean Jackson.
The spec has changed since we initially implemented Animation.playState and we missed one condition for
an animation's play state to be "idle".
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::playState const):
2022-02-27 Matt Woodrow <mattwoodrow@apple.com>
Handle reverse flow direction when converting iterator coords for a subgrid
https://bugs.webkit.org/show_bug.cgi?id=236955
Reviewed by Dean Jackson.
When recursing into a subgrid via createForSubgrid, we convert the iterator's
position into coordinates relative to the subgrid. This handles the case where
the subgrid has a reverse flow direction (RTL vs LTR) and swaps the position
to be relative to the opposite edge.
Marks existing WPT grid-gap-007.html as passing
* rendering/Grid.cpp:
(WebCore::GridIterator::createForSubgrid):
2022-02-27 Antoine Quint <graouts@webkit.org>
[svg] flood-opacity should be clamped to the [0,1] range
https://bugs.webkit.org/show_bug.cgi?id=237253
Reviewed by Dean Jackson.
* rendering/style/SVGRenderStyle.h:
(WebCore::SVGRenderStyle::setFloodOpacity):
2022-02-27 Antoine Quint <graouts@webkit.org>
[svg] stroke-opacity should be clamped to the [0,1] range
https://bugs.webkit.org/show_bug.cgi?id=237254
Reviewed by Dean Jackson.
* rendering/style/SVGRenderStyle.h:
(WebCore::SVGRenderStyle::setStrokeOpacity):
2022-02-27 Antoine Quint <graouts@webkit.org>
[svg] stop-opacity should be clamped to the [0,1] range
https://bugs.webkit.org/show_bug.cgi?id=237255
Reviewed by Dean Jackson.
* rendering/style/SVGRenderStyle.h:
(WebCore::SVGRenderStyle::setStopOpacity):
2022-02-27 Antoine Quint <graouts@webkit.org>
[svg] fill-opacity should be clamped to the [0,1] range
https://bugs.webkit.org/show_bug.cgi?id=237252
Reviewed by Dean Jackson.
* rendering/style/SVGRenderStyle.h:
(WebCore::SVGRenderStyle::setFillOpacity):
2022-02-27 Chris Dumez <cdumez@apple.com>
Simplify SerializedScriptValue construction
https://bugs.webkit.org/show_bug.cgi?id=237241
Reviewed by Darin Adler.
The 2 main factory functions for SerializedScriptValue now share the same code.
I also dropped some SerializedScriptValue API that was no longer useful.
Finally, I simplified factory functions for MessageEvent.
* Modules/indexeddb/IDBValue.cpp:
(WebCore::IDBValue::IDBValue):
* Modules/webaudio/AudioWorkletNode.cpp:
(WebCore::AudioWorkletNode::create):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::SerializedScriptValue::create):
(WebCore::SerializedScriptValue::toString const):
(WebCore::SerializedScriptValue::toString): Deleted.
* bindings/js/SerializedScriptValue.h:
(WebCore::SerializedScriptValue::wireBytes const):
(WebCore::SerializedScriptValue::SerializedScriptValue):
(WebCore::SerializedScriptValue::adopt): Deleted.
(WebCore::SerializedScriptValue::data const): Deleted.
(WebCore::SerializedScriptValue::toWireBytes const): Deleted.
* dom/BroadcastChannel.cpp:
(WebCore::BroadcastChannel::dispatchMessage):
* dom/MessageEvent.cpp:
(WebCore::MessageEvent::MessageEvent):
(WebCore::MessageEvent::create):
* dom/MessageEvent.h:
* dom/MessagePort.cpp:
(WebCore::MessagePort::dispatchMessages):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::postMessage):
* page/EventSource.cpp:
(WebCore::EventSource::dispatchMessageEvent):
* page/History.cpp:
(WebCore::History::stateObjectAdded):
* testing/Internals.cpp:
(WebCore::Internals::serializeObject const):
(WebCore::Internals::deserializeBuffer const):
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::postMessageToWorkerObject):
(WebCore::WorkerMessagingProxy::postMessageToWorkerGlobalScope):
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::postMessage):
* workers/shared/SharedWorkerGlobalScope.cpp:
(WebCore::SharedWorkerGlobalScope::postConnectEvent):
2022-02-27 Tim Nguyen <ntim@apple.com>
Force -webkit-user-modify used style to readonly for inert nodes
https://bugs.webkit.org/show_bug.cgi?id=237244
Reviewed by Darin Adler.
This disallows programmatic edition of contenteditable inert nodes. Edition via user-input is
already prevented by forcing pointer-events style to none.
We create a seperate effectiveUserModify, similar to effectiveUserSelect/effectivePointerEvents,
to avoid changing the computed style.
This behaviour also matches Blink & Gecko.
Test: imported/w3c/web-platform-tests/inert/inert-and-contenteditable.tentative.html
* dom/Node.cpp:
(WebCore::computeEditabilityFromComputedStyle):
* editing/ApplyBlockElementCommand.cpp:
(WebCore::ApplyBlockElementCommand::rangeForParagraphSplittingTextNodesIfNeeded):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::doApply):
* rendering/EventRegion.cpp:
(WebCore::EventRegion::unite):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::styleWillChange):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::effectiveUserModify const):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolveElement):
2022-02-27 Dean Jackson <dino@apple.com>
Loading a USDZ url as the main resource renders as garbage
https://bugs.webkit.org/show_bug.cgi?id=237240
rdar://88767033
Reviewed by Antoine Quint.
We can't render a USD document if the ModelDocument feature is not enabled.
* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::canShowMIMEType):
2022-02-27 Antoine Quint <graouts@webkit.org>
[css-animations] implicit keyframes should be inserted after explicit keyframes with the same offset
https://bugs.webkit.org/show_bug.cgi?id=237246
Reviewed by Dean Jackson.
The CSS Animations spec says the following about implicit keyframes generation:
Let initial keyframe be the keyframe in keyframes with offset 0, timing function default timing
function and composite default composite.
If there is no such keyframe, let initial keyframe be a new empty keyframe with offset 0, timing
function default timing function, composite |default composite, and add it to keyframes after the
last keyframe with offset 0.
Let final keyframe be the keyframe in keyframes with offset 1, timing function default timing
function and composite default composite.
If there is no such keyframe, let final keyframe be a new empty keyframe with offset 1, timing
function default timing function and composite default composite, and add it to keyframes after
the last keyframe with offset 1.
Full details are at https://drafts.csswg.org/css-animations-2/#keyframes.
The KeyframeList::insert() method does the right thing already by adding a new keyframe after all
other keyframes with that same offset, so all we need to do is to use this method rather than
specifying explicit indexes.
* rendering/style/KeyframeList.cpp:
(WebCore::KeyframeList::fillImplicitKeyframes):
2022-02-27 Tim Nguyen <ntim@apple.com>
Use hasAttributeWithoutSynchronisation for checking inert attribute in Adjuster::adjust
https://bugs.webkit.org/show_bug.cgi?id=237248
Reviewed by Dean Jackson.
hasAttributeWithoutSynchronisation should be slightly faster than hasAttribute.
* style/StyleAdjuster.cpp:
(WebCore::Style::Adjuster::adjust const):
2022-02-27 Tim Nguyen <ntim@apple.com>
Optimize StyleSharingResolver inert checks
https://bugs.webkit.org/show_bug.cgi?id=237235
Reviewed by Youenn Fablet.
inert is an boolean attribute, the only thing that matters for the StyleAdjuster
inertness adjustment is the presence of the attribute, not its value. E.g.
`inert=false` is the same as `inert=inert` or `inert=true`.
This saves getting and comparing values for those attributes, and also allows
`inert=inert` and `inert=true` or `inert=false` to start sharing style.
* style/StyleSharingResolver.cpp:
(WebCore::Style::SharingResolver::canShareStyleWithElement const):
2022-02-27 Youenn Fablet <youenn@apple.com>
Simplify CVPixelBuffer data copies in SharedVideoFrameInfo
https://bugs.webkit.org/show_bug.cgi?id=237194
Reviewed by Eric Carlson.
Remove use of vImageUnpremultiplyData_BGRA8888 which might not be correct for canvas data.
Make use of CVPixelBufferGetPlaneCount to share more code between monoplanar and biplanar formats.
Covered by existing tests.
* platform/cocoa/CoreVideoSoftLink.cpp:
* platform/cocoa/CoreVideoSoftLink.h:
* platform/cocoa/SharedVideoFrameInfo.mm:
(WebCore::SharedVideoFrameInfo::isReadWriteSupported const):
(WebCore::copyToCVPixelBufferPlane):
(WebCore::SharedVideoFrameInfo::createPixelBufferFromMemory):
(WebCore::SharedVideoFrameInfo::writePixelBuffer):
2022-02-26 Tim Nguyen <ntim@apple.com>
Remove Node::deprecatedIsInert
https://bugs.webkit.org/show_bug.cgi?id=230845
Reviewed by Antti Koivisto.
This change unfortunately regresses focusability state when dynamically setting inert, due to a cached
computed style invalidation bug. This is minor in practice, since focusability usually gets queried in
user-initiated ways, when style already has fully been updated.
However, making this change will improve performance by avoiding a full DOM ancestor walk when there
is no inert attribute on the page, since we will only check a style bit after this patch.
* dom/Element.cpp:
(WebCore::Element::isFocusable const):
(WebCore::Element::isFocusableWithoutResolvingFullStyle const):
(WebCore::Element::isVisibleWithoutResolvingFullStyle const): Deleted.
* dom/Element.h:
* dom/Node.cpp:
(WebCore::Node::deprecatedIsInert const): Deleted.
* dom/Node.h:
* html/HTMLAreaElement.cpp:
(WebCore::HTMLAreaElement::isFocusable const):
2022-02-26 Tyler Wilcock <tyler_w@apple.com>
AX: Remove unnecessary AccessibilityRenderObject::init() override
https://bugs.webkit.org/show_bug.cgi?id=237239
Reviewed by Chris Fleizach.
The implementation of AccessibilityRenderObject::init() just calls
AccessibilityNodeObject::init(), so we don't need it as an override.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::init): Deleted.
* accessibility/AccessibilityRenderObject.h:
2022-02-26 Chris Dumez <cdumez@apple.com>
Drop Ref<>'s operator==() as it is a bit ambiguous / confusing
https://bugs.webkit.org/show_bug.cgi?id=237231
Reviewed by Darin Adler.
Drop Ref<>'s operator==() as it is a bit ambiguous / confusing. Some people expect it to compare
pointers while other expect it to compare the values we hold references to.
It seems best to omit this operator and be explicit at call sites.
* Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
(WebCore::LibWebRTCRtpSenderBackend::startSource):
* svg/SVGDocumentExtensions.cpp:
(WebCore::SVGDocumentExtensions::removeElementToRebuild):
* svg/graphics/filters/SVGFilterBuilder.cpp:
(WebCore::SVGFilterBuilder::buildEffectExpression const):
2022-02-26 Kate Cheney <katherine_cheney@apple.com>
Update CSP handling of javascript URLs
https://bugs.webkit.org/show_bug.cgi?id=236351
<rdar://problem/88675827>
Reviewed by Brent Fulgham.
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::executeJavaScriptURL):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
(WebCore::createWindow):
* loader/SubframeLoader.cpp:
(WebCore::FrameLoader::SubframeLoader::requestFrame):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::setLocation):
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::allowJavaScriptURLs const):
* page/csp/ContentSecurityPolicy.h:
2022-02-26 Alan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Clean up descendant floats when a block container becomes float
https://bugs.webkit.org/show_bug.cgi?id=237238
<rdar://79960422>
Reviewed by Antti Koivisto.
When a block box becomes float, it forms a "lockdown" container for the descendant floats by establishing a BFC.
What it means is that such descendant floats can't intrude to sibling block containers anymore.
This patch ensures that we remove such floats from sibling (and their descendant) renderers.
Test: fast/block/float/float-merge-anon-parent-crash.html
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::normalizeTreeAfterStyleChange):
2022-02-26 Simon Fraser <simon.fraser@apple.com>
No animation when scroll snap scroller is navigated with the keyboard
https://bugs.webkit.org/show_bug.cgi?id=236244
Reviewed by Tim Horton.
Keyboard-driven scrolls in overflow didn't animate, simply because scrollAnimatorEnabled()
wasn't implemented for RenderLayerScrollableArea.
I could not figure out a reliable way to test that we animated the scroll.
* rendering/RenderLayerScrollableArea.cpp:
(WebCore::RenderLayerScrollableArea::scrollAnimatorEnabled const):
* rendering/RenderLayerScrollableArea.h:
2022-02-25 Simon Fraser <simon.fraser@apple.com>
Scrollbars disappear when very long or wide
https://bugs.webkit.org/show_bug.cgi?id=237232
<rdar://17540446>
Reviewed by Tim Horton.
Our tiling logic does not play nicely with AppKit's NSScrollerImps, probably because we
inadvertently unparent its layers.
Fix by disallowing GraphicsLayers for scrollbars from going into tiled mode, for
both root and overflow scrollbars.
Test: fast/scrolling/mac/scrollbars/very-wide-overlay-scrollbar.html
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::GraphicsLayer):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::setAllowsTiling):
(WebCore::GraphicsLayer::allowsTiling const):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::requiresTiledLayer const):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateOverflowControlsLayers):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
2022-02-25 Said Abou-Hallawa <said@apple.com>
[GPU Process] Implement RemoteImageBufferProxy::drawConsuming()
https://bugs.webkit.org/show_bug.cgi?id=236685
rdar://89007426
Reviewed by Simon Fraser.
Assert ImageBuffer::drawConsuming() does not draw into its backend before
it is destroyed.
* platform/graphics/ConcreteImageBuffer.h:
2022-02-25 Alejandro G. Castro <alex@igalia.com> and Fujii Hironori <Hironori.Fujii@sony.com>
[GTK][WPE][WC] Move ANGLE context initialisation to GraphicsContextGLTextureMapper::initialize
https://bugs.webkit.org/show_bug.cgi?id=236769
Reviewed by Chris Lord.
This is the first step for the long-term plan to share more code
in GraphicsContextGLANGLE between Cocoa and non-Cocoa, and
minimise the ifdefs in GraphicsContextGLANGLE.
We are moving the context initialisation and holding to
GraphicsContextGLTextureMapper, away from
GCGLANGLELayer::ANGLEContext and the layer classes in case of
COORDINATED_GRAPHICS. Later on, Cocoa and non-Cocoa can merge
their ::initialize.
No new tests, this is a refactoring patch.
* platform/TextureMapper.cmake:
* platform/graphics/angle/GraphicsContextGLANGLE.h:
* platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.cpp:
(Nicosia::GCGLANGLELayer::GCGLANGLELayer):
(Nicosia::GCGLANGLELayer::ANGLEContext::errorString): Deleted.
(Nicosia::GCGLANGLELayer::ANGLEContext::lastErrorString): Deleted.
(Nicosia::GCGLANGLELayer::ANGLEContext::createContext): Deleted.
(Nicosia::GCGLANGLELayer::ANGLEContext::ANGLEContext): Deleted.
(Nicosia::GCGLANGLELayer::ANGLEContext::~ANGLEContext): Deleted.
(Nicosia::GCGLANGLELayer::ANGLEContext::makeContextCurrent): Deleted.
(Nicosia::GCGLANGLELayer::ANGLEContext::platformContext const): Deleted.
(Nicosia::GCGLANGLELayer::ANGLEContext::platformDisplay const): Deleted.
(Nicosia::GCGLANGLELayer::ANGLEContext::platformConfig const): Deleted.
(Nicosia::GCGLANGLELayer::makeContextCurrent): Deleted.
(Nicosia::GCGLANGLELayer::platformContext const): Deleted.
(Nicosia::GCGLANGLELayer::platformDisplay const): Deleted.
(Nicosia::GCGLANGLELayer::platformConfig const): Deleted.
* platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.h:
* platform/graphics/opengl/GraphicsContextGLOpenGL.cpp:
(WebCore::GraphicsContextGLOpenGL::initialize):
* platform/graphics/opengl/GraphicsContextGLOpenGL.h:
* platform/graphics/texmap/ANGLEContext.cpp: Removed.
* platform/graphics/texmap/ANGLEContext.h: Removed.
* platform/graphics/texmap/GraphicsContextGLTextureMapper.cpp:
(WebCore::GraphicsContextGLTextureMapper::create):
(WebCore::GraphicsContextGLTextureMapper::GraphicsContextGLTextureMapper):
(WebCore::GraphicsContextGLTextureMapper::layerContentsDisplayDelegate):
(WebCore::GraphicsContextGLTextureMapper::platformInitialize):
(): Deleted.
* platform/graphics/texmap/GraphicsContextGLTextureMapper.h:
* platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.cpp:
(WebCore::GraphicsContextGLANGLE::GraphicsContextGLANGLE):
(WebCore::GraphicsContextGLTextureMapper::platformInitializeContext):
(WebCore::GraphicsContextGLTextureMapper::platformInitialize):
(WebCore::GraphicsContextGLANGLE::platformDisplay const):
(WebCore::GraphicsContextGLANGLE::platformConfig const):
(WebCore::GraphicsContextGLANGLE::makeContextCurrent):
* platform/graphics/texmap/PlatformLayerDisplayDelegate.h: Copied from Source/WebCore/platform/graphics/texmap/GraphicsContextGLTextureMapper.h.
* platform/graphics/texmap/TextureMapperGCGLPlatformLayer.cpp:
(WebCore::TextureMapperGCGLPlatformLayer::TextureMapperGCGLPlatformLayer):
(WebCore::TextureMapperGCGLPlatformLayer::~TextureMapperGCGLPlatformLayer):
(WebCore::TextureMapperGCGLPlatformLayer::paintToTextureMapper):
(WebCore::TextureMapperGCGLPlatformLayer::makeContextCurrent): Deleted.
(WebCore::TextureMapperGCGLPlatformLayer::platformContext const): Deleted.
(WebCore::TextureMapperGCGLPlatformLayer::platformDisplay const): Deleted.
(WebCore::TextureMapperGCGLPlatformLayer::platformConfig const): Deleted.
(WebCore::TextureMapperGCGLPlatformLayer::proxy const): Deleted.
(WebCore::TextureMapperGCGLPlatformLayer::swapBuffersIfNeeded): Deleted.
* platform/graphics/texmap/TextureMapperGCGLPlatformLayer.h:
2022-02-25 Chris Dumez <cdumez@apple.com>
Use the modern Hasher more in Content Extensions code
https://bugs.webkit.org/show_bug.cgi?id=237228
Reviewed by Darin Adler.
* contentextensions/CombinedFiltersAlphabet.cpp:
(WebCore::ContentExtensions::add):
(WebCore::ContentExtensions::TermCreatorTranslator::hash):
* contentextensions/CombinedFiltersAlphabet.h:
(WebCore::ContentExtensions::CombinedFiltersAlphabet::TermPointerHash::hash):
* contentextensions/ContentExtensionRule.h:
(WebCore::ContentExtensions::add):
(WebCore::ContentExtensions::TriggerHash::hash):
* contentextensions/Term.h:
(WebCore::ContentExtensions::Term::Group::operator== const):
(WebCore::ContentExtensions::add):
(WebCore::ContentExtensions::Term::CharacterSet::hash const): Deleted.
(WebCore::ContentExtensions::Term::Group::hash const): Deleted.
(WebCore::ContentExtensions::Term::hash const): Deleted.
2022-02-25 Brandon Stewart <brandonstewart@apple.com>
Do not trigger didFail during FileReaderLoader Destruction
https://bugs.webkit.org/show_bug.cgi?id=237060
Reviewed by Darin Adler.
Setting cancel() instead of terminate() will prevent the didFail() method from being triggered.
This method has the unfortunate side effect of trying to allocate memory, which is not allowed when
under going a sweep event.
* fileapi/FileReaderLoader.cpp:
(WebCore::FileReaderLoader::~FileReaderLoader):
2022-02-25 Brent Fulgham <bfulgham@apple.com>
WebKit continues to render PDF images in Captive Portal mode
https://bugs.webkit.org/show_bug.cgi?id=237120
<rdar://problem/89384234>
Reviewed by Chris Dumez.
WebKit should handle all PDF processing in PDF.JS when in Captive Portal mode. However, testing
revealed that PDF images are still rendered natively. As a first step we should bypass the
native PDF code path. A subsequent patch will handle in PDF.JS.
We need to thread the state of the Captive Portal setting through the image loading code so that
WebKit knows to bail out before consuming the PDF data in the native decoder.
Tested by TestWebKitAPI.
* page/RuntimeEnabledFeatures.h: Add new flag for PDF image decoding state.
* platform/graphics/Image.cpp:
(WebCore::Image::create): Check whether PDF image decoding should be permitted.
2022-02-25 Sihui Liu <sihui_liu@apple.com>
Regression(r242729): m_origin in IDBDatabaseIdentifier is incorrect
https://bugs.webkit.org/show_bug.cgi?id=237044
Reviewed by Youenn Fablet.
In r242729, we swapped top origin and opening origin in m_origin (it is a ClientOrigin) of IDBDatabaseIdentifier.
This can cause trouble since IndexedDB operation will be processed by wrong OriginStorageManager
(OriginStorageManager is identified by ClientOrigin). To fix this issue, we need to swap it back.
New test: IndexedDB.IndexedDBThirdPartyStorageLayout
* Modules/indexeddb/IDBDatabaseIdentifier.cpp:
(WebCore::IDBDatabaseIdentifier::IDBDatabaseIdentifier):
(WebCore::IDBDatabaseIdentifier::databaseDirectoryRelativeToRoot const):
(WebCore::IDBDatabaseIdentifier::databaseDirectoryRelativeToRoot):
* Modules/indexeddb/IDBDatabaseIdentifier.h:
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::getAllDatabaseNamesAndVersions):
(WebCore::IDBServer::IDBServer::diskUsage):
2022-02-25 Chris Dumez <cdumez@apple.com>
SharedArrayBuffer posted to AudioWorkletProcessor is not actually shared with the main thread
https://bugs.webkit.org/show_bug.cgi?id=237144
<rdar://problem/89479641>
Reviewed by Darin Adler.
SerializedScriptValue only maintains SharedArrayBuffers when constructed with SerializationContext::WorkerPostMessage.
With other SerializationContext values, such as the default one that AudioWorkletNode was using, SharedArrayBuffers
are serialized as simple arrays and are no longer shared.
This patch passes SerializationContext::WorkerPostMessage when constructing the SerializedScriptValue since we want
SharedArrayBuffer sharing and since a worklet is essentially a worker.
Note that this patch allows passing a SharedArrayBuffer to an AudioWorklet upon construction via processorOptions.
However, SharedArrayBuffer still won't be shared if sent later on via a MessagePort.postMessage() call. This is
because MessagePort.postMessage() routes all messages via the network process, even if the destination ends up
being within the same process as the sender (See Bug 220038).
Test: http/wpt/webaudio/the-audio-api/the-audioworklet-interface/shared-array-buffer.https.html
* Modules/webaudio/AudioWorkletNode.cpp:
(WebCore::AudioWorkletNode::create):
2022-02-25 Jer Noble <jer.noble@apple.com>
[Cocoa] HLS + Modern EME key rotation causes playback to stall indefinitely
https://bugs.webkit.org/show_bug.cgi?id=237214
<rdar://89372801>
Reviewed by Eric Carlson.
In r275916, Ref was changed to perform pointer equality in its operator==. This caused
takeUnexpectedKeyRequestForInitializationData() to fail to find key requests matching
the initData passed in through MediaKeySession.
Fix the equality test by calling .get() on the Ref, which causes the `==` to resolve to
FragmentedSharedBuffer::operator==().
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::takeUnexpectedKeyRequestForInitializationData):
2022-02-25 Alex Christensen <achristensen@webkit.org>
Re-add YouTubePluginReplacement, removed in r285252
https://bugs.webkit.org/show_bug.cgi?id=237182
<rdar://89148022>
Reviewed by Chris Dumez.
Tests: security/contentSecurityPolicy/object-src-none-blocks-youtube-plugin-replacement.html
security/contentSecurityPolicy/plugins-types-allows-youtube-plugin-replacement.html
security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement-without-mime-type.html
security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement.html
Its removal broke webpages that work in Chrome and Firefox, so back it comes.
* Headers.cmake:
* Modules/plugins: Copied from Source/WebCore/Modules/plugins.
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSPluginElementFunctions.cpp:
(WebCore::pluginScriptObject):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestPluginInterface.cpp:
(WebCore::JSTestPluginInterface::visitChildrenImpl):
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::createElementRenderer):
(WebCore::HTMLPlugInElement::didAddUserAgentShadowRoot):
(WebCore::registrar):
(WebCore::pluginReplacementForType):
(WebCore::HTMLPlugInElement::requestObject):
(WebCore::HTMLPlugInElement::scriptObjectForPluginReplacement):
* html/HTMLPlugInElement.h:
(WebCore::HTMLPlugInElement::pluginReplacementScriptObject):
* html/shadow/ShadowPseudoIds.cpp:
(WebCore::ShadowPseudoIds::webkitPluginReplacement):
* html/shadow/ShadowPseudoIds.h:
* html/shadow/YouTubeEmbedShadowElement.cpp:
* html/shadow/YouTubeEmbedShadowElement.h:
* page/Settings.yaml:
2022-02-25 J Pascoe <j_pascoe@apple.com>
[WebAuthn] Use default pubKeyCredParams if empty in makeCredential
https://bugs.webkit.org/show_bug.cgi?id=237109
rdar://problem/89376484
Reviewed by Brent Fulgham.
The Web Authentication level 2 spec was updated to clarify that
a set of default pubKeyCredParams should be used if the list
supplied by the RP is empty. This patch starts using
the default and updates associated tests.
* Modules/webauthn/AuthenticatorCoordinator.cpp:
(WebCore::AuthenticatorCoordinator::create const):
* Modules/webauthn/PublicKeyCredentialCreationOptions.h:
* Modules/webauthn/WebAuthenticationConstants.h:
2022-02-25 Chris Dumez <cdumez@apple.com>
Use modern Hasher in ContentExtensionsActions
https://bugs.webkit.org/show_bug.cgi?id=237157
Reviewed by Darin Adler.
* contentextensions/ContentExtensionActions.h:
(WebCore::ContentExtensions::add):
(WTF::DefaultHash<WebCore::ContentExtensions::RedirectAction>::hash):
(WTF::DefaultHash<WebCore::ContentExtensions::ModifyHeadersAction>::hash):
(WebCore::ContentExtensions::VariantHasher::hash): Deleted.
(WebCore::ContentExtensions::VectorHasher::hash): Deleted.
2022-02-25 Alan Bujtas <zalan@apple.com>
[Tables] Incorrect table sizing when colgroup comes after tbody
https://bugs.webkit.org/show_bug.cgi?id=237205
<rdar://86582214>
Reviewed by Antti Koivisto.
Let's use the colgroup for table sizing even when it comes after any thead, tbody, tfoot, and tr elements.
This makes WebKit match other rendering engines (see https://src.chromium.org/viewvc/blink?revision=159442&view=revision)
Test: fast/table/table-sizing-fails-when-colgroup-comes-after-content.html
* rendering/RenderTable.cpp:
(WebCore::RenderTable::firstColumn const):
* rendering/RenderTableCol.cpp:
(WebCore::RenderTableCol::nextColumn const):
2022-02-25 Youenn Fablet <youenn@apple.com>
Non-simple CORS preflight fails due to cache-control header
https://bugs.webkit.org/show_bug.cgi?id=236837
<rdar://problem/89382796>
Reviewed by Chris Dumez.
We fixed cache-control in https://bugs.webkit.org/show_bug.cgi?id=233916.
The fix to make the website work is to ensure that Content-Type is not cleared when going to service worker.
Covered by updated tests.
* Modules/beacon/NavigatorBeacon.cpp:
2022-02-25 Zan Dobersek <zdobersek@igalia.com>
[GTK][WPE] Uncouple libgbm, libdrm dependencies from ANGLE functionality
https://bugs.webkit.org/show_bug.cgi?id=237199
Reviewed by Chris Lord.
Unconditionally build with libgbm and libdrm cflags and linker flags
since these will be used outside of ANGLE functionality.
Remove USE(ANGLE) && USE(NICOSIA) guards from GBMDevice files.
* PlatformGTK.cmake:
* PlatformWPE.cmake:
* platform/graphics/gbm/GBMDevice.cpp:
* platform/graphics/gbm/GBMDevice.h:
2022-02-25 Carlos Garcia Campos <cgarcia@igalia.com>
AX: List item marker not exposed when not a direct child of a list item
https://bugs.webkit.org/show_bug.cgi?id=236777
<rdar://problem/89082485>
Reviewed by Adrian Perez de Castro.
It can happen that the marker is not a direct child of a list item, in which case the marker is ignored and not
exposed to ATs.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::parentObjectUnignored const): In case of list marker find the marker list item.
(WebCore::AccessibilityRenderObject::markerRenderer const): Helper to return the list item marker renderer.
(WebCore::AccessibilityRenderObject::addListItemMarker): Add always the list item marker as the first child of
list items.
(WebCore::AccessibilityRenderObject::addChildren): Do not add list item marker children, they will be added to
the right parent in addListItemMarker().
* accessibility/AccessibilityRenderObject.h:
2022-02-25 Youenn Fablet <youenn@apple.com>
Optimize black frame sending in MediaRecorderPrivate
https://bugs.webkit.org/show_bug.cgi?id=237027
Reviewed by Kimmo Kinnunen.
Allow generating black frames as IOSurfaces.
Covered by existing tests.
* platform/graphics/cv/CVUtilities.h:
* platform/graphics/cv/CVUtilities.mm:
2022-02-24 Matt Woodrow <mattwoodrow@apple.com>
Simplify grid RTL handling
https://bugs.webkit.org/show_bug.cgi?id=236694
Reviewed by Dean Jackson.
The previous code stored columns in logical order (column 0 is the rightmost physical column), but the positions were offset
using the physical left border, padding and content distribution offset. This hybrid physical/logical coordinate space
made for tricky conversions into the final coordinate space.
This changes the stored column positions to use purely logical coordinates, and does a single direction swap (by subtracting
from the width) at the end.
No tests added, this refactoring is covered by a large number of existing WPTs.
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::populateGridPositionsForDirection):
(WebCore::RenderGrid::resolveAutoStartGridPosition const):
(WebCore::RenderGrid::resolveAutoEndGridPosition const):
(WebCore::RenderGrid::gridAreaBreadthForOutOfFlowChild):
(WebCore::RenderGrid::logicalOffsetForOutOfFlowChild const):
(WebCore::RenderGrid::gridAreaPositionForOutOfFlowChild const):
(WebCore::RenderGrid::computeContentPositionAndDistributionOffset):
(WebCore::RenderGrid::translateRTLCoordinate const):
(WebCore::RenderGrid::logicalOffsetForChild const):
(WebCore::RenderGrid::translateOutOfFlowRTLCoordinate const): Deleted.
* rendering/RenderGrid.h:
2022-02-24 Jer Noble <jer.noble@apple.com>
[Refactor] Adopt LoggerHelper in Logging EME classes
https://bugs.webkit.org/show_bug.cgi?id=234319
Reviewed by Eric Carlson.
In order to pass down a logger() and logIdentifier() to the platform/
classes, modify LegacyCDMSessionClient to be a CanMakeWeakPtr class,
so it can be passed around by reference and automatically invalidated
when the client is destroyed. Then modify LegacyCDMSessionClient to
provide a logger() and logIdentifier() to callers.
* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDM::CDM):
* Modules/encryptedmedia/CDM.h:
(WebCore::CDM::logIdentifier const):
* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::generateRequest):
(WebCore::MediaKeySession::load):
(WebCore::MediaKeySession::update):
(WebCore::MediaKeySession::close):
(WebCore::MediaKeySession::remove):
(WebCore::MediaKeySession::updateKeyStatuses):
(WebCore::MediaKeySession::sessionClosed):
* Modules/encryptedmedia/MediaKeys.cpp:
(WebCore::MediaKeys::MediaKeys):
(WebCore::MediaKeys::createSession):
(WebCore::MediaKeys::setServerCertificate):
* Modules/encryptedmedia/MediaKeys.h:
* Modules/encryptedmedia/legacy/LegacyCDM.cpp:
(WebCore::LegacyCDM::createSession):
* Modules/encryptedmedia/legacy/LegacyCDMPrivate.h:
* Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.cpp:
(WebCore::LegacyCDMPrivateClearKey::createSession):
* Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.h:
* Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.cpp:
(WebCore::CDMPrivateMediaPlayer::createSession):
* Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.h:
* Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
(WebCore::CDMSessionClearKey::CDMSessionClearKey):
* Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.h:
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
(WebCore::WebKitMediaKeySession::create):
(WebCore::WebKitMediaKeySession::WebKitMediaKeySession):
(WebCore::WebKitMediaKeySession::~WebKitMediaKeySession):
(WebCore::WebKitMediaKeySession::close):
(WebCore::WebKitMediaKeySession::generateKeyRequest):
(WebCore::WebKitMediaKeySession::update):
(WebCore::WebKitMediaKeySession::sendMessage):
(WebCore::WebKitMediaKeySession::sendError):
(WebCore::WebKitMediaKeySession::logChannel const):
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
* Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp:
(WebCore::WebKitMediaKeys::createSession):
* Modules/encryptedmedia/legacy/WebKitMediaKeys.h:
* platform/encryptedmedia/CDMFactory.h:
* platform/encryptedmedia/CDMInstance.h:
(WebCore::CDMInstance::setLogIdentifier):
(WebCore::CDMInstance::setLogger): Deleted.
* platform/encryptedmedia/CDMInstanceSession.h:
(WebCore::CDMInstanceSession::setLogIdentifier):
(WebCore::CDMInstanceSession::setLogger): Deleted.
* platform/encryptedmedia/CDMPrivate.h:
(WebCore::CDMPrivate::setLogIdentifier):
(WebCore::CDMPrivate::setLogger): Deleted.
* platform/encryptedmedia/clearkey/CDMClearKey.cpp:
(WebCore::CDMFactoryClearKey::createCDM):
* platform/encryptedmedia/clearkey/CDMClearKey.h:
* platform/graphics/LegacyCDMSession.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::createSession):
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::createSession):
* platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
(WebCore::CDMFactoryFairPlayStreaming::createCDM):
(WebCore::CDMPrivateFairPlayStreaming::CDMPrivateFairPlayStreaming):
(WebCore::CDMPrivateFairPlayStreaming::supportsConfiguration const):
(WebCore::CDMPrivateFairPlayStreaming::createInstance):
(WebCore::CDMPrivateFairPlayStreaming::setLogger): Deleted.
* platform/graphics/avfoundation/CDMFairPlayStreaming.h:
* platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
(WebCore::CDMPrivateMediaSourceAVFObjC::createSession):
* platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
(WebCore::CDMSessionAVFoundationCF::CDMSessionAVFoundationCF):
* platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h:
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::MediaPlayerPrivateAVFoundationCF::createSession):
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::CDMInstanceFairPlayStreamingAVFObjC):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::setServerCertificate):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::setStorageDirectory):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::didProvideRequest):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::didProvideRenewingRequest):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::didProvidePersistableRequest):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::didFailToProvideRequest):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::requestDidSucceed):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::shouldRetryRequestForReason):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::groupSessionIdentifierChanged):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::externalProtectionStatusDidChangeForContentKeyRequest):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::CDMInstanceSessionFairPlayStreamingAVFObjC):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestLicense):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::loadSession):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequests):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRenewingRequest):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didFailToProvideRequest):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestDidSucceed):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::protectionStatusForDisplayID const):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::setLogger): Deleted.
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::setLogger): Deleted.
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h:
(WebCore::CDMSessionAVContentKeySession::logClassName const):
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
(WebCore::CDMSessionAVContentKeySession::CDMSessionAVContentKeySession):
(WebCore::CDMSessionAVContentKeySession::generateKeyRequest):
(WebCore::CDMSessionAVContentKeySession::releaseKeys):
(WebCore::CDMSessionAVContentKeySession::update):
(WebCore::CDMSessionAVContentKeySession::addParser):
(WebCore::CDMSessionAVContentKeySession::removeParser):
(WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage):
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
(WebCore::CDMSessionAVFoundationObjC::CDMSessionAVFoundationObjC):
(WebCore::CDMSessionAVFoundationObjC::~CDMSessionAVFoundationObjC):
(WebCore::CDMSessionAVFoundationObjC::generateKeyRequest):
(WebCore::CDMSessionAVFoundationObjC::update):
(WebCore::CDMSessionAVFoundationObjC::playerDidReceiveError):
(WebCore::CDMSessionAVFoundationObjC::logChannel const):
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
(WebCore::CDMSessionAVStreamSession::logClassName const):
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
(WebCore::CDMSessionAVStreamSession::CDMSessionAVStreamSession):
(WebCore::CDMSessionAVStreamSession::~CDMSessionAVStreamSession):
(WebCore::CDMSessionAVStreamSession::generateKeyRequest):
(WebCore::CDMSessionAVStreamSession::releaseKeys):
(WebCore::CDMSessionAVStreamSession::update):
(WebCore::CDMSessionAVStreamSession::addParser):
(WebCore::CDMSessionAVStreamSession::removeParser):
(WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage):
* platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
(WebCore::CDMSessionMediaSourceAVFObjC::logger const):
(WebCore::CDMSessionMediaSourceAVFObjC::logIdentifier const):
* platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
(WebCore::CDMSessionMediaSourceAVFObjC::CDMSessionMediaSourceAVFObjC):
(WebCore::CDMSessionMediaSourceAVFObjC::logChannel const):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
(WebCore::MediaPlayerPrivateAVFoundationObjC::createSession):
* platform/graphics/gstreamer/eme/CDMThunder.cpp:
(WebCore::CDMFactoryThunder::createCDM):
* platform/graphics/gstreamer/eme/CDMThunder.h:
* testing/LegacyMockCDM.cpp:
(WebCore::LegacyMockCDM::createSession):
(WebCore::MockCDMSession::MockCDMSession):
* testing/LegacyMockCDM.h:
* testing/MockCDMFactory.cpp:
(WebCore::MockCDMFactory::createCDM):
* testing/MockCDMFactory.h:
2022-02-24 Oriol Brufau <obrufau@igalia.com>
[css-cascade] Support 'revert' in @keyframes
https://bugs.webkit.org/show_bug.cgi?id=237073
Reviewed by Darin Adler.
Resolver::styleForKeyframe was constructing a RenderStyle with only the
styles specified in the @keyframes. But not taking into account the UA
and user rules that affect the element meant that 'revert' was broken.
Since Builder::applyProperty didn't find the declarations from other
origins, 'revert' just behaved as 'unset'.
This patch solves it by detecting if the @keyframes has a 'revert' value
and in that case it collects the UA and user rules so that it can be
resolved properly.
Tests: imported/w3c/web-platform-tests/css/css-cascade/revert-val-006.html
imported/w3c/web-platform-tests/css/css-cascade/revert-val-007.html
imported/w3c/web-platform-tests/css/css-cascade/revert-val-008.html
imported/w3c/web-platform-tests/css/css-cascade/revert-val-010.html
* style/ElementRuleCollector.cpp:
(WebCore::Style::ElementRuleCollector::addAuthorKeyframeRules):
* style/ElementRuleCollector.h:
* style/StyleResolver.cpp:
(WebCore::Style::Resolver::styleForKeyframe):
2022-02-24 Devin Rousso <drousso@apple.com>
REGRESSION(r290436): fix build failures
https://bugs.webkit.org/show_bug.cgi?id=237149
Reviewed by Tim Horton.
* Modules/applepay/cocoa/PaymentSessionErrorCocoa.mm:
(WebCore::PaymentSessionError::sessionError const):
* rendering/RenderThemeCocoa.mm:
(WebCore::RenderThemeCocoa::adjustApplePayButtonStyle const):
Replace `PAL::get_PassKitCore_*()` with `#define` declared in `<pal/cocoa/PassKitSoftLink.h>`.
2022-02-24 Megan Gardner <megan_gardner@apple.com>
Add percent decoding to Scroll to Text Fragment parsing.
https://bugs.webkit.org/show_bug.cgi?id=236818
Reviewed by Chris Dumez.
Leverage URL parser to percent decode parsed text directives in
scroll to text fragment implementation.
Tests: http/wpt/html/dom/scroll-to-text-fragment/scroll-to-text-fragment-start-emoji.html
http/wpt/html/dom/scroll-to-text-fragment/scroll-to-text-fragment-start-sentence.html
http/wpt/html/dom/scroll-to-text-fragment/scroll-to-text-fragment-start.html
* dom/FragmentDirectiveParser.cpp:
(WebCore::FragmentDirectiveParser::parseFragmentDirective):
2022-02-24 Alan Bujtas <zalan@apple.com>
[IFC][Integration] Enable non-paginated vertical-rl writing mode
https://bugs.webkit.org/show_bug.cgi?id=236897
Reviewed by Antti Koivisto.
* layout/integration/LayoutIntegrationCoverage.cpp:
(WebCore::LayoutIntegration::canUseForStyle):
2022-02-24 Chris Dumez <cdumez@apple.com>
Fix bad logging in SharedWorkerObjectConnection::notifyWorkerObjectOfLoadCompletion()
https://bugs.webkit.org/show_bug.cgi?id=237146
Reviewed by Geoffrey Garen.
Fix bad logging in SharedWorkerObjectConnection::notifyWorkerObjectOfLoadCompletion().
It was logging an error even when the load succeeded.
* workers/shared/SharedWorkerObjectConnection.cpp:
(WebCore::SharedWorkerObjectConnection::notifyWorkerObjectOfLoadCompletion):
2022-02-24 Kate Cheney <katherine_cheney@apple.com>
Update CSP console logging
https://bugs.webkit.org/show_bug.cgi?id=232216
<rdar://problem/89322580>
Reviewed by Brent Fulgham.
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willSendRequestInternal):
(WebCore::SubresourceLoader::originalHeaders const):
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::allowResourceFromSource const):
(WebCore::ContentSecurityPolicy::allowWorkerFromSource const):
(WebCore::ContentSecurityPolicy::allowScriptFromSource const):
(WebCore::ContentSecurityPolicy::allowStyleFromSource const):
2022-02-24 Alan Bujtas <zalan@apple.com>
[LFC][IFC] Non-orthogonal inline block boxes keep their baseline on ideographic lines
https://bugs.webkit.org/show_bug.cgi?id=236946
Reviewed by Antti Koivisto.
This is similar to the logic in RenderBlock::baselinePosition for inline block boxes.
* layout/formattingContexts/inline/InlineLineBoxBuilder.cpp:
(WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes):
(WebCore::Layout::LineBoxBuilder::adjustIdeographicBaselineIfApplicable):
* layout/integration/LayoutIntegrationBoxTree.cpp:
(WebCore::LayoutIntegration::BoxTree::buildTree):
* layout/integration/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::updateLayoutBoxDimensions):
* rendering/RenderBlock.h:
2022-02-24 Alan Bujtas <zalan@apple.com>
[IFC][Integration] verticalLogicalMargin returns incorrect values for vertical-rl
https://bugs.webkit.org/show_bug.cgi?id=237138
Reviewed by Antti Koivisto.
This was caused by an accidental copy/paste.
* layout/integration/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::verticalLogicalMargin): also switch over to "switch".
2022-02-24 Devin Rousso <drousso@apple.com>
[Apple Pay] switch from `PassKit/*` to `PassKit[Core,UI]/*`
https://bugs.webkit.org/show_bug.cgi?id=237091
<rdar://problem/81085862>
Reviewed by Tim Horton.
* Modules/applepay/cocoa/PaymentSessionErrorCocoa.mm:
(WebCore::PaymentSessionError::sessionError const):
* rendering/RenderThemeCocoa.mm:
(WebCore::RenderThemeCocoa::adjustApplePayButtonStyle const):
2022-02-24 Frédéric Wang <fwang@igalia.com>
RELEASE_ASSERT(!renderer()); in WebCore::Node::~Node() + 479 (Node.cpp:366)
https://bugs.webkit.org/show_bug.cgi?id=235380
Reviewed by Ryosuke Niwa.
RenderTreeUpdater::tearDownRenderers() browse the composed tree to tear down descendants.
However, element with a shadow root are handled specially in
ComposedTreeIterator::ComposedTreeIterator(), they have to be handled specially by calling
a tearDownLeftoverShadowHostChildren(). This patch does the same for slot elements which
are also handled specially in ComposedTreeIterator(). It also makes names within
tearDownLeftoverShadowHostChildren() more generic. This in particular fixes a release assert
when a slot with pseudo elements children is torn down.
Test: fast/shadow-dom/slot-with-pseudo-element-children-renderer-teardown.html
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::tearDownRenderers): Also call tearDownLeftoverShadowHostChildren
for a slot element and add a comment pointing to the method corresponding to these special
cases.
(WebCore::RenderTreeUpdater::tearDownLeftoverChildrenOfComposedTree): Renamed to remove "shadow host".
* rendering/updating/RenderTreeUpdater.h: Ditto.
2022-02-24 Alan Bujtas <zalan@apple.com>
[IFC][Integration] Adjust hittest coords when in flipped writing mode
https://bugs.webkit.org/show_bug.cgi?id=237103
Reviewed by Antti Koivisto.
This is similar to what we do in LegacyInlineFlowBox::nodeAtPoint.
* layout/integration/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::flippedRectForWritingMode):
(WebCore::LayoutIntegration::flippedPointForWritingMode):
(WebCore::LayoutIntegration::LineLayout::hitTest):
2022-02-24 Kimmo Kinnunen <kkinnunen@apple.com>
LibWebRTCCodecs, -Proxy create and communicate the RemoteVideoFrameProxy incorrectly
https://bugs.webkit.org/show_bug.cgi?id=237083
Reviewed by Youenn Fablet.
Add functions to set media sample ownership identity if the underlying object
supports the feature.
* platform/MediaSample.h:
(WebCore::MediaSample::setOwnershipIdentity):
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
(WebCore::MediaSampleAVFObjC::setOwnershipIdentity):
* platform/graphics/cv/VideoFrameCV.h:
* platform/graphics/cv/VideoFrameCV.mm:
(WebCore::VideoFrameCV::setOwnershipIdentity):
2022-02-24 Martin Robinson <mrobinson@webkit.org>
Implement logical properties for CSS overscroll-behavior
https://bugs.webkit.org/show_bug.cgi?id=237080
Reviewed by Simon Fraser.
No new tests. This is covered by existing WPT tests.
Add support for overscroll-behavior-block and overscroll-behavior-inline, the logical versions
of the overscroll behavior properties.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
* css/CSSProperties.json:
* css/parser/CSSParserContext.cpp:
(WebCore::CSSParserContext::isPropertyRuntimeDisabled const):
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
2022-02-24 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. [GTK] Mark GLContextGLX.cpp as no-unify
* SourcesGTK.txt:
2022-02-23 Commit Queue <commit-queue@webkit.org>
Unreviewed, reverting r290284.
https://bugs.webkit.org/show_bug.cgi?id=237131
It is preventing the fuzzer from finding other bugs
Reverted changeset:
"Make input element UA shadow tree creation lazy"
https://bugs.webkit.org/show_bug.cgi?id=236747
https://commits.webkit.org/r290284
2022-02-23 Tim Nguyen <ntim@apple.com>
Use of showModalDialog should appear as a warning in WI console
https://bugs.webkit.org/show_bug.cgi?id=237046
Reviewed by Devin Rousso.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::showModalDialog):
2022-02-23 Chris Dumez <cdumez@apple.com>
Modernize / simplify ScrollingStateTree a bit
https://bugs.webkit.org/show_bug.cgi?id=237111
Reviewed by Simon Fraser.
Modernize / simplify ScrollingStateTree a bit.
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::nodeTypeAndParentMatch):
Simplify function body to be on one line and make function static since it doesn't
need an instance.
(WebCore::nodeWasReattachedRecursive):
Make function static since it doesn't need an instance.
(WebCore::ScrollingStateTree::createUnparentedNode):
- Pass a reference instead of pointer
(WebCore::ScrollingStateTree::insertNode):
- Use template deduction for Ref<>
- Drop unnecessarily 0-check for parentID since stateNodeForID(parentID) would have
returned null and we would have returned early a few lines above.
(WebCore::ScrollingStateTree::unparentNode):
(WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode):
- Use RefPtr type for protectedNode based on the variable naming. Previously, auto
would have deduced to a raw pointer.
(WebCore::ScrollingStateTree::detachAndDestroySubtree):
(WebCore::ScrollingStateTree::clear):
Pass more references instead of pointers.
(WebCore::ScrollingStateTree::commit):
use auto and std::exchange() to make the code a bit more concise.
(WebCore::ScrollingStateTree::removeNodeAndAllDescendants):
Take a reference in parameter instead of a raw pointer since the pointer couldn't
be null.
(WebCore::ScrollingStateTree::recursiveNodeWillBeRemoved):
- Take a reference in parameter instead of a raw pointer since the pointer couldn't
be null.
- Rename currNode to currentNode per WebKit coding style.
(WebCore::ScrollingStateTree::willRemoveNode):
Take a reference in parameter instead of a raw pointer since the pointer couldn't
be null.
(WebCore::ScrollingStateTree::stateNodeForID const):
Rewrite function in a more concise way by calling HashMap::get() instead of HashMap::find().
(WebCore::reconcileLayerPositionsRecursive):
- Make function static since it doesn't need an instance
- Rename currNode to currentNode per WebKit coding style
(WebCore::ScrollingStateTree::reconcileViewportConstrainedLayerPositions):
Make function a bit more concise by not doing an early return.
(showScrollingStateTree):
Take in a reference instead of a raw pointer.
(WebCore::ScrollingStateTree::nodeTypeAndParentMatch const): Deleted.
(WebCore::ScrollingStateTree::nodeWasReattachedRecursive): Deleted.
(WebCore::ScrollingStateTree::reconcileLayerPositionsRecursive): Deleted.
* page/scrolling/ScrollingStateTree.h:
2022-02-23 Robert Jenner <Jenner@apple.com>
Unreviewed, reverting r290351 and r290404.
Broke the build after revert of initial commit (r290348)
Rebases no longer needed due to revert
Reverted changesets:
"Use of showModalDialog should appear as a warning in WI
console"
https://bugs.webkit.org/show_bug.cgi?id=237046
https://commits.webkit.org/r290351
"Use of showModalDialog should appear as a warning in WI
console"
https://bugs.webkit.org/show_bug.cgi?id=237046
https://commits.webkit.org/r290404
2022-02-23 Robert Jenner <Jenner@apple.com>
Unreviewed, reverting r290348.
Broke a test, slowing down EWS.
Reverted changeset:
"Create a DOMWindow::printWarningMessage method and start
using it in DOMWindow.cpp"
https://bugs.webkit.org/show_bug.cgi?id=237047
https://commits.webkit.org/r290348
2022-02-23 Alan Bujtas <zalan@apple.com>
[IFC][Integration] Flip accumulatedOffset to take writing mode into account when hittesting across formatting contexts.
https://bugs.webkit.org/show_bug.cgi?id=237094
Reviewed by Antti Koivisto.
Both paint and hittest need coord flip (vertical writing mode here) when jumping through formatting context boundaries.
* layout/integration/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::flippedContentOffsetIfNeeded):
(WebCore::LayoutIntegration::LineLayout::paint):
(WebCore::LayoutIntegration::LineLayout::hitTest):
2022-02-23 Chris Dumez <cdumez@apple.com>
Adopt more widely the new URL constructor that takes in a String
https://bugs.webkit.org/show_bug.cgi?id=237099
Reviewed by Darin Adler.
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::convertAndValidatePaymentMethodIdentifier):
* css/parser/CSSParserContext.cpp:
(WebCore::CSSParserContext::completeURL const):
* dom/Document.cpp:
(WebCore::Document::referrer):
* html/DOMURL.cpp:
(WebCore::DOMURL::revokeObjectURL):
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::parsePrivateClickMeasurement const):
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::didNavigateExtensionTab):
(WebCore::InspectorFrontendHost::inspectedPageDidNavigate):
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::didClearWindowObjectInWorld):
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::extractInnerURL):
* platform/cocoa/NetworkExtensionContentFilter.mm:
(WebCore::NetworkExtensionContentFilter::willSendRequest):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::load):
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
(WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(convertPlaybinURI):
* platform/network/soup/URLSoup.cpp:
(WebCore::soupURIToURL):
* platform/win/PasteboardWin.cpp:
(WebCore::filesystemPathFromUrlOrTitle):
* testing/MockPaymentCoordinator.cpp:
(WebCore::MockPaymentCoordinator::showPaymentUI):
* workers/service/ServiceWorkerRegistrationKey.cpp:
(WebCore::ServiceWorkerRegistrationKey::fromDatabaseKey):
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::RegistrationDatabase::importRecords):
2022-02-23 J Pascoe <j_pascoe@apple.com>
[WebAuthn] Improve error message for missing pubKeyCredParams
https://bugs.webkit.org/show_bug.cgi?id=235421
rdar://87884875
Reviewed by Brent Fulgham.
We have seen confusion from library authors around the language
used in this error not indicating enough information about what
the problem is. This patch adds additional information, useful
to developers seeing this error.
* Modules/webauthn/AuthenticatorCoordinator.cpp:
(WebCore::AuthenticatorCoordinator::create const):
2022-02-23 Alan Bujtas <zalan@apple.com>
[IFC][Integration] LineLayout::firstLinePhysicalBaseline/lastLineLogicalBaseline should flip box baseline value for vertical-lr
https://bugs.webkit.org/show_bug.cgi?id=237090
Reviewed by Antti Koivisto.
* layout/integration/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::firstLinePhysicalBaseline const):
(WebCore::LayoutIntegration::LineLayout::lastLineLogicalBaseline const):
(WebCore::LayoutIntegration::LineLayout::firstInlineBoxRect const):
2022-02-23 J Pascoe <j_pascoe@apple.com>
Prevent use of PDFKit when using PDF.js
https://bugs.webkit.org/show_bug.cgi?id=237052
rdar://89251696
Reviewed by Tim Horton.
Add WEBCORE_EXPORT in order to use isPDFMIMEType.
* platform/MIMETypeRegistry.h:
2022-02-23 Alan Bujtas <zalan@apple.com>
[IFC][Integration] LineLayout::firstInlineBoxRect should flip the rect coordinates for vertical-rl
https://bugs.webkit.org/show_bug.cgi?id=237036
Reviewed by Antti Koivisto and Darin Adler.
This is similar to what RenderInline::firstInlineBoxTopLeft does.
* layout/integration/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::firstInlineBoxRect const):
2022-02-23 J Pascoe <j_pascoe@apple.com>
[WebAuthn] userHandle not marked nullable in _WKWebAuthenticationAssertionResponse
https://bugs.webkit.org/show_bug.cgi?id=237043
rdar://89317740
Reviewed by Brent Fulgham.
The userHandle is a nullable field on UserEntity. This patch changes
various API/SPI to allow passing null userHandle.
* Modules/webauthn/AuthenticatorAssertionResponse.cpp:
(WebCore::AuthenticatorAssertionResponse::create):
(WebCore::AuthenticatorAssertionResponse::AuthenticatorAssertionResponse):
* Modules/webauthn/AuthenticatorAssertionResponse.h:
2022-02-23 Antti Koivisto <antti@apple.com>
[CSS Container Queries] offsetWidth/Height and similar should update layout for container queries
https://bugs.webkit.org/show_bug.cgi?id=237079
Reviewed by Simon Fraser.
Fix
css/css-contain/container-queries/inline-size-containment.html
css/css-contain/container-queries/inline-size-containment-vertical-rl.html
* dom/Document.cpp:
(WebCore::Document::updateLayout):
Make iterative instead of recursive.
(WebCore::Document::updateLayoutIfDimensionsOutOfDate):
Check for query containers.
Call local updateLayout instead of the FrameViewLayoutContext one.
* page/FrameView.cpp:
(WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive):
* style/StyleScope.cpp:
(WebCore::Style::Scope::updateQueryContainerState):
Add protection against infinite layout/invalidation cycle with unstable layouts.
* style/StyleScope.h:
2022-02-23 Andres Gonzalez <andresg_22@apple.com>
Fix for assert crash in AccessibilityRenderObject::visiblePositionForIndex.
https://bugs.webkit.org/show_bug.cgi?id=236795
rdar://89025180
Reviewed by Chris Fleizach.
Test: accessibility/native-text-control-attributed-string.html
In some cases like the one described in the bug, AccessibilityRenderObject::visiblePositionForIndex
is passed an index greater than the length of the text actually contained
in the text control. This triggers this assert that verifies that you can
round-trip from index to VisiblePosition and back to index. This patch
does a bounds check in the index and adjust if necessary.
The test exercise this method through the JS AccessibilityUIElement::attributedStringForRange
for both <input> of type text and password.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::visiblePositionForIndex const):
2022-02-23 Diego Pino Garcia <dpino@igalia.com>
[GTK] Unreviewed, build fix for Debian Stable after r290366
* platform/graphics/gstreamer/GStreamerVideoSinkCommon.cpp:
(webKitVideoSinkSetMediaPlayerPrivate):
2022-02-23 Jer Noble <jer.noble@apple.com>
REGRESSION (r287574): ASSERTION FAILED: !m_impl || !m_shouldEnableAssertions || m_impl->wasConstructedOnMainThread() == isMainThread() under WebCore::AVTrackPrivateAVFObjCImpl::initializeAssetTrack()
https://bugs.webkit.org/show_bug.cgi?id=235168
<rdar://problem/87518939>
Reviewed by Alexey Proskuryakov.
Use runOnMainThread() from within WebCore, as it will dispatch to the correct thread when
running under iOS/WebKitLegacy.
* platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
(WebCore::AVTrackPrivateAVFObjCImpl::initializeAssetTrack):
2022-02-23 Youenn Fablet <youenn@apple.com>
RemoteVideoFrameObjectHeap::getVideoFrameBuffer can use base class pixelBuffer accessor
https://bugs.webkit.org/show_bug.cgi?id=237020
Reviewed by Kimmo Kinnunen.
No change of behavior.
Covered by existing tests.
* platform/graphics/cv/VideoFrameCV.h:
(WebCore::VideoFrameC$V::pixelBuffer const: Mark it as final.
2022-02-23 Zan Dobersek <zdobersek@igalia.com>
[GStreamer] Add WebKitDMABufVideoSink
https://bugs.webkit.org/show_bug.cgi?id=236883
Reviewed by Philippe Normand.
Add custom WebKitDMABufVideoSink sink that is able to accept decoded
dmabuf or raw data in a range of RGB-like or YUV formats.
The sink is pretty straightforward, in large part mirroring the
WebKitGLVideoSink implementation. The formats that (at the moment) we
can correctly handle inside the TextureMapper-based graphics pipeline
are combined with both the dmabuf or raw memory type during the caps
construction. Like the GL counterpart, the received samples are passed
on to the associated MediaPlayerPrivateGStreamer object. The common
integration into the MediaPlayerPrivateGStreamer functionality is
encapsulated into the webKitVideoSinkSetMediaPlayerPrivate() function.
The MediaPlayerPrivateGStreamer implementation will be enhanced later to
properly handle samples conforming to either variant of these caps. But
the idea is that when using this sink, a dmabuf-containing sample will
pass the dmabuf to the graphics subsystem and a raw-data-containing
sample will copy the data into a dmabuf object (created or reused) and
then pass it on.
The WEBKIT_GST_DMABUF_SINK_FORCED_FALLBACK_CAPS_FORMAT environment
variable can be set to specify the desired exclusive format that this
sink should support. This is especially helpful to debug the correct
handling of different RGB or YUV formats inside the graphics pipeline.
When set, only raw data of the specified format is accepted, meaning the
pipeline upstream will perform any necessary conversion of the decoded
data into the desired format. Raw data is then packed into dmabufs and
sent into the pipeline for display, enabling the developer to examine
whether the given format is handled appropriately.
The sink element is registered in registerWebKitGStreamerElements().
This functionality will require The GStreamer allocators library, so the
necessary dependency glue is also provided.
* platform/GStreamer.cmake:
* platform/graphics/gstreamer/DMABufVideoSinkGStreamer.cpp: Added.
(forcedFallbackCapsFormat):
(webKitDMABufVideoSinkConstructed):
(webKitDMABufVideoSinkFinalize):
(webKitDMABufVideoSinkGetProperty):
(webkit_dmabuf_video_sink_class_init):
(webKitDMABufVideoSinkSetMediaPlayerPrivate):
(webKitDMABufVideoSinkProbePlatform):
* platform/graphics/gstreamer/DMABufVideoSinkGStreamer.h: Added.
* platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp:
(webKitGLVideoSinkSetMediaPlayerPrivate):
* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::registerWebKitGStreamerElements):
* platform/graphics/gstreamer/GStreamerVideoSinkCommon.cpp: Added.
(webKitVideoSinkSetMediaPlayerPrivate):
* platform/graphics/gstreamer/GStreamerVideoSinkCommon.h: Added.
2022-02-23 Sihui Liu <sihui_liu@apple.com>
REGRESSION(r289474): [iOS] ASSERTION FAILED: isMainThread() under WebCore::IDBServer::UniqueIDBDatabase::abortActiveTransactions()
https://bugs.webkit.org/show_bug.cgi?id=237066
<rdar://problem/89324810>
Reviewed by Chris Dumez.
We no longer need the assertion because the function can be called on non-main thread since r289474, where we
started to abort transactions for suspension on WorkQueue. To avoid confusion, rename mainThreadAbortResult to
suspensionAbortResult.
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::abortActiveTransactions):
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::setSuspensionAbortResult):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::suspensionAbortResult const):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::setMainThreadAbortResult): Deleted.
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::mainThreadAbortResult const): Deleted.
2022-02-23 Kimmo Kinnunen <kkinnunen@apple.com>
Crash when calling WEBGL_lose_context.loseContext() after the context has been lost
https://bugs.webkit.org/show_bug.cgi?id=236966
Reviewed by Dean Jackson.
WebGLRenderingContextBase::forceLostContext() would
try to synthesize a GL error to the underlying
m_context. However, m_context is cleared when a real
context loss happens. This happens for example when we
simulate a GPU status failure or when we create too
many contexts. The m_context is not currently cleared
when the page simulates context lost via WEBGL_lose_contexts.loseContext().
Test: webgl/lose-context-after-context-lost.html
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::synthesizeGLError):
2022-02-23 Youenn Fablet <youenn@apple.com>
Optimize RemoteVideoFrame handling in WebProcess WebRTC pipeline
https://bugs.webkit.org/show_bug.cgi?id=236970
Reviewed by Eric Carlson.
In case of remote video frame, directly get the remote video frame as a MediaSample in receive side.
On send side, wrap remote video frames as provider-based WebRTC video frames.
LibWebRTCCodecs will optimize the handling of remote frames for hardware encoders and no change will
happen for software encoders.
Covered by existing tests.
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
2022-02-23 Lauro Moura <lmoura@igalia.com>
Unreviewed, non-unified build fix after 247623@main
https://bugs.webkit.org/show_bug.cgi?id=237074
* bindings/js/WebAssemblyCachedScriptSourceProvider.h: Namespace.
2022-02-22 Chris Dumez <cdumez@apple.com>
http/wpt/push-api/onpush-disabled.html fails
https://bugs.webkit.org/show_bug.cgi?id=236874
<rdar://problem/89176154>
Reviewed by Youenn Fablet.
Before running the test, we would construct a new WKWebView with the Push API setting disabled.
We would then run the test, which would launch a service worker. Normally, we would expect the
service worker to inherit the settings from the WKWebView. However, it was not reliably
happening because the settings for the service worker are stored on the WebProcessPool and
WebProcessPool::establishServiceWorkerContextConnectionToNetworkProcess() was selecting a
random WebProcessPool object (the first one returned by processPools()).
To address the issue, we now pass the ProcessIdentifier of the client that requested the
service worker connection so that establishServiceWorkerContextConnectionToNetworkProcess() can
now prioritize the WebProcessPool of that process. Also, as an optimization, we now prioritize
this client process to run the service worker (assuming it is origin-clean).
No new tests, unskipped existing test.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::createContextConnection):
* workers/service/server/SWServer.h:
2022-02-22 Tim Nguyen <ntim@apple.com>
Use of showModalDialog should appear as a warning in WI console
https://bugs.webkit.org/show_bug.cgi?id=237046
Reviewed by Devin Rousso and Darin Adler.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::showModalDialog):
2022-02-22 Chris Dumez <cdumez@apple.com>
Add a URL constructor that takes a String
https://bugs.webkit.org/show_bug.cgi?id=237068
Reviewed by Darin Adler.
Adopt the new `URL(const String&)` constructor.
* Modules/webauthn/AuthenticatorCoordinator.cpp:
(WebCore::AuthenticatorCoordinatorInternal::processAppIdExtension):
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::connect):
* bindings/js/ScriptModuleLoader.cpp:
(WebCore::resolveModuleSpecifier):
(WebCore::ScriptModuleLoader::fetch):
(WebCore::ScriptModuleLoader::moduleURL):
(WebCore::ScriptModuleLoader::responseURLFromRequestURL):
(WebCore::ScriptModuleLoader::importModule):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneDeserializer::readFile):
(WebCore::CloneDeserializer::readTerminal):
* contentextensions/ContentExtensionActions.cpp:
(WebCore::ContentExtensions::RedirectAction::parse):
(WebCore::ContentExtensions::RedirectAction::applyToRequest):
* dom/Document.cpp:
(WebCore::Document::referrer):
* html/URLInputType.cpp:
(WebCore::URLInputType::typeMismatchFor const):
* loader/DocumentLoader.cpp:
(WebCore::microsoftTeamsRedirectURL):
* loader/PrivateClickMeasurement.cpp:
(WebCore::PrivateClickMeasurement::parseAttributionRequestQuery):
* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::deleteCacheForOrigin):
* loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::createResource):
* loader/archive/mhtml/MHTMLParser.cpp:
(WebCore::MHTMLParser::parseNextPart):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::open):
* page/Quirks.cpp:
(WebCore::isBBCDomain):
(WebCore::Quirks::triggerOptionalStorageAccessQuirk const):
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::createFromString):
(WebCore::SecurityOrigin::create):
* page/SecurityOriginData.cpp:
(WebCore::SecurityOriginData::toURL const):
* page/SecurityPolicy.cpp:
(WebCore::SecurityPolicy::generateReferrerHeader):
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::reportViolation const):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::originsInMediaCache):
(WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL):
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webKitWebSrcMakeRequest):
* platform/gtk/SelectionData.cpp:
(WebCore::SelectionData::setURIList):
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::setHTTPReferrer):
* platform/network/cf/ResourceErrorCF.cpp:
(WebCore::ResourceError::platformLazyInit):
* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
(WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::didReceiveHeader):
* platform/network/mac/ResourceErrorMac.mm:
(WebCore::ResourceError::platformLazyInit):
* platform/win/PasteboardWin.cpp:
(WebCore::Pasteboard::writeString):
* testing/Internals.cpp:
(WebCore::Internals::sendH2Ping):
2022-02-22 Chris Dumez <cdumez@apple.com>
Drop StringHasher::hashMemory() and use the modern Hasher instead
https://bugs.webkit.org/show_bug.cgi?id=237049
Reviewed by Sam Weinig and Darin Adler.
* Modules/indexeddb/shared/IDBResourceIdentifier.h:
(WebCore::add):
(WebCore::IDBResourceIdentifierHash::hash):
(WebCore::IDBResourceIdentifier::hash const): Deleted.
* dom/Attribute.h:
(WebCore::add):
* dom/DocumentSharedObjectPool.cpp:
(WebCore::DocumentSharedObjectPool::cachedShareableElementDataWithAttributes):
(WebCore::attributeHash): Deleted.
* dom/QualifiedName.cpp:
(WebCore::QualifiedName::QualifiedNameImpl::computeHash const):
* dom/QualifiedName.h:
(WebCore::add):
(WebCore::hashComponents): Deleted.
* dom/QualifiedNameCache.cpp:
(WebCore::QNameComponentsTranslator::hash):
* page/GlobalWindowIdentifier.h:
(WebCore::add):
(WTF::GlobalWindowIdentifierHash::hash):
(WebCore::GlobalWindowIdentifier::hash const): Deleted.
* page/SecurityOriginHash.h:
(WebCore::SecurityOriginHash::hash):
* platform/ScriptExecutionContextIdentifier.h:
(WebCore::add):
(WebCore::ProcessQualified<UUID>::hash const): Deleted.
(WTF::computeHash): Deleted.
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::FontPlatformData::hash const):
* platform/graphics/win/FontPlatformDataCGWin.cpp:
(WebCore::FontPlatformData::hash const):
* svg/SVGElementInlines.h:
(WebCore::SVGAttributeHashTranslator::hash):
* workers/service/ServiceWorkerRegistrationKey.cpp:
(WebCore::ServiceWorkerRegistrationKey::hash const): Deleted.
* workers/service/ServiceWorkerRegistrationKey.h:
(WebCore::add):
(WTF::ServiceWorkerRegistrationKeyHash::hash):
2022-02-22 Tim Nguyen <ntim@apple.com>
Create a DOMWindow::printWarningMessage method and start using it in DOMWindow.cpp
https://bugs.webkit.org/show_bug.cgi?id=237047
Reviewed by Darin Adler.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::close):
(WebCore::DOMWindow::webkitRequestAnimationFrame):
(WebCore::DOMWindow::startListeningForDeviceOrientationIfNecessary):
(WebCore::DOMWindow::startListeningForDeviceMotionIfNecessary):
(WebCore::DOMWindow::printConsoleMessage const):
(WebCore::DOMWindow::printErrorMessage const):
(WebCore::DOMWindow::printWarningMessage const):
* page/DOMWindow.h:
2022-02-22 Chris Dumez <cdumez@apple.com>
Share more code between dispatchSessionStorageEvents() and dispatchLocalStorageEvents()
https://bugs.webkit.org/show_bug.cgi?id=237040
Reviewed by Geoffrey Garen.
* storage/StorageEventDispatcher.cpp:
(WebCore::dispatchStorageEvents):
(WebCore::StorageEventDispatcher::dispatchSessionStorageEvents):
(WebCore::StorageEventDispatcher::dispatchLocalStorageEvents):
(WebCore::dispatchSessionStorageEventsToWindows): Deleted.
(WebCore::dispatchLocalStorageEventsToWindows): Deleted.
2022-02-22 Chris Dumez <cdumez@apple.com>
CachedResourceLoader::allCachedSVGImages() reparses resource URLs unnecessarily
https://bugs.webkit.org/show_bug.cgi?id=237002
Reviewed by Darin Adler.
Store URLs in the HashMaps instead of Strings since we have URLs initially and we
need URLs eventually. This avoids having to re-parse the URL unnecessarily, which
is fairly expensive.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):
(WebCore::CachedResourceLoader::determineRevalidationPolicy const):
(WebCore::CachedResourceLoader::notifyFinished):
* loader/cache/CachedResourceLoader.h:
2022-02-22 Frédéric Wang <fwang@igalia.com>
null ptr deref via WebXRSystem::requestSession
https://bugs.webkit.org/show_bug.cgi?id=235916
Reviewed by Dean Jackson.
WebXRSystem::requestSession() null checks the document's global object via the method
Document::domWindow() and calls WebXRSystem::inlineSessionRequestIsAllowedForGlobalObject()
which dereferences the global object via the method ScriptExecutionContext::globalObject().
The former is just getting a raw pointer from Document::m_domWindow which (once set) remains
non-null until the document is destroyed. The latter instead gets the DOM window via the
document's FrameDestructionObserver::m_frame which is null when document is detached from the
frame. Hence the two methods may disagree, leading to a null ptr deref in
WebXRSystem::inlineSessionRequestIsAllowedForGlobalObject(). This patch works around that
issue by explicitly null checking the result of Document::::globalObject(). Additionally, it
makes the document (and its m_domWindow member) protected earlier in
WebXRSystem::requestSession() i.e. before passing them to potentially complex subroutines
immersiveSessionRequestIsAllowedForGlobalObject() and
inlineSessionRequestIsAllowedForGlobalObject().
Test: webxr/xr-requestSession-crash.html
* Modules/webxr/WebXRSystem.cpp:
(WebCore::WebXRSystem::inlineSessionRequestIsAllowedForGlobalObject const): null-check
document::globalObject() before deferencing it.
(WebCore::WebXRSystem::requestSession): protect document (and its m_domWindow member).
2022-02-22 Chris Dumez <cdumez@apple.com>
Clean up / optimize even more call sites constructing vectors
https://bugs.webkit.org/show_bug.cgi?id=236852
Reviewed by Darin Adler.
* Modules/applepay/PaymentCoordinator.cpp:
(WebCore::PaymentCoordinator::beginPaymentSession):
* Modules/applepay/cocoa/PaymentMethodCocoa.mm:
(WebCore::convert):
* Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::batchPutOperation):
* Modules/gamepad/Gamepad.cpp:
(WebCore::Gamepad::Gamepad):
* Modules/gamepad/GamepadManager.cpp:
(WebCore::GamepadManager::platformGamepadDisconnected):
(WebCore::GamepadManager::makeGamepadVisible):
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::objectStoreNames const):
(WebCore::IDBDatabase::transaction):
* Modules/indexeddb/IDBKeyData.h:
(WebCore::IDBKeyData::isDeletedValue const):
(WebCore::add):
(WebCore::IDBKeyDataHash::hash):
(WebCore::IDBKeyData::hash const): Deleted.
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::indexNames const):
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::objectStoreNames const):
* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::showMediaControlsContextMenu):
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::activeRanges const):
* Modules/mediasource/SampleMap.h:
(WebCore::DecodeOrderSampleMap::size const):
* Modules/mediasource/SourceBufferList.h:
* Modules/speech/SpeechSynthesis.cpp:
(WebCore::SpeechSynthesis::getVoices):
* Modules/speech/cocoa/WebSpeechRecognizerTask.mm:
(-[WebSpeechRecognizerTaskImpl callbackWithTranscriptions:isFinal:]):
* Modules/speech/cocoa/WebSpeechRecognizerTaskMock.mm:
(-[WebSpeechRecognizerTaskMock audioSamplesAvailable:]):
* animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc):
* animation/DocumentTimelinesController.cpp:
(WebCore::DocumentTimelinesController::updateAnimationsAndSendEvents):
* animation/KeyframeEffect.cpp:
(WebCore::processPropertyIndexedKeyframes):
* contentextensions/ContentExtension.cpp:
(WebCore::ContentExtensions::ContentExtension::ContentExtension):
* css/CSSValueList.h:
(WebCore::CSSValueList::size const):
* css/calc/CSSCalcOperationNode.cpp:
(WebCore::CSSCalcOperationNode::hoistChildrenWithOperator):
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::consumeContainerRule):
* dom/DOMStringList.h:
(WebCore::DOMStringList::create):
(WebCore::DOMStringList::append):
(WebCore::DOMStringList::DOMStringList):
* dom/EventPath.cpp:
(WebCore::EventPath::EventPath):
* dom/FullscreenManager.cpp:
(WebCore::FullscreenManager::cancelFullscreen):
* dom/LoadableScript.cpp:
(WebCore::LoadableScript::notifyClientFinished):
* dom/RadioButtonGroups.cpp:
(WebCore::RadioButtonGroup::members const):
* html/DirectoryFileListCreator.cpp:
(WebCore::toFileList):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::saveLastSelection):
(WebCore::HTMLSelectElement::setActiveSelectionAnchorIndex):
* html/ImageBitmap.cpp:
(WebCore::ImageBitmap::detachBitmaps):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::getAttachedShaders):
* html/parser/HTMLMetaCharsetParser.cpp:
(WebCore::HTMLMetaCharsetParser::processMeta):
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::insertPhoneNumberLink):
* html/parser/TextDocumentParser.cpp:
(WebCore::TextDocumentParser::insertFakePreElement):
* loader/ContentFilter.cpp:
(WebCore::ContentFilter::create):
* loader/appcache/ApplicationCacheManifestParser.cpp:
(WebCore::parseApplicationCacheManifest):
* page/ResizeObserver.cpp:
(WebCore::ResizeObserver::deliverObservations):
* page/TextIndicator.cpp:
(WebCore::initializeIndicator):
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::parseSubResourceIntegrityIntoDigests):
* platform/FileChooser.cpp:
(WebCore::FileChooser::chooseFile):
(WebCore::FileChooser::chooseFiles):
(WebCore::FileChooser::chooseMediaFiles):
* platform/SharedBuffer.cpp:
(WebCore::FragmentedSharedBuffer::append):
* platform/ThreadSafeDataBuffer.h:
(WebCore::add):
* platform/audio/AudioDSPKernelProcessor.cpp:
(WebCore::AudioDSPKernelProcessor::initialize):
* platform/audio/AudioResampler.cpp:
(WebCore::AudioResampler::AudioResampler):
* platform/audio/DynamicsCompressorKernel.cpp:
(WebCore::DynamicsCompressorKernel::setNumberOfChannels):
* platform/audio/MultiChannelResampler.cpp:
(WebCore::MultiChannelResampler::MultiChannelResampler):
* platform/cocoa/PlaybackSessionModelMediaElement.mm:
(WebCore::PlaybackSessionModelMediaElement::legibleMediaSelectionOptions const):
* platform/gamepad/mac/Dualshock3HIDGamepad.cpp:
(WebCore::Dualshock3HIDGamepad::Dualshock3HIDGamepad):
* platform/gamepad/mac/LogitechGamepad.cpp:
(WebCore::LogitechGamepad::LogitechGamepad):
* platform/gamepad/mac/StadiaHIDGamepad.cpp:
(WebCore::StadiaHIDGamepad::StadiaHIDGamepad):
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::addRepaintRect):
* platform/graphics/PathUtilities.cpp:
(WebCore::PathUtilities::pathsWithShrinkWrappedRects):
(WebCore::PathUtilities::pathWithShrinkWrappedRectsForOutline):
* platform/graphics/SourceBufferPrivate.cpp:
(WebCore::SourceBufferPrivate::bufferedSamplesForTrackId):
* platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
(WebCore::CDMPrivateFairPlayStreaming::extractKeyIDsSkd):
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::AVFWrapper::setRequestForKey):
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateKeyStatuses):
* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
(WebCore::ImageDecoderAVFObjC::frameInfos const):
* platform/graphics/avfoundation/objc/SourceBufferParserAVFObjC.mm:
(WebCore::SourceBufferParserAVFObjC::didParseStreamDataAsAsset):
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::FontPlatformData::variationAxes const):
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::writeString):
* platform/mediastream/RealtimeVideoCaptureSource.cpp:
(WebCore::RealtimeVideoCaptureSource::setSupportedPresets):
* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::registerBlobURL):
(WebCore::BlobRegistryImpl::writeBlobsToTemporaryFilesForIndexedDB):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::drawBoxSideFromPath):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::connectClippingStackLayers):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::adjustOverflowScrollbarContainerLayers):
* rendering/RenderThemeMac.mm:
(WebCore::paintAttachmentTitleBackground):
* rendering/svg/SVGRenderTreeAsText.cpp:
(WebCore::writeSVGStrokePaintingResource):
* rendering/svg/SVGTextChunk.cpp:
(WebCore::SVGTextChunk::SVGTextChunk):
* style/PageRuleCollector.cpp:
(WebCore::Style::PageRuleCollector::matchPageRules):
* style/RuleSetBuilder.cpp:
(WebCore::Style::RuleSetBuilder::MediaQueryCollector::pop):
* style/StyleBuilderConverter.h:
(WebCore::Style::BuilderConverter::convertContainerName):
2022-02-22 Nikolas Zimmermann <nzimmermann@igalia.com>
[LBSE] Rename RenderSVGTransformableContainer -> LegacyRenderSVGTransformableContainer
https://bugs.webkit.org/show_bug.cgi?id=237023
Reviewed by Rob Buis.
Following the established procedure: rename RenderSVGTransformableContainer -> LegacyRenderSVGTransformableContainer.
In a follow-up patch RenderSVGTransformableContainer will be reintroduced for LBSE, inheriting from
RenderSVGContainer instead of LegacyRenderSVGContainer.
Covered by existing tests, no change in behaviour.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderObject.h:
(WebCore::RenderObject::isLegacySVGTransformableContainer const):
(WebCore::RenderObject::isSVGTransformableContainer const): Deleted.
* rendering/svg/LegacyRenderSVGContainer.cpp:
(WebCore::LegacyRenderSVGContainer::layout):
* rendering/svg/LegacyRenderSVGContainer.h:
* rendering/svg/LegacyRenderSVGTransformableContainer.cpp: Renamed from Source/WebCore/rendering/svg/RenderSVGTransformableContainer.cpp.
(WebCore::LegacyRenderSVGTransformableContainer::LegacyRenderSVGTransformableContainer):
(WebCore::LegacyRenderSVGTransformableContainer::calculateLocalTransform):
(WebCore::LegacyRenderSVGTransformableContainer::graphicsElement):
* rendering/svg/LegacyRenderSVGTransformableContainer.h: Renamed from Source/WebCore/rendering/svg/RenderSVGTransformableContainer.h.
* rendering/svg/RenderSVGViewportContainer.h:
* rendering/svg/SVGContainerLayout.cpp:
* rendering/svg/SVGRenderSupport.cpp:
(WebCore::SVGRenderSupport::transformToRootChanged):
* svg/SVGAElement.cpp:
(WebCore::SVGAElement::createElementRenderer):
* svg/SVGGElement.cpp:
(WebCore::SVGGElement::createElementRenderer):
* svg/SVGSwitchElement.cpp:
(WebCore::SVGSwitchElement::createElementRenderer):
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::createElementRenderer):
2022-02-22 Philippe Normand <pnormand@igalia.com>
[GStreamer] Switch media player to playbin3
https://bugs.webkit.org/show_bug.cgi?id=236884
Reviewed by Xabier Rodriguez-Calvar.
With GStreamer 1.20 playbin3 is quite usable now, so give it a try as default playback
engine during the 2.38 cycle. If one wants to opt out, set the WEBKIT_GST_USE_PLAYBIN2
environment variable to 1.
No new tests, covered by existing media layout tests.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
2022-02-22 Nikolas Zimmermann <nzimmermann@igalia.com>
[LBSE] Activate LBSE for <rect> painting
https://bugs.webkit.org/show_bug.cgi?id=236194
Reviewed by Rob Buis.
Finally activate LBSE for <rect> elements -- painting <rect> elements
now works as expected in LBSE. Try using MiniBrowser and switch
from legacy engine to LBSE and back -- this now works just fine and
rebuilds the render tree / updates display.
Covered by existing tests, no change in behaviour.
* rendering/svg/SVGRenderTreeAsText.cpp:
(WebCore::writeStyle):
(WebCore::writeChildren):
* svg/SVGRectElement.cpp:
(WebCore::SVGRectElement::createElementRenderer):
2022-02-22 Philippe Normand <pnormand@igalia.com>
[GStreamer] Initial MediaRecorder implementation
https://bugs.webkit.org/show_bug.cgi?id=236558
Reviewed by Xabier Rodriguez-Calvar.
Add a MediaRecorder backend based on the GStreamer Transcoder library. We anticipate the
scenario where the GstWebRTC backend might provide encoded streams to the recorder, in which
case transcoding is required. The transcoder library can operate in pass-through as well.
* CMakeLists.txt:
* Modules/mediarecorder/MediaRecorder.cpp:
(WebCore::MediaRecorder::isTypeSupported):
(WebCore::MediaRecorder::createMediaRecorderPrivate):
* Modules/mediarecorder/MediaRecorderProvider.cpp:
(WebCore::MediaRecorderProvider::createMediaRecorderPrivate):
(WebCore::MediaRecorderProvider::isSupported):
* Modules/mediarecorder/MediaRecorderProvider.h:
* loader/EmptyClients.cpp:
* platform/GStreamer.cmake:
* platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
(WTF::adoptGRef):
(WTF::refGPtr<GstEncodingProfile>):
(WTF::derefGPtr<GstEncodingProfile>):
* platform/graphics/gstreamer/GRefPtrGStreamer.h:
* platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:
(WebCore::GStreamerRegistryScanner::initializeEncoders):
* platform/mediarecorder/MediaRecorderPrivateGStreamer.cpp: Added.
(WebCore::MediaRecorderPrivateGStreamer::create):
(WebCore::MediaRecorderPrivateGStreamer::MediaRecorderPrivateGStreamer):
(WebCore::MediaRecorderPrivateGStreamer::~MediaRecorderPrivateGStreamer):
(WebCore::MediaRecorderPrivateGStreamer::startRecording):
(WebCore::MediaRecorderPrivateGStreamer::stopRecording):
(WebCore::MediaRecorderPrivateGStreamer::fetchData):
(WebCore::MediaRecorderPrivateGStreamer::pauseRecording):
(WebCore::MediaRecorderPrivateGStreamer::resumeRecording):
(WebCore::MediaRecorderPrivateGStreamer::mimeType const):
(WebCore::MediaRecorderPrivateGStreamer::isTypeSupported):
(WebCore::MediaRecorderPrivateGStreamer::containerProfile):
(WebCore::MediaRecorderPrivateGStreamer::setSource):
(WebCore::MediaRecorderPrivateGStreamer::setSink):
(WebCore::MediaRecorderPrivateGStreamer::configureVideoEncoder):
(WebCore::MediaRecorderPrivateGStreamer::preparePipeline):
(WebCore::MediaRecorderPrivateGStreamer::processSample):
(WebCore::MediaRecorderPrivateGStreamer::notifyEOS):
* platform/mediarecorder/MediaRecorderPrivateGStreamer.h: Added.
* platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
(webkitMediaStreamSrcEnsureStreamCollectionPosted):
(webkitMediaStreamSrcPadProbeCb):
(webkitMediaStreamSrcSignalEndOfStream):
* platform/mediastream/gstreamer/GStreamerMediaStreamSource.h:
2022-02-22 Tim Nguyen <ntim@apple.com>
Hide PDF.js sidebar shown for long documents
https://bugs.webkit.org/show_bug.cgi?id=236850
Reviewed by Chris Dumez.
Use the built-in PDF.js `#pagemode=none` parameter to do this: https://github.com/mozilla/pdf.js/wiki/Viewer-options
* html/PDFDocument.cpp:
(WebCore::PDFDocument::createDocumentStructure):
2022-02-22 Antti Koivisto <antti@apple.com>
[CSS container Queries] getComputedStyle should update style for invalid query containers
https://bugs.webkit.org/show_bug.cgi?id=237038
Reviewed by Darin Adler.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::hasValidStyleForProperty):
We always need to update style inside a query container since a change to it may affect descendants.
2022-02-22 Kate Cheney <katherine_cheney@apple.com>
Authenticated encryption console logging causing performance regressions
https://bugs.webkit.org/show_bug.cgi?id=236987
<rdar://problem/89108253>
Reviewed by Chris Dumez.
No new tests. Behavior confirmed by existing crypto/subtle tests.
For clients that use repeated unauthenticated AES encryption, console
logging may cause perf issues. We should log the authenticated
encryption warning once per context.
* crypto/SubtleCrypto.cpp:
(WebCore::SubtleCrypto::addAuthenticatedEncryptionWarningIfNecessary):
* dom/ScriptExecutionContext.h:
(WebCore::ScriptExecutionContext::hasLoggedAuthenticatedEncryptionWarning const):
(WebCore::ScriptExecutionContext::setHasLoggedAuthenticatedEncryptionWarning):
2022-02-22 Tim Nguyen <ntim@apple.com>
Re-style PDF.js form fields to match PDFKit
https://bugs.webkit.org/show_bug.cgi?id=237041
Reviewed by Geoffrey Garen.
Remove black border on :hover, only display light blue background on hover, display blue focusring on :focus.
* Modules/pdfjs-extras/style-cocoa.css:
(.annotationLayer :is():
2022-02-22 Jer Noble <jer.noble@apple.com>
[Cocoa] Partial rollout of r289946, broke Netflix
https://bugs.webkit.org/show_bug.cgi?id=237019
<rdar://89261425>
Reviewed by Eric Carlson.
Adopting AVContentKeySupport for AVSampleBufferDisplayLayer broke Netflix playback on Cocoa
ports. Disable that support by hard coding sampleBufferRenderersSupportKeySession() to
return false.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::sampleBufferRenderersSupportKeySession):
2022-02-22 Tyler Wilcock <tyler_w@apple.com>
AX: Only compute ariaTreeRows for isTree() objects
https://bugs.webkit.org/show_bug.cgi?id=236994
Reviewed by Andres Gonzalez.
We only expose AXPropertyName::ARIATreeRows for isTree() objects, but compute it for every object, which is wasteful.
This patch also includes a drive-by fixing of setting AXPropertyName::IsTreeItem. Prior to this patch,
we never set this property. Also, we now only store AXPropertyName::ARIATreeItemContent for isTreeItem() objects.
The AXPropertyName::IsTreeItem fix makes test accessibility/roles-exposed.html closer to passing with ITM enabled.
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::ariaTreeRows):
Remove unncessary tab character.
* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::initializeAttributeData):
2022-02-22 Tyler Wilcock <tyler_w@apple.com>
AX: Fix accessibility/aria-current-state-changed-notification.html in isolated tree mode
https://bugs.webkit.org/show_bug.cgi?id=237014
Reviewed by Chris Fleizach.
We need to update AXPropertyName::CurrentValue when we get a AXCurrentStateChanged notification.
Fixes accessibility/aria-current-state-changed-notification.html in isolated tree mode.
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::updateIsolatedTree):
* accessibility/isolatedtree/AXIsolatedTree.cpp:
2022-02-22 Andres Gonzalez <andresg_22@apple.com>
Fix for crash in several AX LayoutTests in isolated tree mode.
https://bugs.webkit.org/show_bug.cgi?id=237015
Reviewed by Chris Dumez.
Follow up to https://bugs.webkit.org/show_bug.cgi?id=236748.
The iteration over the object's children has to happen over a copy
because the children vector can change during the traversal of the tree.
* accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::collectNodeChangesForSubtree):
2022-02-22 Tim Nguyen <ntim@apple.com>
Make pointer-events checks for SVG take in account inert subtrees
https://bugs.webkit.org/show_bug.cgi?id=235836
Reviewed by Antti Koivisto.
Re-using visibleToHitTesting in SVG code isn't possible, because visibleToHitTesting removes visibility: hidden;
content from hit-testing, which we do not want to here, since pointer-events has values for SVG which still
allow clicking content regardless of their visibility value (pointer-events: painted/fill/stroke/all).
Instead, we add an inert-aware effectivePointerEvents, similar to effectiveUserSelect and re-use that across the codebase.
Tests: imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/inert-svg-hittest.html
imported/w3c/web-platform-tests/inert/inert-svg-hittest.tentative.html
* rendering/RenderElement.cpp:
(WebCore::RenderElement::styleWillChange):
* rendering/RenderElement.h:
(WebCore::RenderElement::visibleToHitTesting const):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::layerStyleChanged):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::effectivePointerEvents const):
* rendering/svg/LegacyRenderSVGModelObject.cpp:
(WebCore::LegacyRenderSVGModelObject::checkIntersection):
(WebCore::LegacyRenderSVGModelObject::checkEnclosure):
* rendering/svg/LegacyRenderSVGShape.cpp:
(WebCore::LegacyRenderSVGShape::nodeAtFloatPoint):
* rendering/svg/RenderSVGImage.cpp:
(WebCore::RenderSVGImage::nodeAtFloatPoint):
* rendering/svg/RenderSVGModelObject.cpp:
(WebCore::RenderSVGModelObject::checkIntersection):
(WebCore::RenderSVGModelObject::checkEnclosure):
* rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::nodeAtPoint):
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::nodeAtFloatPoint):
* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::nodeAtPoint):
2022-02-22 Tim Nguyen <ntim@apple.com>
Rename RenderStyle::userSelectIncludingInert to RenderStyle::effectiveUserSelect
https://bugs.webkit.org/show_bug.cgi?id=237033
Reviewed by Antti Koivisto.
This naming is consistent with other properties (effectiveDisplay/Appearance/PointerEvents/etc.).
* dom/Node.cpp:
(WebCore::computeEditabilityFromComputedStyle):
(WebCore::Node::canStartSelection const):
* dom/Position.cpp:
(WebCore::Position::nodeIsUserSelectNone):
(WebCore::Position::nodeIsUserSelectAll):
* page/EventHandler.cpp:
(WebCore::EventHandler::canMouseDownStartSelect):
(WebCore::EventHandler::selectCursor):
* page/Frame.cpp:
(WebCore::Frame::rangeForPoint):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::selectionBackgroundColor const):
(WebCore::RenderElement::selectionColor const):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::collectSelectionGeometriesInternal):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::effectiveUserSelect const):
(WebCore::RenderStyle::userSelectIncludingInert const): Deleted.
2022-02-22 Chris Dumez <cdumez@apple.com>
Move service worker and push API preference from RuntimeEnabledFeatures to Settings
https://bugs.webkit.org/show_bug.cgi?id=236989
Reviewed by Youenn Fablet.
Move service worker and push API preference from RuntimeEnabledFeatures to Settings, since RuntimeEnabledFeatures is deprecated.
* Modules/push-api/PushEvent.idl:
* Modules/push-api/PushManager.idl:
* Modules/push-api/PushMessageData.idl:
* Modules/push-api/PushSubscription.idl:
* Modules/push-api/PushSubscriptionChangeEvent.idl:
* Modules/push-api/PushSubscriptionOptions.idl:
* Modules/push-api/ServiceWorkerGlobalScope+PushAPI.idl:
* Modules/push-api/ServiceWorkerRegistration+PushAPI.idl:
* dom/Document.cpp:
(WebCore::Document::suspend):
(WebCore::Document::resume):
(WebCore::Document::finishedParsing):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::matchRegistration):
(WebCore::DocumentLoader::responseReceived):
(WebCore::DocumentLoader::commitData):
(WebCore::DocumentLoader::unregisterReservedServiceWorkerClient):
(WebCore::DocumentLoader::loadMainResource):
* page/NavigatorBase.cpp:
(WebCore::NavigatorBase::serviceWorker):
* page/NavigatorServiceWorker.idl:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::pushAPIEnabled const): Deleted.
(WebCore::RuntimeEnabledFeatures::setPushAPIEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::serviceWorkerEnabled const): Deleted.
(WebCore::RuntimeEnabledFeatures::setServiceWorkerEnabled): Deleted.
* workers/service/ExtendableEvent.idl:
* workers/service/ExtendableMessageEvent.idl:
* workers/service/FetchEvent.idl:
* workers/service/ServiceWorker.idl:
* workers/service/ServiceWorkerClient.idl:
* workers/service/ServiceWorkerClients.idl:
* workers/service/ServiceWorkerContainer.idl:
* workers/service/ServiceWorkerGlobalScope.idl:
* workers/service/ServiceWorkerRegistration.idl:
* workers/service/ServiceWorkerWindowClient.idl:
2022-02-22 Marcos Caceres <marcos@marcosc.com>
Permission API: handle non-fully active documents
https://bugs.webkit.org/show_bug.cgi?id=236952
Spec change:
https://github.com/w3c/permissions/pull/365
Reviewed by Youenn Fablet.
Test: imported/w3c/web-platform-tests/permissions/non-fully-active.https.html
* Modules/permissions/PermissionStatus.cpp:
(WebCore::PermissionStatus::stateChanged):
* Modules/permissions/Permissions.cpp:
(WebCore::Permissions::query):
2022-02-22 Asumu Takikawa <asumu@igalia.com>
Initial support for Wasm/ESM-integration in the WebCore module loader
https://bugs.webkit.org/show_bug.cgi?id=236268
Reviewed by Yusuke Suzuki.
Add initial WebAssembly script support for WebCore module loading. It
does not yet support Wasm scripts in workers. Detection of Wasm
modules is currently done by MIME type, not by import assertions.
* Headers.cmake:
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::hasWasmMIMEType const):
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::evaluateModule):
* bindings/js/ScriptController.h:
* bindings/js/ScriptModuleLoader.cpp:
(WebCore::ScriptModuleLoader::evaluate):
(WebCore::ScriptModuleLoader::notifyFinished):
* bindings/js/ScriptModuleLoader.h:
* bindings/js/WebAssemblyCachedScriptSourceProvider.h: Added.
* bindings/js/WebAssemblyScriptSourceCode.h: Copied from Source/JavaScriptCore/parser/SourceProvider.cpp.
(WebCore::WebAssemblyScriptSourceCode::WebAssemblyScriptSourceCode):
(WebCore::WebAssemblyScriptSourceCode::jsSourceCode const):
* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::isSupportedWebAssemblyMIMEType):
* platform/MIMETypeRegistry.h:
* workers/WorkerOrWorkletScriptController.cpp:
(WebCore::WorkerOrWorkletScriptController::evaluateModule):
* workers/WorkerOrWorkletScriptController.h:
2022-02-22 Pablo Saavedra <psaavedra@igalia.com>
Properly uninitialize EGL display before termination
https://bugs.webkit.org/show_bug.cgi?id=236766
From the docs [1], if contexts or surfaces associated with display
is current to any thread, they are not released until they
are no longer current as a result of eglMakeCurrent.
So call eglMakeCurrent() to such effect.
[1] https://www.khronos.org/registry/EGL/sdk/docs/man/html/eglMakeCurrent.xhtml
Reviewed by Carlos Garcia Campos.
* platform/graphics/PlatformDisplay.cpp:
(WebCore::PlatformDisplay::terminateEGLDisplay):
2022-02-22 Chris Dumez <cdumez@apple.com>
Avoid having to iterate the whole frame tree(s) every time we need to dispatch storage events
https://bugs.webkit.org/show_bug.cgi?id=236985
Reviewed by Darin Adler.
Avoid having to iterate the whole frame tree(s) every time we need to dispatch storage events,
by keeping track of window objects interested in storage events. A Window object is interested
in storage events if both of the following conditions is true:
1. It has a Storage object (either localStorage or sessionStorage)
2. It has a storage event listener registered.
This patch also refactors the code so that we share more logic between WebKit1 and WebKit2.
* inspector/agents/InspectorDOMStorageAgent.cpp:
(WebCore::InspectorDOMStorageAgent::setDOMStorageItem):
(WebCore::InspectorDOMStorageAgent::removeDOMStorageItem):
(WebCore::InspectorDOMStorageAgent::clearDOMStorageItems):
* loader/EmptyClients.cpp:
* page/DOMWindow.cpp:
(WebCore::windowsInterestedInStorageEvents):
(WebCore::DOMWindow::forEachWindowInterestedInStorageEvents):
(WebCore::DOMWindow::~DOMWindow):
(WebCore::DOMWindow::willDetachDocumentFromFrame):
(WebCore::DOMWindow::eventListenersDidChange):
* page/DOMWindow.h:
* page/DOMWindowProperty.h:
* storage/Storage.cpp:
(WebCore::Storage::setItem):
(WebCore::Storage::removeItem):
(WebCore::Storage::clear):
* storage/StorageArea.h:
* storage/StorageEventDispatcher.cpp:
(WebCore::dispatchSessionStorageEventsToWindows):
(WebCore::dispatchLocalStorageEventsToWindows):
(WebCore::StorageEventDispatcher::dispatchSessionStorageEvents):
(WebCore::StorageEventDispatcher::dispatchLocalStorageEvents):
(WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames): Deleted.
(WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames): Deleted.
* storage/StorageEventDispatcher.h:
2022-02-21 Alex Christensen <achristensen@webkit.org>
Improve const correctness for SecurityOrigin accessors
https://bugs.webkit.org/show_bug.cgi?id=236983
Reviewed by Chris Dumez.
* loader/SubresourceLoader.h:
* loader/cache/CachedResource.h:
(WebCore::CachedResource::origin const):
(WebCore::CachedResource::origin):
* loader/cache/CachedResourceRequest.h:
(WebCore::CachedResourceRequest::origin const):
(WebCore::CachedResourceRequest::origin):
2022-02-21 Brandon Stewart <brandonstewart@apple.com>
Ensure layer has backing during traversal
https://bugs.webkit.org/show_bug.cgi?id=236858
Reviewed by Simon Fraser.
Ensure the layer has a backing attached to it before trying to append
the node id.
* rendering/RenderLayerCompositor.cpp:
(WebCore::collectStationaryLayerRelatedOverflowNodes):
2022-02-21 Cameron McCormack <heycam@apple.com>
Make input element UA shadow tree creation lazy
https://bugs.webkit.org/show_bug.cgi?id=236747
Reviewed by Aditya Keerthi.
We currently delay InputType creation for parser inserted elements until
just after the attributes have been set, so that we don't wastefully
create an InputType and the UA shadow tree creation if a non-text
type="" was specified on the tag. We don't do anything similar for
script inserted input elements. We could make the InputType creation
lazy, but most of the wasted time is due to the shadow tree creation.
This patch makes InputType shadow tree creation lazy by delaying it
until one of the following happens:
1. the element is inserted into the document
2. the type="" or value="" attributes are changed before the element
is inserted into the document
3. any DOM methods that need access to the innerTextElement() are
called on the element before the element is inserted into the
document
Not all places where we call innerTextElement() on the
HTMLInputElement are safe to lazily create the shadow trees, so we
have two accessors:
- innerTextElement() returns the inner text element if it's been
created already
- innerTextElementCreatingShadowSubtreeIfNeeded will perform the lazy
shadow tree construction if it hasn't already been done
Since the existing
createShadowSubtreeAndUpdateInnerTextElementEditability function has
more responsibility than just creating the subtree and ensuring the
editability is set appropriately, it's renamed to a more manageable
createShadowSubtree.
This change is a 0.5% progression on Speedometer 2.
Test: fast/forms/lazy-shadow-tree-creation.html
* html/BaseDateAndTimeInputType.h:
* html/BaseDateAndTimeInputType.cpp:
(WebCore::BaseDateAndTimeInputType::createShadowSubtree):
(WebCore::BaseDateAndTimeInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
* html/ColorInputType.h:
* html/ColorInputType.cpp:
(WebCore::ColorInputType::createShadowSubtree):
(WebCore::ColorInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
* html/FileInputType.h:
* html/FileInputType.cpp:
(WebCore::FileInputType::createShadowSubtree):
(WebCore::FileInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
* html/InputType.cpp:
(WebCore::InputType::createShadowSubtree):
(WebCore::InputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
* html/RangeInputType.h:
* html/RangeInputType.cpp:
(WebCore::RangeInputType::createShadowSubtree):
(WebCore::RangeInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
* html/SearchInputType.h:
* html/SearchInputType.cpp:
(WebCore::SearchInputType::createShadowSubtree):
(WebCore::SearchInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
Renamed createShadowSubtreeAndUpdateInnerTextElementEditability to
createShadowSubtree and remove the "isInnerTextElementEditable"
argument, since we can ask the element() for its value if needed.
createShadowSubtree is now also responsible for creating the shadow
root.
* html/TextFieldInputType.h:
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::createShadowSubtree):
(WebCore::TextFieldInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
Renamed. Ensure all shadow tree state is up to date now that it can be
created later.
* html/InputType.h:
* html/InputType.cpp:
(WebCore::InputType::createShadowSubtree):
(WebCore::InputType::hasCreatedShadowSubtree const):
New functions to create the shadow subtree if it hasn't been done
already, and to query whether it's been done.
* html/HTMLInputElement.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::innerTextElementCreatingShadowSubtreeIfNeeded):
* html/HTMLTextAreaElement.h:
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::innerTextElementCreatingShadowSubtreeIfNeeded):
* html/HTMLTextFormControlElement.h:
* html/InputType.h:
* html/InputType.cpp:
(WebCore::InputType::innerTextElementCreatingShadowSubtreeIfNeeded):
New functions to first create the shadow subtree before returning
innerTextElement(). HTMLTextAreaElement never lazily creates its
shadow subtree and so just returns innerTextElement().
* html/HTMLInputElement.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::createShadowSubtreeAndUpdateInnerTextElementEditability):
Deleted. Just call through to m_inputType->createShadowTree()
directly.
(WebCore::HTMLInputElement::HTMLInputElement):
(WebCore::HTMLInputElement::create):
(WebCore::HTMLInputElement::initializeInputType):
(WebCore::HTMLInputElement::updateType):
Don't immediately create the shadow tree.
(WebCore::HTMLInputElement::didFinishInsertingNode):
Create the shadow subtree now that the element's been inserted. No
need to call dataListMayHaveChanged since
TextFieldInputType::createShadowSubtree will now do this.
* html/BaseDateAndTimeInputType.cpp:
(WebCore::BaseDateAndTimeInputType::updateInnerTextValue):
Ensure the shadow subtree is created since we need to poke at it.
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::forwardEvent):
Don't forward the event if the shadow tree hasn't been created yet.
(WebCore::HTMLTextFormControlElement::setSelectionRange):
Ensure the shadow tree has been created. This is needed if the
selection APIs are called on the input element before it's inserted
into the document.
(WebCore::HTMLTextFormControlElement::visiblePositionForIndex const):
Assert that the shadow tree has been created, since editing
functionality should only be needed if the element's been inserted
into the document.
(WebCore::HTMLTextFormControlElement::setInnerTextValue):
Ensure the shadow tree has been created.
* html/RangeInputType.cpp:
(WebCore::RangeInputType::handleMouseDownEvent):
(WebCore::RangeInputType::handleTouchEvent):
(WebCore::RangeInputType::handleKeydownEvent):
Ensure the shadow tree has been created in case the event will change
the value.
(WebCore::RangeInputType::sliderTrackElement const):
Only return the element if it's been created.
(WebCore::RangeInputType::typedSliderThumbElement const):
Assert that the element has been created.
(WebCore::RangeInputType::dataListMayHaveChanged):
Only try to re-layout if the shadow tree has been created.
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::isEmptyValue const):
Avoid creating the shadow subtree.
(WebCore::TextFieldInputType::forwardEvent):
Move the element assertion up to be consistent with other functions.
(WebCore::TextFieldInputType::innerTextElement const):
Don't assert, since this now can legitimately return null.
* html/FileInputType.cpp:
(WebCore::FileInputType::disabledStateChanged):
(WebCore::FileInputType::attributeChanged):
* html/RangeInputType.cpp:
(WebCore::RangeInputType::disabledStateChanged):
(WebCore::RangeInputType::attributeChanged):
(WebCore::RangeInputType::setValue):
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::disabledStateChanged):
(WebCore::TextFieldInputType::readOnlyStateChanged):
(WebCore::TextFieldInputType::updatePlaceholderText):
(WebCore::TextFieldInputType::updateAutoFillButton):
(WebCore::TextFieldInputType::dataListMayHaveChanged):
Don't update the shadow tree contents if it hasn't been created yet.
createShadowTree is responsible for ensuring it creates the shadow
tree contents reflecting the current state.
2022-02-21 Wenson Hsieh <wenson_hsieh@apple.com>
Add test coverage for the pasteboard writing codepath added in r289839
https://bugs.webkit.org/show_bug.cgi?id=236944
Reviewed by Aditya Keerthi.
Add test coverage for the changes in r289839 in the case where `ENABLE(IMAGE_ANALYSIS_ENHANCEMENTS)` is turned
on. To do this, we set the platform image analysis results to a new internal mock object,
`FakeImageAnalysisResult`, that returns a string for a given NSRange. This code is then exercised by several
existing layout tests that copy and paste text inside image overlays:
- fast/images/text-recognition/image-overlay-line-wrapping.html
- fast/images/text-recognition/image-overlay-text-without-leading-whitespace.html
- fast/images/text-recognition/mac/copy-image-overlay-text-with-context-menu.html
* testing/Internals.cpp:
(WebCore::Internals::installImageOverlay):
* testing/Internals.h:
* testing/Internals.mm:
(-[FakeImageAnalysisResult initWithString:]):
(-[FakeImageAnalysisResult _attributedStringForRange:]):
(WebCore::Internals::fakeImageAnalysisResultForTesting):
2022-02-21 Myles C. Maxfield <mmaxfield@apple.com>
Sort WebCore and WebKit Xcode project files
https://bugs.webkit.org/show_bug.cgi?id=237010
Unreviewed.
No new tests because there is no behavior change.
* WebCore.xcodeproj/project.pbxproj:
== Rolled over to ChangeLog-2022-02-22 ==