Skip to content

Commit

Permalink
[LBSE] Support clip-path shapes
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=265207

Reviewed by Nikolas Zimmermann.

Support clip-path shapes.

* LayoutTests/platform/mac-sonoma-wk2-lbse-text/TestExpectations:
* Source/WebCore/rendering/RenderLayer.cpp:
(WebCore::RenderLayer::referenceBoxRectForClipPath const):

Canonical link: https://commits.webkit.org/271026@main
  • Loading branch information
rwlbuis committed Nov 21, 2023
1 parent 9cb0043 commit 0c248b2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -366,13 +366,6 @@ svg/clip-path/clip-path-on-svg-005.svg [ ImageOnlyFailure ]
svg/clip-path/clip-path-precision-001.svg [ ImageOnlyFailure ]
svg/clip-path/clip-path-recursion-001.svg [ ImageOnlyFailure ]
svg/clip-path/clip-path-recursion-002.svg [ Crash ImageOnlyFailure ]
svg/clip-path/clip-path-shape-border-box.svg [ ImageOnlyFailure ]
svg/clip-path/clip-path-shape-circle-1.svg [ ImageOnlyFailure ]
svg/clip-path/clip-path-shape-ellipse-1.svg [ ImageOnlyFailure ]
svg/clip-path/clip-path-shape-margin-box.svg [ ImageOnlyFailure ]
svg/clip-path/clip-path-shape-rounded-inset-1.svg [ ImageOnlyFailure ]
svg/clip-path/clip-path-shape-rounded-inset-2.svg [ ImageOnlyFailure ]
svg/clip-path/clip-path-shape-stroke.svg [ ImageOnlyFailure ]
svg/clip-path/clip-path-text-003.svg [ ImageOnlyFailure ]
svg/clip-path/clip-path-use-referencing-clipped-text.html [ ImageOnlyFailure ]
svg/clip-path/clip-path-use-referencing-text.html [ ImageOnlyFailure ]
Expand Down
11 changes: 9 additions & 2 deletions Source/WebCore/rendering/RenderLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1345,11 +1345,18 @@ void RenderLayer::dirtyAncestorChainHasBlendingDescendants()

FloatRect RenderLayer::referenceBoxRectForClipPath(CSSBoxType boxType, const LayoutSize& offsetFromRoot, const LayoutRect& rootRelativeBounds) const
{
// FIXME: [LBSE] Upstream clipping support for SVG.
bool isReferenceBox = false;

#if ENABLE(LAYER_BASED_SVG_ENGINE)
if (renderer().document().settings().layerBasedSVGEngineEnabled() && renderer().isSVGLayerAwareRenderer())
isReferenceBox = true;
else
#endif
isReferenceBox = renderer().isRenderBox();

// FIXME: Support different reference boxes for inline content.
// https://bugs.webkit.org/show_bug.cgi?id=129047
if (!renderer().isRenderBox())
if (!isReferenceBox)
return rootRelativeBounds;

auto referenceBoxRect = renderer().referenceBoxRect(boxType);
Expand Down

0 comments on commit 0c248b2

Please sign in to comment.