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

darin at apple.com darin at apple.com
Thu Apr 8 00:47:12 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit dc3f0ecf837ebac20ee00a2a5a4308e039145b1e
Author: darin at apple.com <darin at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Dec 23 00:49:46 2009 +0000

    ASSERTION FAILED: m_numNodeListCaches
    https://bugs.webkit.org/show_bug.cgi?id=19526
    <rdar://problem/7431572>
    
    Reviewed by Sam Weinig.
    
    WebCore:
    
    Test: fast/dom/NodeList/adoptNode-node-list-cache.html
    
    * dom/Node.cpp:
    (WebCore::Node::setDocument): Call removeNodeListCache on the old
    document and addNodeListCache on the new one if moving a node that
    has node lists.
    
    LayoutTests:
    
    * fast/dom/NodeList/adoptNode-node-list-cache-expected.txt: Added.
    * fast/dom/NodeList/adoptNode-node-list-cache.html: Added.
    * fast/dom/NodeList/resources: Added.
    * fast/dom/NodeList/resources/adoptNode-node-list-cache-subframe.html: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52511 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 4396e65..b5ca3ee 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
+2009-12-22  Darin Adler  <darin at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        ASSERTION FAILED: m_numNodeListCaches
+        https://bugs.webkit.org/show_bug.cgi?id=19526
+        <rdar://problem/7431572>
+
+        * fast/dom/NodeList/adoptNode-node-list-cache-expected.txt: Added.
+        * fast/dom/NodeList/adoptNode-node-list-cache.html: Added.
+        * fast/dom/NodeList/resources: Added.
+        * fast/dom/NodeList/resources/adoptNode-node-list-cache-subframe.html: Added.
+
 2009-12-22  Dirk Pranke  <dpranke at chromium.org>
 
         Reviewed by Eric Seidel.
diff --git a/LayoutTests/fast/dom/NodeList/adoptNode-node-list-cache-expected.txt b/LayoutTests/fast/dom/NodeList/adoptNode-node-list-cache-expected.txt
new file mode 100644
index 0000000..5818178
--- /dev/null
+++ b/LayoutTests/fast/dom/NodeList/adoptNode-node-list-cache-expected.txt
@@ -0,0 +1,2 @@
+
+TEST PASSED - Unless an assertion or crash happens soon.
diff --git a/LayoutTests/fast/dom/NodeList/adoptNode-node-list-cache.html b/LayoutTests/fast/dom/NodeList/adoptNode-node-list-cache.html
new file mode 100644
index 0000000..376adb4
--- /dev/null
+++ b/LayoutTests/fast/dom/NodeList/adoptNode-node-list-cache.html
@@ -0,0 +1,56 @@
+<head>
+<script>
+
+var pageHasLoaded = false;
+var frameHasLoaded = false;
+
+function gc()
+{
+    if (window.GCController)
+        return GCController.collect();
+
+    for (var i = 0; i < 10000; i++)
+        var s = new String("");
+}
+
+function pageLoaded()
+{
+    if (window.layoutTestController)
+        layoutTestController.waitUntilDone();
+
+    pageHasLoaded = true;
+    if (pageHasLoaded && frameHasLoaded)
+        runTest();
+}
+
+function frameLoaded()
+{
+    frameHasLoaded = true;
+    if (pageHasLoaded && frameHasLoaded)
+        runTest();
+}
+
+function runTest()
+{
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+
+    var frame = document.getElementById("frame");
+    frame.setAttribute("onload", "frameLoadedAgain()");
+    frame.setAttribute("src", "about:blank");
+}
+
+function frameLoadedAgain()
+{
+    gc();
+    document.getElementById("result").firstChild.data = "TEST PASSED - Unless an assertion or crash happens soon.";
+    if (window.layoutTestController)
+        layoutTestController.notifyDone();
+}
+
+</script>
+</head>
+<body onload="pageLoaded()">
+<iframe id="frame" src="resources/adoptNode-node-list-cache-subframe.html" onload="frameLoaded()"></iframe>
+<div id="result">TEST DID NOT RUN YET</div>
+</body>
diff --git a/LayoutTests/fast/dom/NodeList/resources/adoptNode-node-list-cache-subframe.html b/LayoutTests/fast/dom/NodeList/resources/adoptNode-node-list-cache-subframe.html
new file mode 100644
index 0000000..46d3447
--- /dev/null
+++ b/LayoutTests/fast/dom/NodeList/resources/adoptNode-node-list-cache-subframe.html
@@ -0,0 +1,12 @@
+<script>
+var doc = document.implementation.createHTMLDocument('a');
+var b = document.createElement('b');
+// Give it a node list cache on document
+b.childNodes;
+
+// Attach it to doc to update m_document
+doc.adoptNode(b);
+doc.body.appendChild(b);
+doc.body.removeChild(b);
+</script>
+<p>Close the document to see if there's an assertion failure.</p>
\ No newline at end of file
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index f4454d5..7a913d1 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,5 +1,20 @@
 2009-12-22  Darin Adler  <darin at apple.com>
 
+        Reviewed by Sam Weinig.
+
+        ASSERTION FAILED: m_numNodeListCaches
+        https://bugs.webkit.org/show_bug.cgi?id=19526
+        <rdar://problem/7431572>
+
+        Test: fast/dom/NodeList/adoptNode-node-list-cache.html
+
+        * dom/Node.cpp:
+        (WebCore::Node::setDocument): Call removeNodeListCache on the old
+        document and addNodeListCache on the new one if moving a node that
+        has node lists.
+
+2009-12-22  Darin Adler  <darin at apple.com>
+
         First cut at fixing Windows build.
 
         * WebCorePrefix.cpp: Touch it.
diff --git a/WebCore/dom/Node.cpp b/WebCore/dom/Node.cpp
index 057adf0..69e31b1 100644
--- a/WebCore/dom/Node.cpp
+++ b/WebCore/dom/Node.cpp
@@ -520,6 +520,12 @@ void Node::setDocument(Document* document)
     updateDOMNodeDocument(this, m_document, document);
 #endif
 
+    if (hasRareData() && rareData()->nodeLists()) {
+        if (m_document)
+            m_document->removeNodeListCache();
+        document->addNodeListCache();
+    }
+
     if (m_document)
         m_document->selfOnlyDeref();
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list