Bug 13020

Summary: REGRESSION: Returning false from onkeypress event on Input is ignored when key is Tab
Product: WebKit Reporter: Elliott Sprehn <esprehn>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: adele, ap
Priority: P1 Keywords: InRadar, Regression
Version: 523.x (Safari 3)   
Hardware: Mac   
OS: OS X 10.4   
URL: http://enfinitystudios.thaposse.net/
Attachments:
Description Flags
Test Case none

Description Elliott Sprehn 2007-03-08 23:06:46 PST
An onkeypress event handler for an input element which returns false to abort the key press will be ignored when the key that was pressed was Tab. The return value of false is obeyed when the key is not the Tab key.

However, If the onkeydown event is used instead the return value of false will be obeyed for Tab.

This new behavior is consistent with IE, however it is inconsistent with Gecko and previous versions of Safari.

Reproducible in latest nightly: (Fri Mar 9 6:30:40 GMT 2007)
Comment 1 Elliott Sprehn 2007-03-08 23:18:45 PST
Created attachment 13554 [details]
Test Case

In this test case pressing tab in both inputs should do nothing as per previous Safari behavior. However in the input where the event handler was attached with onkeypress the return value of false is ignored and the focus jumps off the input to the Back button in the browser.
Comment 2 Elliott Sprehn 2007-03-08 23:20:40 PST
It should also be noted that Gecko allows aborting Tab key presses with onkeypress, but *not* with onkeydown, which is the exact opposite of this bug.
Comment 3 Alexey Proskuryakov 2007-03-09 09:20:36 PST
Confirmed as a regression with r20057.
Comment 4 Mark Rowe (bdash) 2007-03-13 16:22:00 PDT
<rdar://problem/5061024>
Comment 5 Adele Peterson 2007-03-23 14:25:51 PDT
Committed revision 20453.
Comment 6 Alexey Proskuryakov 2008-01-21 04:47:22 PST
We no longer dispatch keypress event for tab, arrow keys etc., so this fix has been effectively undone.