Note from 28th April 2020

Anyone knows which browsers support the href attribute in #SVG <use> tags without the xlink namespace?

Couldn't find the information in #CanIUse.

I'm not interested (this time) in support in SVG editors or other tools, just browsers.

10 Webmentions

1 like

1 repost

  1. Xavier Zaława avatar

8 replies

  1. Jérémie Patonnier avatar Jérémie Patonnier
    All browsers since Safari 13 😉
  2. Nicolas Hoizey avatar Nicolas Hoizey
    Thanks!

    So it's still pretty new, might be a good idea to keep namespaces for a while…
  3. Florens Verschelde avatar Florens Verschelde
    Firefox and Chromium do, WebKit doesn't.
    Not sure about IE11 and Edge18.
  4. Yvain Liechti avatar Yvain Liechti
    developer.mozilla.org/en-US/docs/Web… safari 12.1 c'est indiqué ici ?
  5. Nicolas Hoizey avatar Nicolas Hoizey
    @fvsch well, if MDN is right, iOS Safari 12.2 do support it… interesting.

    I guess all browsers will keep support for `xlink:href` for a while anyway, might be safer keeping it. But with the `xmlns` declaration.

    In @esviji, I had `xlink:href` but no `xmlns`, it fails in SVGO.
  6. Florens Verschelde avatar Florens Verschelde
    Because HTML is more permissive than XML, you can use namespaced attributes without declaring the namespace and it won't blow in your face. :)
  7. Nicolas Hoizey avatar Nicolas Hoizey
    But I never use namespaced attributes in HTML, only in SVG… 😉

    I played with @parceljs yesterday for @esviji, to replace 6 years old Grunt build, and stumbled upon this issue:
    github.com/posthtml/htmln…
  8. Jérémie Patonnier avatar Jérémie Patonnier
    IE support unprefixed href since IE9 (it was the first)