2010-08-30 Mihai Parparita <mihaip@chromium.org>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Aug 2010 05:39:21 +0000 (05:39 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Aug 2010 05:39:21 +0000 (05:39 +0000)
        Reviewed by Adam Barth.

        HISTORY_ALWAYS_ASYNC should be removed (history should always be async)
        https://bugs.webkit.org/show_bug.cgi?id=44315

        Remove ENABLE_HISTORY_ALWAYS_ASYNC #define.

        * wtf/Platform.h:
2010-08-30  Mihai Parparita  <mihaip@chromium.org>

        Reviewed by Adam Barth.

        HISTORY_ALWAYS_ASYNC should be removed (history should always be async)
        https://bugs.webkit.org/show_bug.cgi?id=44315

        Add test that checks history.back() asynchronous behavior. Modifies
        location-hash.html to not assume synchronous traversal and removes it
        from the Chromium test expectations, since it passes there now too.

        * fast/dom/location-hash-expected.txt:
        * fast/dom/location-hash.html:
        * fast/history/history-traversal-is-asynchronous-expected.txt: Added.
        * fast/history/history-traversal-is-asynchronous.html: Added.
        * platform/chromium/test_expectations.txt:
2010-08-30  Mihai Parparita  <mihaip@chromium.org>

        Reviewed by Adam Barth.

        HISTORY_ALWAYS_ASYNC should be removed (history should always be async)
        https://bugs.webkit.org/show_bug.cgi?id=44315

        Remove check in RedirectScheduler::scheduleHistoryNavigation that would
        dispatch some navigations synchronously.

        Test: fast/history/history-traversal-is-asynchronous.html

        * loader/RedirectScheduler.cpp:
        (WebCore::RedirectScheduler::scheduleHistoryNavigation):

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

JavaScriptCore/ChangeLog
JavaScriptCore/wtf/Platform.h
LayoutTests/ChangeLog
LayoutTests/fast/dom/location-hash-expected.txt
LayoutTests/fast/dom/location-hash.html
LayoutTests/fast/history/history-traversal-is-asynchronous-expected.txt [new file with mode: 0644]
LayoutTests/fast/history/history-traversal-is-asynchronous.html [new file with mode: 0644]
LayoutTests/platform/chromium/test_expectations.txt
WebCore/ChangeLog
WebCore/loader/RedirectScheduler.cpp

index b926001..e307ff8 100644 (file)
@@ -1,3 +1,14 @@
+2010-08-30  Mihai Parparita  <mihaip@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        HISTORY_ALWAYS_ASYNC should be removed (history should always be async)
+        https://bugs.webkit.org/show_bug.cgi?id=44315
+
+        Remove ENABLE_HISTORY_ALWAYS_ASYNC #define.
+
+        * wtf/Platform.h: 
+
 2010-08-30  Chris Rogers  <crogers@google.com>
 
         Reviewed by Kenneth Russell.
index d114085..7ead013 100644 (file)
 
 /* PLATFORM(SKIA) for Win/Linux, CG/CI for Mac */
 #if PLATFORM(CHROMIUM)
-#define ENABLE_HISTORY_ALWAYS_ASYNC 1
 #if OS(DARWIN)
 #define WTF_PLATFORM_CG 1
 #define WTF_PLATFORM_CI 1
index 7002ebb..ce10d84 100644 (file)
@@ -1,3 +1,20 @@
+2010-08-30  Mihai Parparita  <mihaip@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        HISTORY_ALWAYS_ASYNC should be removed (history should always be async)
+        https://bugs.webkit.org/show_bug.cgi?id=44315
+
+        Add test that checks history.back() asynchronous behavior. Modifies
+        location-hash.html to not assume synchronous traversal and removes it
+        from the Chromium test expectations, since it passes there now too.
+
+        * fast/dom/location-hash-expected.txt:
+        * fast/dom/location-hash.html:
+        * fast/history/history-traversal-is-asynchronous-expected.txt: Added.
+        * fast/history/history-traversal-is-asynchronous.html: Added.
+        * platform/chromium/test_expectations.txt:
+
 2010-08-30  Jian Li  <jianli@chromium.org>
 
         Reviewed by Darin Fisher.
index 6991eda..a5cb605 100644 (file)
@@ -11,8 +11,16 @@ PASS: window.history.length == originalHistoryLength + 2 should be true and is.
 PASS: window.location.hash should be #bar and is.
 PASS: window.location == originalLocation + '#bar' should be true and is.
 PASS: window.history.length == originalHistoryLength + 2 should be true and is.
+PASS: window.location.hash should be #bar and is.
+PASS: window.location == originalLocation + '#bar' should be true and is.
+PASS: window.location.hash should be #bar and is.
+PASS: window.location == originalLocation + '#bar' should be true and is.
 PASS: window.location.hash should be #foo and is.
 PASS: window.location == originalLocation + '#foo' should be true and is.
+PASS: window.location.hash should be #foo and is.
+PASS: window.location == originalLocation + '#foo' should be true and is.
+PASS: window.location.hash should be and is.
+PASS: window.location == originalLocation should be true and is.
 PASS: window.location.hash should be and is.
 PASS: window.location == originalLocation should be true and is.
 PASS: window.location.hash should be #foo and is.
index f580f52..c0b8dd9 100644 (file)
             shouldBe('window.history.length == originalHistoryLength + 2', true);
             break;        
         case 3:
+            shouldBe('window.location.hash', '#bar');
+            shouldBe("window.location == originalLocation + '#bar'", true);
             window.history.back();
-            shouldBe('window.location.hash', '#foo');
-            shouldBe("window.location == originalLocation + '#foo'", true);
+            // history.back() is asychronous, location should be unchanged
+            shouldBe('window.location.hash', '#bar');
+            shouldBe("window.location == originalLocation + '#bar'", true);
             break;
         case 4:
+            shouldBe('window.location.hash', '#foo');
+            shouldBe("window.location == originalLocation + '#foo'", true);
             window.history.back();
-            shouldBe('window.location.hash', '');
-            shouldBe("window.location == originalLocation", true);
+            // history.back() is asychronous, location should be unchanged
+            shouldBe('window.location.hash', '#foo');
+            shouldBe("window.location == originalLocation + '#foo'", true);
             break;
         case 5:
+            shouldBe('window.location.hash', '');
+            shouldBe("window.location == originalLocation", true);
             window.history.forward();
-            shouldBe('window.location.hash', '#foo');
-            shouldBe("window.location == originalLocation + '#foo'", true);
+            // history.forward() is asychronous, location should be unchanged
+            shouldBe('window.location.hash', '');
+            shouldBe("window.location == originalLocation", true);
             break;
         case 6:
+            shouldBe('window.location.hash', '#foo');
+            shouldBe("window.location == originalLocation + '#foo'", true);
             window.location.hash = '';
             if (numErrors == 0)
                 print("SUCCESS!", "green")
         }
         
         state ++;
-        step();
+        
+        // Do the step in a timeout to give asynchornous history.back/forward()
+        // calls a chance to run.
+        setTimeout(step, 0);
     }
         
     function runTests() {
diff --git a/LayoutTests/fast/history/history-traversal-is-asynchronous-expected.txt b/LayoutTests/fast/history/history-traversal-is-asynchronous-expected.txt
new file mode 100644 (file)
index 0000000..1e88a4e
--- /dev/null
@@ -0,0 +1,10 @@
+Checks that session history traversal is done asynchronously.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS location.hash is "#state1"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/history/history-traversal-is-asynchronous.html b/LayoutTests/fast/history/history-traversal-is-asynchronous.html
new file mode 100644 (file)
index 0000000..e1b87c0
--- /dev/null
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <link rel="stylesheet" href="../js/resources/js-test-style.css">
+  <script src="../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<pre id="console"></pre>
+<script>
+description('Checks that session history traversal is done asynchronously.');
+
+onload = function()
+{
+    // Make sure that we can generate history entries
+    setTimeout(runTest, 0);
+}
+
+function runTest() 
+{
+    location.hash = '#state1';
+    history.back();
+    // If history.back() is asychronous, then the location won't have been
+    // updated yet.
+    shouldBe('location.hash', '"#state1"');
+
+    finishJSTest();
+}
+
+var successfullyParsed = true;
+var jsTestIsAsync = true;
+</script>  
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>
index 33797a2..b07826f 100644 (file)
@@ -2408,10 +2408,6 @@ BUG32949 WIN LINUX MAC : fast/dom/Window/invalid-protocol.html = TEXT
 
 BUG21852 DEFER SKIP LINUX WIN : fast/canvas/webgl = CRASH
 
-// Disabled until we get history.{back,forward,go} changed to always be
-// asynchronously again.
-BUG33350 : fast/dom/location-hash.html = TEXT
-
 // WebKit roll 53941 -> 54015
 BUG33358 WIN LINUX : fast/dom/Window/window-postmessage-clone-frames.html = TEXT
 
index 14c760a..2c4a77a 100644 (file)
@@ -1,3 +1,18 @@
+2010-08-30  Mihai Parparita  <mihaip@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        HISTORY_ALWAYS_ASYNC should be removed (history should always be async)
+        https://bugs.webkit.org/show_bug.cgi?id=44315
+
+        Remove check in RedirectScheduler::scheduleHistoryNavigation that would
+        dispatch some navigations synchronously.
+
+        Test: fast/history/history-traversal-is-asynchronous.html
+
+        * loader/RedirectScheduler.cpp:
+        (WebCore::RedirectScheduler::scheduleHistoryNavigation):
+
 2010-08-30  Jian Li  <jianli@chromium.org>
 
         Reviewed by Darin Fisher.
index d3b6c53..461baf7 100644 (file)
@@ -341,16 +341,6 @@ void RedirectScheduler::scheduleHistoryNavigation(int steps)
         return;
     }
     
-#if !ENABLE(HISTORY_ALWAYS_ASYNC)
-    // If the specified entry and the current entry have the same document (or documents, in there are frames), this is either a 
-    // state object traversal or a fragment traversal (or both) and should be performed synchronously.
-    HistoryItem* currentEntry = m_frame->loader()->history()->currentItem();
-    if (currentEntry != specifiedEntry && currentEntry->hasSameDocuments(specifiedEntry)) {
-        m_frame->loader()->history()->goToItem(specifiedEntry, FrameLoadTypeIndexedBackForward);
-        return;
-    }
-#endif
-    
     // In all other cases, schedule the history traversal to occur asynchronously.
     schedule(adoptPtr(new ScheduledHistoryNavigation(steps)));
 }