click event not fired if element has been hidden by mouseup

RESOLVED FIXED in Firefox 15

Status

()

Core
Event Handling
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: Clochix, Assigned: roc)

Tracking

({css2, regression})

Trunk
mozilla16
css2, regression
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(firefox15+ verified)

Details

Attachments

(2 attachments)

(Reporter)

Description

5 years ago
Created attachment 630142 [details]
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).
(Reporter)

Updated

5 years ago
Keywords: css2, regression

Updated

5 years ago
Component: General → DOM: Events
OS: Linux → All
Product: Firefox → Core
QA Contact: general → events
Hardware: x86 → All
Version: 15 Branch → Trunk

Comment 1

5 years ago
Regression range, please.

Updated

5 years ago
Component: DOM: Events → Event Handling
Regression from bug 758179?
Attachment #630142 - Attachment mime type: text/plain → text/html
tracking-firefox15: --- → +
Created attachment 630457 [details] [diff] [review]
fix

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 5

5 years ago
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/integration/mozilla-inbound/rev/5caad70e9632
https://hg.mozilla.org/mozilla-central/rev/5caad70e9632

(Merged by Ed Morley)
Status: NEW → RESOLVED
Last Resolved: 5 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?

Updated

5 years ago
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.
https://hg.mozilla.org/releases/mozilla-aurora/rev/d7b39049209d
status-firefox15: --- → fixed

Updated

5 years ago
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.
status-firefox15: fixed → verified

Updated

5 years ago
Depends on: 780582
You need to log in before you can comment on or make changes to this bug.