forked from mirrors/gecko-dev
Automatic update from web-platform-tests [css-nesting] Move towards syntax proposal 3. Remove the demand to have @nest, and really all traces of it; everything that's not an ident or at-rule will now start parsing a selector. We support both implicit insertion of descendant selectors, and parsing of relative nested selectors. These should be serialized correctly. Declarations are not explicitly allowed after rules (but rules are always counted as after declarations), so we add some simple WPT tests to that effect. There are new error handling rules in [css-syntax-3], which we follow. Specifically, semicolons abort parsing of qualified rules within nesting context, to maintain that we only skip to the next semicolon and no further when we hit random junk within a rule (like before). Change-Id: I097c4bb8fb1a93222820d84510057224173a83bc Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3987945 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Commit-Queue: Steinar H Gunderson <sesse@chromium.org> Cr-Commit-Position: refs/heads/main@{#1065492} -- wpt-commits: b0c95fefa6f5f89c9374dfc736e762d8a4fbb8de wpt-pr: 36692
33 lines
701 B
HTML
33 lines
701 B
HTML
<!DOCTYPE html>
|
|
<title>Properties in nested conditional rules</title>
|
|
<link rel="author" title="Adam Argyle" href="mailto:argyle@google.com">
|
|
<link rel="help" href="https://drafts.csswg.org/css-nesting-1/">
|
|
<style>
|
|
.test {
|
|
background-color: red;
|
|
width: 100px;
|
|
height: 100px;
|
|
display: grid;
|
|
}
|
|
|
|
@media (min-width: 50px) {
|
|
.test-5 > div {
|
|
background-color: green;
|
|
}
|
|
}
|
|
|
|
@supports (display: grid) {
|
|
.test-10 {
|
|
background-color: green;
|
|
}
|
|
}
|
|
|
|
body * + * {
|
|
margin-top: 8px;
|
|
}
|
|
</style>
|
|
<body>
|
|
<p>Tests pass if <strong>block is green</strong></p>
|
|
<div class="test test-5"><div></div></div>
|
|
<div class="test test-10"><div></div></div>
|
|
</body>
|