Bug 815737 - firefox stops responding after onscroll event
Summary: firefox stops responding after onscroll event
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: firefox
Version: 17
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Gecko Maintainer
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-04-24 12:07 UTC by Michal Hlavinka
Modified: 2012-04-25 07:28 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2012-04-25 07:28:41 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Mozilla Foundation 748675 0 None None None Never

Description Michal Hlavinka 2012-04-24 12:07:22 UTC
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 Jan Horak 2012-04-25 07:28:41 UTC
Looks like nice upstream bug. I've filled it here: https://bugzilla.mozilla.org/show_bug.cgi?id=748675
Thanks.


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