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:22.214.171.124) 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
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.
This is possibly the behavior we need to keep for backward compatibility. I'll bring this up on WebApps WG / DOM 3 Events.
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.
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.
Created attachment 449318 [details] [diff] [review] patch I pushed the patch to tryserver. If everything looks good there, I'll write the tests and ask reviews.
Created attachment 449341 [details] [diff] [review] with tests This may break something on the web, so would be great to get this in reasonable soon.
Oops, I need to remember to land this. Will do later today.
This was landed in: http://hg.mozilla.org/mozilla-central/rev/c9c2ad1bf872