Files
sousa-gecko/testing/web-platform/tests/css/cssom/style-attr-clone.html
T
Emilio Cobos Álvarez f81f1103c1 Bug 2039719 - Avoid attribute reparsing in common cases when cloning. r=dom-core,smaug
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
2026-05-15 19:19:21 +00:00

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>