In particular, this helps when cloning elements out of a <template> element, because that hits the cross-document codepath. We keep unconditionally reparsing for SVGElement because the set-up there is totally busted. Not touching ReparseStyleAttribute() for now (though we should look into it). Differential Revision: https://phabricator.services.mozilla.com/D300644
15 lines
493 B
HTML
15 lines
493 B
HTML
<!doctype html>
|
|
<title>Style mutations on cloned element don't affect the original element</title>
|
|
<link rel="help" href="https://drafts.csswg.org/cssom/">
|
|
<link rel="match" href="style-attr-clone-ref.html">
|
|
<div id=wrapper style="display: none">
|
|
<div id="target" style="color: red">What color am I</div>
|
|
</div>
|
|
<script>
|
|
target.style.color = "green";
|
|
let clone = target.cloneNode(true);
|
|
clone.style.color = "blue";
|
|
wrapper.appendChild(clone);
|
|
wrapper.style.display = "";
|
|
</script>
|