RESOLVED FIXED311469
SVGPointList should truncate on odd coordinate count instead of clearing the entire list
https://bugs.webkit.org/show_bug.cgi?id=311469
Summary SVGPointList should truncate on odd coordinate count instead of clearing the ...
Ahmad Saleem
Reported 2026-04-04 01:49:42 PDT
Hi Team, Found recently progressed and now with missing coverage failing test, so this is to fix it. Per SVG 2 spec [1], when a polyline/polygon points attribute contains an odd number of coordinates (e.g. "0,0 100,0 20" where the trailing y value is missing), the successfully parsed coordinate pairs should be retained. Currently WebKit rejects the entire list and returns 0 items, instead of keeping the 2 valid pairs. This is covered by the WPT test svg/types/scripted/SVGList-parse-invalid-clears-items.html, subtest "SVGPointList truncates items when y attribute value is missing". The fix changes SVGPointList::parse() to break out of the parse loop when x succeeds but y is missing at end-of-string, retaining already-parsed pairs. Invalid tokens (e.g. "INVALID") at any position still correctly clear the entire list. [1] https://svgwg.org/svg2-draft/shapes.html#PolylineElement — "If an odd number of coordinates is provided, then the element is in error, with the same user agent behavior as occurs with an incorrectly specified 'path' element." Thanks!
Attachments
Radar WebKit Bug Importer
Comment 1 2026-04-04 01:50:21 PDT
Ahmad Saleem
Comment 2 2026-04-04 01:53:32 PDT
EWS
Comment 3 2026-04-08 14:55:24 PDT
Committed 310798@main (31e8f16d17b1): <https://commits.webkit.org/310798@main> Reviewed commits have been landed. Closing PR #62027 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.