Skip to content

Commit e2d7fe7

Browse files
committed
CompositeOperation relative and subtraction procedure
1 parent 2bd8165 commit e2d7fe7

File tree

2 files changed

+40
-6
lines changed

2 files changed

+40
-6
lines changed

css-values-4/Overview.bs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ Property Value Examples</h3>
354354
</div>
355355

356356
<h2 id="combining-values">
357-
Combining Values: Interpolation, Addition, and Accumulation</h2>
357+
Combining Values: Interpolation, Addition, Accumulation, and Subtraction</h2>
358358

359359
Some procedures, for example
360360
<a href="https://www.w3.org/TR/css-transitions/">transitions</a>
@@ -432,6 +432,25 @@ Combining Values: Interpolation, Addition, and Accumulation</h2>
432432
when <a>added</a> together would produce ''blur(2) blur(3)'',
433433
but when <a>accumulated</a> would produce ''blur(5)''.
434434
</div>
435+
436+
<dt><dfn id="subtraction" lt="value subtraction | subtraction procedure" local-lt="subtract | subtraction">subtraction</dfn>
437+
<dd>
438+
Given two property values
439+
<var>V<sub>a</sub></var> and <var>V<sub>B</sub></var>,
440+
returns the difference of the two properties,
441+
<var>V</var><sub>result</sub>.
442+
<var>V<sub>a</sub></var> represents
443+
the first term of the operation and
444+
<var>V<sub>B</sub></var> represents
445+
the second. This is performed as <a>accumulation</a>
446+
of the first term with the negated value of the second.
447+
448+
<div class="note">
449+
Note: Subtraction is used exclusively to produce
450+
<a lt="composite operation relative">relative</a>
451+
<a lt="effect value">effect values</a>.
452+
</div>
453+
435454
</dl>
436455

437456
These operations are only defined on <a>computed values</a>.

web-animations-1/Overview.bs

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3185,7 +3185,7 @@ in each property's property definition table:
31853185
<dt><dfn>by computed value</dfn>
31863186
<dd>
31873187
Corresponding individual components of the <a>computed values</a>
3188-
are combined (interpolated, added, or accumulated)
3188+
are combined (interpolated, added, accumulated, or subtracted)
31893189
using the indicated procedure for that value type
31903190
(see [[css-values-4#combining-values]]).
31913191
If the number of components or the types of corresponding components
@@ -3544,7 +3544,11 @@ given <var>iteration progress</var>, <var ignore=''>current iteration</var> and
35443544
<a>keyframe effect</a>.
35453545
1. Let <var>value to combine</var> be the property value of
35463546
<var>target property</var> specified on
3547-
<var>keyframe</var>.
3547+
<var>keyframe</var>, unless the <var>composite operation to use</var>
3548+
is <a lt="composite operation relative">relative</a> in
3549+
which it is the same property value <a
3550+
lt="value subtraction">subtracted</a>
3551+
from the last <a>keyframe</a> in the <a>keyframe effect</a> .
35483552
1. Replace the property value of <var>target property</var>
35493553
on <var>keyframe</var> with the result of combining
35503554
<var>underlying value</var> (<var>V</var><sub>a</sub>) and
@@ -3792,7 +3796,7 @@ The specific operation used to combine an <a>effect value</a> with an
37923796
<dfn>composite operation</dfn> of the <a>keyframe effect</a> that
37933797
produced the <a>effect value</a>.
37943798

3795-
This specification defines three <a>composite operations</a> as
3799+
This specification defines four <a>composite operations</a> as
37963800
follows:
37973801

37983802
: <dfn lt="composite operation replace">replace</dfn>
@@ -3814,6 +3818,8 @@ follows:
38143818
<a lt="value accumulation">accumulation operation</a> is
38153819
defined such that it is not commutative, the order of the operands
38163820
is <a>underlying value</a> followed by <a>effect value</a>.
3821+
: <dfn lt="composite operation relative">relative</dfn></dt>
3822+
:: The <a>effect value</a> is composited identically to <a>accumulate</a>.
38173823

38183824
### Applying the composited result ### {#applying-the-composited-result}
38193825

@@ -5804,7 +5810,7 @@ composition behavior are represented by the
58045810
<dfn>CompositeOperation</dfn> enumeration.
58055811

58065812
<pre class='idl'>
5807-
enum CompositeOperation { "replace", "add", "accumulate" };
5813+
enum CompositeOperation { "replace", "add", "accumulate", "relative" };
58085814
</pre>
58095815

58105816
: <dfn enum-value for="CompositeOperation,CompositeOperationOrAuto">replace</dfn>
@@ -5830,12 +5836,21 @@ enum CompositeOperation { "replace", "add", "accumulate" };
58305836
lt="value accumulation">accumulated</a> on to the
58315837
<a>underlying value</a>.
58325838

5839+
: <dfn enum-value for="CompositeOperation,CompositeOperationOrAuto">relative</dfn>
5840+
:: Corresponds to the <a
5841+
lt="composite operation relative">relative</a>
5842+
<a>composite operation</a> value such that
5843+
the <a>effect value</a> is calculated as described
5844+
in [[#the-effect-value-of-a-keyframe-animation-effect]]
5845+
and <a lt="value accumulation">accumulated</a> on to the
5846+
<a>underlying value</a>.
5847+
58335848
The possible values of a [=keyframe=]'s composition behavior share the same
58345849
values as the {{CompositeOperation}} enumeration along with the additional
58355850
{{CompositeOperationOrAuto/auto}} value.
58365851

58375852
<pre class='idl'>
5838-
enum CompositeOperationOrAuto { "replace", "add", "accumulate", "auto" };
5853+
enum CompositeOperationOrAuto { "replace", "add", "accumulate", "relative", "auto" };
58395854
</pre>
58405855

58415856
: <dfn enum-value for=CompositeOperationOrAuto>auto</dfn>

0 commit comments

Comments
 (0)