W3C home > Mailing lists > Public > public-pointer-events@w3.org > January to March 2015

Why isn't pointer-type an enum?

From: Rick Byers <rbyers@chromium.org>
Date: Mon, 9 Mar 2015 11:47:09 -0400
Message-ID: <CAFUtAY8eTD5xM+4oo_FQD1MjcW1xJ5PZ_mXoPqF-y77gJqa9QQ@mail.gmail.com>
To: "public-pointer-events@w3.org" <public-pointer-events@w3.org>
Cc: Mustaq Ahmed <mustaq@chromium.org>
I forget the discussion that went into changing pointerType from an 'int'
to a 'DOMString', but I don't think it pre-dated the addition of enumerations
to WebIDL <http://www.w3.org/TR/WebIDL/#idl-enums>, did it?  Why didn't we
use an enum?  Document.visibilityState
<http://www.w3.org/TR/page-visibility/#VisibilityState> is defined to be an
enum.

I wonder to what extent this matters in practice.  Obviously it's super
valuable for non-JS bindings, but I'm not sure how important those are in
practice.  Will JS extensions like asm.js be able to do additional
optimizations on enums they can't do on bare DOMStrings?

Again, I'm asking because of my InputDevice proposal
<https://docs.google.com/a/chromium.org/document/d/1WLadG2dn4vlCewOmUtUEoRsThiptC7Ox28CRmYUn8Uw/edit#>
.

Rick
Received on Monday, 9 March 2015 15:47:55 UTC

This archive was generated by hypermail 2.3.1 : Monday, 9 March 2015 15:47:55 UTC