Skip to content

Commit ef74bdd

Browse files
tursunovachromium-wpt-export-bot
authored andcommitted
Support evaluation of <boolean-expr[ style( <style-query> ) ]> queries
Note: Evaluation of media() queries is not supported yet, to be done in next CL. Bug: 346977961 Change-Id: I109120002fa8df8ad1e498d43ef5197abd0563a5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6291331 Reviewed-by: Anders Hartvoll Ruud <[email protected]> Commit-Queue: Munira Tursunova <[email protected]> Cr-Commit-Position: refs/heads/main@{#1423216}
1 parent b7a11de commit ef74bdd

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,30 @@
193193
else: false_value)`,
194194
[],
195195
'false_value');
196+
test_if(`if(not style(--non-existent): true_value;
197+
else: false_value)`,
198+
[],
199+
'true_value');
200+
test_if(`if(not style(--x: 0): true_value;
201+
else: false_value)`,
202+
[['--x', '3']],
203+
'true_value');
204+
test_if(`if(style(--x: 0) and style(--y: 3): true_value;
205+
else: false_value)`,
206+
[['--x', '3'], ['--y', '3']],
207+
'false_value');
208+
test_if(`if(style(--x: 3) and style(--y: 3): true_value;
209+
else: false_value)`,
210+
[['--x', '3'], ['--y', '3']],
211+
'true_value');
212+
test_if(`if(style(--x: 0) or style(--y: 3): true_value;
213+
else: false_value)`,
214+
[['--x', '3'], ['--y', '3']],
215+
'true_value');
216+
test_if(`if(style(--x: 0) or (style(--y: 3) and style(--z: 3)): true_value;
217+
else: false_value)`,
218+
[['--x', '3'], ['--y', '3'], ['--z', '3']],
219+
'true_value');
196220

197221
// Valid if() with multiple conditions with unregistered custom properties
198222
test_if(`if(style(--non-existent): value1;

0 commit comments

Comments
 (0)