Skip to content

Commit

Permalink
Disallow empty token stream inside if() function
Browse files Browse the repository at this point in the history
"if()" should be invalid parse time according to [0].

Move CSSInlineIfForStyleQueries flag to test.

Changed wpt tests using `if(){}` as non substitutable value.

[0] https://drafts.csswg.org/css-values-5/#if-notation

Bug: 346977961
Change-Id: I1112bc16f00043e6784213b0c00d19f0cc71dd20
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6197081
Commit-Queue: Munira Tursunova <[email protected]>
Reviewed-by: Anders Hartvoll Ruud <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1411577}
  • Loading branch information
tursunova authored and chromium-wpt-export-bot committed Jan 27, 2025
1 parent 3c653e4 commit 6269521
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions css/css-paint-api/registered-property-value-003.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
inherits: false
});

target.style.setProperty('--prop', 'if(){}');
target.style.setProperty('--prop', 'foo(){}');

expectWorkletValue(target, '--prop', '[CSSUnparsedValue if(){}]');
expectWorkletValue(target, '--prop', '[CSSUnparsedValue foo(){}]');
} catch(e) {
document.body.textContent = e;
takeScreenshot();
Expand Down
4 changes: 2 additions & 2 deletions css/css-properties-values-api/at-property.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
test_descriptor('initial-value', 'rgb(1, 2, 3)');
test_descriptor('initial-value', 'red');
test_descriptor('initial-value', 'foo');
test_descriptor('initial-value', 'if(){}');
test_descriptor('initial-value', 'foo(){}');

// initial-value: not computationally independent
test_descriptor('initial-value', '3em', null, {'syntax': '"<length>"'});
Expand Down Expand Up @@ -191,7 +191,7 @@
}

// syntax, initialValue, inherits, expected
test_applied('*', 'if(){}', false, 'if(){}');
test_applied('*', 'foo(){}', false, 'foo(){}');
test_applied('<angle>', '42deg', false, '42deg');
test_applied('<angle>', '1turn', false, '360deg');
test_applied('<color>', 'green', false, 'rgb(0, 128, 0)');
Expand Down

0 comments on commit 6269521

Please sign in to comment.