Re: [Inkscape-devel] [Bug 174720] Re: currentColor in style= is misinterpreted
bulia byak wrote:
On Tue, Apr 8, 2008 at 7:56 AM, Martin von Gagern <martin.vgagern@...240...> wrote: ...
Another interesting way to avoid these issues might be some more extensive verification. An invalid style attribute like the one above certainly should never have been generated by inkscape itself. If you were to implement appropriate error checking code in sp_style_read_*, you could enable it while processing internally generated attributes. You might wish to disable it for file reading or attributes entered in the XML editor, or even better, you might wish to handle errors there differently. So perhaps you want a format error listener interface, and pass instance of that along. Quite a bit of work, but maybe worthwhile, as it would also help identify SVG documents in the wild that aren't fully understood by inkscape.
I don't think we want to overburden Inkscape itself with checks over and above those prescribed by the SVG/CSS standard. But an external consistency checker for Inkscape-produced files might be a great addition to the testing project.
Instead of making sure that Inkscape knows how to parse/serialize CSS properly, wouldn't it be better to simply use libcroco for all of this? At first glance it seems to provide plenty of functionality.
On Wed, Apr 09, 2008 at 12:19:00PM +0200, Jasper van de Gronde wrote:
Instead of making sure that Inkscape knows how to parse/serialize CSS properly, wouldn't it be better to simply use libcroco for all of this? At first glance it seems to provide plenty of functionality.
libcroco doesn't provide property-specific parsing of values[*1], but it does have code to help with parsing a style attribute value into component ‘property:value;’ pairs -- and inkscape uses this code (see sp_style_merge_from_style_string and its call from sp_style_read, in style.cpp).
pjrm.
[*1] Actually, cr-style.c in libcroco does have code for parsing certain HTML properties, but very few of those supported exist in SVG, and about half of even those have different validity rules in SVG compared to HTML, such as whether a unitless number is a valid length.
participants (2)
-
Jasper van de Gronde
-
Peter Moulder