Closed Bug 227540 Opened 21 years ago Closed 21 years ago

ClearTimeout() not working ?

Categories

(Core :: DOM: Core & HTML, defect)

x86
Windows XP
defect
Not set
major

Tracking

()

RESOLVED FIXED

People

(Reporter: postmaster, Unassigned)

References

()

Details

(Keywords: qawanted)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031007 Firebird/0.7
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031007 Firebird/0.7

If you go to the web site I specified in the URL section using any Mozilla
version I have (1.2, 1.3, 1.4 and Firebird .6 et .7), you'll notice that the
submenus open as you hover some links on the left pane, but if you try to select
one of them in a few seconds the submenu will disappear by itself.

If you now visit it using Opera or Internet Explorer, you will notice that the
submenus do not disappear if you hover them, but if you place your cursor
anywhere on the page that is not a submenu they will simply disappear after a
while...

Since the "cancel hiding" thing is done using clearTimeout, I think the problem
comes from here.

PS: Firebird's JavaScript console does not inform me about ANY script error or
warning...

Reproducible: Always

Steps to Reproduce:
1. Open the page
2. Hover for example "Tercümanlık", a submenu will appear
3. Now hover something in the opened submenu.
Actual Results:  
The submenu disppeared even though we have hovered it

Expected Results:  
It shouldn't have disappeared when hovered (you can check with Opera, Internet
Explorer, ...)
Confirming reported behavior with Mozilla trunk 2003102804 on Win2K.
Over to DOM for a look; the timeout functions are not from JS Engine -
Assignee: general → general
Status: UNCONFIRMED → NEW
Component: JavaScript Engine → DOM: Level 0
Ever confirmed: true
QA Contact: PhilSchwartau → ian
Thank you... And sorry for the misplacing :s (I do not know much about which 
subject covers exactly what...)

BTW: The bug repeats in Mozilla Firebird 0.7 under Windows XP (RTM and SP1, 
Home and Pro) as well as under Windows NT 4 Workstation (SP5 and SP6a)...

@
This needs a minimal testcase or an analysis of what's going on (and really
shouldn't have been confirmed without such).
Keywords: qawanted
ANALYSIS:

Okay... So what happens is that Mozilla tends to do some mouseOver and 
mouseOut actions BEFORE the user can actually point the object, and therefore 
the lastTimeout variable does not contain any "valuable" information

Opera or IE6 do not act that way, still for instance IE4 seemed to behave the 
same way as well... Anyways we have a solution

SOLUTION:

Well, pretty easy: simply instead of remebering the last clearTimeout ID, we 
remeber ANY clearTimeout ID we did not cancel yet! So yes it is not a variable 
but an array now... But... It works :D

SO:

So, that's not a bug but a behavior... That should perhaps be considered when 
doing complicated menus using DIVs, and that menus need delayed hiding...
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.