Skip to content

Commit 19c90d8

Browse files
CSS: Update WPT :matches for intersection behavior
".a+:matches(.c>.e)" requires the intersection of ".a+*" and ".c>.e", not ".a+.c>.e". WebKit passes the test, Blink's current implementation does not. BUG=842157 Change-Id: I51566255006199c511b1d235232c0d9bef40035a Reviewed-on: https://chromium-review.googlesource.com/1059982 Reviewed-by: Rune Lillesveen <[email protected]> Commit-Queue: Eric Willigers <[email protected]> Cr-Commit-Position: refs/heads/master@{#560228}
1 parent 499bf36 commit 19c90d8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

css/selectors/invalidation/matches.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
.a+.c>.e {
3737
color: black;
3838
}
39+
.c>.a+.e {
40+
color: black;
41+
}
3942
.a+:matches(.b+.f, :matches(.c>.e, .g)) {
4043
color: red;
4144
}
@@ -74,6 +77,7 @@
7477
</div>
7578
</div>
7679
<div class="c" id="c2">
80+
<div id="a2"></div>
7781
<div class="e" id="e2">
7882
Red
7983
</div>
@@ -120,6 +124,8 @@
120124

121125
test(() => {
122126
a1.className = "a";
127+
assert_equals(getComputedStyle(e2).color, black);
128+
a2.className = "a";
123129
assert_equals(getComputedStyle(e2).color, red);
124130
}, "Invalidate nested :matches().");
125131

0 commit comments

Comments
 (0)