From 523c40321b9d8f73d3d166f5e981826193225d5b Mon Sep 17 00:00:00 2001 From: Brian Birtles Date: Thu, 9 Aug 2018 13:11:27 +0900 Subject: [PATCH] [web-animations] Use 'auto' for unspecified keyframe-specific composite operations This fixes #3000. --- web-animations-1/Overview.bs | 87 +++++++++++++++++++++--------------- 1 file changed, 52 insertions(+), 35 deletions(-) diff --git a/web-animations-1/Overview.bs b/web-animations-1/Overview.bs index 66ad8e3064e..09a110002a7 100644 --- a/web-animations-1/Overview.bs +++ b/web-animations-1/Overview.bs @@ -3269,13 +3269,13 @@ The timing function specified on the last keyframe in the list is never applied. Each keyframe may have a keyframe-specific composite -operation that, if not null, is applied to all values -specified in that keyframe. +operation that, if set, is applied to all values specified in that +keyframe. The possible operations and their meanings are identical to those defined for the composite operation associated with the keyframe effect as a whole in [[#effect-composition]]. If the keyframe-specific composite operation for a keyframe -is null, the composite operation specified for the +is not set, the composite operation specified for the keyframe effect as a whole is used for values specified in that keyframe.

Calculating computed keyframes

@@ -4669,10 +4669,10 @@ interface KeyframeEffect : AnimationEffect { dictionary ComputedKeyframe { // ... property-value pairs ... // i.e. DOMString propertyName - double? offset = null; - double computedOffset; - DOMString easing = "linear"; - CompositeOperation? composite = null; + double? offset = null; + double computedOffset; + DOMString easing = "linear"; + CompositeOperationOrAuto composite = "auto"; }; @@ -4701,8 +4701,9 @@ interface KeyframeEffect : AnimationEffect { :: The keyframe-specific composite operation used to combine the values specified in this keyframe with the underlying value. - This member will be null if the composite - operation specified on the keyframe effect is being used. + This member will be {{CompositeOperationOrAuto/auto}} if the + composite operation specified on the keyframe effect is + being used. @@ -4722,10 +4723,10 @@ interface KeyframeEffect : AnimationEffect {
              dictionary BaseComputedKeyframe {
-                 double?             offset = null;
-                 double              computedOffset;
-                 DOMString           easing = "linear";
-                 CompositeOperation? composite = null;
+                 double?                  offset = null;
+                 double                   computedOffset;
+                 DOMString                easing = "linear";
+                 CompositeOperationOrAuto composite = "auto";
             };
             
@@ -4999,9 +5000,9 @@ WebIDL-like definition: dictionary Keyframe { // ... property-value pairs ... // i.e. DOMString propertyName - double? offset = null; - DOMString easing = "linear"; - CompositeOperation? composite = null; + double? offset = null; + DOMString easing = "linear"; + CompositeOperationOrAuto composite = "auto"; }; dictionary PropertyIndexedKeyframes { @@ -5009,7 +5010,7 @@ dictionary PropertyIndexedKeyframes { // i.e. (DOMString or sequence&lt;DOMString&gt;) propertyName (double? or sequence<double?>) offset = []; (DOMString or sequence<DOMString>) easing = []; - (CompositeOperation? or sequence<CompositeOperation?>) composite = []; + (CompositeOperationOrAuto or sequence<CompositeOperationOrAuto>) composite = []; }; typedef (sequence<Keyframe> or PropertyIndexedKeyframes) KeyframeArgument; @@ -5042,8 +5043,8 @@ The meaning and allowed values of each argument is as follows: :: The keyframe-specific composite operation used to combine the values specified in this keyframe with the underlying value. - If null, the composite operation specified on the - keyframe effect will be used. + If {{CompositeOperationOrAuto/auto}}, the composite operation + specified on the keyframe effect will be used. Since this type cannot be expressed in WebIDL, its processing is defined in @@ -5096,7 +5097,7 @@ otherwise, using the following procedure: dictionary BasePropertyIndexedKeyframe { (double? or sequence<double?>) offset = []; (DOMString or sequence<DOMString>) easing = []; - (CompositeOperation? or sequence<CompositeOperation?>) composite = []; + (CompositeOperationOrAuto or sequence<CompositeOperationOrAuto>) composite = []; }; @@ -5105,9 +5106,9 @@ otherwise, using the following procedure:
         dictionary BaseKeyframe {
-            double?             offset = null;
-            DOMString           easing = "linear";
-            CompositeOperation? composite = null;
+            double?                  offset = null;
+            DOMString                easing = "linear";
+            CompositeOperationOrAuto composite = "auto";
         };
         
@@ -5330,11 +5331,11 @@ keyframes using the following procedure: 1. If the “composite” member of the property-indexed keyframe is not an empty sequence: - 1. Let composite modes be a sequence of nullable - composite operations assigned from the + 1. Let composite modes be a sequence of + {{CompositeOperationOrAuto}} values assigned from the “composite” member of property-indexed keyframe. - If that member is a single nullable composite + If that member is a single {{CompositeOperationOrAuto}} value operation, let composite modes be a sequence of length one, with the value of the “composite” as its single item. @@ -5345,7 +5346,8 @@ keyframes using the following procedure: from the beginning of the list until composite modes has as many items as processed keyframes. - 1. Assign each non-null value in composite modes to the + 1. Assign each value in composite modes that is not + {{CompositeOperationOrAuto/auto}} to the keyframe-specific composite operation on the keyframe with the corresponding position in processed keyframes until the end of processed @@ -5435,7 +5437,8 @@ dictionary KeyframeEffectOptions : EffectTiming { animation with the effect stack, as specified by one of the CompositeOperation enumeration values. This is used for all keyframes that specify - a null keyframe-specific composite operation. + a {{CompositeOperationOrAuto/auto}} keyframe-specific composite + operation. @@ -5462,9 +5465,9 @@ enum IterationCompositeOperation {"replace", "accumulate"}; subsequent iterations of an animation effect build on the final value of the previous iteration. -

The CompositeOperation enumeration

+

The CompositeOperation and CompositeOperationOrAuto enumerations

-The possible values of an animation effect's +The possible values of an keyframe effect's composition behavior are represented by the CompositeOperation enumeration. @@ -5472,14 +5475,14 @@ composition behavior are represented by the enum CompositeOperation {"replace", "add", "accumulate"}; -: replace +: replace :: Corresponds to the replace composite operation value such that the animation effect overrides the underlying value it is combined with. -: add +: add :: Corresponds to the add composite operation value such that @@ -5487,7 +5490,7 @@ enum CompositeOperation {"replace", "add", "accumulate"}; lt="animation addition">added to the underlying value with which it is combined. -: accumulate +: accumulate :: Corresponds to the accumulate composite operation value such that @@ -5495,6 +5498,18 @@ enum CompositeOperation {"replace", "add", "accumulate"}; lt="animation accumulation">accumulated on to the underlying value. +The possible values of a [=keyframe=]'s composition behavior share the same +values as the {{CompositeOperation}} enumeration along with the additional +{{CompositeOperationOrAuto/auto}} value. + +
+enum CompositeOperationOrAuto {"replace", "add", "accumulate", "auto"};
+
+ +: auto +:: Indicates that the [=composite operation=] of the associated [=keyframe + effect=] should be used. +

The Animatable interface mixin

Objects that may be the target of an {{KeyframeEffect}} object implement @@ -5972,8 +5987,8 @@ The following changes have been made since the process a keyframes argument to allow specifying offset, composite and multiple - easing values including allowing null values for - composite. + easing values including allowing + {{CompositeOperationOrAuto/auto}} values for composite. * Changed the type of the {{KeyframeEffect/KeyframeEffect(target, keyframes, options)/target}} argument to the {{KeyframeEffect}} and @@ -5981,6 +5996,8 @@ The following changes have been made since the Animatable? to (Element or CSSPseudoElement)? (#186). +* Made unspecified [=composite operations=] on [=keyframes=] be represented by + {{CompositeOperationOrAuto/auto}} values. * Dropped the SharedKeyframeList interface. * Converted {{Animatable}} from a [NoInterfaceObject] interface to an [=interface mixin=].