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

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

Issue 296533004: Fix incorrect iframe loading during back/forward navigation. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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
« no previous file with comments | « LayoutTests/http/tests/navigation/resources/back-to-dynamic-iframe-iframe.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/NavigationScheduler.cpp
diff --git a/Source/core/loader/NavigationScheduler.cpp b/Source/core/loader/NavigationScheduler.cpp
index 9dda7c06a5a5053232b2d3ec86ee362ddfd0e3f8..ffe1447b40653488a9a63e912ce51b02101595c2 100644
--- a/Source/core/loader/NavigationScheduler.cpp
+++ b/Source/core/loader/NavigationScheduler.cpp
@@ -373,6 +373,18 @@ void NavigationScheduler::timerFired(Timer<NavigationScheduler>*)
void NavigationScheduler::schedule(PassOwnPtr<ScheduledNavigation> redirect)
{
ASSERT(m_frame->page());
+
+ // In a back/forward navigation, we sometimes restore history state to iframes, even though the state was generated
+ // dynamically and JS will try to put something different in the iframe. In this case, we will load stale things
+ // and/or confuse the JS when it shortly thereafter tries to schedule a location change. Let the JS have its way.
+ // FIXME: This check seems out of place.
+ if (!m_frame->loader().stateMachine()->committedFirstRealDocumentLoad() && m_frame->loader().provisionalDocumentLoader()) {
+ RefPtr<Frame> protect(m_frame);
+ m_frame->loader().provisionalDocumentLoader()->stopLoading();
+ if (!m_frame->host())
+ return;
+ }
+
cancel();
m_redirect = redirect;
startTimer();
« no previous file with comments | « LayoutTests/http/tests/navigation/resources/back-to-dynamic-iframe-iframe.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698