Peter Moulder wrote:
The limitation of just one author stylesheet per document is an oversight in libcroco datastructures. Dodji (libcroco maintainer) agrees it's a libcroco bug, and the CRCascade or CRStyleSheet data structure can be changed accordingly.
(The way most of libcroco implements `list of T' is for the T struct to get next/prev members, i.e. add next & prev members to CRStyleSheet, add cr_stylesheet_* functions for accessing this list, and leave CRCascade unchanged. Not saying I like the current scheme, but I think we should use the same scheme throughout libcroco, and consider changing the scheme throughout libcroco at once.)
Meanwhile, Inkscape will also need changing: SPStyleElem's read_content method will need to update just its own CRStyleSheet, and we'll need to make sure that the list of stylesheets in the CRCascade matches the order of their occurrence in the document, so that we get the right precedence when stylesheets conflict with each other.
This is odd. I would have thought that Libcroco would have come across this problem before. Inkscape, at a bare minimum, will probably need to allow 2 <style> sections: 1 for the <svg> chunk, and 1 for the surrounding document from which it will inherit style. More precisely, for an <svg> element embedded in an xhtml document.
However, this is an excellent update. It will probably be a big feature for those people exporting svg from other programs.
Bob