Bug 8150 - Click is registered only if mouse pointer is fully stationary while mouse button is down (except for link and button)
Summary: Click is registered only if mouse pointer is fully stationary while mouse but...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-03 00:15 PDT by Aapo Laitinen
Modified: 2023-10-21 03:30 PDT (History)
4 users (show)

See Also:


Attachments
Test case (1.42 KB, text/html)
2006-04-03 00:15 PDT, Aapo Laitinen
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aapo Laitinen 2006-04-03 00:15:21 PDT
The click event handler attached to an element such as a table cell or a paragraph will fire only if the mouse pointer remains perfectly stationary while the mouse button is held down. However, click event handlers attached to links and buttons are fired even if the mouse moves a bit while the button is down.

It is very easy to move the mouse a couple of pixels while clicking. Not having any allowance at all makes Safari seem unresponsive. All elements should have at least some degree of allowance in regards to detecting clicks. For consistency, it might be best if they were very liberal in this regard, like buttons.

Strictly speaking the current behaviour is according to the standards:

"A click is defined as a mousedown and mouseup over the same screen location."
http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-eventgroupings-mouseevents

However, it is clear that being overly strict here is bad for usability and accessibility, not to mention inconsistent. Mozilla and Opera have thus chosen ignore this bit. The workaround is to simulate the click event with mousedown and mouseup.

Tested in nightly that was downloaded on 2006-04-03. Attaching a test case.
Comment 1 Aapo Laitinen 2006-04-03 00:15:57 PDT
Created attachment 7480 [details]
Test case
Comment 2 Alexey Proskuryakov 2006-05-03 06:29:31 PDT
Yes, onclick is called in Mozilla an WinIE as long as mousedown and mouseup are in the same object, regardless of how much the mouse pointer has moved. Of course, they don't agree on what to do with drag&drop or when the two objects have parent-child relationship.
Comment 3 Darin Adler 2007-01-26 09:35:29 PST
The patch for bug 12133 resolved part of this problem. We should make a layout test so it doesn't regress, and fix the third case cited in this bug too.
Comment 4 Ahmad Saleem 2023-10-21 03:30:24 PDT
I am able to click all three and also few pixels away before releasing mouse.

@Alexey - Is it reproducible to you? CCing - Abrar as well, since he is recently doing lot of work on event handling.