True but this bug is a totally different beast.
Simply add a flag to styles to differentiate those that need to be persistent and others. Or better maintain two lists : styles defined on the element and styles computed.
Because there is a question of priority with styles. Styles corresponding to largest class matching will have the highest priority. Inline styles having the upmost priority. So styles defined are copied to styles computed _after_ all rules applied.
I'm kind of surprised that libcroco don't support all that.
-Bruno
Bruno Winck Email: bwinck@...2632... Blog: http://www.kneaver.com/blog
Kneaver Corp http://www.kneaver.com/ Twitter:http://twitter.com/kneaver PH: +(415) 335-6932
-----Original Message----- From: Martin Owens [mailto:doctormo@...400...] Sent: Monday, January 13, 2014 10:24 PM To: Bruno Winck, Kneaver Cc: 'Jelle Mulder'; inkscape-devel@lists.sourceforge.net Subject: Re: [Inkscape-devel] External CSS support {Spam?}
On Mon, 2014-01-13 at 18:51 +0530, Bruno Winck, Kneaver wrote:
As far as performance is concerned my change has little impact. I'm just creating a SPStyleElem before the root from the PI and apply it before. If there is no style in PI nothing is changed. As mentioned in some comments in the code 2 traversals would be desirable to be sure all styles fragments are available before the display traversal or as some browsers are doing is to restart the traversal whenever styles are affecting the traversal.
There is one other bug that we need to be concerned with:
https://bugs.launchpad.net/inkscape/+bug/167937
This means that styles applied from an external css would be applied into the element's style when we save the svg. Which would reduce the usefulness of it.
Best Regards, Martin Owens