diff options
Diffstat (limited to 'testing/web-platform/tests/css/css-scoping/slotted-slot.html')
-rw-r--r-- | testing/web-platform/tests/css/css-scoping/slotted-slot.html | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-scoping/slotted-slot.html b/testing/web-platform/tests/css/css-scoping/slotted-slot.html new file mode 100644 index 0000000000..1f4aa75ae6 --- /dev/null +++ b/testing/web-platform/tests/css/css-scoping/slotted-slot.html @@ -0,0 +1,17 @@ +<!DOCTYPE html> +<title>CSS Test: ::slotted() not matching slot elements</title> +<link rel="author" title="Rune Lillesveen" href="mailto:futhark@chromium.org"> +<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 id="host" style="color:green">This text should be green.</div> +<script> + test(() => { + let root = host.attachShadow({mode:"open"}); + root.innerHTML = '<div><slot id="slot"></slot><div>'; + let innerHost = root.firstChild; + let innerRoot = innerHost.attachShadow({mode:"open"}); + innerRoot.innerHTML = "<style>::slotted(#slot){color:red}</style><slot></slot>"; + assert_equals(getComputedStyle(root.querySelector("#slot")).color, "rgb(0, 128, 0)"); + }, "Check that ::slotted does not match slot elements"); +</script> |