Skip to content

Commit

Permalink
Remove SVG style attribute reparsing code.
Browse files Browse the repository at this point in the history
Now that XBL and xml:base are gone, and that <svg:use> is sane (using
shadow trees instead of NAC), we can just remove this, and fix this bug.

Differential Revision: https://phabricator.services.mozilla.com/D81553

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1494356
gecko-commit: fdff19ec13e2d4e94ac22be9f0702446da4088db
gecko-integration-branch: autoland
gecko-reviewers: longsonr
  • Loading branch information
emilio authored and moz-wptsync-bot committed Jun 30, 2020
1 parent 0464638 commit 1753398
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
3 changes: 3 additions & 0 deletions svg/scripted/script-style-attribute-csp-ref.html
@@ -0,0 +1,3 @@
<!doctype html>
<meta charset="UTF-8">
<svg style="width: 100px; height: 100px; background-color: green"></svg>
22 changes: 22 additions & 0 deletions svg/scripted/script-style-attribute-csp.html
@@ -0,0 +1,22 @@
<!doctype html>
<meta charset="UTF-8">
<!--
Allow scripts, but don't allow inline styles.
This does allow scripts to *set* inline styles via the .style attribute.
-->
<title>Setting style setters via script for an SVG element outside of the document should work</title>
<meta http-equiv="Content-Security-Policy" content="
script-src 'unsafe-inline';
style-src 'none';
">
<link rel="match" href="script-style-attribute-csp-ref.html">
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1494356">
<body>
<script>
const element = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
element.style.width = '100px';
element.style.height = '100px';
element.style.backgroundColor = 'green';
document.body.appendChild(element);
</script>

0 comments on commit 1753398

Please sign in to comment.