[web-animations] Please, clarify Keyframe.composite default value

Hi, everyone.

I'd like to attract your attention to attribute composite of Keyframe  
The procedure for handling Keyframe instances by KeyframeEffect  
constructor or
KeyframeEffect.setFrames() is quite complex and tricky.
So let's start from beginning.

Description for KeyframeEffect.setFrames() reads:

A Keyframe object or sequence of Keyframe objects used to replace the set  
of keyframes that make up this effect.

The processing of the frames parameter is defined in §5.17.1 Processing a  
sequence of Keyframe objects or a single item. Subsequently, the resulting  
sequence of Keyframe objects is normalized using the procedure in §5.17.3  
Normalizing a sequence of keyframes before storing.

§5.17.1 Processing a sequence of Keyframe objects or a single item  
reference to "procedure for converting an ECMAScript value to an IDL  
Keyframe object",
which reads:

Let keyframe result be a Keyframe object with the offset, easing and  
composite attributes set to the default dictionary values.
If property is a case-sensitive match for the string "composite",

Set the composite member of keyframe result to the result applying the  
procedure for converting an ECMAScript value to an IDL enumeration type  
[WEBIDL] withCompositeOperation as the enumeration type, to the result of  
calling the [[Get]] internal method on keyframe input with property name  

The default value for 'composite' attribute is specified as null (  
http://w3c.github.io/web-animations/#dictdef-keyframe )
However if keyframe input contains attribute 'composite' with the value  
null, the procedure for converting an ECMAScript value to an IDL  
enumeration type [WEBIDL]
will throw TypeError, because null does not belong to  CompositeOperation   

I think this is confusing. If I execute the following code:
> new KeyframeEffect({}).getFrames(); // produces [{offset: null, easing:  
> 'linear', composite: null, computedOffset: 0}]
I might think that null is valid value for composite attribute.
However, the following code will throw TypeError
> new KeyframeEffect({composite: null});
Next, the description of Keyframe.composite reads:

> The composite operation used to combine the values specified in this  
> keyframe with the underlying value.

> If null, the composite operation specified on the AnimationEffect will  
> be used.
and the description  for KeyframeEffectOptions.composite reads:
> The composite operation used to composite this animation with the  
> animation stack, as specified by one of the CompositeOperation  
> enumeration values. This is used for all keyframes that do not specify a  
> composite operation.
So it is not clear how the null value of 'composite' attribute will be  
Also, please, clarify where the null value will be substituted by some  
default value (either from AnimationEffect or from KeyframeEffectOptions):
in the KeyframeEffect constructor or setFrames() method or the reader of  
composite attribute.


Написано в почтовом клиенте браузера Opera: http://www.opera.com/mail/

Received on Friday, 7 November 2014 11:14:49 UTC