summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-position/backdrop-tree-abiding-slotted.html
blob: 057b484e2629e1617c44e8bf24555f9d22b9f564 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Position Test: ::backdrop is tree abiding, allowed after ::slotted</title>
<link rel="help" href="https://drafts.csswg.org/css-position-4/#backdrop">
<link rel="help" href="https://drafts.csswg.org/css-pseudo-4/#tree-abiding">
<link rel="help" href="https://drafts.csswg.org/css-scoping/#slotted-pseudo">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div>
  <template shadowrootmode="open">
    <style>
      ::slotted(dialog)::backdrop {
        background-color: green;
      }
    </style>
    <slot></slot>
  </template>
  <dialog id="target"></dialog>
</div>
<script>
  const target = document.getElementById("target");
  target.showModal();

  test(() => {
    assert_equals(getComputedStyle(target, "::backdrop").backgroundColor, "rgb(0, 128, 0)");
  }, "::backdrop is tree-abiding and should be allowed after ::slotted()");
</script>