Diff
Copied: branches/chromium/1025/LayoutTests/fast/loader/form-state-restore-with-locked-back-forward-list-expected.txt (from rev 109480, trunk/LayoutTests/fast/loader/form-state-restore-with-locked-back-forward-list-expected.txt) (0 => 109936)
--- branches/chromium/1025/LayoutTests/fast/loader/form-state-restore-with-locked-back-forward-list-expected.txt (rev 0)
+++ branches/chromium/1025/LayoutTests/fast/loader/form-state-restore-with-locked-back-forward-list-expected.txt 2012-03-06 19:07:12 UTC (rev 109936)
@@ -0,0 +1,2 @@
+PASS location.search is "?TestName1=Ok1&TestName2=Ok2"
+
Copied: branches/chromium/1025/LayoutTests/fast/loader/form-state-restore-with-locked-back-forward-list.html (from rev 109480, trunk/LayoutTests/fast/loader/form-state-restore-with-locked-back-forward-list.html) (0 => 109936)
--- branches/chromium/1025/LayoutTests/fast/loader/form-state-restore-with-locked-back-forward-list.html (rev 0)
+++ branches/chromium/1025/LayoutTests/fast/loader/form-state-restore-with-locked-back-forward-list.html 2012-03-06 19:07:12 UTC (rev 109936)
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<body _onLoad_="document.forms[0].submit();">
+<form method=POST action=""
+<input name="TestName1" type="hidden" value="Bad1">
+<input name="TestName2" type="hidden" value="Bad2">
+</form>
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+}
+</script>
+</body>
+</html>
Copied: branches/chromium/1025/LayoutTests/fast/loader/resources/form-state-restore-with-locked-back-forward-list-2.html (from rev 109480, trunk/LayoutTests/fast/loader/resources/form-state-restore-with-locked-back-forward-list-2.html) (0 => 109936)
--- branches/chromium/1025/LayoutTests/fast/loader/resources/form-state-restore-with-locked-back-forward-list-2.html (rev 0)
+++ branches/chromium/1025/LayoutTests/fast/loader/resources/form-state-restore-with-locked-back-forward-list-2.html 2012-03-06 19:07:12 UTC (rev 109936)
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+<body _onLoad_="document.forms[0].submit();">
+<form method="GET" action=""
+<input name="TestName1" type="hidden" value="Ok1">
+<input name="TestName2" type="hidden" value="Ok2">
+</form>
+</body>
+</html>
Copied: branches/chromium/1025/LayoutTests/fast/loader/resources/form-state-restore-with-locked-back-forward-list-3.html (from rev 109480, trunk/LayoutTests/fast/loader/resources/form-state-restore-with-locked-back-forward-list-3.html) (0 => 109936)
--- branches/chromium/1025/LayoutTests/fast/loader/resources/form-state-restore-with-locked-back-forward-list-3.html (rev 0)
+++ branches/chromium/1025/LayoutTests/fast/loader/resources/form-state-restore-with-locked-back-forward-list-3.html 2012-03-06 19:07:12 UTC (rev 109936)
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<body>
+<script src=""
+<script>
+shouldBeEqualToString("location.search", '?TestName1=Ok1&TestName2=Ok2');
+if (window.layoutTestController)
+ layoutTestController.notifyDone();
+</script>
+</body>
Modified: branches/chromium/1025/Source/WebCore/loader/FrameLoader.cpp (109935 => 109936)
--- branches/chromium/1025/Source/WebCore/loader/FrameLoader.cpp 2012-03-06 19:01:51 UTC (rev 109935)
+++ branches/chromium/1025/Source/WebCore/loader/FrameLoader.cpp 2012-03-06 19:07:12 UTC (rev 109936)
@@ -736,6 +736,7 @@
// OK, completed.
m_isComplete = true;
+ m_requestedHistoryItem = 0;
m_frame->document()->setReadyState(Document::Complete);
RefPtr<Frame> protect(m_frame);
@@ -3166,6 +3167,7 @@
// Loads content into this frame, as specified by history item
void FrameLoader::loadItem(HistoryItem* item, FrameLoadType loadType)
{
+ m_requestedHistoryItem = item;
HistoryItem* currentItem = history()->currentItem();
bool sameDocumentNavigation = currentItem && item->shouldDoSameDocumentNavigationTo(currentItem);
Modified: branches/chromium/1025/Source/WebCore/loader/FrameLoader.h (109935 => 109936)
--- branches/chromium/1025/Source/WebCore/loader/FrameLoader.h 2012-03-06 19:01:51 UTC (rev 109935)
+++ branches/chromium/1025/Source/WebCore/loader/FrameLoader.h 2012-03-06 19:07:12 UTC (rev 109936)
@@ -119,6 +119,7 @@
void open(CachedFrameBase&);
void loadItem(HistoryItem*, FrameLoadType);
+ HistoryItem* requestedHistoryItem() const { return m_requestedHistoryItem.get(); }
static void reportLocalLoadFailed(Frame*, const String& url);
@@ -433,6 +434,7 @@
#endif
KURL m_previousUrl;
+ RefPtr<HistoryItem> m_requestedHistoryItem;
};
// This function is called by createWindow() in JSDOMWindowBase.cpp, for example, for
Modified: branches/chromium/1025/Source/WebCore/loader/HistoryController.cpp (109935 => 109936)
--- branches/chromium/1025/Source/WebCore/loader/HistoryController.cpp 2012-03-06 19:01:51 UTC (rev 109935)
+++ branches/chromium/1025/Source/WebCore/loader/HistoryController.cpp 2012-03-06 19:07:12 UTC (rev 109936)
@@ -200,9 +200,10 @@
if (!itemToRestore)
return;
-
- LOG(Loading, "WebCoreLoading %s: restoring form state from %p", m_frame->tree()->uniqueName().string().utf8().data(), itemToRestore);
- doc->setStateForNewFormElements(itemToRestore->documentState());
+ if (m_frame->loader()->requestedHistoryItem() == m_currentItem.get() && !m_frame->loader()->documentLoader()->isClientRedirect()) {
+ LOG(Loading, "WebCoreLoading %s: restoring form state from %p", m_frame->tree()->uniqueName().string().utf8().data(), itemToRestore);
+ doc->setStateForNewFormElements(itemToRestore->documentState());
+ }
}
void HistoryController::invalidateCurrentItemCachedPage()