|Summary:||REGRESSION(r41760-41844): ESC Key does not fire document.onkeypress (affects Yahoo Mail)|
|Product:||WebKit||Reporter:||Joseph Pecoraro <email@example.com>|
|Component:||WebCore Misc.||Assignee:||Nobody <firstname.lastname@example.org>|
|Severity:||Major||CC:||email@example.com, firstname.lastname@example.org, email@example.com, firstname.lastname@example.org, email@example.com, firstname.lastname@example.org, email@example.com|
|Priority:||P1||Keywords:||InChromiumBugs, NeedsRadar, Regression|
|Version:||528+ (Nightly build)|
|OS:||Mac OS X 10.5|
Created an attachment (id=29418) [details] Test page to easily display keypress/down/up charcodes.
On Mac OS X: Safari 4 properly shows 27. Firefox 3.0.8 properly shows 27. Webkit Nightly does not show anything for ESC. On my Windows XP Virtual Machine: Chrome does not show anything for ESC. Firefox 2 properly shows 27.
Eek. Probably a duplicate of:  and  I must have overlooked those when I first searched.
Wow. This is not quite a duplicate - the old bugs were not regressions! The difference is about what target the handler is installed on.
*** Bug 25012 has been marked as a duplicate of this bug. ***
Note that this is only a regression on Mac - on Windows, we didn't fire this event in Safari 3.2.1 either. This was probably caused by <http://trac.webkit.org/projects/webkit/changeset/41793> and related changes to _interceptEditingKeyEvent. This method now correctly discovers that the keydown event was handled, preventing keypress dispatch.
Please fix this. It breaks detection of keyboard autorepeat for these keys, which works in Firefox, Opera and IE. This isn't a Mac-specific issue.
Could you please elaborate why detecting autorepeat for ESC matters, and how keypress helps with that? We should just implement KeyboardEvent.repeat attribute from DOM 3 Events spec (which obviously needs to be tracked in a different bug).
I forgot that keydown is fired on repeats--which doesn't make sense for the event name, but it gives a workaround here. I need to detect repeats on backspace, not escape, to detect changes to text input fields. But a correction: IE *doesn't* do this, which I'm guessing is the behavior WebKit's matching. Since there's no consistency here anyway, I guess fixing this won't really make much difference. (KeyboardEvent.repeat would be helpful, though unrelated--scripts having to track pressed keys manually is brittle.)