Skip to content

Commit b3b5798

Browse files
committed
[css-values-5] Force the random base value to stay in the [0, 1) range.
1 parent 92bef11 commit b3b5798

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

css-values-5/Overview.bs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2115,6 +2115,12 @@ Generating a Random Numeric Value: the ''random()'' function</h3>
21152115
rather than allowing the UA to generate a [=random base value=]
21162116
and controlling how it's shared.
21172117

2118+
While ''1'' is technically allowed as a valid value
2119+
(because CSS grammars can only express closed ranges),
2120+
the [=random base value=] is clamped to the highest representable value
2121+
less than ''1'',
2122+
so [=random base values=] remain in the half-open range `[0, 1)`.
2123+
21182124
Note: While this <em>might</em> be useful for authors
21192125
to get predictable values while testing a page,
21202126
the reason it exists is to fix some corner cases in [=inheritance=]

0 commit comments

Comments
 (0)