Closed Bug 761572 Opened 12 years ago Closed 12 years ago

click event not fired if element has been hidden by mouseup

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla16
Tracking Status
firefox15 + verified

People

(Reporter: clochix, Assigned: roc)

References

Details

(Keywords: css2, regression)

Attachments

(2 files)

Attached file Test case
I have an element with 2 event listeners:
* on mouseup, I hide the element with "display: none";
* on click, I trigger an action.

The action is no more triggered in latest nightly (BuildID: 20120603030523). "click" is not fired.
In Firefox 12 and Chromium, everything works as expected.

If I use "visibility: hidden" instead of "display: none", everything works fine.

I don't know if it's a bug or the expected behaviour.

Here's a test case: http://jsfiddle.net/b2Aw5/ (same as attached file).
Keywords: css2, regression
Component: General → DOM: Events
OS: Linux → All
Product: Firefox → Core
QA Contact: general → events
Hardware: x86 → All
Version: 15 Branch → Trunk
Regression range, please.
Component: DOM: Events → Event Handling
Regression from bug 758179?
Attachment #630142 - Attachment mime type: text/plain → text/html
Attached patch fixSplinter Review
The fix for bug 758179 revealed this bug. Now, setting display:none on mouseup is automatically flushed so the frame is gone by the time we get around to dispatching click/dblclick in PostHandleEvent. This bug already existed though, since Web content itself could have caused a flush after setting elements to display:none in mouseup.

This patch reverts a bit of the patch for bug 401528. I've tested the testcases in that bug and they don't regress.
Assignee: nobody → roc
Attachment #630457 - Flags: review?(bugs)
This patch seems to fix bug 761483 as well.
Blocks: 761483
Comment on attachment 630457 [details] [diff] [review]
fix

This is quite risky, but I don't have better ideas.
Attachment #630457 - Flags: review?(bugs) → review+
https://hg.mozilla.org/mozilla-central/rev/5caad70e9632

(Merged by Ed Morley)
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla16
Comment on attachment 630457 [details] [diff] [review]
fix

Review of attachment 630457 [details] [diff] [review]:
-----------------------------------------------------------------

Need to get this fixed on Aurora.
Attachment #630457 - Flags: approval-mozilla-aurora?
Depends on: 763014
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) (away June 9-19) from comment #8)
> Comment on attachment 630457 [details] [diff] [review]
> fix
> 
> Review of attachment 630457 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> Need to get this fixed on Aurora.

FYI - See bug 763014. I'm seeing bustage as a result of this fix that causes reproducible crashes upon double-clicking the top portion of a FF window.
Comment on attachment 630457 [details] [diff] [review]
fix

[Triage Comment]
Approved for Aurora 15, since this appears to be a regression in that version.
Attachment #630457 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
In that case, we also need bug 763014 on Aurora at the same time.
Flags: in-testsuite+
Verified using the test case attached in the Description that the click event is fired (if element has been hidden by mouseup). 

Verified using Firefox 15 beta 3 on Windows 7, Ubuntu 12.04 and Mac OS X 10.6:
Mozilla/5.0 (Windows NT 6.1; rv:15.0) Gecko/20100101 Firefox/15.0
Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20100101 Firefox/15.0																			
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:15.0) Gecko/20100101 Firefox/15.0

After clicking on 'Set display to none' button the background text gets selected when hovering the mouse over - filed Bug 780582.
Depends on: 780582
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: