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

abarth at webkit.org abarth at webkit.org
Wed Dec 22 13:21:51 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 8abc3bc99a3b198eb1eeb0977f73581501cac766
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Sep 13 01:04:35 2010 +0000

    2010-09-12  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Eric Seidel.
    
            Adoption agency should use takeAllChildrenFrom
            https://bugs.webkit.org/show_bug.cgi?id=45570
    
            Before this patch, we were using an unsafe pattern of walking the
            sibling list without grabbing references.  Instead, we should use the
            shiny new takeAllChildrenFrom method that shoves the children into a
            vector first.  Also, update takeAllChildrenFrom to handle the case
            where the old parent is attached.
    
            * dom/ContainerNode.cpp:
            (WebCore::ContainerNode::takeAllChildrenFrom):
            * html/parser/HTMLTreeBuilder.cpp:
            (WebCore::HTMLTreeBuilder::callTheAdoptionAgency):
            * html/parser/HTMLTreeBuilder.h:
    2010-09-12  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Eric Seidel.
    
            Adoption agency should use takeAllChildrenFrom
            https://bugs.webkit.org/show_bug.cgi?id=45570
    
            More test cases.
    
            * html5lib/resources/webkit01.dat:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67357 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index a529cce..bf876a4 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -2,6 +2,17 @@
 
         Reviewed by Eric Seidel.
 
+        Adoption agency should use takeAllChildrenFrom
+        https://bugs.webkit.org/show_bug.cgi?id=45570
+
+        More test cases.
+
+        * html5lib/resources/webkit01.dat:
+
+2010-09-12  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Eric Seidel.
+
         isParsingFragment assert hit in new treebuilder
         https://bugs.webkit.org/show_bug.cgi?id=45621
 
diff --git a/LayoutTests/html5lib/resources/webkit01.dat b/LayoutTests/html5lib/resources/webkit01.dat
index 7022813..a4cbde0 100644
--- a/LayoutTests/html5lib/resources/webkit01.dat
+++ b/LayoutTests/html5lib/resources/webkit01.dat
@@ -432,3 +432,43 @@ console.log("FOO<span>BAR</span>BAZ");
 |         <tbody>
 |           <tr>
 |       <div>
+
+#data
+<a><li><style></style><title></title></a>
+#errors
+#document
+| <html>
+|   <head>
+|   <body>
+|     <a>
+|     <li>
+|       <a>
+|         <style>
+|         <title>
+
+#data
+<font></p><p><meta><title></title></font>
+#errors
+#document
+| <html>
+|   <head>
+|   <body>
+|     <font>
+|       <p>
+|     <p>
+|       <font>
+|         <meta>
+|         <title>
+
+#data
+<a><center><title></title><a>
+#errors
+#document
+| <html>
+|   <head>
+|   <body>
+|     <a>
+|     <center>
+|       <a>
+|         <title>
+|       <a>
diff --git a/LayoutTests/platform/mac/http/tests/navigation/post-goback1-expected.txt b/LayoutTests/platform/mac/http/tests/navigation/post-goback1-expected.txt
index 62479e9..fe41dc6 100644
--- a/LayoutTests/platform/mac/http/tests/navigation/post-goback1-expected.txt
+++ b/LayoutTests/platform/mac/http/tests/navigation/post-goback1-expected.txt
@@ -20,6 +20,7 @@ layer at (0,0) size 800x600
       RenderBR {BR} at (0,0) size 0x0
       RenderText {#text} at (0,296) size 591x37
         text run at (0,296) width 591: "This page was requested with an HTTP POST"
+      RenderText {#text} at (0,0) size 0x0
 
 ============== Back Forward List ==============
         http://127.0.0.1:8000/navigation/post-goback1.html  **nav target**
diff --git a/LayoutTests/platform/mac/http/tests/navigation/postredirect-basic-expected.txt b/LayoutTests/platform/mac/http/tests/navigation/postredirect-basic-expected.txt
index f353654..6c9a27b 100644
--- a/LayoutTests/platform/mac/http/tests/navigation/postredirect-basic-expected.txt
+++ b/LayoutTests/platform/mac/http/tests/navigation/postredirect-basic-expected.txt
@@ -20,6 +20,7 @@ layer at (0,0) size 800x600
       RenderBR {BR} at (0,0) size 0x0
       RenderText {#text} at (0,296) size 575x37
         text run at (0,296) width 575: "This page was requested with an HTTP GET"
+      RenderText {#text} at (0,0) size 0x0
 
 ============== Back Forward List ==============
         http://127.0.0.1:8000/navigation/postredirect-basic.html  **nav target**
diff --git a/LayoutTests/platform/mac/http/tests/navigation/postredirect-frames-expected.txt b/LayoutTests/platform/mac/http/tests/navigation/postredirect-frames-expected.txt
index bcf663e..de49e7d 100644
--- a/LayoutTests/platform/mac/http/tests/navigation/postredirect-frames-expected.txt
+++ b/LayoutTests/platform/mac/http/tests/navigation/postredirect-frames-expected.txt
@@ -26,6 +26,7 @@ layer at (0,0) size 800x600
               RenderBR {BR} at (0,0) size 0x0
               RenderText {#text} at (0,296) size 575x37
                 text run at (0,296) width 575: "This page was requested with an HTTP GET"
+              RenderText {#text} at (0,0) size 0x0
       RenderFrame {FRAME} at (0,540) size 800x60
         layer at (0,0) size 785x90
           RenderView at (0,0) size 785x60
diff --git a/LayoutTests/platform/mac/http/tests/navigation/postredirect-goback1-expected.txt b/LayoutTests/platform/mac/http/tests/navigation/postredirect-goback1-expected.txt
index f37153f..89175bf 100644
--- a/LayoutTests/platform/mac/http/tests/navigation/postredirect-goback1-expected.txt
+++ b/LayoutTests/platform/mac/http/tests/navigation/postredirect-goback1-expected.txt
@@ -20,6 +20,7 @@ layer at (0,0) size 800x600
       RenderBR {BR} at (0,0) size 0x0
       RenderText {#text} at (0,296) size 575x37
         text run at (0,296) width 575: "This page was requested with an HTTP GET"
+      RenderText {#text} at (0,0) size 0x0
 
 ============== Back Forward List ==============
         http://127.0.0.1:8000/navigation/postredirect-goback1.html  **nav target**
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index fb66f95..b3e8873 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -2,6 +2,25 @@
 
         Reviewed by Eric Seidel.
 
+        Adoption agency should use takeAllChildrenFrom
+        https://bugs.webkit.org/show_bug.cgi?id=45570
+
+        Before this patch, we were using an unsafe pattern of walking the
+        sibling list without grabbing references.  Instead, we should use the
+        shiny new takeAllChildrenFrom method that shoves the children into a
+        vector first.  Also, update takeAllChildrenFrom to handle the case
+        where the old parent is attached.
+
+        * dom/ContainerNode.cpp:
+        (WebCore::ContainerNode::takeAllChildrenFrom):
+        * html/parser/HTMLTreeBuilder.cpp:
+        (WebCore::HTMLTreeBuilder::callTheAdoptionAgency):
+        * html/parser/HTMLTreeBuilder.h:
+
+2010-09-12  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Eric Seidel.
+
         isParsingFragment assert hit in new treebuilder
         https://bugs.webkit.org/show_bug.cgi?id=45621
 
diff --git a/WebCore/dom/ContainerNode.cpp b/WebCore/dom/ContainerNode.cpp
index 1e337b0..2dd50bb 100644
--- a/WebCore/dom/ContainerNode.cpp
+++ b/WebCore/dom/ContainerNode.cpp
@@ -72,7 +72,6 @@ void ContainerNode::removeAllChildren()
     removeAllChildrenInContainer<Node, ContainerNode>(this);
 }
 
-
 void ContainerNode::takeAllChildrenFrom(ContainerNode* oldParent)
 {
     NodeVector children;
@@ -82,10 +81,14 @@ void ContainerNode::takeAllChildrenFrom(ContainerNode* oldParent)
 
     for (unsigned i = 0; i < children.size(); ++i) {
         ExceptionCode ec = 0;
+        if (children[i]->attached())
+            children[i]->detach();
         // FIXME: We need a no mutation event version of adoptNode.
         RefPtr<Node> child = document()->adoptNode(children[i].release(), ec);
         ASSERT(!ec);
-        parserAddChild(child.release());
+        parserAddChild(child.get());
+        if (attached() && !child->attached())
+            child->attach();
     }
 }
 
diff --git a/WebCore/html/parser/HTMLTreeBuilder.cpp b/WebCore/html/parser/HTMLTreeBuilder.cpp
index 9241837..7cd9f34 100644
--- a/WebCore/html/parser/HTMLTreeBuilder.cpp
+++ b/WebCore/html/parser/HTMLTreeBuilder.cpp
@@ -1612,21 +1612,6 @@ HTMLElementStack::ElementRecord* HTMLTreeBuilder::furthestBlockForFormattingElem
     return 0;
 }
 
-// FIXME: This should have a whitty name.
-// FIXME: This must be implemented in many other places in WebCore.
-void HTMLTreeBuilder::reparentChildren(Element* oldParent, Element* newParent)
-{
-    Node* child = oldParent->firstChild();
-    while (child) {
-        Node* nextChild = child->nextSibling();
-        oldParent->parserRemoveChild(child);
-        newParent->parserAddChild(child);
-        if (newParent->attached() && !child->attached())
-            child->attach();
-        child = nextChild;
-    }
-}
-
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#parsing-main-inbody
 void HTMLTreeBuilder::callTheAdoptionAgency(AtomicHTMLToken& token)
 {
@@ -1719,7 +1704,7 @@ void HTMLTreeBuilder::callTheAdoptionAgency(AtomicHTMLToken& token)
         // 8
         RefPtr<Element> newElement = m_tree.createHTMLElementFromElementRecord(formattingElementRecord);
         // 9
-        reparentChildren(furthestBlock->element(), newElement.get());
+        newElement->takeAllChildrenFrom(furthestBlock->element());
         // 10
         Element* furthestBlockElement = furthestBlock->element();
         // FIXME: All this creation / parserAddChild / attach business should
diff --git a/WebCore/html/parser/HTMLTreeBuilder.h b/WebCore/html/parser/HTMLTreeBuilder.h
index 4634f0a..b483f96 100644
--- a/WebCore/html/parser/HTMLTreeBuilder.h
+++ b/WebCore/html/parser/HTMLTreeBuilder.h
@@ -170,7 +170,6 @@ private:
     PassRefPtr<NamedNodeMap> attributesForIsindexInput(AtomicHTMLToken&);
 
     HTMLElementStack::ElementRecord* furthestBlockForFormattingElement(Element*);
-    void reparentChildren(Element* oldParent, Element* newParent);
     void callTheAdoptionAgency(AtomicHTMLToken&);
 
     void closeTheCell();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list