[whatwg] Firing popstate for all history entry changes
mihaip at chromium.org
Fri Aug 27 17:00:05 PDT 2010
On Fri, Aug 27, 2010 at 4:03 PM, Ian Hickson <ian at hixie.ch> wrote:
> Ok, I've changed popstate to get fired (or queued up, if before 'load')
> for every traversal, not just those to non-null states.
looks good to me.
> BTW, there's another problem with this API, which is that since popstates
> are dropped while the document is loading, calling pushState() while the
> document is loading leads to a very confused state. Should we make
> pushState() throw an exception if called before load? (replaceState() is
> probably ok, though even that's a bit dodgy.)
This seems related to the thread from around a month ago when I asked
about setting location.href before onload (Gecko, and now WebKit, will
not create a new session history entry if this happens before load).
Throwing an exception, ignoring the pushState, or having it be treated
as replaceState all make sense to me.
> I assume we don't want to change this, in which case I should probably put
> a note in the spec warning about using pushState() and replaceState()
> before load. Any opinions on this?
At least a note that the pending state object is not affected by
push/replaceState makes sense.
More information about the whatwg