mousedown within div hides div --> mouse can't do anything in content area

VERIFIED WORKSFORME

Status

()

Core
DOM
P3
normal
VERIFIED WORKSFORME
18 years ago
17 years ago

People

(Reporter: joakim, Assigned: joki (gone))

Tracking

({testcase})

Trunk
x86
Windows 98
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [nsbeta2+], URL)

Attachments

(3 attachments)

(Reporter)

Description

18 years ago
On http://gnome.simplemente.net/findout.html I have a rather simple dropdown 
menu system using <div> tags that are initially invisible, but are made visible 
by calling some JavaScript. This generally works fine, but the <div>s that make 
up the menus each contain an image whose onMouseDown calls a piece of JavaScript 
to make the menu invisible again. When I click on this, the menu disappears as 
it should, but further clicks in the Mozilla window produce no results, 
including trying to mark text, following links, or the images with onMouseDown 
events.

I'm fairly sure that this has to do with the clicked image being inside a <div>, 
since setting its onMouseDown to the same JavaScript function call as the 
top-level menu items (which work fine) produces the same insensitivity to 
clicks.

Sorry about not producing a simpler test case, but I'm a bit pressed for time, 
and I have mucked around with this for a few hours already, trying to see if I 
was doing anything wrong.

Updated

18 years ago
Whiteboard: davidr8@home.com making testcase

Comment 1

18 years ago
Created attachment 7624 [details]
medium-sized testcase

Comment 2

18 years ago
Joakim, you're right about pretty much everything you said about this bug, 
especially the part about it being tough to nail down.

Additional things to notice:
- This bug only happens with onmousedown (not onclick or onmouseup).
- The div must have position:absolute for this bug to show up.
- It doesn't matter if div starts out as visible or hidden.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: testcase
Whiteboard: davidr8@home.com making testcase

Updated

18 years ago
QA Contact: gerardok → ckritzer

Comment 3

18 years ago
I just ran into this same bug, and have narrowed down the circumstances a bit. 
Here are the details I've discovered:

1). the problem indeed only occurs for mousedown
3). the problem occurs when you mousedown on any type of element, not just 
images.
2). the problem occurs when, for the element you mousedown on, position: 
absolute OR position: relative.  position: static is not affected.
4). the problem occurs when you mousedown on a child element.  After that 
mousedown, it's ancestors will not be able to receive any mouse events
5). instead of ancestors receiving their own mouse events, they will all be 
targetted at the child element who first triggered the mousedown

I've put together a little test case to further illustrate the problem which 
I'll attach in a second

Comment 4

18 years ago
Created attachment 7674 [details]
fairly simple test case
Sounds like this one is yours joki, reassigning.
Assignee: jst → joki

Comment 6

18 years ago
Lucky for you, joki, this bug seems to be fixed in M15.  Woohoo!

Updated

18 years ago
Summary: Calling a JavaScript function onMouseDown on an image within a <div> makes clicks nonfunctional → mousedown within div hides div --> mouse can't do anything in content area

Comment 7

18 years ago
Created attachment 7887 [details]
testcase like first one, but shows the effect of _moving_ the div.

Comment 8

18 years ago
In the testcase I just added, mouse focus gets stolen when you click "move div" 
unless you move the mouse to put the mouseup inside the div.

Comment 9

18 years ago
nominating for nsbeta2 based on:
 - severity
 - visibility
 - major functionality broken
Keywords: nsbeta2

Comment 10

18 years ago
ckritzer, could you retest this to help PDT make a +/- call for beta2? Thanks.

Comment 11

18 years ago
Hmmnn...

Just retested on:
 - MacOS9 2000-05-04-08-M16 Commercial Build
 - Linux6 2000-05-04-08-M16 Commercial Build
 - Win98 2000-05-04-09-M16 Commercial Build

and here's what I've found:
- 3rd testcase works great on all platforms
- 2nd testcase still returns incorrect info
- 1st testcase appears to hang up event firing when you do the following steps:
  1) click on 'show div' text or 'show div' button
  2) when the div appears, click on the 'hide div' text
  3) div disappears, clicking on either group of text or buttons does not fire 
events...in fact, you don't even get the visible button-press action (button 
does not "push down" like you would expect it to)...

So, the original bug/testcase still exists.

Comment 12

18 years ago
steps to reproduce bug using third testcase:
1. load http://bugzilla.mozilla.org/showattachment.cgi?attach_id=7887
2. click "show div"
3. click "move div right" within the div (the part that just appeared)
4. try selecting "text outside div"

sorry for not giving steps earlier.. does the bug still not show up for you?

Comment 13

17 years ago
Putting on [nsbeta2+] radar for beta2 fix. 
Whiteboard: [nsbeta2+]
(Assignee)

Comment 14

17 years ago
All three test cases work great for me right now on WinNT.  ckritzer, could you 
reverify the problem?  I checked in some stuff that may have impacted this right 
before 5/16.  I want to get this checked on another platform before I mark it 
WORKSFORME.  Thx.
Status: NEW → ASSIGNED

Comment 15

17 years ago
works for me too (win98, 2000 052508)
(Assignee)

Comment 16

17 years ago
Okay, I'm marking this worksforme.
Status: ASSIGNED → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → WORKSFORME

Comment 17

17 years ago
Marking VERIFED WORKSFORME on:
- MacOS9 2000-06-01-20-M16 Commercial Build
- Linux6 2000-06-01-20-M16 Commercial Build
- Win98  2000-06-01-21-M16 Commercial Build
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.