commit ccf612b0a4ae5727f7c50623a3e635db90e98c57
parent aa8f9a6919c757c4e89b683fecfd24ed6e91ae6c
Author: Diego Escalante <descalante@mozilla.com>
Date: Fri, 24 Oct 2025 19:34:38 +0000
Bug 1986743 - Add deep Implicit Scope Invalidation WPT. r=dshin
Differential Revision: https://phabricator.services.mozilla.com/D270009
Diffstat:
1 file changed, 28 insertions(+), 0 deletions(-)
diff --git a/testing/web-platform/tests/css/css-cascade/scope-invalidation.html b/testing/web-platform/tests/css/css-cascade/scope-invalidation.html
@@ -932,3 +932,31 @@ test_scope_invalidation(document.currentScript, () => {
assert_not_green(f);
}, 'Parent element of subject affecting scope limit')
</script>
+
+<template>
+ <div class=a>
+ <div><div><div><div>
+ <style>
+ @scope(.a) {
+ @scope {
+ @scope(> .b) {
+ :scope { background: green; }
+ }
+ }
+ }
+ </style>
+ <div class=b></div>
+ </div></div></div></div>
+ </div>
+</template>
+<script>
+test_scope_invalidation(document.currentScript, () => {
+ let a = main.querySelector('.a');
+ let b = main.querySelector('.b');
+ assert_green(b);
+ a.classList.remove('a');
+ assert_not_green(b);
+ a.classList.add('a');
+ assert_green(b);
+}, 'Sandwiched deep implicit scope root, :scope in subject')
+</script>