Skip to content

Commit

Permalink
Fix container query WPT tests to reflect recent WG resolution.
Browse files Browse the repository at this point in the history
As per CSSWG resolution in:

  w3c/csswg-drafts#5984 (comment)

Differential Revision: https://phabricator.services.mozilla.com/D212412

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1790886
gecko-commit: bc97304e5b3d4d2110fd8f2120ba9914406a116a
gecko-reviewers: jwatt
  • Loading branch information
emilio authored and moz-wptsync-bot committed Jun 3, 2024
1 parent a975c0f commit 5f26ad5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
18 changes: 9 additions & 9 deletions css/css-contain/container-queries/container-for-shadow-dom.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
</div>
</template>
<style>
@container (width = 400px) {
@container (width = 200px) {
#t2 { color: green; }
}
</style>
Expand Down Expand Up @@ -102,7 +102,7 @@
</div>
</template>
<style>
@container (width = 400px) {
@container (width = 200px) {
#inclusive-ancestor-part > div::part(part) { color: green; }
}
</style>
Expand All @@ -118,7 +118,7 @@
width: 200px;
container-type: inline-size;
}
@container (width = 200px) {
@container (width = 400px) {
::slotted(#t6)::before {
content: "X";
color: green;
Expand Down Expand Up @@ -158,7 +158,7 @@

<div id="inclusive-ancestor-part-before">
<style>
@container (width = 400px) {
@container (width = 200px) {
#inclusive-ancestor-part-before > div::part(part)::before {
content: "X";
color: green;
Expand All @@ -182,7 +182,7 @@

<div id="inclusive-ancestor-inner-part">
<style>
@container (width = 400px) {
@container (width = 200px) {
#inclusive-ancestor-inner-part > div::part(inner-part) { color: green; }
}
</style>
Expand Down Expand Up @@ -236,15 +236,15 @@
width: 200px;
container-type: inline-size;
}
#t11 { color: green; }
#t11 { color: red; }
</style>
<div>
<span id="t11" part="part"></span>
</div>
</template>
<style>
@container (width = 200px) {
#no-container-for-part > div::part(part) { color: red; }
#no-container-for-part > div::part(part) { color: green; }
}
</style>
</div>
Expand All @@ -258,7 +258,7 @@
width: 200px;
container-type: inline-size;
}
@container (width = 400px) {
@container (width = 200px) {
:host::part(part) { color: green; }
}
</style>
Expand Down Expand Up @@ -286,7 +286,7 @@
test(() => {
const t2 = document.querySelector("#t2");
assert_equals(getComputedStyle(t2).color, green);
}, "Match container in same tree, not walking flat tree ancestors");
}, "Match container in walking flat tree ancestors");

test(() => {
const t3 = document.querySelector("#t3");
Expand Down
12 changes: 6 additions & 6 deletions css/css-contain/container-queries/container-units-shadow.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@

test(() => {
let cs = getComputedStyle(direct);
assert_equals(cs.width, '100px');
assert_equals(cs.height, '100px');
}, 'Direct slotted child queries shadow-including ancestors');
assert_equals(cs.width, '15px');
assert_equals(cs.height, '15px');
}, 'Direct slotted child queries flat tree');

test(() => {
let cs = getComputedStyle(nondirect);
assert_equals(cs.width, '10px'); // #direct
assert_equals(cs.height, '20px'); // #outer
}, 'Nondirect slotted child queries shadow-including ancestors');
assert_equals(cs.width, '1.5px');
assert_equals(cs.height, '3px');
}, 'Nondirect slotted child queries flat tree ancestors');
</script>

0 comments on commit 5f26ad5

Please sign in to comment.