Bug 264876
Summary: | [SVG2] getPointAtLength should throw exception when not in Active Document for SVGPathElement | ||
---|---|---|---|
Product: | WebKit | Reporter: | Ahmad Saleem <ahmad.saleem792> |
Component: | SVG | Assignee: | Nobody <webkit-unassigned> |
Status: | REOPENED | ||
Severity: | Normal | CC: | sabouhallawa, webkit-bug-importer, zimmermann |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=269647 |
Ahmad Saleem
Hi Team,
While looking through SVG2 Web-spec (around IDL interfaces), I noticed that we need to through exception when 'getPointAtLength' is not in renderable document.
SVG Web-Spec: https://svgwg.org/svg2-draft/types.html#InterfaceSVGGeometryElement
"The getPointAtLength method is used to return the point at a given distance along the path. When getPointAtLength(distance) is called, the following steps are run:
If current element is a non-rendered element, and the UA is not able to compute the total length of the path, then throw an InvalidStateError.'
So I think we need to update our both 'Legacy' and 'LBSE' RenderShape call sites for 'getPointAtLength' to be 'ExceptionOr<>' and throw an error.
WebKit Source: https://searchfox.org/wubkat/rev/7753b1fdea4b4605b4851dec61966b8b7247302a/Source/WebCore/rendering/svg/RenderSVGShape.cpp#312
Just wanted to raise so we can track and fix it.
Thanks!
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Ahmad Saleem
It might progress this failing WPT test case:
https://wpt.fyi/results/svg/types/scripted/SVGGeometryElement.getPointAtLength-03.svg?label=master&label=experimental&aligned=&q=getpointatlength
"When SVGGeometryElement.getPointAtLength is called with an element that is not in the document, either succeed or throw exception with SVGPathElement"
Radar WebKit Bug Importer
<rdar://problem/118720630>
EWS
Committed 274308@main (9f2facf9ef6d): <https://commits.webkit.org/274308@main>
Reviewed commits have been landed. Closing PR #23699 and removing active labels.
Ahmad Saleem
Reverted 274929@main