Bug 28184

Summary: keypress event not fired for DELETE key
Product: WebKit Reporter: Matt Gaddis <gaddis>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal CC: ap
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
Attachments:
Description Flags
test case html file none

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.