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


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):

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 on the CC list for the bug.

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