2011-01-08 Charlie Reis <creis@chromium.org>
[WebKit.git] / Source / WebCore / loader / FrameLoader.cpp
index 6dcd054e27832cec746938654cfad9a5f70f8d1c..3d864becad970b5987740bf54720633424bac15b 100644 (file)
@@ -2333,8 +2333,9 @@ void FrameLoader::checkLoadCompleteForThisFrame()
             // Check all children first.
             RefPtr<HistoryItem> item;
             if (Page* page = m_frame->page())
-                if (isBackForwardLoadType(loadType()) && m_frame == page->mainFrame())
-                    item = history()->currentItem();
+                if (isBackForwardLoadType(loadType()))
+                    // Reset the back forward list to the last committed history item at the top level.
+                    item = page->mainFrame()->loader()->history()->currentItem();
                 
             bool shouldReset = true;
             if (!(pdl->isLoadingInAPISense() && !pdl->isStopping())) {