bugzilla.mozilla.org will be intermittently unavailable on Saturday, March 24th, from 16:00 until 20:00 UTC.

Firefox truncates SVG path data after a stray comma (per spec), unlike other browsers




2 years ago
2 years ago


(Reporter: mstange, Unassigned)



Firefox Tracking Flags

(Not tracked)



(1 attachment)



2 years ago
http://cory.li/puzzle-and-dragons/15-puzzle.svg has a big light brown triangle in Firefox. In Chrome the file renders as the author expected.
The problem is in the path data for #framearea:

  M 8,8 L 370,8 L 370,370, L 8,370 L 8,8 M 18,18 L 18,360 L 360,360 L 360,18 L 18,18 M 8,8 z

The extra comma after "L 370,370" causes the path parsing to fail, and error recovery behaviour is specified to drop the remaining path data.  So it renders as if the path were "M 8,8 L 370,8 L 370,370".  This the correct behaviour according to the spec.  I haven't tested other browsers to see how lenient they are about unexpected commas.
Created attachment 8735206 [details]
testcase 1

In Chrome & Opera 12.16 (w/ Presto not Blink), this renders as a box. In Firefox, this renders as a triangle.
(Just came to the same conclusion as heycam about the comma and then saw his comment.)
Microsoft Edge 13 and Safari 9 each agree with Chrome here, too. (as does Opera w/ Presto as noted above)

Inkscape agrees with our rendering, though. :) So we're not entirely on our own in following the spec here.
Summary: This SVG looks different than in Chrome → Firefox truncates SVG path data after a stray comma (per spec), unlike other browsers
You need to log in before you can comment on or make changes to this bug.