-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[css-nesting] Make selectors dropped during forgiving parsing still
count towards nest-containment. Also add a test. We keep track of this using a simple boolean, and since we make CSSParser from scratch every time we start parsing a new top-level selector, we don't need to worry about resetting it. In line with CSSWG resolution at w3c/csswg-drafts#7972. Bug: 1095675 Change-Id: I869e6859e32284167ef4e1e8c60b64e770b9e945 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4200218 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Commit-Queue: Steinar H Gunderson <sesse@chromium.org> Cr-Commit-Position: refs/heads/main@{#1098520}
- Loading branch information
Steinar H. Gunderson
authored and
Chromium LUCI CQ
committed
Jan 30, 2023
1 parent
40c9879
commit c0c2114
Showing
4 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
third_party/blink/web_tests/external/wpt/css/css-nesting/nest-containing-forgiving-ref.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!DOCTYPE html> | ||
<title>Nest-containing in forgiving parsing</title> | ||
<style> | ||
.test { | ||
background-color: green; | ||
width: 100px; | ||
height: 100px; | ||
display: grid; | ||
} | ||
|
||
body * + * { | ||
margin-top: 8px; | ||
} | ||
</style> | ||
<body> | ||
<p>Tests pass if <strong>block is green</strong></p> | ||
<div class="test"></div> | ||
</body> |
27 changes: 27 additions & 0 deletions
27
third_party/blink/web_tests/external/wpt/css/css-nesting/nest-containing-forgiving.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!DOCTYPE html> | ||
<title>Nest-containing in forgiving parsing</title> | ||
<link rel="author" title="Steinar H. Gunderson" href="mailto:sesse@chromium.org"> | ||
<link rel="help" href="https://drafts.csswg.org/css-nesting-1/"> | ||
<link rel="match" href="nest-containing-forgiving-ref.html"> | ||
<style> | ||
.test { | ||
background-color: red; | ||
width: 100px; | ||
height: 100px; | ||
display: grid; | ||
} | ||
|
||
.does-not-exist { | ||
:is(.test-1, !&) { | ||
background-color: green; | ||
} | ||
} | ||
|
||
body * + * { | ||
margin-top: 8px; | ||
} | ||
</style> | ||
<body> | ||
<p>Tests pass if <strong>block is green</strong></p> | ||
<div class="test test-1"></div> | ||
</body> |