[whatwg] question about the popstate event
Darin Fisher
darin at chromium.org
Tue Jan 12 15:54:19 PST 2010
Hi,
I've been discussing this issue with Brady Eidson over at
https://bugs.webkit.org/show_bug.cgi?id=33224,
and his interpretation appears to be different. (I think he may have
convinced me too.)
I'd really like some help understanding how pushState is intended to work
and to see how that lines up
with the spec.
Also, assuming Brady is correct, then I wonder why pushState was designed
this way. It seems strange
to me that entries in session history would disappear when you navigate away
from a document that used
pushState.
-Darin
On Tue, Jan 5, 2010 at 6:55 PM, Justin Lebar <justin.lebar at gmail.com> wrote:
> > From my reading of the spec, I would expect the following steps:
> > 5. Page A is loaded.
> > 6. The load event for Page A is dispatched.
> > 7. The popstate event for Page A is dispatched.
>
> I think this is correct. A popstate event is always dispatched
> whenever a new session history entry is activated (6.10.3).
>
> -Justin
>
> On Tue, Jan 5, 2010 at 4:53 PM, Darin Fisher <darin at chromium.org> wrote:
> > I'd like to make sure that I'm understanding the spec for pushState and
> the
> > popstate event properly.
> > Suppose, I have the following sequence of events:
> > 1. Page A is loaded.
> > 2. Page A calls pushState("foo", null).
> > 3. The user navigates to Page B.
> > 4. The user navigates back to Page A (clicks the back button once).
> > Assuming the document of Page A was disposed upon navigation to Page B
> > (i.e., that it was not preserved in a page cache), should a popstate
> event
> > be generated as a result of step 4?
> > From my reading of the spec, I would expect the following steps:
> > 5. Page A is loaded.
> > 6. The load event for Page A is dispatched.
> > 7. The popstate event for Page A is dispatched.
> > Do I understand correctly?
> > Thanks,
> > -Darin
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20100112/b74160dc/attachment-0002.htm>
More information about the whatwg
mailing list