Unfortunately, it's not so simple when you deal with legacy conventions. And DOM Events have a lot of history behind them.
Here's how type attribute of Event is defined in DOM2 Events specification:
Interface Event (introduced in DOM Level 2)
type (of type DOMString, readonly)The name of the event (case-insensitive). The name must be an XML name.
The reasoning behind this, I suppose, is explained by this paragraph in the same doc:
In HTML 4.0, event listeners were specified as attributes of an element.[...] In order to achieve compatibility with HTML 4.0, implementors may view the setting of attributes which represent event handlers as the creation and registration of an EventListener on the EventTarget.
Now, while the stance has changed in DOM3 (where event names are case-sensitive), the original approach is, I suppose, ofter considered to be the safest bet - so one won't have to depend on user agents' correctness (check this discussion and this funny issue as examples).
Note that W3C itself has registered a whole slew of PascalCased events in DOM2 (all the MutationEvents, DOMActivate
, DOMFocusIn
and DOMFocusOut
).