Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!doctype html>
<meta charset="utf-8">
<title>Manual slot assignment doesn't try to un-assign from the wrong slot</title>
<link rel="match" href="manual-slot-assignment-no-wrong-unassign-ref.html">
<link rel="help" href="https://bugzil.la/2018012">
<link rel="author" href="mailto:emilio@crisal.io" title="Emilio Cobos Álvarez">
<link rel="author" href="https://mozilla.com" title="Mozilla">
<div id="host">
<div id="target">Target text</div>
</div>
<script>
host.getBoundingClientRect();
let shadow = host.attachShadow({ mode: "open" });
shadow.innerHTML = `<slot></slot>`;
host.getBoundingClientRect();
// Intentionally duplicated, and intentionally assigning to "fresh" slots.
document.createElement("slot").assign(target);
host.getBoundingClientRect();
document.createElement("slot").assign(target);
host.getBoundingClientRect();
target.style.color = "green";
</script>