Handling missing point attribute in input SVG
Hello,
Since it is my first post here, I would like to introduce myself. I'm CS student interested in FLOSS software and C++ development. I would like to contribute to Inkscape to raise my programming skills and do something good this year.
I've begun by solving bug #1202753. For polygon elements in input file, that have empty or no "points" attribute SPShape::curve field is NULL. According to comment in sp-polygon.cpp:125 this should not be the case.
When points="", sp_polygon_set does not initialize SPShape::curve. Comment in sp-polygon.cpp:169 refers to W3C note: http://www.w3.org/TR/SVG11/implnote.html#ErrorProcessing. How should this situation be handled in document tree?
Regards, Tomasz Boczkowski
2013/7/25 Tomasz Boczkowski <penginsbacon@...400...>:
I've begun by solving bug #1202753. For polygon elements in input file, that have empty or no "points" attribute SPShape::curve field is NULL. According to comment in sp-polygon.cpp:125 this should not be the case.
The SVG specification says that the point list of a polygon can be empty: http://www.w3.org/TR/SVG11/shapes.html#PointsBNF
It seems that if the points attribute is empty or missing (equivalent to points=""), then SPShape::curve should be set to an empty curve, and nothing should be rendered.
When points="", sp_polygon_set does not initialize SPShape::curve. Comment in sp-polygon.cpp:169 refers to W3C note: http://www.w3.org/TR/SVG11/implnote.html#ErrorProcessing. How should this situation be handled in document tree?
I'm not sure whether we folow the error processing part of the specification at all. It says that nothing past the point of error should be rendered, but this would cause problems e.g. when using the XML editor: specifying a bad attribute value could cause large portions of the document to suddenly disappear.
Regards, Krzysztof
participants (2)
-
Krzysztof Kosiński
-
Tomasz Boczkowski