mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
LibWeb: Allow whitespace in not after a boolean-expr-group
This commit is contained in:
parent
32cfb4e7d8
commit
14dba82202
|
|
@ -220,6 +220,7 @@ OwnPtr<BooleanExpression> Parser::parse_boolean_expression(TokenStream<Component
|
|||
tokens.discard_whitespace();
|
||||
|
||||
if (auto child = parse_boolean_expression_group(tokens, result_for_general_enclosed, parse_test)) {
|
||||
tokens.discard_whitespace();
|
||||
transaction.commit();
|
||||
return BooleanNotExpression::create(child.release_nonnull());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
Harness status: OK
|
||||
|
||||
Found 16 tests
|
||||
|
||||
16 Pass
|
||||
Pass @supports ((a)) {}
|
||||
Pass @supports ((a) ) {}
|
||||
Pass @supports ( (a)) {}
|
||||
Pass @supports ( (a) ) {}
|
||||
Pass @supports (not (a)) {}
|
||||
Pass @supports (not (a) ) {}
|
||||
Pass @supports ( not (a)) {}
|
||||
Pass @supports ( not (a) ) {}
|
||||
Pass @supports ((a) and (b)) {}
|
||||
Pass @supports ((a) and (b) ) {}
|
||||
Pass @supports ( (a) and (b)) {}
|
||||
Pass @supports ( (a) and (b) ) {}
|
||||
Pass @supports ((a) or (b)) {}
|
||||
Pass @supports ((a) or (b) ) {}
|
||||
Pass @supports ( (a) or (b)) {}
|
||||
Pass @supports ( (a) or (b) ) {}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
<!DOCTYPE html>
|
||||
<title>Parsing of @supports with whitespace</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-conditional-3/#at-supports">
|
||||
<script src=../../resources/testharness.js></script>
|
||||
<script src=../../resources/testharnessreport.js></script>
|
||||
<main id=main></main>
|
||||
<script>
|
||||
let examples = [
|
||||
'@supports ((a)) {}',
|
||||
'@supports ((a) ) {}',
|
||||
'@supports ( (a)) {}',
|
||||
'@supports ( (a) ) {}',
|
||||
|
||||
'@supports (not (a)) {}',
|
||||
'@supports (not (a) ) {}',
|
||||
'@supports ( not (a)) {}',
|
||||
'@supports ( not (a) ) {}',
|
||||
|
||||
'@supports ((a) and (b)) {}',
|
||||
'@supports ((a) and (b) ) {}',
|
||||
'@supports ( (a) and (b)) {}',
|
||||
'@supports ( (a) and (b) ) {}',
|
||||
|
||||
'@supports ((a) or (b)) {}',
|
||||
'@supports ((a) or (b) ) {}',
|
||||
'@supports ( (a) or (b)) {}',
|
||||
'@supports ( (a) or (b) ) {}',
|
||||
];
|
||||
|
||||
for (let example of examples) {
|
||||
test((t) => {
|
||||
let style = document.createElement('style');
|
||||
t.add_cleanup(() => style.remove());
|
||||
style.textContent = example;
|
||||
main.append(style);
|
||||
assert_equals(style.sheet.rules.length, 1);
|
||||
}, example);
|
||||
}
|
||||
</script>
|
||||
Loading…
Reference in New Issue
Block a user