[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9

beidson at apple.com beidson at apple.com
Thu Feb 4 21:24:19 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 2689c8bd061cce3e40764766c0f55623039310e7
Author: beidson at apple.com <beidson at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jan 22 04:22:02 2010 +0000

    history.back() for same-document history traversals isn't synchronous as the specification states.
    <rdar://problem/7535011> and https://bugs.webkit.org/show_bug.cgi?id=33538
    
    Reviewed by Maciej Stachowiak.
    
    JavaScriptCore:
    
    * wtf/Platform.h: Add a "HISTORY_ALWAYS_ASYNC" enable and turn it on for Chromium.
    
    WebCore:
    
    In resolving https://bugs.webkit.org/show_bug.cgi?id=25570, all history.back()/forward()/go() navigations
    were made asynchronous. That doesn't agree with the HTML5 spec and might have been overreaching for fixing
    that particular bug. In working with the new history state APIs I noticed some things that should've been
    possible were not possible because of this change.
    
    The change in loading behavior is well covered via modifications to previous tests.
    
    * loader/RedirectScheduler.cpp:
    (WebCore::RedirectScheduler::scheduleHistoryNavigation): Determine beforehand if the traversal is
      a same-document navigation. If it is, perform the load directly instead of scheduling it.
    
    LayoutTests:
    
    The change in loading behavior is well covered via modifications to these previous tests:
    
    * fast/loader/stateobjects/document-destroyed-navigate-back-with-fragment-scroll.html:
    * fast/loader/stateobjects/pushstate-with-fragment-urls-and-hashchange-expected.txt:
    * fast/loader/stateobjects/pushstate-with-fragment-urls-and-hashchange.html:
    * fast/loader/stateobjects/state-api-on-detached-frame-crash-expected.txt:
    * fast/loader/stateobjects/state-api-on-detached-frame-crash.html:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53672 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 84f6c1a..aa3556f 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,12 @@
+2010-01-21  Brady Eidson  <beidson at apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        history.back() for same-document history traversals isn't synchronous as the specification states.
+        <rdar://problem/7535011> and https://bugs.webkit.org/show_bug.cgi?id=33538
+
+        * wtf/Platform.h: Add a "HISTORY_ALWAYS_ASYNC" enable and turn it on for Chromium.
+
 2010-01-21  Geoffrey Garen  <ggaren at apple.com>
 
         Reviewed by Oliver Hunt.
diff --git a/JavaScriptCore/wtf/Platform.h b/JavaScriptCore/wtf/Platform.h
index c5e0e26..f587c9a 100644
--- a/JavaScriptCore/wtf/Platform.h
+++ b/JavaScriptCore/wtf/Platform.h
@@ -458,6 +458,7 @@
 
 /* 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
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 2b6575d..a6cfb7e 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,18 @@
+2010-01-21  Brady Eidson  <beidson at apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        history.back() for same-document history traversals isn't synchronous as the specification states.
+        <rdar://problem/7535011> and https://bugs.webkit.org/show_bug.cgi?id=33538
+
+        The change in loading behavior is well covered via modifications to these previous tests:
+
+        * fast/loader/stateobjects/document-destroyed-navigate-back-with-fragment-scroll.html:
+        * fast/loader/stateobjects/pushstate-with-fragment-urls-and-hashchange-expected.txt:
+        * fast/loader/stateobjects/pushstate-with-fragment-urls-and-hashchange.html:
+        * fast/loader/stateobjects/state-api-on-detached-frame-crash-expected.txt:
+        * fast/loader/stateobjects/state-api-on-detached-frame-crash.html:
+
 2010-01-21  Kent Tamura  <tkent at chromium.org>
 
         Reviewed by Darin Adler.
diff --git a/LayoutTests/fast/loader/stateobjects/document-destroyed-navigate-back-with-fragment-scroll.html b/LayoutTests/fast/loader/stateobjects/document-destroyed-navigate-back-with-fragment-scroll.html
index a552739..f29b3d1 100644
--- a/LayoutTests/fast/loader/stateobjects/document-destroyed-navigate-back-with-fragment-scroll.html
+++ b/LayoutTests/fast/loader/stateobjects/document-destroyed-navigate-back-with-fragment-scroll.html
@@ -24,7 +24,7 @@ function runFirstStageOfTest()
 function runSecondStageOfTest()
 {
     alert("Last path component of location is " + lastPathComponent());
-    history.back();
+    setTimeout("history.back();", 0);
 }
 
 function runThirdStageOfTest()
@@ -48,7 +48,7 @@ function statePopped()
     alert("State popped - " + event.state + " (type " + typeof event.state + ")");
     if (event.state == "FirstEntry") {
         history.replaceState("FirstEntryWillLaterBeReactivated", null, "#FirstEntryWillLaterBeReactivated");
-        history.forward();
+        setTimeout("history.forward();", 0);
     } else if (event.state == "SecondEntry") {
         history.replaceState("SecondEntryWillLaterBeReactivated", null, "#SecondEntryWillLaterBeReactivated");
         window.location = "resources/navigate-back.html";
diff --git a/LayoutTests/fast/loader/stateobjects/pushstate-with-fragment-urls-and-hashchange-expected.txt b/LayoutTests/fast/loader/stateobjects/pushstate-with-fragment-urls-and-hashchange-expected.txt
index b72eb1c..7df792a 100644
--- a/LayoutTests/fast/loader/stateobjects/pushstate-with-fragment-urls-and-hashchange-expected.txt
+++ b/LayoutTests/fast/loader/stateobjects/pushstate-with-fragment-urls-and-hashchange-expected.txt
@@ -2,33 +2,33 @@ This test pushes a series of state objects with different URLs and fragment iden
 
 State popped with event null (type object) and last path component some-other.html?withsomeotherquery
 State popped with event null (type object) and last path component some-other.html?withsomeotherquery#
-Hash change fired
+Hash change fired and last path component is some-other.html?withsomeotherquery#
 State popped with event null (type object) and last path component some-other.html?withsomeotherquery
-Hash change fired
+Hash change fired and last path component is some-other.html?withsomeotherquery
 State popped with event null (type object) and last path component some-other.html?withsomeotherquery#somehash
-Hash change fired
+Hash change fired and last path component is some-other.html?withsomeotherquery#somehash
 State popped with event null (type object) and last path component some-other.html?withsomeotherquery#someotherhash
-Hash change fired
+Hash change fired and last path component is some-other.html?withsomeotherquery#someotherhash
 State popped with event null (type object) and last path component some-other.html?withquery#someotherhash
 State popped with event null (type object) and last path component some-other.html?withquery#
-Hash change fired
+Hash change fired and last path component is some-other.html?withquery#
 State popped with event null (type object) and last path component some-other.html?withquery#somehash
-Hash change fired
+Hash change fired and last path component is some-other.html?withquery#somehash
 State popped with event null (type object) and last path component some-other.html?withquery
-Hash change fired
+Hash change fired and last path component is some-other.html?withquery
 State popped with event null (type object) and last path component some-other.html?withquery#
-Hash change fired
+Hash change fired and last path component is some-other.html?withquery#
 State popped with event null (type object) and last path component some-other.html?withquery
-Hash change fired
+Hash change fired and last path component is some-other.html?withquery
 State popped with event null (type object) and last path component some-other.html
 State popped with event null (type object) and last path component pushstate-with-fragment-urls-and-hashchange.html#
 State popped with event null (type object) and last path component pushstate-with-fragment-urls-and-hashchange.html#
 State popped with event null (type object) and last path component pushstate-with-fragment-urls-and-hashchange.html#otherhash
-Hash change fired
+Hash change fired and last path component is pushstate-with-fragment-urls-and-hashchange.html#otherhash
 State popped with event null (type object) and last path component pushstate-with-fragment-urls-and-hashchange.html#hash
-Hash change fired
+Hash change fired and last path component is pushstate-with-fragment-urls-and-hashchange.html#hash
 State popped with event null (type object) and last path component pushstate-with-fragment-urls-and-hashchange.html#
-Hash change fired
+Hash change fired and last path component is pushstate-with-fragment-urls-and-hashchange.html#
 State popped with event null (type object) and last path component pushstate-with-fragment-urls-and-hashchange.html#
 State popped with event OriginalEntry (type string) and last path component pushstate-with-fragment-urls-and-hashchange.html
 
diff --git a/LayoutTests/fast/loader/stateobjects/pushstate-with-fragment-urls-and-hashchange.html b/LayoutTests/fast/loader/stateobjects/pushstate-with-fragment-urls-and-hashchange.html
index bbfc316..e701601 100644
--- a/LayoutTests/fast/loader/stateobjects/pushstate-with-fragment-urls-and-hashchange.html
+++ b/LayoutTests/fast/loader/stateobjects/pushstate-with-fragment-urls-and-hashchange.html
@@ -48,14 +48,14 @@ function statePopped()
 {
     log("State popped with event " + event.state + " (type " + typeof event.state + ") and last path component " + lastPathComponent());
     if (event.state != "OriginalEntry")
-        history.back();
+        setTimeout("history.back();", 0);
     else if (window.layoutTestController)
         layoutTestController.notifyDone();
 }
 
 function hashChanged()
 {
-    log("Hash change fired");
+    log("Hash change fired and last path component is " + lastPathComponent());
 }
 
 </script>
diff --git a/LayoutTests/fast/loader/stateobjects/state-api-on-detached-frame-crash-expected.txt b/LayoutTests/fast/loader/stateobjects/state-api-on-detached-frame-crash-expected.txt
index 3eaff39..8b13789 100644
--- a/LayoutTests/fast/loader/stateobjects/state-api-on-detached-frame-crash-expected.txt
+++ b/LayoutTests/fast/loader/stateobjects/state-api-on-detached-frame-crash-expected.txt
@@ -1 +1 @@
-If this test doesn't crash, it passed.
+
diff --git a/LayoutTests/fast/loader/stateobjects/state-api-on-detached-frame-crash.html b/LayoutTests/fast/loader/stateobjects/state-api-on-detached-frame-crash.html
index 8ecca69..d9e7a2e 100644
--- a/LayoutTests/fast/loader/stateobjects/state-api-on-detached-frame-crash.html
+++ b/LayoutTests/fast/loader/stateobjects/state-api-on-detached-frame-crash.html
@@ -8,21 +8,12 @@ function runTest()
 {
     var ifr = frames[0];
     document.body.removeChild(document.getElementsByTagName("iframe")[0])
-    try {
-        ifr.history.replaceState("foo", "bar");
-    } catch(e) {
-        alert(e);
-    }
-    try {
-        ifr.history.pushState("fu", "barred");
-    } catch(e) {
-        alert(e);
-    }   
+    ifr.history.replaceState("foo", "bar");
+    ifr.history.pushState("fu", "barred");
 }
 
 </script>
 <body onload="runTest();">
-If this test doesn't crash, it passed.
 <iframe src="about:blank">
 </iframe>
 </body>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 31ca71e..a20372c 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2010-01-21  Brady Eidson  <beidson at apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        history.back() for same-document history traversals isn't synchronous as the specification states.
+        <rdar://problem/7535011> and https://bugs.webkit.org/show_bug.cgi?id=33538
+
+        In resolving https://bugs.webkit.org/show_bug.cgi?id=25570, all history.back()/forward()/go() navigations
+        were made asynchronous. That doesn't agree with the HTML5 spec and might have been overreaching for fixing
+        that particular bug. In working with the new history state APIs I noticed some things that should've been
+        possible were not possible because of this change.
+
+        The change in loading behavior is well covered via modifications to previous tests.
+
+        * loader/RedirectScheduler.cpp:
+        (WebCore::RedirectScheduler::scheduleHistoryNavigation): Determine beforehand if the traversal is
+          a same-document navigation. If it is, perform the load directly instead of scheduling it.
+
 2010-01-21  Jakub Wieczorek  <faw217 at gmail.com>
 
         Reviewed by Tor Arne Vestbø.
diff --git a/WebCore/loader/RedirectScheduler.cpp b/WebCore/loader/RedirectScheduler.cpp
index e53a1db..04e9642 100644
--- a/WebCore/loader/RedirectScheduler.cpp
+++ b/WebCore/loader/RedirectScheduler.cpp
@@ -32,12 +32,14 @@
 #include "config.h"
 #include "RedirectScheduler.h"
 
+#include "BackForwardList.h"
 #include "DocumentLoader.h"
 #include "Event.h"
 #include "FormState.h"
 #include "Frame.h"
 #include "FrameLoadRequest.h"
 #include "FrameLoader.h"
+#include "HistoryItem.h"
 #include "HTMLFormElement.h"
 #include "HTMLFrameOwnerElement.h"
 #include "Page.h"
@@ -265,11 +267,23 @@ void RedirectScheduler::scheduleHistoryNavigation(int steps)
 
     // Invalid history navigations (such as history.forward() during a new load) have the side effect of cancelling any scheduled
     // redirects. We also avoid the possibility of cancelling the current load by avoiding the scheduled redirection altogether.
-    if (!m_frame->page()->canGoBackOrForward(steps)) { 
-        cancel(); 
-        return; 
-    } 
-
+    HistoryItem* specifiedEntry = m_frame->page()->backForwardList()->itemAtIndex(steps);
+    if (!specifiedEntry) {
+        cancel();
+        return;
+    }
+    
+#if !ENABLE(HISTORY_ALWAYS_ASYNC)
+    // If the specified entry and the current entry have the same document, 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 && specifiedEntry->document() && currentEntry->document() == specifiedEntry->document()) {
+        m_frame->loader()->history()->goToItem(specifiedEntry, FrameLoadTypeIndexedBackForward);
+        return;
+    }
+#endif
+    
+    // In all other cases, schedule the history traversal to occur asynchronously.
     schedule(new ScheduledRedirection(steps));
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list