SvgLoader: Defs type nodes are not saved in loader's node list.

Summary:
If there is an empty (unused) <defs /> inside the svg file, this can cause problems.
<defs> node is managed separately in loader->def.
So it doesn't have to be added to loader's list.

Test Plan: N/A

Reviewers: Hermet, smohanty

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers, kimcinoo, herb

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D12127
This commit is contained in:
junsu choi 2020-09-02 18:34:59 +09:00 committed by Hermet Park
parent af8bf56c98
commit 40b6e44947
1 changed files with 12 additions and 6 deletions

View File

@ -2160,17 +2160,23 @@ _evas_svg_loader_xml_open_parser(Evas_SVG_Loader *loader,
parent = eina_array_data_get(loader->stack, eina_array_count(loader->stack) - 1);
node = method(loader, parent, attrs, attrs_length);
}
eina_array_push(loader->stack, node);
if (node->type == SVG_NODE_DEFS)
{
loader->doc->node.doc.defs = node;
loader->def = node;
}
{
loader->doc->node.doc.defs = node;
loader->def = node;
}
else
{
eina_array_push(loader->stack, node);
}
}
else if ((method = _find_graphics_factory(tag_name)))
{
parent = eina_array_data_get(loader->stack, eina_array_count(loader->stack) - 1);
if (eina_array_count(loader->stack) > 0)
parent = eina_array_data_get(loader->stack, eina_array_count(loader->stack) - 1);
else
parent = loader->doc;
node = method(loader, parent, attrs, attrs_length);
}
else if ((gradient_method = _find_gradient_factory(tag_name)))