W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2001

Event types and case sensitivity

From: David Flanagan <david@oreilly.com>
Date: Tue, 21 Aug 2001 16:26:14 -0700
Message-Id: <200108212326.QAA01456@oxymoron.oreilly.com>
To: www-dom@w3.org

In the DOM Level 2 Events spec, the description of the type property of
the Event interface says:

    The name of the event (case-insensitive). The name must be an XML name.

Since this is a read-only property, what I need to know is not just that
it is case-insensitive, but what capitalization the returned value
uses.  Is the value all lowercase, all uppercase, mixed case?  As it is,
I can't just use the value of the type property to compare to known
event types.  I must first convert that value to a known
capitalization.  In JavaScript, I'd use code like this:

   if (event.type.toLowerCase() == "mouseup") { ... }

Furthermore, this the only place in the Event spec that says anything
about case-insensitivity.  None of the descriptions of the type argument
to the various init...() methods say that the event type is case
insensitive, and most importantly, the EventTarget.addEventListener()
method does not say anything about the type argument being case
insensitive.  

Am I missing something here?  If the event type is really intended to be
case-insensitive, then I think the spec needs to be clarified in a
number of places.  Otherwise, if it is supposed to be case-sensitive,
then the Event.type description needs to be fixed.

     David Flanagan
Received on Tuesday, 21 August 2001 20:20:17 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:49 GMT