Opened 12 years ago

Closed 12 years ago

#1407 closed defect (fixed)

IE8 window resize causes infinite loop

Reported by: guest Owned by: gogo
Priority: normal Milestone: 0.96
Component: Xinha Core Version: trunk
Severity: major Keywords: race condition, infinite loop, hang


First discussed here:

I have a web page with a Xinha editor and also some other DHTML controls on the same page. When one of the other controls "opens" and displays a form field and attempst to focus() on that field, Xinha spins off into an infinite loop processing events. Specifically, the sizeEditor() function is called forever.

Each time sizeEditor() is called, its this._risizing member is false so the sizeEditor() continues processing. _risizing is set to true, processing is performed, and finally _risizing is set to false before returning. However, I suspect that the processing within sizeEditor() is causing IE8 to queue up some new size events that are not processed until *after* sizeEditor() returns, and thus, the whole process starts again--forever.

Change History (3)

comment:1 in reply to: ↑ description Changed 12 years ago by guest

More information: It appears that anything that triggers a resize event leads to an avalanche of resize events. Simply loading the page, and then resizing the page in the browser also causes an infinite cascade of resize events. Thus, it seems that the sizeEditor() method, which is called in responce to a resize event, itself generates new resize events.

comment:2 Changed 12 years ago by guest

The problem is a change in the way IE8 handles onresize events. You can work around this by generating an X-UA-Compatible header (or http-equiv meta tag) with "IE=7" to get IE7 rendering behavior out of IE8. See for more details.

comment:3 Changed 12 years ago by ray

  • Resolution set to fixed
  • Status changed from new to closed
  • Summary changed from IE8 event race conditions / infinite loop to IE8 window resize causes infinite loop

rev [1170]: this happens apparently because IE8 fires two resize events on one actual resize (weirdly not when Xinha is in an frame/iframe).
This fix works by only allowing only one out of two resize events to actually execute

Please test if this still happens in circumstances I haven't tested, or otherwise that some resize event is falsely not executed

Note: See TracTickets for help on using tickets.