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

relnote(122): SVG use elements cannot use data URIs #31124

Merged
merged 3 commits into from
Jan 12, 2024

Conversation

bsmth
Copy link
Member

@bsmth bsmth commented Dec 18, 2023

For security reasons, the following is no longer allowed:

<svg>
  <use href="data:image/svg+xml;base64,PHN2ZyB4bWxucz0i...#x" />
</svg>

The same is true for setAttribute:

<use>
  <set attributeName="href" to="data:image/svg+xml;base64,PHN2ZyB4bWxuc..."/>
</use>

and in JS:

use.setAttribute("href", "data:image/svg+xml;base64,PHN2ZyB4...

Bugzilla:

Related issues and pull requests:

Additional resources:

@bsmth bsmth requested a review from a team as a code owner December 18, 2023 16:36
@bsmth bsmth requested review from pepelsbey and removed request for a team December 18, 2023 16:36
@github-actions github-actions bot added the Content:Firefox Content in the Mozilla/Firefox subtree label Dec 18, 2023
Copy link
Contributor

github-actions bot commented Dec 18, 2023

Preview URLs

External URLs (1)

URL: /en-US/docs/Mozilla/Firefox/Releases/122
Title: Firefox 122 for developers

(comment last updated: 2024-01-09 11:31:53)

@pepelsbey
Copy link
Member

There’s also a href attribute for the <image> element in SVG. I wonder if it’s also affected by this limitation, not just <use>.

@bsmth
Copy link
Member Author

bsmth commented Dec 18, 2023

There’s also a href attribute for the <image> element in SVG. I wonder if it’s also affected by this limitation, not just <use>.

This is only in <use> as there's special handling going on when you call it (cloning elements and modifying the DOM).

@bsmth bsmth added this to the Firefox 122 milestone Jan 8, 2024
@bsmth bsmth requested a review from pepelsbey January 9, 2024 10:25
Copy link
Member

@pepelsbey pepelsbey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks :)

@bsmth bsmth merged commit d8f4d73 into mdn:main Jan 12, 2024
7 checks passed
@bsmth bsmth deleted the 31111-svg-use-data-uri branch January 12, 2024 13:44
@bsmth
Copy link
Member Author

bsmth commented Jan 12, 2024

Thank you!

dipikabh pushed a commit to dipikabh/content that referenced this pull request Jan 17, 2024
* relnote(122): SVG use elements cannot use data URIs

* Update files/en-us/mozilla/firefox/releases/122/index.md

Co-authored-by: Vadim Makeev <[email protected]>

---------

Co-authored-by: Vadim Makeev <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:Firefox Content in the Mozilla/Firefox subtree
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants