» I like your style

Fixed position iframe crashes Firefox

I can’t find a work-around or even any reference to this bug, so I’m writing it up here in case someone else runs into it or finds a solution.

Affected Browsers: Firefox 1.5, Firefox 2.0, Seamonkey 1.0, Seamonkey 1.1 Beta

Description: Using JavaScript to set display:none from within an iframe whose parent div has position: fixed causes Firefox to crash.

Sets to reproduce: Create two pages with the following code:

parent.html

<html><body>
<div style="position: fixed" id="div1">
<iframe src="iframe.html" />
</div>
</body></html>



iframe.html

<html><body>
<a href="javascript:parent.document.getElementById('div1').style.display = 'none'">Crash Me</a>
</body></html>


Clicking on the ‘Crash Me’ button crashes Firefox, but seems to work fine in a recent nightly build of Seamonkey 1.5. Is that because its using Gecko 1.9? I guess that means I have to wait for Firefox 3.0 :(