After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 762919 - Incorrect parsing of stroke-dasharray properties
Incorrect parsing of stroke-dasharray properties
Status: RESOLVED OBSOLETE
Product: librsvg
Classification: Core
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: librsvg maintainers
librsvg maintainers
Depends on:
Blocks:
 
 
Reported: 2016-03-01 11:10 UTC by Massimo
Modified: 2017-12-13 18:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Better follow the W3C spec regarding ‘stroke-dasharray’ (1.50 KB, patch)
2016-03-09 02:54 UTC, Ricordisamoa
none Details | Review

Description Massimo 2016-03-01 11:10:57 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
Comment 1 Ricordisamoa 2016-03-09 02:54:44 UTC
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.
Comment 2 Ricordisamoa 2016-03-09 05:27:21 UTC
Actually the patch makes the numbers separated by ", " worse... :(
Comment 3 GNOME Infrastructure Team 2017-12-13 18:17:00 UTC
-- 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.