Bug 28184 - keypress event not fired for DELETE key
Summary: keypress event not fired for DELETE key
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-11 12:49 PDT by Matt Gaddis
Modified: 2009-08-17 09:56 PDT (History)
1 user (show)

See Also:


Attachments
test case html file (1.79 KB, text/html)
2009-08-11 12:49 PDT, Matt Gaddis
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Gaddis 2009-08-11 12:49:22 PDT
Created attachment 34583 [details]
test case html file

The scenario:
Event listeners are attached to the document for keydown, keypress, and keyup events. In the attached file, input_document.html, watch the console for evidence of the events fired from inside an text input.

When "1"  is pressed:
onkeydown charCode = 0
onkeypress charCode = 49 
onkeyup charCode = 0

When DELETE is pressed:
onkeydown charCode = 0
onkeyup charCode = 0 
(note the missing onkeypress)

Other observations:
This behavior does not change when the listeners are attached to the text input.
Safari 3 reports all three events: onkeydown, onkeypress, onkeyup when the DELETE key is pressed.
Comment 1 Alexey Proskuryakov 2009-08-11 22:26:16 PDT
I don't think keypress is supposed to be dispatched for Delete. Does this work in Internet Explorer?
Comment 2 Matt Gaddis 2009-08-17 09:33:59 PDT
Firefox does respond with the 3 events for a DELETE key press.
Opera does respond with the 3 events for a DELETE key press.
IE responds with 2 events (keydown and keyup) for a DELETE key press.
Comment 3 Alexey Proskuryakov 2009-08-17 09:56:28 PDT
Thank you for the additional info.

For keyboard event dispatch, our intention is to match IE behavior as closely as possible.