Changing visibility onmousedown prevents click event from firing

NEW
Unassigned

Status

()

Core
Event Handling
16 years ago
2 years ago

People

(Reporter: James Bradley, Unassigned)

Tracking

Trunk
Points:
---
Bug Flags:
blocking1.3 -

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(2 attachments)

(Reporter)

Description

16 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.2.1) Gecko/20021130
Build Identifier: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.2.1) Gecko/20021130

I have posted a page displaying the error at the URL above. The link element
includes an href and event handlers. Clicking on the link fires the handlers but
does not execute the link. 

Reproducible: Always

Steps to Reproduce:
1.Click on button.
2.
3.

Actual Results:  
Linked page fails to load.

Expected Results:  
Loaded the linked page.
Seeing this on linux too (trunk 2003-02-11-08).  If I _double_-click, the link
opens.  Sounds like the reframes that are triggered by the event handlers
confuse the click event dispatch....
Assignee: asa → saari
Status: UNCONFIRMED → NEW
Component: Browser-General → Event Handling
Ever confirmed: true
OS: Windows 98 → All
QA Contact: asa → desale
Hardware: PC → All
Summary: Mozilla fails to execute a link in seemingly valid markup. It appears the event handlers are interfering. → Mozilla fails to execute a link in seemingly valid markup. It appears the event handlers are interfering.

Updated

16 years ago
Flags: blocking1.3?

Comment 2

16 years ago
i am seing this on win2k 2003021008 ... if i click like mad it eventually goes
the the link, but this is definitely a problem.
There's another interesting possibility here....  The mousedown and mouseup
event are dispatched to _different_ content (since the mousedown affects what
content is under the mouse).  That means that together they do _not_ constitute
a click event.  I bet that's the problem, actually.

Updated

16 years ago
Severity: major → normal
Created attachment 115298 [details]
minimal testcase

This shows what the problem is -- the mouseup and mousedown are on different
target nodes, so there is no click event.

If I click really fast, I can apparently confuse the event system, though....
I have to say, I'm not sure what the desired behavior is here....
Summary: Mozilla fails to execute a link in seemingly valid markup. It appears the event handlers are interfering. → Changing visibility onmousedown prevents click event from firing

Comment 7

16 years ago
One more data point (Linux 2003021210): If you click and drag the button so that
it gets highlighted, (a) the onClick works, and (b) there is no way to
de-highlight the button [for whatever it's worth].  Double-clicking works.

Updated

16 years ago
Flags: blocking1.3? → blocking1.3-

Comment 8

15 years ago
The following javascript is intended to present an alert message on a
right-click (this technique works in IE). This routine does not function in
Mozilla. Javascript console reports Error: event is not defined
Source File: http://ptcentral.net/br/
Line: 11

<script language="JavaScript"><!--
function click(){if (event.button==2){alert('©1999 Blazon Rose
Barony')}}document.onmousedown=click// --></script>
Comment 8 talks about an IE-ism, the global event property of windows, that is
not standard, and should not be supported.  Does it have anything to do with the
URL of this bug?

/be
Assignee: saari → nobody
QA Contact: desale → events

Comment 10

2 years ago
I recently come across this bug and I was surprised that it exists so long ago :)

Now I'm using the developer edition of firefox and yes, when element's style is changed from mousedown event then click event is not fired always. I mean...something it is but sometimes it does not.

My situation is as follows. I have an DOM element (a tag) with href attribute on it. With JS I'm attaching 2 event listeners - one for mousedown and one for mouseup.

During on mousedown I'm setting inserting a new node inside the A tag. Then I'm requesting animation frame to change style which causes a transition.

During on mouseup event I'm again changing styles (with transition in rAF) and removing the newly added node inside the A tag.

Based on this structure the following 2 things happens.
1. When I press mouse's button it is instantly firing all events - mousedown, mouseclick (redirection happens), mouseup nevertheless I didn't release mouse's button so it is still down.
2. When I press mouse's button it is firing mousedown and when mouse is released then only mouseup is fired.

Again I want to mention that all these events are attached to the A tag and each of these listeners are adding/removing and transitioning child elements of A tag not the A tag itself.
You need to log in before you can comment on or make changes to this bug.