Commit 3deb6544 authored by Jochen Eisinger's avatar Jochen Eisinger Committed by Commit Bot

When cancelling parsing of a document, try to transition to completed

With browser side navigations, we might cancel parsing because a new
navigation started, which in turn might fail. In that case, the original
document should be in a defined state

BUG=714373
R=japhet@chromium.org

Change-Id: Idf09c46a2dde8ce1107d8c8d1d414e5fa06987da
Reviewed-on: https://chromium-review.googlesource.com/758998
Commit-Queue: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: default avatarNate Chapin <japhet@chromium.org>
Cr-Commit-Position: refs/heads/master@{#515842}
parent 2a5c9415
......@@ -1517,6 +1517,16 @@ void FrameLoader::StartLoad(FrameLoadRequest& frame_load_request,
if (had_placeholder_client_document_loader)
provisional_document_loader_->SetSentDidFinishLoad();
frame_->GetDocument()->CancelParsing();
// If we're starting a regular navigation on a regular document (i.e., there
// was no placeholder DocumentLoader), it's not enough to cancel parsing, but
// we also have to check whether the document was completed, so it's in a
// defined state should the navigation fail.
if (!had_placeholder_client_document_loader &&
type == kFrameLoadTypeStandard &&
navigation_policy == kNavigationPolicyCurrentTab) {
frame_->GetDocument()->CheckCompleted();
}
DetachDocumentLoader(provisional_document_loader_);
// beforeunload fired above, and detaching a DocumentLoader can fire events,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment