Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1178)

Unified Diff: Source/core/loader/FrameLoader.cpp

Issue 1177313002: Revert of Fix Blink commit type for subframes after initial about:blank load. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/loader/FrameLoader.cpp
diff --git a/Source/core/loader/FrameLoader.cpp b/Source/core/loader/FrameLoader.cpp
index 2d62c050ac3cdf02aa843c43665e6fe284d36bf4..e63eca19569d0a418ff100f0d677b7740187d16d 100644
--- a/Source/core/loader/FrameLoader.cpp
+++ b/Source/core/loader/FrameLoader.cpp
@@ -664,13 +664,7 @@
return FrameLoadTypeReload;
if (request.resourceRequest().cachePolicy() == ReloadBypassingCache)
return FrameLoadTypeReloadFromOrigin;
- // From the HTML5 spec for location.assign():
- // "If the browsing context's session history contains only one Document,
- // and that was the about:blank Document created when the browsing context
- // was created, then the navigation must be done with replacement enabled."
- if (request.lockBackForwardList()
- || (!m_stateMachine.committedMultipleRealLoads()
- && equalIgnoringCase(m_frame->document()->url(), blankURL())))
+ if (request.lockBackForwardList())
return FrameLoadTypeRedirectWithLockedBackForwardList;
if (!request.originDocument() && request.resourceRequest().url() == m_documentLoader->urlForHistory())
return FrameLoadTypeSame;
@@ -1217,9 +1211,17 @@
frameLoadRequest.resourceRequest().setFrameType(m_frame->isMainFrame() ? WebURLRequest::FrameTypeTopLevel : WebURLRequest::FrameTypeNested);
ResourceRequest& request = frameLoadRequest.resourceRequest();
+ // The current load should replace the history item if it is the first real
+ // load of the frame.
+ bool replacesCurrentHistoryItem = false;
+ if (type == FrameLoadTypeRedirectWithLockedBackForwardList
+ || !m_stateMachine.committedFirstRealDocumentLoad()) {
+ replacesCurrentHistoryItem = true;
+ }
+
m_policyDocumentLoader = client()->createDocumentLoader(m_frame, request, frameLoadRequest.substituteData().isValid() ? frameLoadRequest.substituteData() : defaultSubstituteDataForURL(request.url()));
m_policyDocumentLoader->setNavigationType(navigationType);
- m_policyDocumentLoader->setReplacesCurrentHistoryItem(type == FrameLoadTypeRedirectWithLockedBackForwardList);
+ m_policyDocumentLoader->setReplacesCurrentHistoryItem(replacesCurrentHistoryItem);
m_policyDocumentLoader->setIsClientRedirect(frameLoadRequest.clientRedirect() == ClientRedirect);
// stopAllLoaders can detach the LocalFrame, so protect it.
« no previous file with comments | « LayoutTests/http/tests/navigation/resources/forward-and-cancel-frames.html ('k') | Source/core/loader/NavigationScheduler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698