Skip to content

Commit

Permalink
Part 6 - Implement scoped styles.
Browse files Browse the repository at this point in the history
Differential Revision: https://phabricator.services.mozilla.com/D207783

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1886441
gecko-commit: bddfdb4b7b6686af36f951455e5b6529052cbdf4
gecko-reviewers: firefox-style-system-reviewers, emilio
  • Loading branch information
dshin-moz authored and moz-wptsync-bot committed May 30, 2024
1 parent 74c5f45 commit c426a43
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion css/css-cascade/scope-evaluation.html
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@
<div class=a>
<span id="in"></span>
<div class=b>
<span id="out"</span>
<span id="out"></span>
<div class=c></div>
</div>
</div>
Expand Down
18 changes: 18 additions & 0 deletions css/css-cascade/scope-proximity.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,21 @@
assert_equals(getComputedStyle(item).borderColor, 'rgb(0, 128, 0)');
}, 'Specificity wins over proximity');
</script>

<template>
<style>
@scope (.foo) {
.bar span[id] { border-color:green; }
}
</style>
<div class=foo>
<div class="foo bar">
<span id=item></span>
</div>
</div>
</template>
<script>
test_scope(document.currentScript, () => {
assert_equals(getComputedStyle(item).borderColor, 'rgb(0, 128, 0)');
}, 'Identical root with further proximity is not ignored');
</script>

0 comments on commit c426a43

Please sign in to comment.