W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2010

[whatwg] Firing popstate for all history entry changes

From: Mihai Parparita <mihaip@chromium.org>
Date: Fri, 27 Aug 2010 17:00:05 -0700
Message-ID: <AANLkTimQtcRqGRDe_g7TKJ9NfsVcc39aMdZgQybcsOw8@mail.gmail.com>
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.

Thanks, http://html5.org/tools/web-apps-tracker?from=5376&to=5377
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.

Mihai
Received on Friday, 27 August 2010 17:00:05 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:26 UTC