Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: bdffad83ec6dff81c58fb20356f55210b68bcd45
      
https://github.com/WebKit/WebKit/commit/bdffad83ec6dff81c58fb20356f55210b68bcd45
  Author: Karl Dubost <[email protected]>
  Date:   2026-06-09 (Tue, 09 Jun 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/svg/shapes/reftests/ellipse-auto-rx-clip-path-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/svg/shapes/reftests/ellipse-auto-rx-clip-path-ref.html
    A 
LayoutTests/imported/w3c/web-platform-tests/svg/shapes/reftests/ellipse-auto-rx-clip-path.html
    A 
LayoutTests/imported/w3c/web-platform-tests/svg/shapes/reftests/ellipse-auto-rx-css-clip-path-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/svg/shapes/reftests/ellipse-auto-rx-css-clip-path-ref.html
    A 
LayoutTests/imported/w3c/web-platform-tests/svg/shapes/reftests/ellipse-auto-rx-css-clip-path.html
    A 
LayoutTests/imported/w3c/web-platform-tests/svg/shapes/reftests/ellipse-auto-rx-percent-clip-path-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/svg/shapes/reftests/ellipse-auto-rx-percent-clip-path-ref.html
    A 
LayoutTests/imported/w3c/web-platform-tests/svg/shapes/reftests/ellipse-auto-rx-percent-clip-path.html
    A 
LayoutTests/imported/w3c/web-platform-tests/svg/shapes/reftests/ellipse-auto-rx-textpath-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/svg/shapes/reftests/ellipse-auto-rx-textpath-ref.html
    A 
LayoutTests/imported/w3c/web-platform-tests/svg/shapes/reftests/ellipse-auto-rx-textpath.html
    A 
LayoutTests/imported/w3c/web-platform-tests/svg/shapes/scripted/ellipse-auto-radii-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/svg/shapes/scripted/ellipse-auto-radii.svg
    M Source/WebCore/rendering/svg/SVGPathData.cpp

  Log Message:
  -----------
  pathFromEllipseElement reads style.rx() and style.ry() without checking 
isAuto()
https://bugs.webkit.org/show_bug.cgi?id=316505
rdar://178959205

Reviewed by Simon Fraser.

Per SVG 2 [1], an `auto` value for either `rx` or `ry` on an <ellipse>
resolves to the used value of the other property; if both are auto, both
used values are 0. RenderSVGEllipse honors this rule
(RenderSVGEllipse.cpp:99-107), but pathFromEllipseElement reads
style.rx() / style.ry() raw, and SVGLengthContext::valueForLength returns
0 for the Auto variant. The result is that every consumer of
pathFromGraphicsElement() — getTotalLength, getPointAtLength,
isPointInStroke (with stroke-dasharray, which forces the ensure-path
slow path), <clipPath>, CSS clip-path: url(), and <textPath> — sees an
empty path even though the element renders correctly.

Fix by mirroring the resolution from RenderSVGEllipse::calculateRadiiAndCenter:
substitute the auto operand before valueForLength, then re-overwrite
post-resolution to handle the borrowed-percentage axis mismatch.

This brings WebKit to interop parity with Firefox 152 on SVG 2 ellipse
auto resolution.

[1] https://w3c.github.io/svgwg/svg2-draft/shapes.html#EllipseElement

Tests: 
imported/w3c/web-platform-tests/svg/shapes/reftests/ellipse-auto-rx-clip-path-ref.html
       
imported/w3c/web-platform-tests/svg/shapes/reftests/ellipse-auto-rx-clip-path.html
       
imported/w3c/web-platform-tests/svg/shapes/reftests/ellipse-auto-rx-css-clip-path-ref.html
       
imported/w3c/web-platform-tests/svg/shapes/reftests/ellipse-auto-rx-css-clip-path.html
       
imported/w3c/web-platform-tests/svg/shapes/reftests/ellipse-auto-rx-percent-clip-path-ref.html
       
imported/w3c/web-platform-tests/svg/shapes/reftests/ellipse-auto-rx-percent-clip-path.html
       
imported/w3c/web-platform-tests/svg/shapes/reftests/ellipse-auto-rx-textpath-ref.html
       
imported/w3c/web-platform-tests/svg/shapes/reftests/ellipse-auto-rx-textpath.html
       
imported/w3c/web-platform-tests/svg/shapes/scripted/ellipse-auto-radii.svg

* 
LayoutTests/imported/w3c/web-platform-tests/svg/shapes/reftests/ellipse-auto-rx-clip-path-expected.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/svg/shapes/reftests/ellipse-auto-rx-clip-path-ref.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/svg/shapes/reftests/ellipse-auto-rx-clip-path.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/svg/shapes/reftests/ellipse-auto-rx-css-clip-path-expected.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/svg/shapes/reftests/ellipse-auto-rx-css-clip-path-ref.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/svg/shapes/reftests/ellipse-auto-rx-css-clip-path.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/svg/shapes/reftests/ellipse-auto-rx-percent-clip-path-expected.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/svg/shapes/reftests/ellipse-auto-rx-percent-clip-path-ref.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/svg/shapes/reftests/ellipse-auto-rx-percent-clip-path.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/svg/shapes/reftests/ellipse-auto-rx-textpath-expected.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/svg/shapes/reftests/ellipse-auto-rx-textpath-ref.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/svg/shapes/reftests/ellipse-auto-rx-textpath.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/svg/shapes/scripted/ellipse-auto-radii-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/svg/shapes/scripted/ellipse-auto-radii.svg:
 Added.
* Source/WebCore/rendering/svg/SVGPathData.cpp:
(WebCore::pathFromEllipseElement):

Canonical link: https://commits.webkit.org/314846@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to