Re: getUserMedia WebIDL feedback

Le jeudi 07 juin 2012 à 11:26 -0400, Dan Burnett a écrit :
> > * rather than minting our own error object (NavigatorUserMediaError), it
> > is recommended to use instead DOMError; NotSupportedError is already a
> > well-defined DOMError type [2]; MANDATORY_UNSATIFIED_ERR isn't, but I'm
> > not sure we need a separate code; PERMISSION_DENIED might be replaced
> > with SecurityError (but that's probably worth checking with
> > www-dom@w3.org)
> 
> I am happy to use more appropriate error messages where they exist.
> It is *extremely* important to the constraint approach that an author
> can know when a mandatory constraint could not be satisfied.

Could you elaborate on that? 

> > * I'm not sure we need to report an error set of constraints that cannot
> > be satisfied (vs only when none of the possible options can be
> > satisfied)
> 
> For mandatory, we need to at least indicate that the mandatory
> constraints could not all be simultaneously satisfied.  I think it
> would be helpful to also receive, with that error message, at least
> one of the mandatory constraints that could not be satisfied.

If that is the case, then DOMError might not be the best approach; but
what's the use case behind reporting which constraint couldn't be
satisfied? (that leaks information, hence my asking)

> > 
> > * I think the type for MediaStreamConstraints member should be (boolean
> > or MediaTrackConstraints) [rather than DOMString, and instead of
> > including the dictionary keyword in the type]; the default values should
> > be set to false;
> 
> Actually, I had heard someone (I think it was Anant) say that use of
> enums and booleans was deprecated in favor of DOMString.  If that's
> not true, and we should use booleans, then I'm happy to do so.
> Anant?

I'm quite sure that enums and boolean are not deprecated :) What has
been deprecated is pseudo-enums using integer constants (in favor of
string based enums).


> > * the type for the 1st member of MediaTrackConstraints also includes a
> > buggy "dictionary" keyword; instead of a sequence<>, the second member
> > should use an array
> 
> You are probably right.  I will check this.  The WebIDL spec is not very clear on some of this.

Feel free to check, but I'm quite confident on this. FWIW, I wrote and
maintain the WebIDL checker, and maintain the underlying widlproc
parser, so I think I'm reasonably well aware of WebIDL and at least its
syntactic intricacies :)

Dom

Received on Thursday, 7 June 2012 15:36:46 UTC