User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:16.0) Gecko/20100101 Firefox/16.0 Build ID: 20120911232325 Steps to reproduce: 1. Click the button with your mouse 2. Press the spacebar Actual results: On Linux: 1. Click is fired on the element 2. Keydown is fired on the document 3. Click is fired on the element Expected results: On every other OS and any browser: 1. Click is fired on the element 2. Keydown is fired on the document
OS: Mac OS X → Linux
Status: UNCONFIRMED → NEW
Component: Untriaged → DOM: Events
Ever confirmed: true
Product: Firefox → Core
does this occur in all distros? which ones have you tested?
We have tested Ubuntu so far (last release), I'm going to check other distros when I get a chance.
On Gecko NS_VK_SPACE has traditionally fired click after keyup. NS_VK_RETURN causes click after keypress.
IIRC the behavior is from old Netscape times. http://mxr.mozilla.org/mozilla-central/source/content/html/content/src/nsHTMLButtonElement.cpp#339
I guess this old behavior can be just taken out then?
After discussing this with Olli on IRC we came to the conclusion that this is an expected behavior and that the focus logic is platform dependent. Webapps/sites can prevent the default behavior if they want to achieve a consistent experience across platforms. I guess we can close this. Cheers!
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → INVALID
Still investigating if we could change the behavior.
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
This is now over a year old, was any decision taken?
Any chance to have a testcase which shows where the key event actually is dispatched, in other browsers. Gecko dispatches it to the button if the focus is there.
You need to log in before you can comment on or make changes to this bug.