Last Comment Bug 35971 - mousedown within div hides div --> mouse can't do anything in content area
: mousedown within div hides div --> mouse can't do anything in content area
: testcase
Product: Core
Classification: Components
Component: DOM (show other bugs)
: Trunk
: x86 Windows 98
P3 normal with 1 vote (vote)
: ---
Assigned To: joki (gone)
: ckritzer (gone)
: Andrew Overholt [:overholt]
Depends on:
  Show dependency treegraph
Reported: 2000-04-15 19:23 PDT by joakim
Modified: 2001-03-21 17:38 PST (History)
2 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

medium-sized testcase (1.03 KB, text/html)
2000-04-16 00:41 PDT, Jesse Ruderman
no flags Details
fairly simple test case (2.04 KB, text/html)
2000-04-17 15:47 PDT, Joe Hewitt
no flags Details
testcase like first one, but shows the effect of _moving_ the div. (982 bytes, text/html)
2000-04-23 16:33 PDT, Jesse Ruderman
no flags Details

Description User image joakim 2000-04-15 19:23:03 PDT
On 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 

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 

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.
Comment 1 User image Jesse Ruderman 2000-04-16 00:41:10 PDT
Created attachment 7624 [details]
medium-sized testcase
Comment 2 User image Jesse Ruderman 2000-04-16 00:48:02 PDT
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.
Comment 3 User image Joe Hewitt 2000-04-17 15:46:29 PDT
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 
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 User image Joe Hewitt 2000-04-17 15:47:46 PDT
Created attachment 7674 [details]
fairly simple test case
Comment 5 User image Johnny Stenback (:jst, 2000-04-17 16:07:48 PDT
Sounds like this one is yours joki, reassigning.
Comment 6 User image Joe Hewitt 2000-04-20 09:21:36 PDT
Lucky for you, joki, this bug seems to be fixed in M15.  Woohoo!
Comment 7 User image Jesse Ruderman 2000-04-23 16:33:16 PDT
Created attachment 7887 [details]
testcase like first one, but shows the effect of _moving_ the div.
Comment 8 User image Jesse Ruderman 2000-04-23 16:34:56 PDT
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 User image ckritzer (gone) 2000-04-26 13:29:07 PDT
nominating for nsbeta2 based on:
 - severity
 - visibility
 - major functionality broken
Comment 10 User image Phil Peterson 2000-05-04 17:01:26 PDT
ckritzer, could you retest this to help PDT make a +/- call for beta2? Thanks.
Comment 11 User image ckritzer (gone) 2000-05-05 07:38:22 PDT

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 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 User image Jesse Ruderman 2000-05-08 22:36:05 PDT
steps to reproduce bug using third testcase:
1. load
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 User image leger 2000-05-18 15:25:14 PDT
Putting on [nsbeta2+] radar for beta2 fix. 
Comment 14 User image joki (gone) 2000-05-25 16:13:10 PDT
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 
Comment 15 User image Jesse Ruderman 2000-05-25 16:53:50 PDT
works for me too (win98, 2000 052508)
Comment 16 User image joki (gone) 2000-05-31 16:48:21 PDT
Okay, I'm marking this worksforme.
Comment 17 User image ckritzer (gone) 2000-06-02 11:06:30 PDT
- MacOS9 2000-06-01-20-M16 Commercial Build
- Linux6 2000-06-01-20-M16 Commercial Build
- Win98  2000-06-01-21-M16 Commercial Build

Note You need to log in before you can comment on or make changes to this bug.