Skip to content

Commit 7d818ff

Browse files
committed
Allow out of range math functions result in random fixed value
[the spec](https://drafts.csswg.org/css-values-4/#calc-range) states that "Parse-time range-checking of values is not performed within math functions, and therefore out-of-range values do not cause the declaration to become invalid". This means we should allow math functions that result in out of range results in <random-value-sharing> fixed values at parse time with the expectation that they will be clamped at compute time
1 parent 98685b7 commit 7d818ff

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

css/css-values/random-computed.tentative.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@
259259

260260
// Test unresolvable percentage values
261261
test_random_computed_value_has_fixed('translate', 'random(10%, 100%)', '10%', '100%');
262+
test_random_computed_value_has_fixed('translate', 'random(fixed random(1, 2), 10%, 100%)', '10%', '100%');
262263

263264
// Test random value sharing
264265
test(() => {

css/css-values/random-invalid.tentative.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
test_invalid_value('width', 'random(element-shared 1px, 2px)');
2323
test_invalid_value('width', 'random(1px, 2px, 1px, element-shared)');
2424
test_invalid_value('width', 'random(--foo --bar, 1px, 2px)');
25-
test_invalid_value('width', 'random(fixed random(1, 2), 1px, 2px)');
2625
test_invalid_value('width', 'random(fixed 0.5 element-shared, 1px, 2px)');
2726
test_invalid_value('width', 'random(fixed 0.5 auto, 1px, 2px)');
2827
test_invalid_value('width', 'random(fixed 0.5 --foo, 1px, 2px)');

0 commit comments

Comments
 (0)