Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 256f95732ea9bd8728a36ff2db5206a7b333d282
https://github.com/WebKit/WebKit/commit/256f95732ea9bd8728a36ff2db5206a7b333d282
Author: Ahmad Saleem <[email protected]>
Date: 2026-08-10 (Mon, 10 Aug 2026)
Changed paths:
M LayoutTests/TestExpectations
M Source/WebCore/rendering/svg/SVGRenderSupport.cpp
M Source/WebCore/rendering/svg/SVGRenderSupport.h
Log Message:
-----------
[Legacy SVG] CSS clip-path basic-shape is mispositioned on a foreignObject
with non-zero x/y
https://bugs.webkit.org/show_bug.cgi?id=319856
rdar://182755161
Reviewed by Taher Ali.
A legacy <foreignObject> paints its content at the box location() (its x/y),
while
objectBoundingBox()/strokeBoundingBox() stay origin-relative (0,0,w,h) so they
compose with
localToParentTransform() for container bounds; that transform adds the x/y
translate on top.
CSS clip-path basic-shapes (e.g. inset()) build their reference box from those
origin-relative
boxes, so the clip is positioned as if x=y=0 and no longer lines up with the
content it is
meant to clip.
Move the reference box to the foreignObject's location() in
clipPathReferenceBox(), through a
new SVGRenderSupport::svgContentLocationOffset() helper that returns a zero
offset for every
other renderer, since they all realize their x/y through
localToParentTransform() instead. The
view-box reference box is left alone, since it describes the nearest SVG
viewport rather than
the foreignObject's own geometry.
* LayoutTests/TestExpectations: Progression
* Source/WebCore/rendering/svg/SVGRenderSupport.cpp:
(WebCore::SVGRenderSupport::svgContentLocationOffset):
(WebCore::clipPathReferenceBox):
* Source/WebCore/rendering/svg/SVGRenderSupport.h:
Canonical link: https://commits.webkit.org/318904@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications