Path2D(string) should use the broken path until the first error
Categories
(Core :: Graphics: Canvas2D, defect)
Tracking
()
People
(Reporter: tristan.fraipont, Assigned: nical)
Details
Attachments
(2 files)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:98.0) Gecko/20100101 Firefox/98.0
Steps to reproduce:
Create a new Path2D from an SVG path data string containing an error (e.g M10 10L20 20 30, the 30 is an error).
Then try to draw that Path2D object on a 2D context.
Actual results:
Nothing is drawn.
Expected results:
According to the HTML specs, the path data should be parsed and interpreted by following the rules of SVG 2, which state that "the SVG user agent shall render a ‘path’ element up to (but not including) the path command containing the first error in the path data specification".
So we should have had the first MoveTo 0 0 and LineTo 10 10 honored.
Firefox does respect this rule for SVG <path>. Safari and Chrome do too for both SVG and Path2D.
This is NOT a regression. Running bisect against old builds still reproduced the issue.
On a side note, I couldn't find a single WPT testing Path2D(string)...
Updated•4 years ago
|
| Assignee | ||
Comment 1•2 years ago
|
||
Updated•2 years ago
|
| Assignee | ||
Updated•2 years ago
|
Comment 2•2 years ago
|
||
There is an r+ patch which didn't land and no activity in this bug for 2 weeks.
:nical, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit BugBot documentation.
| Assignee | ||
Comment 3•2 years ago
|
||
I want to look into adding a test when time allows.
Description
•