Skip to content

Commit 6084ade

Browse files
tursunovachromium-wpt-export-bot
authored andcommitted
if() boolean-expr of style() and media() queries parsing support
Supported if syntax now: <if()> = if( [ <if-condition> : <declaration-value>? ; ]* <if-condition> : <declaration-value>? ;? ) <if-condition> = <boolean-expr[ <if-test> ]> | else <if-test> = media( <media-query> ) | style( <style-query> ) Spec: https://drafts.csswg.org/css-values-5/#if-notation Bug: 346977961 Change-Id: Iabdb7b3331600259cecd76eb409e8c48d750d538 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6289526 Commit-Queue: Munira Tursunova <moonira@google.com> Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org> Cr-Commit-Position: refs/heads/main@{#1423173}
1 parent 5b42b1c commit 6084ade

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

css/css-values/if-style-query.html

+11-3
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,14 @@
185185
test_if(`if(style(--x):a)if(style(--x):b)`,
186186
[['--x', '3']],
187187
'a/**/b');
188+
test_if(`if(style(--x!): true_value;
189+
else: false_value)`,
190+
[['--x', '3']],
191+
'false_value');
192+
test_if(`if(style(color: green): true_value;
193+
else: false_value)`,
194+
[],
195+
'false_value');
188196

189197
// Valid if() with multiple conditions with unregistered custom properties
190198
test_if(`if(style(--non-existent): value1;
@@ -491,13 +499,13 @@
491499
else: false_value)`,
492500
[['--x', '3']],
493501
'');
494-
test_if(`if(style(--x!): true_value;
502+
test_if(`if(style(--x) and invalid: true_value;
495503
else: false_value)`,
496504
[['--x', '3']],
497505
'');
498-
test_if(`if(style(color: green): true_value;
506+
test_if(`if(invalid or style(--x): true_value;
499507
else: false_value)`,
500-
[],
508+
[['--x', '3']],
501509
'');
502510
test_if(`if(style(not (--x: 5) or (--z: 10px)): true_value;
503511
else: false_value;)`,

0 commit comments

Comments
 (0)