[webkit-changes] [WebKit/WebKit] 9f2fac: [SVG2] getPointAtLength should throw exception whe...
Ahmad Saleem
noreply at github.com
Thu Feb 8 13:20:29 PST 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 9f2facf9ef6db9cf652f3e8729ce4e5cc3b90e26
https://github.com/WebKit/WebKit/commit/9f2facf9ef6db9cf652f3e8729ce4e5cc3b90e26
Author: Ahmad Saleem <ahmad.saleem792+github at gmail.com>
Date: 2024-02-08 (Thu, 08 Feb 2024)
Changed paths:
M LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGGeometryElement.getPointAtLength-03-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGGeometryElement.getPointAtLength-04-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGGeometryElement.getPointAtLength-05-expected.txt
M LayoutTests/svg/dom/SVGPolygonElement-baseVal-list-removal-crash.html
M LayoutTests/svg/dom/path-pointAtLength-expected.txt
M LayoutTests/svg/dom/path-pointAtLength.html
M Source/WebCore/svg/SVGGeometryElement.cpp
M Source/WebCore/svg/SVGPathElement.cpp
Log Message:
-----------
[SVG2] getPointAtLength should throw exception when in non-rendered document for SVGPathElement
https://bugs.webkit.org/show_bug.cgi?id=264876
rdar://problem/118720630
Reviewed by Said Abou-Hallawa.
This patch aligns WebKit with Gecko / Firefox, Blink / Chromium and Web-Specification [1]:
[1] https://svgwg.org/svg2-draft/types.html#InterfaceSVGGeometryElement
NOTE: SVGPathElement interface with SVGGeometryElement.
This patch aligns WebKit to throw exception in case of document being non-rendered element.
"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."
I took the opportunity to add meaningful error to `SVGGeometryElement` as well and add check for
content-visibility to SVGPathElement.
* Source/WebCore/svg/SVGGeometryElement.cpp:
(SVGGeometryElement::getPointAtLength): Added meaningful message
* Source/WebCore/svg/SVGPathElement.cpp:
(SVGPathElement::getPointAtLength): Aligned with 'SVGGeometryElement'
* LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGGeometryElement.getPointAtLength-03-expected.txt: Rebaselined
* LayoutTests/svg/dom/SVGPolygonElement-baseVal-list-removal-crash.html: Rebaselined
* LayoutTests/svg/dom/path-pointAtLength.html: Ditto
* LayoutTests/svg/dom/path-pointAtLength-expected.txt: Ditto
* LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGGeometryElement.getPointAtLength-04-expected.txt: Rebaselined
* LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGGeometryElement.getPointAtLength-05-expected.txt: Rebaselined
Canonical link: https://commits.webkit.org/274308@main
More information about the webkit-changes
mailing list