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)
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.
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.
Confirmed as a regression with r20057.
<rdar://problem/5061024>
Committed revision 20453.
We no longer dispatch keypress event for tab, arrow keys etc., so this fix has been effectively undone.