Open Bug 651483 Opened 14 years ago Updated 3 years ago

Any DOMContentLoaded listener on the chrome window alters frameset reload behavior

Categories

(Core :: DOM: Navigation, defect)

defect

Tracking

()

People

(Reporter: ma1, Unassigned)

Details

While investigating on http://forums.informaction.com/viewtopic.php?p=27144 I've found that attaching any DOMContentLoaded event listener (even an empty function) to the chrome window significantly alters the reload behavior of (some?) framesets. Steps to reproduce on a clean profile (either Nightly or any maintained branch): 1) Open a new tab and load http://nagios.mozilla.org 2) Click the "Tactical overview" link on the side menu, and wait for the "Tactical overview" page to be loaded. 3) Hit the Reload button and observe that the main page still contains the "Tactical overview" page after the reload. 4) Now "Open Tools>Error Console" (after enabling console support if required by the tested Firefox version) and evaluate the following script: top.opener.addEventListener("DOMContentLoaded", function(){}, false) 5) Close the previously opened tab, open a new one and repeat steps 1-3 Actual result: the second reload, after the DOMContentLoaded listener had been attached, yields a different result: after reloading, the main frame doesn't contain the "Tactical overview" page anymore, but frameset is reset to its initial state instead, i.e. the URLs initially specified in the <frame> elements are restored, rather than keeping the navigated ones. Expected result: attaching an empty DOMContentLoaded listener to the chrome window should cause no observable difference in reloading behavior. It should be also noticed that, while trying to produce a contrived test case, I've found http://evil.hackademix.net/test/frames_dlc/ (a bare-bones frameset) similar to Nagios') exhibits the second behavior (reloading resets the initial frameset layout) no matter whether a listener is attached or not, so I'm not sure about which behavior should be considered normal: however, it shouldn't be changed by empty chrome listeners...
> 3) Hit the Reload button and observe that the main page still contains the > "Tactical overview" page after the reload. I can't reproduce this using a clean profile with a 2011-04-20 m-c nightly. When I click the reload button, we reload showing the original nagios landing page. At least on Mac. Note that this could well be a timing issue; I'm a little surprised I'm getting the landing page and not the tactical overview page, given what that code looks like.
Component: DOM → Document Navigation
QA Contact: general → docshell
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.