Skip to content

Commit 1a70cf7

Browse files
andruudchromium-wpt-export-bot
authored andcommitted
Consume whitespace after 'not <supports-in-parens>'
Fixes a bug where e.g. '@supports (not (a) )' would fail to parse. Fixed: 1330233 Change-Id: Ic9a2f58283e8e45859c75153309db12668f65af5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3688074 Commit-Queue: Anders Hartvoll Ruud <[email protected]> Reviewed-by: Kevin Babbitt <[email protected]> Cr-Commit-Position: refs/heads/main@{#1013641}
1 parent 29a7d56 commit 1a70cf7

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<!DOCTYPE html>
2+
<title>Parsing of @supports with whitespace</title>
3+
<link rel="help" href="https://drafts.csswg.org/css-conditional-3/#at-supports">
4+
<script src=/resources/testharness.js></script>
5+
<script src=/resources/testharnessreport.js></script>
6+
<main id=main></main>
7+
<script>
8+
let examples = [
9+
'@supports ((a)) {}',
10+
'@supports ((a) ) {}',
11+
'@supports ( (a)) {}',
12+
'@supports ( (a) ) {}',
13+
14+
'@supports (not (a)) {}',
15+
'@supports (not (a) ) {}',
16+
'@supports ( not (a)) {}',
17+
'@supports ( not (a) ) {}',
18+
19+
'@supports ((a) and (b)) {}',
20+
'@supports ((a) and (b) ) {}',
21+
'@supports ( (a) and (b)) {}',
22+
'@supports ( (a) and (b) ) {}',
23+
24+
'@supports ((a) or (b)) {}',
25+
'@supports ((a) or (b) ) {}',
26+
'@supports ( (a) or (b)) {}',
27+
'@supports ( (a) or (b) ) {}',
28+
];
29+
30+
for (let example of examples) {
31+
test((t) => {
32+
let style = document.createElement('style');
33+
t.add_cleanup(() => style.remove());
34+
style.textContent = example;
35+
main.append(style);
36+
assert_equals(style.sheet.rules.length, 1);
37+
}, example);
38+
}
39+
</script>

0 commit comments

Comments
 (0)