Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<title>:scope pseudo does not match in shadow root</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="host"></div>
<script>
test(() => {
host.attachShadow({mode: 'open'}).innerHTML = `
<style>
div {
background-color: green;
}
:scope div {
background-color: red;
}
:scope > div {
background-color: red;
}
</style>
<div>Test</div>
`;
let div = host.shadowRoot.querySelector('div');
assert_equals(getComputedStyle(div).backgroundColor, 'rgb(0, 128, 0)');
}, ':scope does not match in shadow root');
</script>