Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /css/css-position/backdrop-tree-abiding-slotted.html - WPT Dashboard Interop Dashboard
<!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-shadow/#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>