Skip to content

Commit 552bf9e

Browse files
committed
[css-values-4] Add some text clarifying how 'contexts' inherit into calculations.
1 parent 15cabaf commit 552bf9e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

css-values-4/Overview.bs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4329,6 +4329,22 @@ Type Checking</h3>
43294329
and to make division-by-zero detectable at parse time.
43304330
This version now relaxes those restrictions.
43314331

4332+
[=Calculations=] are evaluated in terms of some "context",
4333+
depending on where they are placed,
4334+
which determines how units are resolved,
4335+
how percentages are treated,
4336+
etc.
4337+
By default, this context is defined by the property/descriptor/etc
4338+
that the calculation is being used in.
4339+
Functions can define a different context
4340+
for their contained values.
4341+
(For example, ''media-progress()'' evaluates its [=calculations=]
4342+
in the context of the [=media feature=] it mentions.)
4343+
Directly nested [=math functions=]
4344+
(forming a larger [=calculation tree=])
4345+
always use the context of their top-most [=math function=],
4346+
so the entire [=calculation tree=] is consistent.
4347+
43324348
<div algorithm>
43334349
To <dfn>determine the type of a [=calculation=]</dfn>:
43344350

0 commit comments

Comments
 (0)