Bug 244706 - CSS - overflow: clip is not working on SVG elements
Summary: CSS - overflow: clip is not working on SVG elements
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Rob Buis
URL: https://wpt.fyi/results/svg/render/re...
Keywords: BrowserCompat, InRadar, SVGHitList
Depends on:
Blocks:
 
Reported: 2022-09-02 01:52 PDT by Karl Dubost
Modified: 2022-09-09 02:55 PDT (History)
19 users (show)

See Also:


Attachments
Patch (8.56 KB, patch)
2022-09-07 03:04 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (9.23 KB, patch)
2022-09-08 01:17 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (9.22 KB, patch)
2022-09-09 01:03 PDT, Rob Buis
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Karl Dubost 2022-09-02 01:52:27 PDT
https://wpt.fyi/results/svg/render/reftests/overflow-clip.html?label=experimental&label=master&aligned

This test fails
http://wpt.live/svg/render/reftests/overflow-clip.html

data:text/html,<svg%20style="overflow:%20clip;%20width:%20100px;%20height:%20100px">%20%20%20<rect%20width="200"%20height="200"%20fill="green">%20</svg>



while it is working for simple divs.
data:text/html,<div%20style="overflow:clip;width:100px;height:100px"><div%20style="width:200px;height:200px;background-color:gold"></div></div>

Work in Firefox and Chrome.
Comment 1 Radar WebKit Bug Importer 2022-09-02 01:52:37 PDT
<rdar://problem/99479553>
Comment 2 Rob Buis 2022-09-07 03:04:05 PDT
Created attachment 462177 [details]
Patch
Comment 3 Simon Fraser (smfr) 2022-09-07 10:39:19 PDT
Comment on attachment 462177 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=462177&action=review

> Source/WebCore/rendering/svg/LegacyRenderSVGRoot.cpp:216
> +    return effectiveOverflowX() == Overflow::Hidden || style().overflowX() == Overflow::Auto

Would be nice to have a isNonVisibleOverflow(Overflow) helper we can use everywhere.
Comment 4 Rob Buis 2022-09-08 01:17:25 PDT
Created attachment 462199 [details]
Patch
Comment 5 Simon Fraser (smfr) 2022-09-08 13:06:51 PDT
Comment on attachment 462199 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=462199&action=review

> Source/WebCore/rendering/style/RenderStyle.h:2553
> +inline bool isNonVisibleOverflow(const Overflow& overflow)

Overflow is a uint8_t enum, so it's more efficient to pass by value.
Comment 6 Rob Buis 2022-09-09 01:03:39 PDT
Created attachment 462221 [details]
Patch
Comment 7 EWS 2022-09-09 02:54:59 PDT
Committed 254295@main (88bf94fa06f3): <https://commits.webkit.org/254295@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 462221 [details].