Open Bug 407125 Opened 12 years ago Updated 9 months ago
pagehide fires for unloads in iframes not prompted by user navigation
According to http://developer.mozilla.org/en/docs/Using_Firefox_1.5_caching#pagehide_event : "If you want to define behavior that occurs [when] *the user* navigates away from the page... you can use the new pagehide event." And also: "If the page contains frames, then when the cached page is loaded... When *the user* navigates away from the cached page, the pagehide event from each frame fires before the pagehide event in the main document." (emphases mine) But loading netscape.aol.com fires 9-11 pagehide events for http://netscape.aol.com/ads/load.htm , and reloading it fires a page hide event for http://netscape.aol.com/ (as expected), one each for http://netscape.aol.com/ads/load_v4.adp and http://cdn.atwola.com/_media/uac/tcode.html , and another 9-11 for http://netscape.aol.com/ads/load.htm . There aren't any iframes in the HTML file, but there are two in the DOM of the loaded document, so I suspect these pagehides are happening as the page reuses an iframe to load multiple pieces of content. Based on the description of pagehide on MDC, this shouldn't be happening and probably hurts performance besides contributing to bugs like bug 407116.
Shouldn't the pagehide listeners be checking the event's target? Seems like we should just change the documentation on MDC...
Component: XUL Widgets → DOM
Product: Toolkit → Core
QA Contact: xul.widgets → general
(In reply to comment #1) > Shouldn't the pagehide listeners be checking the event's target? Seems like we > should just change the documentation on MDC... We could do that, but is the current behavior really the intended (and useful) behavior?
Perhaps not most useful, but it certainly is intended.
The documentation is just wrong. pagehide/pageshow fire whenever unload/load would have fired before bfcache existed. Nothing to do with users at all, everything to do with loads.
Assignee: nobody → web.developer
Component: DOM → Web Developer
Product: Core → Documentation
QA Contact: general
Assignee: web.developer → nobody
Component: Web Developer → Mozilla Platform
Product: Documentation → Developer Documentation
Priority: -- → P5
Component: Mozilla Platform → HTML
Priority: P5 → --
You need to log in before you can comment on or make changes to this bug.