Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 662cd4ef59c3c0cd16b3036dc50ee9ec802973f7
https://github.com/WebKit/WebKit/commit/662cd4ef59c3c0cd16b3036dc50ee9ec802973f7
Author: Ahmad Saleem <[email protected]>
Date: 2026-05-27 (Wed, 27 May 2026)
Changed paths:
M
LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGGeometryElement.isPointInStroke-01-expected.txt
M LayoutTests/svg/dom/SVGGeometry-isPointInStroke-expected.txt
M LayoutTests/svg/dom/SVGGeometry-isPointInStroke.xhtml
M Source/WebCore/rendering/svg/RenderSVGShape.cpp
M Source/WebCore/rendering/svg/legacy/LegacyRenderSVGShape.cpp
Log Message:
-----------
SVGGeometryElement.isPointInStroke() ignores 'vector-effect:
non-scaling-stroke'
https://bugs.webkit.org/show_bug.cgi?id=314689
rdar://176931749
Reviewed by Rob Buis.
This patch aligns WebKit with Gecko / Firefox and Blink / Chromium.
LegacyRenderSVGShape::isPointInStroke() invoked shapeDependentStrokeContains()
with LocalCoordinateSpace, which is explicitly defined to skip the
non-scaling-stroke transform. As a result, stroke hit-testing used the
shape's local stroke-width instead of the effective (screen-space) stroke
width, producing "true" for points that lie outside a non-scaling stroke.
Handle non-scaling-stroke directly in isPointInStroke() by transforming
both the path and the test point by the non-scaling-stroke CTM, then
performing a path-based strokeContains() check. This also bypasses the
subclass fast paths in LegacyRenderSVGEllipse / LegacyRenderSVGRect, which
do not account for non-scaling-stroke. Shapes without non-scaling-stroke
continue to use the existing fast paths, so there is no performance impact
on regular hit-testing or on isPointInStroke() for scaling strokes.
NOTE: This patch fixes bug in both Legacy SVG and Layer Based SVG engines.
*
LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGGeometryElement.isPointInStroke-01-expected.txt:
Progression
* LayoutTests/svg/dom/SVGGeometry-isPointInStroke.xhtml: Updated (match other
browsers)
* LayoutTests/svg/dom/SVGGeometry-isPointInStroke-expected.txt: Rebaselined
* Source/WebCore/rendering/svg/legacy/LegacyRenderSVGShape.cpp:
(WebCore::LegacyRenderSVGShape::isPointInStroke):
* Source/WebCore/rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::isPointInStroke):
Canonical link: https://commits.webkit.org/313967@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications