Skip to content

Commit e5a508a

Browse files
committed
[css-values-4] Re-add text defining the clamping of interpolation results. Fixes w3c#6097
1 parent f3b9982 commit e5a508a

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

css-values-4/Overview.bs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,26 @@ Combining Values: Interpolation, Addition, and Accumulation</h2>
448448
If a value type does not define a specific procedure for <a>accumulation</a>,
449449
its <a>accumulation</a> operation is identical to <a>addition</a>.
450450

451+
<h3 id="combining-range">
452+
Range Checking</h3>
453+
454+
Interpolation can result in a value outside the valid range for a property,
455+
even if all of the inputs to interpolation are valid;
456+
this especially happens when |p| is outside the [0, 1] range,
457+
but some [=easing functions=] can cause this to occur even within that range.
458+
If the final result
459+
<em>after</em> interpolation, addition, and accumulation
460+
is out-of-range for the target context the value is being used in,
461+
it does not cause the declaration to be invalid.
462+
Instead, the value must be clamped to the range allowed in the target context,
463+
exactly the same as [=math functions=]
464+
(see [[#calc-range]]).
465+
466+
Note: Even if interpolation results in an out-of-range value,
467+
addition/accumulation might "correct" the result and bring it back into range.
468+
Thus, clamping is only applied to the <em>final</em> result
469+
of applying all interpolation-related operations.
470+
451471
<h2 id="textual-values">
452472
Textual Data Types</h2>
453473

0 commit comments

Comments
 (0)