GNOME Bugzilla – Bug 762919
Incorrect parsing of stroke-dasharray properties
Last modified: 2017-12-13 18:17:00 UTC
https://git.gnome.org/browse/librsvg/tree/rsvg-styles.c#n832 g_strsplit (.., ",", ..,) is used to parse dash arrays, but the spec says: <quote> <dasharray> contains a list of comma and/or white space separated <length>s and <percentage>s that specify the lengths of alternating dashes and gaps </quote> So using g_strsplit_set and passing also the white spaces as delimiters allows to render the file painting-control-02-f.svg from the svg1.1 test suite better. https://www.w3.org/Graphics/SVG/Test/20110816/harness/htmlSVGWeb/painting-control-02-f.html If, while counting the #dashes: https://git.gnome.org/browse/librsvg/tree/rsvg-styles.c#n838 the empty strings that g_strsplit_set generates when it finds multiple delimiter sequences are swapped to the end of the string array and then ignored also the file painting-stroke-09-t.svg is rendered better. https://www.w3.org/Graphics/SVG/Test/20110816/harness/htmlSVGWeb/painting-stroke-09-t.html
Created attachment 323463 [details] [review] Better follow the W3C spec regarding ‘stroke-dasharray’ The SVG 1.1 Recommendation published by the World Wide Web Consortium at https://www.w3.org/TR/SVG/painting.html#StrokeDasharrayProperty prescribes: <dasharray> contains a list of comma and/or white space separated <length>s and <percentage>s that specify the lengths of alternating dashes and gaps. This patch makes spaces work as separators, just like commas.
Actually the patch makes the numbers separated by ", " worse... :(
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/librsvg/issues/136.