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

(2014/04/17 11:36), Boris Zbarsky wrote:
> 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

I was mistakenly looking at TR. Good to know.

> 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.

Yes, that's the approach we ultimately want to go with. We'll add the 
union type in the short/medium-term if people ask for it.

Thanks Boris,

Brian

Received on Thursday, 17 April 2014 06:01:06 UTC