This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 23279 - Unclear whether pageshow should fire when .pushState is called
Summary: Unclear whether pageshow should fire when .pushState is called
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-18 21:40 UTC by contributor
Modified: 2013-09-25 02:00 UTC (History)
3 users (show)

See Also:


Attachments

Description contributor 2013-09-18 21:40:46 UTC
Specification: http://www.whatwg.org/specs/web-apps/current-work/
Multipage: http://www.whatwg.org/C#event-pageshow
Complete: http://www.whatwg.org/c#event-pageshow
Referrer: 

Comment:
It’s not explicitly stated here whether pageshow should fire when, for
example, .pushState is called. I would assume so from the phrase “traversing
to a session history entry” but I’m not confident of my interpretation and
Firefox 23.0.1 (which has implemented the pageshow event) does not.

Posted from: 50.0.151.136
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.65 Safari/537.36
Comment 1 Ian 'Hixie' Hickson 2013-09-23 20:12:30 UTC
Step 4.6.4 of "traverse the history" seems pretty unambiguous about when the event should be fired. Can you elaborate on why this is unclear? Is the reference to "traversing to a session history entry" maybe not obviously an invocation of a spec algorithm? Is the algorithm unclear?
Comment 2 Jared Jacobs 2013-09-23 22:34:37 UTC
It would have helped me if the word "traversing" perhaps linked to the algorithm at the beginning of the section, but that's probably because I wasn't reading straight through the document. I started from the pageshow event definition.

Just now I also read the .pushState section (#dom-history-pushstate) which has a note down at step 6 that reads:

  "Since this is neither a navigation of the browsing context
  nor a history traversal, it does not cause a hashchange event
  to be fired."

This note was helpful for me. It seems to imply that .pushState should not trigger a pageshow event to be fired either, since only history traversals can do that.

Feel free to close/reject this issue. Thanks.
Comment 3 Ian 'Hixie' Hickson 2013-09-24 22:30:33 UTC
Aha, yes, a hyperlink from the event definition would make sense! I've added one.

You should also read this blog post;
   http://ln.hixie.ch/?start=1140242962&count=1

In particular, the part about "statements of fact".
Comment 4 contributor 2013-09-24 22:31:34 UTC
Checked in as WHATWG revision r8198.
Check-in comment: Add a hyperlink to make this clearer.
http://html5.org/tools/web-apps-tracker?from=8197&to=8198
Comment 5 Ian 'Hixie' Hickson 2013-09-25 02:00:40 UTC
Please reopen if there's anything further you think could be added to clarify this.