Commit dd8e5b13 authored by Hiroyuki Ikezoe's avatar Hiroyuki Ikezoe Committed by Hiroyuki Ikezoe

Apply style attributes of svg element at the end of svg element tag.

Because svg element's presentation attributes does not apply
when drawing SVG which has no "style" element.

Fix for bug #620693.
parent bd8bb3d0
......@@ -690,7 +690,7 @@ rsvg_end_element (void *data, const xmlChar * name)
&& !strcmp ((const char *) name, ctx->priv->currentnode->type->str))
rsvg_pop_def_group (ctx);
if (ctx->priv->treebase && !strcmp ((const char *)name, "style"))
if (ctx->priv->treebase && !strcmp ((const char *)name, "svg"))
_rsvg_node_svg_apply_atts ((RsvgNodeSvg *)ctx->priv->treebase, ctx);
}
}
......
<?xml version="1.0" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" id="svg" viewBox="-5 -5 10 10" stroke="#f00" fill="none" stroke-width="2">
<circle r="4"/>
</svg>
......@@ -95,6 +95,7 @@ static const FixtureData fixtures[] =
{"/styles/selectors/2 or more selectors (fill)", "592207", "styles/bug592207.svg", "#target", "fill", .expected.color = 0xff0000},
{"/styles/selectors/2 or more selectors (stroke)", "592207", "styles/bug592207.svg", "#target", "stroke", .expected.color = 0x0000ff},
{"/styles/svg-element-style", "615701", "styles/svg-class.svg", "#svg", "fill", .expected.color = 0x0000ff},
{"/styles/presentation attribute in svg element", "620693", "styles/bug620693.svg", "#svg", "stroke", .expected.color = 0xff0000},
{"/styles/!important", "379629", "styles/bug379629.svg", "#base_shadow", "stroke", .expected.color = 0xffc0cb /* pink */},
{"/styles/!important", "379629", "styles/bug379629.svg", "#base_shadow", "stroke-width", .expected.length = {POINTS_LENGTH(5.), 'i'}},
{"/styles/!important/class", "614606", "styles/bug614606.svg", "#path6306", "fill", .expected.color = 0xff0000 /* red */ },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment