wpt / css / css-shadow / shadow-reassign-dynamic-006.html

Status: PASS | Duration: 6ms | Subtests: 1/1 | Open test on wpt.live | Open ref on wpt.live | wpt.fyi

/css/css-shadow/shadow-reassign-dynamic-006.html

<!doctype html>
<meta charset="utf-8">
<title>CSS Scoping: Dynamic reassignment of a named slot child.</title>
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
<link rel="help" href="https://drafts.csswg.org/css-shadow/#selectors-data-model">
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1927714">
<link rel="match" href="shadow-reassign-dynamic-006-ref.html">
<div id="host">
  <template shadowrootmode="open">
    <slot></slot>
    <slot></slot>
  </template>
  <div id="child1">Child1</div>
  <div id="child2" slot="named-slot">Child2</div>
</div>
<script>
  host.getBoundingClientRect();
  host.shadowRoot.querySelectorAll("slot")[1].name = "named-slot";
  host.getBoundingClientRect();
</script>

/css/css-shadow/shadow-reassign-dynamic-006-ref.html

<!doctype html>
<title>CSS Test Reference</title>
<div id="host">
  <div>Child1</div>
  <div>Child2</div>
</div>