Skip to content

Namespaced attributes don't work #264

@Rich-Harris

Description

@Rich-Harris

This is broken:

<svg>
  <defs>
    <circle id='stamp' r='10' fill='blue'/>
  </defs>

  <!-- this should render a red circle in the top left -->
  <use xlink:href='#stamp' x='20' y='20' fill='red' stroke='blue'/>
</svg>

The <use> element doesn't recognise the xlink:href attribute. This line in the generated code...

setAttribute( use, 'xlink:href', "#stamp" );

...should be something like this instead:

setAttributeNS( use, xlink, 'href', '#stamp' );

(where xlink is "http://www.w3.org/1999/xlink")

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions