[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

commit-queue at webkit.org commit-queue at webkit.org
Wed Dec 22 12:22:16 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit cdef7ffb239c87e77c9cca6b5eb647a61a5f702f
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Aug 20 03:57:13 2010 +0000

    2010-08-19  Mihai Parparita  <mihaip at chromium.org>
    
            Reviewed by Brady Eidson.
    
            Assertion failure when going back inside frame during onload
            https://bugs.webkit.org/show_bug.cgi?id=44217
    
            Adds a test that does a history.back() within the main frame during
            onload of a child frame. If HISTORY_ALWAYS_ASYNC was set to 0, this
            would crash the DRT with an assertion failure, since we hadn't called
            updateForFrameLoadCompleted in the main frame yet.
    
            (renames history-back-within-subframe to history-back-within-subframe-hash
            to differentiate between the two otherwise similar tests)
    
            * fast/history/history-back-within-subframe-hash-expected.txt: Renamed from LayoutTests/fast/history/history-back-within-subframe-expected.txt.
            * fast/history/history-back-within-subframe-hash.html: Renamed from LayoutTests/fast/history/history-back-within-subframe.html.
            * fast/history/history-back-within-subframe-url-expected.txt: Added
            * fast/history/history-back-within-subframe-url.html: Added.
            * fast/history/resources/history-back-within-subframe-hash-2.html: Renamed from LayoutTests/fast/history/resources/history-back-within-subframe-2.html.
            * fast/history/resources/history-back-within-subframe-url-2.html: Added.
            * fast/history/resources/history-back-within-subframe-url-3.html: Added.
    2010-08-19  Mihai Parparita  <mihaip at chromium.org>
    
            Reviewed by Brady Eidson.
    
            Assertion failure when going back inside frame during onload
            https://bugs.webkit.org/show_bug.cgi?id=44217
    
            Fix assertion failure when doing a history.back() within the main frame
            during onload of a child frame. This would happen when
            HISTORY_ALWAYS_ASYNC was set to 0, because we would only compare the
            current frame document sequence numbers when determining if we're in the
            same document, instead of also recursing over child frames.
    
            Test: fast/history/history-back-within-subframe-hash.html
    
            * history/HistoryItem.cpp:
            (WebCore::HistoryItem::hasSameDocuments):
            * history/HistoryItem.h:
            * loader/RedirectScheduler.cpp:
            (WebCore::RedirectScheduler::scheduleHistoryNavigation):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65724 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 1ea39da..c1be129 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,26 @@
+2010-08-19  Mihai Parparita  <mihaip at chromium.org>
+
+        Reviewed by Brady Eidson.
+
+        Assertion failure when going back inside frame during onload
+        https://bugs.webkit.org/show_bug.cgi?id=44217
+
+        Adds a test that does a history.back() within the main frame during
+        onload of a child frame. If HISTORY_ALWAYS_ASYNC was set to 0, this
+        would crash the DRT with an assertion failure, since we hadn't called
+        updateForFrameLoadCompleted in the main frame yet.
+
+        (renames history-back-within-subframe to history-back-within-subframe-hash
+        to differentiate between the two otherwise similar tests)
+
+        * fast/history/history-back-within-subframe-hash-expected.txt: Renamed from LayoutTests/fast/history/history-back-within-subframe-expected.txt.
+        * fast/history/history-back-within-subframe-hash.html: Renamed from LayoutTests/fast/history/history-back-within-subframe.html.
+        * fast/history/history-back-within-subframe-url-expected.txt: Added
+        * fast/history/history-back-within-subframe-url.html: Added.
+        * fast/history/resources/history-back-within-subframe-hash-2.html: Renamed from LayoutTests/fast/history/resources/history-back-within-subframe-2.html.
+        * fast/history/resources/history-back-within-subframe-url-2.html: Added.
+        * fast/history/resources/history-back-within-subframe-url-3.html: Added.
+
 2010-08-19  Kenichi Ishibashi  <bashi at google.com>
 
         Reviewed by Kent Tamura.
diff --git a/LayoutTests/fast/history/history-back-within-subframe-expected.txt b/LayoutTests/fast/history/history-back-within-subframe-hash-expected.txt
similarity index 100%
rename from LayoutTests/fast/history/history-back-within-subframe-expected.txt
rename to LayoutTests/fast/history/history-back-within-subframe-hash-expected.txt
diff --git a/LayoutTests/fast/history/history-back-within-subframe-hash.html b/LayoutTests/fast/history/history-back-within-subframe-hash.html
new file mode 100644
index 0000000..b127e70
--- /dev/null
+++ b/LayoutTests/fast/history/history-back-within-subframe-hash.html
@@ -0,0 +1,12 @@
+<body>
+<script>
+onload = function() {
+  if (window.layoutTestController) {
+    layoutTestController.dumpAsText();
+    layoutTestController.waitUntilDone();
+  }
+}
+</script>
+<iframe src="resources/history-back-within-subframe-hash-2.html"></iframe>
+<div id="result">FAIL</div>
+</body>
diff --git a/LayoutTests/fast/dom/beforeload/image-before-load-innerHTML-expected.txt b/LayoutTests/fast/history/history-back-within-subframe-url-expected.txt
similarity index 100%
copy from LayoutTests/fast/dom/beforeload/image-before-load-innerHTML-expected.txt
copy to LayoutTests/fast/history/history-back-within-subframe-url-expected.txt
diff --git a/LayoutTests/fast/history/history-back-within-subframe-url.html b/LayoutTests/fast/history/history-back-within-subframe-url.html
new file mode 100644
index 0000000..508264e
--- /dev/null
+++ b/LayoutTests/fast/history/history-back-within-subframe-url.html
@@ -0,0 +1,24 @@
+<body>
+<script>
+onload = function() {
+  if (window.layoutTestController)
+  {
+      layoutTestController.dumpAsText();
+      layoutTestController.waitUntilDone();
+  }
+}
+
+wentBack = false;
+
+function onFrameLoaded()
+{
+    wentBack = true;
+    history.back();
+    document.getElementById('result').innerText = 'PASS';
+    if (window.layoutTestController)
+        layoutTestController.notifyDone();      
+}
+</script>
+<iframe src="resources/history-back-within-subframe-url-2.html"></iframe>
+<div id="result">FAIL</div>
+</body>
diff --git a/LayoutTests/fast/history/history-back-within-subframe.html b/LayoutTests/fast/history/history-back-within-subframe.html
deleted file mode 100644
index ef87c9a..0000000
--- a/LayoutTests/fast/history/history-back-within-subframe.html
+++ /dev/null
@@ -1,12 +0,0 @@
-<body>
-<script>
-onload = function() {
-  if (window.layoutTestController) {
-    layoutTestController.dumpAsText();
-    layoutTestController.waitUntilDone();
-  }
-}
-</script>
-<iframe src="resources/history-back-within-subframe-2.html"></iframe>
-<div id="result">FAIL</div>
-</body>
diff --git a/LayoutTests/fast/history/resources/history-back-within-subframe-2.html b/LayoutTests/fast/history/resources/history-back-within-subframe-hash-2.html
similarity index 100%
rename from LayoutTests/fast/history/resources/history-back-within-subframe-2.html
rename to LayoutTests/fast/history/resources/history-back-within-subframe-hash-2.html
diff --git a/LayoutTests/fast/history/resources/history-back-within-subframe-url-2.html b/LayoutTests/fast/history/resources/history-back-within-subframe-url-2.html
new file mode 100644
index 0000000..bf3e1a1
--- /dev/null
+++ b/LayoutTests/fast/history/resources/history-back-within-subframe-url-2.html
@@ -0,0 +1,10 @@
+<body onload="init()">
+<script>
+function init()
+{
+    if (!parent.wentBack)
+        setTimeout(function() {window.location.href = 'history-back-within-subframe-url-3.html';}, 0);
+}
+</script>
+frame 2
+</body>
\ No newline at end of file
diff --git a/LayoutTests/fast/history/resources/history-back-within-subframe-url-3.html b/LayoutTests/fast/history/resources/history-back-within-subframe-url-3.html
new file mode 100644
index 0000000..4678be2
--- /dev/null
+++ b/LayoutTests/fast/history/resources/history-back-within-subframe-url-3.html
@@ -0,0 +1,3 @@
+<body onload="parent.onFrameLoaded()">
+frame 3
+</body>
\ No newline at end of file
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 8c05ea4..96d81d3 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,24 @@
+2010-08-19  Mihai Parparita  <mihaip at chromium.org>
+
+        Reviewed by Brady Eidson.
+
+        Assertion failure when going back inside frame during onload
+        https://bugs.webkit.org/show_bug.cgi?id=44217
+
+        Fix assertion failure when doing a history.back() within the main frame
+        during onload of a child frame. This would happen when
+        HISTORY_ALWAYS_ASYNC was set to 0, because we would only compare the
+        current frame document sequence numbers when determining if we're in the
+        same document, instead of also recursing over child frames.
+
+        Test: fast/history/history-back-within-subframe-hash.html
+
+        * history/HistoryItem.cpp:
+        (WebCore::HistoryItem::hasSameDocuments):
+        * history/HistoryItem.h:
+        * loader/RedirectScheduler.cpp:
+        (WebCore::RedirectScheduler::scheduleHistoryNavigation):
+
 2010-08-19  Balazs Kelemen  <kb at inf.u-szeged.hu>
 
         Reviewed by Antonio Gomes.
diff --git a/WebCore/history/HistoryItem.cpp b/WebCore/history/HistoryItem.cpp
index 3ee423b..3409f81 100644
--- a/WebCore/history/HistoryItem.cpp
+++ b/WebCore/history/HistoryItem.cpp
@@ -480,6 +480,22 @@ void HistoryItem::clearChildren()
     m_children.clear();
 }
 
+bool HistoryItem::hasSameDocuments(HistoryItem* otherItem)
+{
+    if (documentSequenceNumber() != otherItem->documentSequenceNumber())
+        return false;
+        
+    if (children().size() != otherItem->children().size())
+        return false;
+    
+    for (size_t i = 0; i < children().size(); i++) {
+        if (!children()[i]->hasSameDocuments(otherItem->children()[i].get()))
+            return false;
+    }
+    
+    return true;
+}
+
 String HistoryItem::formContentType() const
 {
     return m_formContentType;
diff --git a/WebCore/history/HistoryItem.h b/WebCore/history/HistoryItem.h
index ef73c5e..dfdbc43 100644
--- a/WebCore/history/HistoryItem.h
+++ b/WebCore/history/HistoryItem.h
@@ -159,6 +159,8 @@ public:
     const HistoryItemVector& children() const;
     bool hasChildren() const;
     void clearChildren();
+    
+    bool hasSameDocuments(HistoryItem* otherItem);
 
     // This should not be called directly for HistoryItems that are already included
     // in GlobalHistory. The WebKit api for this is to use -[WebHistory setLastVisitedTimeInterval:forItem:] instead.
diff --git a/WebCore/loader/RedirectScheduler.cpp b/WebCore/loader/RedirectScheduler.cpp
index d969f30..26d7787 100644
--- a/WebCore/loader/RedirectScheduler.cpp
+++ b/WebCore/loader/RedirectScheduler.cpp
@@ -342,10 +342,10 @@ void RedirectScheduler::scheduleHistoryNavigation(int steps)
     }
     
 #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.
+    // 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->documentSequenceNumber() == specifiedEntry->documentSequenceNumber()) {
+    if (currentEntry != specifiedEntry && currentEntry->hasSameDocuments(specifiedEntry)) {
         m_frame->loader()->history()->goToItem(specifiedEntry, FrameLoadTypeIndexedBackForward);
         return;
     }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list