[Web MIDI API] send(…, DOMHighResTimeStamp? timestamp)

For send()'s second argument, the spec says that it takes DOMHighResTimeStamp… however, "DOMHighResTimeStamp" isn't a "real data type" (in that there is no way to actually force a type check on it in some meaningful way AFAICT).  Hence, it's actually just a double that is relative to some start time. This is confirmed in [1]:

typedef double DOMHighResTimeStamp;

To avoid confusion during implementation, I would suggest changing the value data type of the second argument of the send() method to a double.   

optional double timestamp;

Also, why is the second argument nullable when it's already optional?  

Note that the current text in the spec is redundant because WebIDL already handles the type checking. Please remove " or if timestamp is passed but is not a valid DOMHighResTimeStamp, throw a TYPE_ERROR exception".  


[1] http://www.w3.org/TR/2012/REC-hr-time-20121217/#domhighrestimestamp

--  
Marcos Caceres
http://datadriven.com.au

Received on Monday, 24 December 2012 01:31:02 UTC