Skip to content

Commit 78d657b

Browse files
committed
[css-values-5] No reason for per-element to delay random() resolution. Clarify the resolution timing, tho.
1 parent 762eace commit 78d657b

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

css-values-5/Overview.bs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,12 +1093,22 @@ Generating a Random Numeric Value: the ''random()'' function</h3>
10931093
as lengths and angles are not the same type.
10941094
</div>
10951095

1096-
If ''per-element'' is not present in the <<random-caching-options>>,
1097-
a ''random()'' function can be [=simplify a calculation tree|simplified=]
1096+
A ''random()'' function can be [=simplify a calculation tree|simplified=]
10981097
as soon as its argument [=calculations=]
10991098
can be simplified to numeric values.
1100-
If ''per-element'' is specified in the <<random-caching-options>>,
1101-
the function cannot be simplified until [=used value=] time.
1099+
1100+
Note: This means that ''random()'' is <em>usually</em> resolved
1101+
by [=computed value=] time,
1102+
and thus will inherit as a static numeric value.
1103+
However, if the argument [=calculations=] aren't resolved
1104+
until [=used value=] time
1105+
(such as if they include <<percentage>> values
1106+
that require layout information to resolve),
1107+
[=inheritance=] will transfer the ''random()'' function itself.
1108+
(This is no different, however, to the behavior of the <<percentage>>s themselves,
1109+
which would inherit as <<percentage>>s
1110+
and thus might resolve to different values on the child elements.)
1111+
11021112

11031113
Issue: At least in theory it should be fine to use ''random()''
11041114
in non-property contexts,

0 commit comments

Comments
 (0)