WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 42940
popstate events are lost when network connection is in progress
https://bugs.webkit.org/show_bug.cgi?id=42940
Summary
popstate events are lost when network connection is in progress
Ben Cherry
Reported
2010-07-24 18:28:38 PDT
User history navigation (back/forward buttons) while there is network traffic does not always fire a popstate event. These events are completely lost, and can get an application into the wrong state, where the user navigated through their history, but the app was never notified. Seen in Chrome 5 and 6 and Safari 5 on OS X 10.6. Mozilla's Firefox 4 implementation of popstate does not show this behavior. Reproduced here by downloading an image for 1s in the popstate handler, which prevents further popstates from firing while the image downloads:
http://www.bcherry.net/playground/pushstate
Attachments
Patch
(6.68 KB, patch)
2010-10-08 11:58 PDT
,
Mihai Parparita
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Brady Eidson
Comment 1
2010-07-28 09:53:10 PDT
<
rdar://problem/8245251
>
Zach Rait
Comment 2
2010-09-28 18:51:41 PDT
We're experiencing a similar error at Facebook with our implementation of HTML5 history. We have a workaround that verifies that the current location actually matches the most recently fired popstate event, but that's an ugly hack and we'd greatly prefer that multiple presses of "Back" actually generated the correct number of popstate events.
Mihai Parparita
Comment 3
2010-10-08 09:22:24 PDT
Looking into this.
Mihai Parparita
Comment 4
2010-10-08 11:58:36 PDT
Created
attachment 70273
[details]
Patch
Mihai Parparita
Comment 5
2010-10-08 12:01:16 PDT
Darin or Brady, could you take a look at this?
Adam Barth
Comment 6
2010-10-08 12:23:35 PDT
Comment on
attachment 70273
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=70273&action=review
> WebCore/loader/FrameLoader.cpp:661 > + m_frame->document()->setReadyState(Document::Loading);
Is this change detectable by reading document.readyState? If so, we should add a test that shows the change.
Mihai Parparita
Comment 7
2010-10-08 12:39:35 PDT
(In reply to
comment #6
)
> (From update of
attachment 70273
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=70273&action=review
> > > WebCore/loader/FrameLoader.cpp:661 > > + m_frame->document()->setReadyState(Document::Loading); > > Is this change detectable by reading document.readyState? If so, we should add a test that shows the change.
Without this change a couple of tests in fast/loader/stateobjects fail (document-destroyed-navigate-back-with-fragment-scroll.html and document-destroyed-navigate-back.html) since they navigate back to a page that had a state object attached to its history entry. I don't think it's otherwise directly testable from layout tests though, since no script runs between FrameLoader::didBeginDocument and Document::implicitOpen.
Adam Barth
Comment 8
2010-10-08 12:44:21 PDT
Comment on
attachment 70273
[details]
Patch Okiedokes. This looks good to me, but it wouldn't hurt to have a pushState/popState expert look it over.
Darin Fisher (:fishd, Google)
Comment 9
2010-10-08 16:35:20 PDT
Comment on
attachment 70273
[details]
Patch LGTM
WebKit Commit Bot
Comment 10
2010-10-08 17:02:09 PDT
Comment on
attachment 70273
[details]
Patch Clearing flags on attachment: 70273 Committed
r69432
: <
http://trac.webkit.org/changeset/69432
>
WebKit Commit Bot
Comment 11
2010-10-08 17:02:15 PDT
All reviewed patches have been landed. Closing bug.
Zach Rait
Comment 12
2010-10-11 14:17:00 PDT
Confirmed fixed for FB, thanks Mihai.
Ben Cherry
Comment 13
2010-10-11 16:19:42 PDT
Fixed on my test case as well. Thanks to everyone involved!
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug