Closed Bug 441766 Opened 16 years ago Closed 16 years ago

Program flow is broken during fast repeating of onclick event (probably also on other events)

Categories

(Firefox :: General, defect)

3.0 Branch
x86
Windows XP
defect
Not set
major

Tracking

()

RESOLVED INVALID

People

(Reporter: bobson, Unassigned)

References

()

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9) Gecko/2008052906 Firefox/3.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9) Gecko/2008052906 Firefox/3.0

Somethings goes wrong with events switching from FF2 into FF3.

Example code from provided URL can be download from here:
http://www.bobson.eu/bugzilla/firefox/events1/events1.tgz

Idea is simple.
Two div's are filled with data from HMTL request.
Steps of event:
1) clear div's
2) get data for div 1
3) concat cleared innerHTML of div 1 with new data ( innerHTML += )
4) get data for div 2
5) concat cleared innerHTML of div 2 with new data ( innerHTML += )

Event is run in onclick event of anchor.
When you click very fast (eg. using double-click button on mouse) it looks like program flow is broken because it seams to doing such:
clear div1; clear div1; concat div1 innerHTML; concat div1 innerHTML;

instead of doing:
clear div1; concat div1 innerHTML; clear div1; concat div1 innerHTML;

In very rare cases it even put data in wrong div - so its looks that:
- or it can happen that getElementById() return's wrong element 
- or local variables are not always loacal, 
- or data flow is broken and some code in function is skipped in execution

There is counter of requests in example put betwean [ and ]. As we see - sometimes its even not make events in proper order of clicks (it shall be asc sorted).


BTW - FF3 freez from time to time for 10-40sec (several times per day) - usually when I'm scrolling or typing text. Its normal?


Reproducible: Sometimes

Steps to Reproduce:
[notice] its happen very often.
1. Open provided url
2. Start to click on anhor very fast to get doubled text in divs
Actual Results:  
[div id=t1]
t1: [110] This is generated on server.
[/div]
[div id=t2]
t2: [111] This is generated on server.
t2: [109] This is generated on server.
[/div]

or

[div id=t1]
t1: [116] This is generated on server.
t1: [117] This is generated on server.
[/div]
[div id=t2]
t2: [118] This is generated on server.
t2: [119] This is generated on server.
[/div]

very rare bug looks like :

[div id=t1]
t1: [116] This is generated on server.
t2: [118] This is generated on server.
[/div]
[div id=t2]
t2: [118] This is generated on server.
t2: [119] This is generated on server.
[/div]


Expected Results:  
every time:
[div id=t1]
t1: [126] This is generated on server.
[/div]
[div id=t2]
t2: [127] This is generated on server.
[/div]

My FF3 is installed on directiory of FF2 instalation. I also have firebug plugin installed. Dont know if this is important - we can reproduce this bug here on several PC's.
Here is SWF movie which show this error.
www.bobson.eu/bugzilla/firefox/events1/event_error1.swf
Version: unspecified → 3.0 Branch
Wouldn't report this as a Firefox3 bug.
A better diagram would be for user function usage overflow:
(1.x is request one, 2.x is request two)
1.1) winLoadContainers gets fired and clears divs
1.2) getReq gets fired and waits there
2.1) winLoadContainers gets firefox and clears the divs
2.2) getReq gets fired and waits there
1.3) runs fillObj and concats the existing with the new which is empty
2.3) runs fillObj and concats the existing with the new which is the content from 1.3
2.1 should be: winLoadContainers gets fired and clears the divs
Ok. After tests we made on ir, it looks like its a "feature" not a bug. Maybe there shall be more in documentation of event's about that.

Strange that ff team decide to do events in such "not standard" way (I dont see such aproach in IE or Opera).
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: