Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Noting xlink:href fallback option to support older browsers #16242

Merged
merged 2 commits into from May 24, 2022

Conversation

meatnordrink
Copy link
Contributor

@meatnordrink meatnordrink commented May 19, 2022

Summary

Added a note that xlink:href may be included in addition to href to support older browsers.

Motivation

We recently tried removing xlink:href from an svg sprite we use for our site, and found that it broke the sprite for users on Safari < 12.1, as specified by the browser support table. Looking at our analytics, this only comprises a portion of a single percent of our users - but this is still over a thousand users a week. Therefore, it seems worthwhile to note that both attributes may be included, which allows rendering on Safari < 12.1, but also future-proofs against browsers dropping support for xlink:href.

Supporting details

Note that this is supported in the W3 SVG2 spec here:

When the ‘href’ attribute is present in both the XLink namespace and without a namespace, the value of the attribute without a namespace shall be used. The attribute in the XLink namespace shall be ignored.

Related issues

I proposed this same change to the href page: #16241

Metadata

  • Adds a new document
  • Rewrites (or significantly expands) a document
  • Fixes a typo, bug, or other error

@meatnordrink meatnordrink requested a review from a team as a code owner May 19, 2022 21:21
@github-actions github-actions bot added the Content:SVG SVG docs label May 19, 2022
@github-actions
Copy link
Contributor

github-actions bot commented May 19, 2022

Preview URLs

Flaws

URL: /en-US/docs/Web/SVG/Attribute/xlink:href
Title: xlink:href
on GitHub
Flaw count: 2

  • macros:
    • /en-US/docs/Web/SVG/Element/animateColor redirects to /en-US/docs/Web/SVG/Element/animate
    • /en-US/docs/Web/SVG/Element/animateColor redirects to /en-US/docs/Web/SVG/Element/animate

External URLs

URL: /en-US/docs/Web/SVG/Attribute/xlink:href
Title: xlink:href
on GitHub

No new external URLs

(this comment was updated 2022-05-23 14:26:29.334953)

Accepting CR suggestion

Co-authored-by: Onkar Ruikar <87750369+OnkarRuikar@users.noreply.github.com>
@meatnordrink
Copy link
Contributor Author

Thanks @OnkarRuikar !

@Rumyra Rumyra merged commit 420b8e8 into mdn:main May 24, 2022
@meatnordrink meatnordrink deleted the patch-7 branch May 25, 2022 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:SVG SVG docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants