Open
Bug 748675
Opened 13 years ago
Updated 3 years ago
browser stops responding after alert in onscroll event
Categories
(Core :: DOM: UI Events & Focus Handling, defect)
Tracking
()
NEW
People
(Reporter: jhorak, Unassigned)
References
Details
From: https://bugzilla.redhat.com/show_bug.cgi?id=815737
Description of problem:
I want to switch positioning of one element to fixed once it gets out of the
screen. I tried using onscroll event for this, but once the event got
triggered. Firefox stops redrawing and the tab does not respond. When I tried
calling the same function by onclick event, it works as expected. No
error/warning messages in error console. Only onscroll event makes troubles.
Changing position of that small element does not affect page size, so it should
not affect anything scrolling related. It works in other web browsers.
I was not able to prepare simplified reproducer that just moves the elements,
so I've used alert() for reproducer.
Version-Release number of selected component (if applicable):
firefox-11.0-2.fc17.x86_64
How reproducible:
always
Steps to Reproduce:
1.try to show alert message in onscroll event
for example open http://mihlit.cz/smetiste/test.html and scroll
2.
3.
Actual results:
firefox not redrawing, current tab not responding (you can close the tab with
ctrl-w)
Expected results:
firefox shows alert message
Additional info:
This works in Konqueror(KHTML), Aurora(webkit), Opera. Other browsers were not
tested.
Original code making troubles (it does not trigger the issue when used
standalone without other code):
function $(v) { if (typeof(e)=='string') return document.getElementById(v);
return v;}
function getElPos(e)
{
if (typeof(e)=='string') e=$(e);
var posX=0, posY=0;
while(e!=null){
posX+=e.offsetLeft;
posY+=e.offsetTop;
e=e.offsetParent;
}
return [posX,posY];
}
window.onscroll=function() {
if (!STOP) { // make sure ff is not stuck because there are too many events
STOP=true;
var e=mainw.childs.leftcol.childs.navigation_outter;
e.geometry=function() {
e.elem.style.position='fixed';
e.elem.style.left=getElPos(e.par.elem)[0]+'px';
e.elem.style.top='0px';
e.elem.style.width=parseInt($('lcstatus_outter').offsetWidth)+'px';
}
e.geometry();
}
}
Comment 1•13 years ago
|
||
Looks a heck of a lot like bug 723532.
Depends on: 723532
Summary: browser stops responding after onscroll event → browser stops responding after alert in onscroll event
| Assignee | ||
Updated•6 years ago
|
Component: Event Handling → User events and focus handling
Updated•3 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•