Re: Units of time in Web Animations [was: Intent to Ship: Element.animate]

On 4/16/14 8:42 PM, Brian Birtles wrote:
> I thought we could possibly make the TimingInput dictionary's 'duration'
> member be a union type "(DOMString or double)" but they're not
> distinguishable right?

They didn't use to be, but now they are.  See the table at 
http://heycam.github.io/webidl/#dfn-distinguishable

In terms of processing model for this case, if the value is a Number, 
the numeric type is picked.  Otherwise the value is coerced to a string 
and DOMString is picked.

So you could do this.

Of course long term value types in ES will be the solution here, with 
the caller being able to pass in things like 2000ms as a value, not a 
string.  But that's pretty long term.

-Boris

Received on Thursday, 17 April 2014 02:36:44 UTC