Skip to content

Commit

Permalink
[css-values-4] Add some text clarifying how 'contexts' inherit into c…
Browse files Browse the repository at this point in the history
…alculations.
  • Loading branch information
tabatkins committed Oct 7, 2024
1 parent 15cabaf commit 552bf9e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions css-values-4/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -4329,6 +4329,22 @@ Type Checking</h3>
and to make division-by-zero detectable at parse time.
This version now relaxes those restrictions.

[=Calculations=] are evaluated in terms of some "context",
depending on where they are placed,
which determines how units are resolved,
how percentages are treated,
etc.
By default, this context is defined by the property/descriptor/etc
that the calculation is being used in.
Functions can define a different context
for their contained values.
(For example, ''media-progress()'' evaluates its [=calculations=]
in the context of the [=media feature=] it mentions.)
Directly nested [=math functions=]
(forming a larger [=calculation tree=])
always use the context of their top-most [=math function=],
so the entire [=calculation tree=] is consistent.

<div algorithm>
To <dfn>determine the type of a [=calculation=]</dfn>:

Expand Down

0 comments on commit 552bf9e

Please sign in to comment.