This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Apparently Gecko and WebKit have implemented pageshow and pagehide events (and onpageshow/onpagehide event handler attributes). http://webkit.org/blog/516/webkit-page-cache-ii-the-unload-event/ I guess this is something that should be specced in HTML5.
I agree, this is worth specifying. These events are becoming de-facto necessary to implement a Web-compatible back/forward cache.
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document: http://dev.w3.org/html5/decision-policy/decision-policy.html Status: Accepted Change Description: see diff given below Rationale: Concurred with reporter's comments.
Checked in as WHATWG revision r4231. Check-in comment: Add pageshow and pagehide events. http://html5.org/tools/web-apps-tracker?from=4230&to=4231
(In reply to comment #1) > I agree, this is worth specifying. These events are becoming de-facto necessary > to implement a Web-compatible back/forward cache. > Maciej, could you check whether the spec matches what is implemented in WebKit, please?
WebKit and Firefox uses the PageTransitionEvent interface, which has members .persisted and .initPageTransitionEvent().
Also, pageshow should have target set to document (just like the load event).
(In reply to comment #6) > Also, pageshow should have target set to document (just like the load event). > ...and pagehide
What does .persisted return?
It returns true for pageshow if the page is loaded by navigating in history and the page was not garbage collected, I think. It always returns true for pagehide, AFAICT.
Checked in as WHATWG revision r4800. Check-in comment: Make pageshow/pagehide use PageTransitionEvent, to match reality as described by zcorpan. http://html5.org/tools/web-apps-tracker?from=4799&to=4800