Closed
Bug 556493
Opened 14 years ago
Closed 14 years ago
No click fired when mousedown on the text of an element and mouseup on empty area
Categories
(Core :: DOM: Events, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: janne.aukia, Assigned: smaug)
References
(Depends on 1 open bug)
Details
Attachments
(3 files)
546 bytes,
text/html
|
Details | |
892 bytes,
patch
|
Details | Diff | Splinter Review | |
3.67 KB,
patch
|
jst
:
review+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_1; fi-fi) AppleWebKit/531.9 (KHTML, like Gecko) Version/4.0.3 Safari/531.9 Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; fi; rv:1.9.2.2) Gecko/20100316 Firefox/3.6.2 A div with text, when you mouse down on the text and mouse up outside the text, no click event is fired, even though the event targets are the same for mousedown and mouseup. The same surprising behaviour happens in Safari as well. Reproducible: Always
Reporter | ||
Comment 1•14 years ago
|
||
Reporter | ||
Comment 2•14 years ago
|
||
This would seem to be related to: https://bugzilla.mozilla.org/show_bug.cgi?id=326851 . The difference is that no visible parent-child-relationship is needed, but the problem occurs with a div with text content as well.
Assignee | ||
Comment 3•14 years ago
|
||
This is possibly the behavior we need to keep for backward compatibility. I'll bring this up on WebApps WG / DOM 3 Events.
Assignee | ||
Comment 4•14 years ago
|
||
And the behavior doesn't seem too surprising. When text is clicked, user clicks actually a text node, and then releasing happens on the div element.
Reporter | ||
Comment 5•14 years ago
|
||
Thanks for the response! In practice, this problem shows up with, for example, links that have been styled like buttons by adding padding and background to them. When the user mousedowns on the link text but mouseups in the padded area, the event does not fire. For the user, the button feels like randomly working and not working, since even a small movement of the mouse while clicking the link might prevent the click event. Work around is to track the mousedown and up elements with javascript, but it is quite difficult. Or to just respond to mouseup event, with the risk of user accidentally mouseupping over a wrong button.
Assignee | ||
Comment 6•14 years ago
|
||
Ok, per current DOM 3 Events draft the click event should be fired. I'll change this and hopefully the change doesn't cause too many regressions.
Assignee: nobody → Olli.Pettay
Status: UNCONFIRMED → NEW
Ever confirmed: true
Reporter | ||
Comment 7•14 years ago
|
||
Great!
Assignee | ||
Comment 8•14 years ago
|
||
I pushed the patch to tryserver. If everything looks good there, I'll write the tests and ask reviews.
Assignee | ||
Comment 9•14 years ago
|
||
This may break something on the web, so would be great to get this in reasonable soon.
Attachment #449341 -
Flags: review?(jst)
Updated•14 years ago
|
Attachment #449341 -
Flags: review?(jst) → review+
Assignee | ||
Comment 10•14 years ago
|
||
Oops, I need to remember to land this. Will do later today.
Comment 11•14 years ago
|
||
This was landed in: http://hg.mozilla.org/mozilla-central/rev/c9c2ad1bf872
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•