Open Bug 407125 Opened 12 years ago Updated 9 months ago

pagehide fires for unloads in iframes not prompted by user navigation

Categories

(Developer Documentation :: HTML, defect)

defect
Not set

Tracking

(Not tracked)

People

(Reporter: myk, Unassigned)

References

()

Details

(Keywords: dev-doc-needed)

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
Keywords: perf
Product: Core → Documentation
QA Contact: general
Assignee: web.developer → nobody
Component: Web Developer → Mozilla Platform
Product: Documentation → Developer Documentation

The MDN team is no longer actively working on Mozilla Platform docs. Volunteer contributions are welcome.

Priority: -- → P5

This was in the wrong component, as far as I can tell. This event is part of the HTML standard.

Component: Mozilla Platform → HTML
Priority: P5 → --
You need to log in before you can comment on or make changes to this bug.