[go: nahoru, domu]

Skip to content

Commit

Permalink
Bug 1818018 [wpt PR 38611] - [@scope] Make scoping limit exclusive, a…
Browse files Browse the repository at this point in the history
…=testonly

Automatic update from web-platform-tests
[@scope] Make scoping limit exclusive

w3c/csswg-drafts#6577

Fixed: 1417896
Change-Id: I4c51177df78eba71cbbfacb88257bdee91b2039b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4272283
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1108286}

--

wpt-commits: c8ee8829ffe92a484644a4d1806e124eef70bf29
wpt-pr: 38611
  • Loading branch information
andruud authored and moz-wptsync-bot committed Mar 7, 2023
1 parent 5cbebf2 commit d255182
Showing 1 changed file with 59 additions and 2 deletions.
61 changes: 59 additions & 2 deletions testing/web-platform/tests/css/css-cascade/scope-evaluation.html
Original file line number Diff line number Diff line change
Expand Up @@ -356,11 +356,68 @@
assert_not_green('#adjacent');
assert_green('.a');
assert_green('.a > div');
assert_green('.b');
assert_not_green('.b');
assert_not_green('#below');
}, 'The scoping limit is in scope');
}, 'The scoping limit is not in scope');
</script>

<template>
<style>
@scope (.a) to (.b > *) {
* { background-color: green; }
}
</style>
<div id=above>
<div class=a>
<div>
<div class=b>
<div id=limit></div>
</div>
</div>
</div>
<div id=adjacent></div>
</div>
</template>
<script>
test_scope(document.currentScript, () => {
assert_not_green('#above');
assert_not_green('#adjacent');
assert_green('.a');
assert_green('.a > div');
assert_green('.b');
assert_not_green('#limit');
}, 'Simulated inclusive scoping limit');
</script>

<template>
<style>
@scope (.a) to (.a) {
* { background-color: green; }
}
</style>
<div id=above>
<div class=a>
<div>
<div class=b>
<div id=inner></div>
</div>
</div>
</div>
<div id=adjacent></div>
</div>
</template>
<script>
test_scope(document.currentScript, () => {
assert_not_green('#above');
assert_not_green('#adjacent');
assert_not_green('.a');
assert_not_green('.a > div');
assert_not_green('.b');
assert_not_green('#inner');
}, 'Scope with no elements');
</script>


<template>
<style>
@scope (.a) {
Expand Down

0 comments on commit d255182

Please sign in to comment.