W3C home > Mailing lists > Public > public-webapps-bugzilla@w3.org > November 2012

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

From: <bugzilla@jessica.w3.org>
Date: Tue, 13 Nov 2012 21:41:00 +0000
To: public-webapps-bugzilla@w3.org
Message-ID: <bug-19936-2532-vMuYGU1jJu@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=19936

Travis Leithead [MSFT] <travil@microsoft.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |travil@microsoft.com

--- Comment #4 from Travis Leithead [MSFT] <travil@microsoft.com> ---
I think this is a good idea--I was personally always a little turned off by the
throw-on-not-matched behavior of enums (though I understand the rationale for
that).

I'd propose a slight syntax change. Instead of:

enum CanvasContextName {
    "2d", "webgl", default = ""
};

the following seems more appropriate:
enum CanvasContextName {
    "2d", "webgl", "" = default
};

which would allow you to re-use enums for input elements:

enum InputTypeEnum {
    "text" = default,
    "file",
    "submit",
    "range",
    ...[etc.]
};

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
Received on Tuesday, 13 November 2012 21:41:03 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 13 November 2012 21:41:03 GMT