Re: Processing model for the first argument of Animatable.animate is not well defined

On 4/17/14 2:04 AM, Brian Birtles wrote:
> I've updated the spec now starting at:
>
>    http://dev.w3.org/fxtf/web-animations/#processing-the-effect-parameter
>    (Not that named anchors really work with respec, but it's section 5.9.4)

Thanks, that helps.  Some more comments:

1) In section 5.9.1 step 4, it's not clear to me what it means for 
"effect" to be "an EffectCallback object".  Since EffectCallback isn't 
an interface, there is no such concept defined a priori....

What you probably want to test there is IsCallable.

Similarly, it's not clear to me what "effect is a Keyframe object or a 
sequence of Keyframe objects" means.  For example, Keyframe is a 
dictionary, which means it can be initialized with any object, so it 
doesn't make sense to talk about "a Keyframe object".

What you might want to do is test 
http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.isarray 
and if so treat as a sequence, else as a Keyframe.  And if WebIDL 
switches to sequence meaning iterable, we can loosen the restriction 
here to allow any iterable, not just an Array.

Or should this entire step simply be referencing section 5.9.4, perhaps? 
  It looks like most of these issues are not present there.

Also, a nit.  "Assign animation.effect to effect." probably means to say 
"Set animation.effect to effect."

2) It's not clear to me whether the text in the table in section 5.9.1 
is normative or informative.  If the former, it seems like it should 
just reference 5.9.4 instead of repeating it?  If the latter, that would 
be good to flag somewhere.

3) In section 5.14.4, the definition is OK for now, but once sequence in 
WebIDL means iterable we can just treat iterable as sequence here and 
otherwise treat the object as Keyframe.

4) In 5.9.4, "effect" can't be undefined, since it's already been passed 
through an "object?" argument, so it's an object or null.

5) In 5.9.4, I don't think we should throw if a platform object that 
doesn't implement AnimationEffect is passed in.  I would replace that 
step of the if/then cascade with just:  "If effect is a platform object 
that implements the AnimationEffect interface, return the IDL value that 
represents a reference to that platform object".

6) In 5.9.4, when converting to a callback function type, we should say 
which type we convert to (EffectCallback in this case).

7) We shouldn't special-case Date and RegExp objects here in the next to 
last step of 5.9.4; those are valid things to pass to a dictionary 
argument (not that anyone really ever will, but...).  This also means 
the last step can go away, since we'll always convert to a 
sequence-or-Keyframe.

Thanks again for dealing with this,
Boris

Received on Thursday, 17 April 2014 06:34:49 UTC