[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

darin at chromium.org darin at chromium.org
Thu Apr 8 01:09:37 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit b3957396b198085cc7e851448da657c86eb65fa0
Author: darin at chromium.org <darin at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jan 15 08:20:00 2010 +0000

    2010-01-14  Darin Fisher  <darin at chromium.org>
    
            Reviewed by Brady Eidson.
    
            history.pushState should clear the entire forward history
            https://bugs.webkit.org/show_bug.cgi?id=33160
    
            Test: fast/loader/stateobjects/pushstate-clears-forward-history.html
    
            * history/BackForwardList.cpp:
            (WebCore::BackForwardList::addItem):
            (WebCore::BackForwardList::pushStateItem):
            * history/BackForwardList.h:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53324 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index f8c0289..a62b03c 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-01-14  Darin Fisher  <darin at chromium.org>
+
+        Reviewed by Brady Eidson.
+
+        history.pushState should clear the entire forward history
+        https://bugs.webkit.org/show_bug.cgi?id=33160
+
+        * fast/loader/stateobjects/pushstate-clears-forward-history-expected.txt: Added.
+        * fast/loader/stateobjects/pushstate-clears-forward-history.html: Added.
+
 2010-01-14  Csaba Osztrogonác  <ossy at webkit.org>
 
         Rubber-stamped by Kenneth Rohde Christiansen.
diff --git a/LayoutTests/fast/loader/stateobjects/pushstate-clears-forward-history-expected.txt b/LayoutTests/fast/loader/stateobjects/pushstate-clears-forward-history-expected.txt
new file mode 100644
index 0000000..519f1e9
--- /dev/null
+++ b/LayoutTests/fast/loader/stateobjects/pushstate-clears-forward-history-expected.txt
@@ -0,0 +1,11 @@
+main frame - has 1 onunload handler(s)
+main frame - has 1 onunload handler(s)
+main frame - has 1 onunload handler(s)
+main frame - has 1 onunload handler(s)
+You should NOT see an active forward button.
+
+============== Back Forward List ==============
+        (file test):fast/loader/stateobjects/pushstate-clears-forward-history.html  **nav target**
+        (file test):fast/loader/stateobjects/pushstate-clears-forward-history.html?a  **nav target**
+curr->  (file test):fast/loader/stateobjects/pushstate-clears-forward-history.html?a  **nav target**
+===============================================
diff --git a/LayoutTests/fast/loader/stateobjects/pushstate-clears-forward-history.html b/LayoutTests/fast/loader/stateobjects/pushstate-clears-forward-history.html
new file mode 100644
index 0000000..b08c5a5
--- /dev/null
+++ b/LayoutTests/fast/loader/stateobjects/pushstate-clears-forward-history.html
@@ -0,0 +1,34 @@
+<script>
+onload = function() {
+  if (location.search.substring(1).length == 0) {
+    sessionStorage.testStage = 0;
+    if (window.layoutTestController) {
+      layoutTestController.dumpAsText();
+      layoutTestController.dumpBackForwardList();
+      layoutTestController.waitUntilDone();
+    }
+  }
+  switch (sessionStorage.testStage++) {
+  case 0:
+    location = "?a";
+    break;
+  case 1:
+    location = "?b";
+    break;
+  case 2:
+    history.back();
+    break;
+  case 3:
+    history.pushState(null, null);
+    if (window.layoutTestController)
+      layoutTestController.notifyDone();
+    break;
+  }
+}
+onunload = function() {
+  // disable page cache
+}
+</script>
+<body>
+You should NOT see an active forward button.
+</body>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index e31ed6b..9a820f6 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2010-01-14  Darin Fisher  <darin at chromium.org>
+
+        Reviewed by Brady Eidson.
+
+        history.pushState should clear the entire forward history
+        https://bugs.webkit.org/show_bug.cgi?id=33160
+
+        Test: fast/loader/stateobjects/pushstate-clears-forward-history.html
+
+        * history/BackForwardList.cpp:
+        (WebCore::BackForwardList::addItem):
+        (WebCore::BackForwardList::pushStateItem):
+        * history/BackForwardList.h:
+
 2010-01-14  Gavin Barraclough  <barraclough at apple.com>
 
         Rubber stamped by Sam Weinig.
diff --git a/WebCore/history/BackForwardList.cpp b/WebCore/history/BackForwardList.cpp
index 3550e37..56e1b2e 100644
--- a/WebCore/history/BackForwardList.cpp
+++ b/WebCore/history/BackForwardList.cpp
@@ -59,17 +59,12 @@ BackForwardList::~BackForwardList()
 
 void BackForwardList::addItem(PassRefPtr<HistoryItem> prpItem)
 {
-    insertItemAfterCurrent(prpItem, true);
-}
-
-void BackForwardList::insertItemAfterCurrent(PassRefPtr<HistoryItem> prpItem, bool removeForwardList)
-{
     ASSERT(prpItem);
     if (m_capacity == 0 || !m_enabled)
         return;
     
     // Toss anything in the forward list    
-    if (removeForwardList && m_current != NoCurrentItemIndex) {
+    if (m_current != NoCurrentItemIndex) {
         unsigned targetSize = m_current + 1;
         while (m_entries.size() > targetSize) {
             RefPtr<HistoryItem> item = m_entries.last();
@@ -251,13 +246,8 @@ void BackForwardList::pushStateItem(PassRefPtr<HistoryItem> newItem)
     ASSERT(current);
 
     Document* newItemDocument = newItem->document();
-    while (HistoryItem* item = forwardItem()) {
-        if (item->document() != newItemDocument)
-            break;
-        removeItem(item);
-    }
 
-    insertItemAfterCurrent(newItem, false);
+    addItem(newItem);
     
     if (!current->document()) {
         current->setDocument(newItemDocument);
diff --git a/WebCore/history/BackForwardList.h b/WebCore/history/BackForwardList.h
index 88398a5..eb4921a 100644
--- a/WebCore/history/BackForwardList.h
+++ b/WebCore/history/BackForwardList.h
@@ -108,8 +108,6 @@ public:
 private:
     BackForwardList(Page*);
     
-    void insertItemAfterCurrent(PassRefPtr<HistoryItem>, bool removeForwardList);
-
     Page* m_page;
 #if PLATFORM(CHROMIUM) 
     BackForwardListClient* m_client;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list