WebKit export of https://bugs.webkit.org/show_bug.cgi?id=270806 (#45206)

diff --git a/css/css-cascade/scope-evaluation.html b/css/css-cascade/scope-evaluation.html
index f181048..c6ea13c 100644
--- a/css/css-cascade/scope-evaluation.html
+++ b/css/css-cascade/scope-evaluation.html
@@ -512,7 +512,6 @@
 }, ':scope in two different compounds');
 </script>
 
-
 <template>
   <style>
     @scope (.a:has(.c)) {
@@ -545,3 +544,24 @@
   assert_not_green('.second .d');
 }, 'Scope root with :has()');
 </script>
+
+<template>
+  <style>
+    @scope (.a) to (.b, .c) {
+      * { background-color:green; }
+    }
+  </style>
+  <div class=a>
+    <span id="in"></span>
+    <div class=b>
+      <span id="out"</span>
+      <div class=c></div>
+    </div>
+  </div>
+</template>
+<script>
+test_scope(document.currentScript, () => {
+  assert_green('#in');
+  assert_not_green('#out');
+}, 'Any scope limit makes the element out of scope');
+</script>