[Bug 19936] consider allowing non-matching enums to be converted to a particular value

https://www.w3.org/Bugs/Public/show_bug.cgi?id=19936

Jan-Ivar Bruaroey [:jib] <jib@mozilla.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jib@mozilla.com

--- Comment #5 from Jan-Ivar Bruaroey [:jib] <jib@mozilla.com> ---
This would be useful for getUserMedia constraints, which has a WebIDL-compliant
proposal on the table (full webidl is at the bottom):
http://lists.w3.org/Archives/Public/public-media-capture/2014Apr/0002.html

In short, clients may specify both required and non-required constraints. E.g.
{ video: { facingMode:'left' } } is a non-required that the UA may ignore.

Unfortunately, it becomes impossible to extend VideoFacingModeEnum with new
types later, such as 'up' and 'down', without causing getUserMedia() to throw
on old browsers because the "non-required" constraint wasn't recognized.

The workaround is to use DOMString and merely refer to the enums in a comment.

However, the syntax shown here looks promising and would have both
implementation benefits (we could keep our lovely binding code, which does a
lot of nice parsing for us and prevents us writing bugs), and documentation
benefits (the documentation is expressly clear about what's needed, both to
caller and implementer, and isn't reduced to prose by this largely backroom
compatibility concern).

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Tuesday, 8 April 2014 21:34:19 UTC