Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-cascade/scope-implicit-remove-sheet.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>CSS Cascading Test: Invalidate style when implicit @scope sheet is removed</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="target">
<style id="scope_sheet">
@scope { --matches-scope: true; }
</style>
</div>
<script>
test(() => {
assert_equals(getComputedStyle(target).getPropertyValue("--matches-scope"), "true");
}, "Implicit @scope rule initially matches");
test(() => {
scope_sheet.remove();
assert_equals(getComputedStyle(target).getPropertyValue("--matches-scope"), "");
}, "@scope rule no longer matches after sheet removal");
</script>