Skip to content

Commit 2959b23

Browse files
committed
[css-values-4] Generalize the min()/max() serialization algo to apply to all non-calc() math functions.
1 parent 355cdea commit 2959b23

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

css-values-4/Overview.bs

+10-8
Original file line numberDiff line numberDiff line change
@@ -3185,7 +3185,7 @@ Serialization</h3>
31853185
<div algorithm="serialize a calc() value">
31863186
To <dfn export>serialize a ''calc()'' value</dfn>
31873187

3188-
1. [=Simplify the expression=] inside of it.
3188+
1. [=Simplify the calculation=] inside of it.
31893189

31903190
2. If this simplification process results in only a single value
31913191
(one <<number>>, one <<dimension>>, or one <<percentage>>),
@@ -3203,12 +3203,14 @@ Serialization</h3>
32033203
</div>
32043204

32053205
<div algorithm="serialize a min()/max() value">
3206-
To <dfn export lt="serialize a min() value|serialize a max() value">serialize a ''min()'' or ''max()'' value</dfn>:
3206+
To <dfn export lt="serialize a non-calc() math function">serialize a non-''calc()'' [=math function=]</dfn>:
32073207

3208-
1. For each comma-separated expression inside of it,
3209-
[=simplify the expression=].
3208+
1. For each comma-separated [=calculation=] inside of the [=math function=],
3209+
[=simplify the calculation=].
32103210

3211-
2. Let |s| initially be "min(" or "max(", as appropriate.
3211+
2. Let |s| initially be the name of the [=math function=],
3212+
followed by "(".
3213+
(E.g. "min(", "sin(", etc.)
32123214

32133215
3. [=serialize the summation|Serialize each summation=],
32143216
then join them into a single string,
@@ -3219,13 +3221,13 @@ Serialization</h3>
32193221
then return it.
32203222
</div>
32213223

3222-
<div algorithm="simplify an expression">
3223-
To <dfn export lt="simplify an expression | simplify the expression" for="math function">simplify an expression</dfn>:
3224+
<div algorithm="simplify a calculation">
3225+
To <dfn export lt="simplify a calculation | simplify the calculation" for="math function">simplify a calculation</dfn>:
32243226

32253227
1. Replace any ''calc()'' values with parentheses containing their contents.
32263228
2. Resolve all multiplications and divisions.
32273229
3. Combine identical units.
3228-
4. Recurse into ''min()'' or ''max()'' values.
3230+
4. Recurse into remaining [=math functions=].
32293231
5. Return the result.
32303232

32313233
Note: The value-computation process can transform disparate units into identical ones.

0 commit comments

Comments
 (0)