SVG: <use> element doesn't copy over style attribute

RESOLVED DUPLICATE of bug 265894

Status

()

Core
SVG
RESOLVED DUPLICATE of bug 265894
2 years ago
2 years ago

People

(Reporter: Manuel Strehl, Unassigned)

Tracking

38 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

2 years ago
Consider this SVG image:

    <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1">
      <defs>
        <path d="M0,0 H100 V100 H0 z" fill="red" id="path2"/>
      </defs>
      <use xlink:href="#path2" style="fill:green"/>
    </svg>

In Firefox it renders as a red square. However, according to the spec for SVG 1.1,

http://www.w3.org/TR/SVG/struct.html#UseElement

the style attribute of the <use> should be copied to the referenced <path> instance. Then, according to

http://www.w3.org/TR/SVG/styling.html#UsingPresentationAttributes

the style attribute should take precedence over the fill attribute, rendering the path green, just like in the generic case:

    <path d="M0,0 H100 V100 H0 z" fill="red" style="fill:green"/><!--renders green-->

Chrome: Renders red, too.
IE: Renders red, too.
RSVG: Renders green. \o/
Batik: Renders red, too.

Updated

2 years ago
Status: UNCONFIRMED → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 265894
You need to log in before you can comment on or make changes to this bug.