LayoutTests:
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 May 2007 05:53:17 +0000 (05:53 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 May 2007 05:53:17 +0000 (05:53 +0000)
        Reviewed by Brady.

        - Test case for <rdar://problem/5203036> REGRESSION: Assertion failure in WebCore::FrameLoader::restoreScrollPositionAndViewState() going back from fark.com Photoshop contest (13684)

        * http/tests/incremental/slow-utf8-html.pl:
        * http/tests/navigation/back-to-slow-frame.html: Added.
        * http/tests/navigation/back-to-slow-frame-expected.txt: Added.
        * http/tests/navigation/resources/back-to-slow-frame-2.html: Added.
        * http/tests/navigation/resources/back-to-slow-frame-3.html: Added.
        * http/tests/navigation/resources/slow-resource-1-sec.pl: Added.

WebCore:

        Reviewed by Brady.

        - fixed <rdar://problem/5203036> REGRESSION: Assertion failure in WebCore::FrameLoader::restoreScrollPositionAndViewState() going back from fark.com Photoshop contest (13684)

        Test: http/tests/navigation/back-to-slow-frame.html

        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::restoreScrollPositionAndViewState): Add needed early return.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@21474 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/http/tests/navigation/back-to-slow-frame-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/navigation/back-to-slow-frame.html [new file with mode: 0644]
LayoutTests/http/tests/navigation/resources/back-to-slow-frame-2.html [new file with mode: 0644]
LayoutTests/http/tests/navigation/resources/back-to-slow-frame-3.html [new file with mode: 0644]
LayoutTests/http/tests/navigation/resources/slow-resource-1-sec.pl [new file with mode: 0755]
WebCore/ChangeLog
WebCore/loader/FrameLoader.cpp

index 509559d..9b76c4d 100644 (file)
@@ -1,3 +1,16 @@
+2007-05-14  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Brady.
+
+        - Test case for <rdar://problem/5203036> REGRESSION: Assertion failure in WebCore::FrameLoader::restoreScrollPositionAndViewState() going back from fark.com Photoshop contest (13684)
+
+        * http/tests/incremental/slow-utf8-html.pl:
+        * http/tests/navigation/back-to-slow-frame.html: Added.
+        * http/tests/navigation/back-to-slow-frame-expected.txt: Added.
+        * http/tests/navigation/resources/back-to-slow-frame-2.html: Added.
+        * http/tests/navigation/resources/back-to-slow-frame-3.html: Added.
+        * http/tests/navigation/resources/slow-resource-1-sec.pl: Added.
+
 2007-05-14  Kimmo Kinnunen  <kimmok@iki.fi>
 
         Reviewed by Darin.
diff --git a/LayoutTests/http/tests/navigation/back-to-slow-frame-expected.txt b/LayoutTests/http/tests/navigation/back-to-slow-frame-expected.txt
new file mode 100644 (file)
index 0000000..786701e
--- /dev/null
@@ -0,0 +1,11 @@
+This test checks that going back and forth across a slow-loading frame doesn't crash. If you got back here without crashing, you win.
+
+If testing manually click here.
+
+============== Back Forward List ==============
+        http://127.0.0.1:8000/navigation/back-to-slow-frame.html  **nav target**
+curr->  http://127.0.0.1:8000/navigation/resources/back-to-slow-frame-2.html  **nav target**
+            http://127.0.0.1:8000/navigation/resources/slow-resource-1-sec.pl (in frame "<!--framePath //<!--frame0-->-->")
+        http://127.0.0.1:8000/navigation/resources/back-to-slow-frame-3.html  **nav target**
+===============================================
diff --git a/LayoutTests/http/tests/navigation/back-to-slow-frame.html b/LayoutTests/http/tests/navigation/back-to-slow-frame.html
new file mode 100644 (file)
index 0000000..4682757
--- /dev/null
@@ -0,0 +1,11 @@
+<script>
+if (window.layoutTestController) {
+    layoutTestController.dumpBackForwardList();
+    layoutTestController.dumpAsText();
+    layoutTestController.queueLoad("resources/back-to-slow-frame-2.html");
+    layoutTestController.queueLoad("resources/back-to-slow-frame-3.html");
+    layoutTestController.queueBackNavigation(1);
+}
+</script>
+<p>This test checks that going back and forth across a slow-loading frame doesn't crash.
+<p>If testing manually, <a href="resources/back-to-slow-frame-2.html">click here</a>.
diff --git a/LayoutTests/http/tests/navigation/resources/back-to-slow-frame-2.html b/LayoutTests/http/tests/navigation/resources/back-to-slow-frame-2.html
new file mode 100644 (file)
index 0000000..48bb5a3
--- /dev/null
@@ -0,0 +1,6 @@
+<iframe src="slow-resource-1-sec.pl"></iframe>
+<br>
+<p>This test checks that going back and forth across a slow-loading frame doesn't crash. If you got back here without crashing, you win.
+<p>If testing manually <a href="back-to-slow-frame-3.html">click here</a>.
+
+
diff --git a/LayoutTests/http/tests/navigation/resources/back-to-slow-frame-3.html b/LayoutTests/http/tests/navigation/resources/back-to-slow-frame-3.html
new file mode 100644 (file)
index 0000000..4b513b4
--- /dev/null
@@ -0,0 +1,2 @@
+<p>This test checks that going back and forth across a slow-loading frame doesn't crash.
+<p>If testing manually <a href="javascript:history.back()">click here</a>.
diff --git a/LayoutTests/http/tests/navigation/resources/slow-resource-1-sec.pl b/LayoutTests/http/tests/navigation/resources/slow-resource-1-sec.pl
new file mode 100755 (executable)
index 0000000..94ccd0b
--- /dev/null
@@ -0,0 +1,29 @@
+#!/usr/bin/perl -w
+
+# flush the buffers after each print
+select (STDOUT);
+$| = 1;
+
+sleep 1;
+
+print "Content-Type: text/plain\n";
+print "Expires: Thu, 01 Dec 2003 16:00:00 GMT\n";
+print "Cache-Control: no-store, no-cache, must-revalidate\n";
+print "Pragma: no-cache\n";
+print "\n";
+
+print "This resource<br>\n";
+print "Only loads<br>\n";
+print "After a second<br>\n";
+print "Of delay<br>\n";
+print "<br>\n";
+print "<br>\n";
+print "<br>\n";
+print "<br>\n";
+print "<br>\n";
+print "<br>\n";
+print "<br>\n";
+print "<br>\n";
+print "<br>\n";
+print "<br>\n";
+
index 5453551..6e53243 100644 (file)
@@ -1,3 +1,14 @@
+2007-05-14  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Brady.
+
+        - fixed <rdar://problem/5203036> REGRESSION: Assertion failure in WebCore::FrameLoader::restoreScrollPositionAndViewState() going back from fark.com Photoshop contest (13684)
+
+        Test: http/tests/navigation/back-to-slow-frame.html
+        
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::restoreScrollPositionAndViewState): Add needed early return.
+
 2007-05-14  Mitz Pettel  <mitz@webkit.org>
 
         Reviewed by Dave Hyatt.
index f1f6448..5e8bf5e 100644 (file)
@@ -3672,6 +3672,9 @@ void FrameLoader::saveScrollPositionAndViewStateToItem(HistoryItem* item)
 */
 void FrameLoader::restoreScrollPositionAndViewState()
 {
+    if (!m_committedFirstRealDocumentLoad)
+        return;
+
     ASSERT(m_currentHistoryItem);
     
     // FIXME: As the ASSERT attests, it seems we should always have a currentItem here.