Bug 13368 - KeyboardEvent::initKeyboardEvent doesn't match the DOM Level 3 Events spec
: KeyboardEvent::initKeyboardEvent doesn't match the DOM Level 3 Events spec
Status: NEW
: WebKit
HTML DOM
: 523.x (Safari 3)
: Macintosh All
: P2 Normal
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2007-04-16 22:59 PST by
Modified: 2013-04-05 17:11 PST (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2007-04-16 22:59:14 PST
Our implementation of KeyboardEvent::initKeyboardEvent doesn't match the DOM Level 3 Events spec.

See the spec here:
http://www.w3.org/TR/DOM-Level-3-Events/events.html#Events-KeyboardEvents-Interfaces

See current implementation of the method here:
http://trac.webkit.org/projects/webkit/browser/trunk/WebCore/dom/KeyboardEvent.cpp?rev=19579#L66

Our implementation takes 5 booleans representing the state of the 5 modifier keys, while the spec defines the last argument of the method to be DOMString containing a space-separated list of modifier keys.
------- Comment #1 From 2007-04-16 23:09:54 PST -------
It looks like WebKit is implementing an old version of this method. http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/events.html#Events-KeyboardEvents-Interfaces contains a definition that matches WebKit's, and it looks like WebKit's method was checked in on 2003-10-20 (http://trac.webkit.org/projects/webkit/changeset/5226)
------- Comment #2 From 2007-04-17 12:08:54 PST -------
We should consider implementing this in a custom way so that both versions work.
------- Comment #3 From 2008-01-04 16:39:41 PST -------
Also, bug 16375 points out that events crated with initKeyboardEvent aren't very good because they will always have a keyCode of 0 and charCode of 0. So any code that looks at keyCode or charCode, including code inside the engine that responds to keyboard events and older legacy JavaScript code, won't work with these events.
------- Comment #4 From 2008-01-04 16:40:03 PST -------
Sorry, I meant bug 16735.