mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-13 19:44:28 +00:00
svg_loader: only the first css style node is interpreted
Since the css id selector is not supported in TVG, only the first style node is taken into account.
This commit is contained in:
parent
b6ca58f655
commit
e36368c40c
1 changed files with 8 additions and 4 deletions
|
@ -2695,10 +2695,14 @@ static void _svgLoaderParserXmlOpen(SvgLoaderData* loader, const char* content,
|
|||
if (loader->stack.count > 0) parent = loader->stack.data[loader->stack.count - 1];
|
||||
else parent = loader->doc;
|
||||
if (!strcmp(tagName, "style")) {
|
||||
node = method(loader, nullptr, attrs, attrsLength, simpleXmlParseAttributes);
|
||||
loader->cssStyle = node;
|
||||
loader->doc->node.doc.style = node;
|
||||
loader->style = true;
|
||||
// TODO: For now only the first style node is saved. After the css id selector
|
||||
// is introduced this if condition shouldin't be necessary any more
|
||||
if (!loader->cssStyle) {
|
||||
node = method(loader, nullptr, attrs, attrsLength, simpleXmlParseAttributes);
|
||||
loader->cssStyle = node;
|
||||
loader->doc->node.doc.style = node;
|
||||
loader->style = true;
|
||||
}
|
||||
} else {
|
||||
node = method(loader, parent, attrs, attrsLength, simpleXmlParseAttributes);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue