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

darin at apple.com darin at apple.com
Wed Dec 22 12:27:15 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 75227d73d16f372bc54be7acabe4860e76d2b94c
Author: darin at apple.com <darin at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Aug 24 00:44:03 2010 +0000

    Parser DOM tree manipulation functions do not need to be virtual.
    
    Reviewed by Geoff Garen.
    
    * dom/ContainerNode.h: Made parserAddChild, parserRemoveChild, and
    parserInsertBefore non-virtual.
    
    * dom/Node.cpp: Removed the parserAddChild, parserRemoveChild, and
    parserInsertBefore functions, which should never have been in the Node class.
    * dom/Node.h: Ditto.
    
    * html/HTMLConstructionSite.cpp:
    (WebCore::HTMLConstructionSite::attach): Changed argument type to ContainerNode*
    because we never need to attach a child to a non-container node.
    (WebCore::HTMLConstructionSite::findFosterSite): Cast the result of the parent
    function to ContainerNode*. A parent is always guaranteed to be a container, but
    the parent function returns a Node* so that callers can use it without including
    ContainerNode's header. That seems like something we can easily fix later.
    
    * html/HTMLConstructionSite.h: Changed AttachmentSite::parent and the
    attach function to ContainerNode* instead of Node*.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65849 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index d947f96..c563440 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,27 @@
+2010-08-23  Darin Adler  <darin at apple.com>
+
+        Reviewed by Geoff Garen.
+
+        Parser DOM tree manipulation functions do not need to be virtual.
+
+        * dom/ContainerNode.h: Made parserAddChild, parserRemoveChild, and
+        parserInsertBefore non-virtual.
+
+        * dom/Node.cpp: Removed the parserAddChild, parserRemoveChild, and
+        parserInsertBefore functions, which should never have been in the Node class.
+        * dom/Node.h: Ditto.
+
+        * html/HTMLConstructionSite.cpp:
+        (WebCore::HTMLConstructionSite::attach): Changed argument type to ContainerNode*
+        because we never need to attach a child to a non-container node.
+        (WebCore::HTMLConstructionSite::findFosterSite): Cast the result of the parent
+        function to ContainerNode*. A parent is always guaranteed to be a container, but
+        the parent function returns a Node* so that callers can use it without including
+        ContainerNode's header. That seems like something we can easily fix later.
+
+        * html/HTMLConstructionSite.h: Changed AttachmentSite::parent and the
+        attach function to ContainerNode* instead of Node*.
+
 2010-08-23  Adam Barth  <abarth at webkit.org>
 
         Reviewed by Eric Seidel.
diff --git a/WebCore/dom/ContainerNode.h b/WebCore/dom/ContainerNode.h
index 1114d3b..b84da2f 100644
--- a/WebCore/dom/ContainerNode.h
+++ b/WebCore/dom/ContainerNode.h
@@ -52,9 +52,9 @@ public:
     // They don't send DOM mutation events or handle reparenting.
     // However, arbitrary code may be run by beforeload handlers.
     virtual ContainerNode* legacyParserAddChild(PassRefPtr<Node>);
-    virtual void parserAddChild(PassRefPtr<Node>);
-    virtual void parserRemoveChild(Node*);
-    virtual void parserInsertBefore(PassRefPtr<Node> newChild, Node* refChild);
+    void parserAddChild(PassRefPtr<Node>);
+    void parserRemoveChild(Node*);
+    void parserInsertBefore(PassRefPtr<Node> newChild, Node* refChild);
 
     bool hasChildNodes() const { return m_firstChild; }
     virtual void attach();
diff --git a/WebCore/dom/Node.cpp b/WebCore/dom/Node.cpp
index 89d1392..0e79972 100644
--- a/WebCore/dom/Node.cpp
+++ b/WebCore/dom/Node.cpp
@@ -646,21 +646,6 @@ ContainerNode* Node::legacyParserAddChild(PassRefPtr<Node>)
     return 0;
 }
 
-void Node::parserAddChild(PassRefPtr<Node>)
-{
-    ASSERT_NOT_REACHED();
-}
-
-void Node::parserRemoveChild(PassRefPtr<Node>)
-{
-    ASSERT_NOT_REACHED();
-}
-
-void Node::parserInsertBefore(PassRefPtr<Node>, Node*)
-{
-    ASSERT_NOT_REACHED();
-}
-
 bool Node::isContentEditable() const
 {
     return parent() && parent()->isContentEditable();
diff --git a/WebCore/dom/Node.h b/WebCore/dom/Node.h
index 3f09162..6280a12 100644
--- a/WebCore/dom/Node.h
+++ b/WebCore/dom/Node.h
@@ -264,11 +264,6 @@ public:
     // Also does not dispatch DOM mutation events.
     // Returns the appropriate container node for future insertions as you parse, or 0 for failure.
     virtual ContainerNode* legacyParserAddChild(PassRefPtr<Node>);
-    // addChild is tied into the logic of the LegacyHTMLTreeBuilder.  We need
-    // a "clean" version to use for the HTML5 version of the HTMLTreeBuilder.
-    virtual void parserAddChild(PassRefPtr<Node>);
-    virtual void parserRemoveChild(PassRefPtr<Node>);
-    virtual void parserInsertBefore(PassRefPtr<Node> newChild, Node* nextChild);
 
     // Called by the parser when this element's close tag is reached,
     // signaling that all child tags have been parsed and added.
diff --git a/WebCore/html/HTMLConstructionSite.cpp b/WebCore/html/HTMLConstructionSite.cpp
index 4908b23..5898691 100644
--- a/WebCore/html/HTMLConstructionSite.cpp
+++ b/WebCore/html/HTMLConstructionSite.cpp
@@ -83,7 +83,7 @@ bool causesFosterParenting(const QualifiedName& tagName)
 } // namespace
 
 template<typename ChildType>
-PassRefPtr<ChildType> HTMLConstructionSite::attach(Node* parent, PassRefPtr<ChildType> prpChild)
+PassRefPtr<ChildType> HTMLConstructionSite::attach(ContainerNode* parent, PassRefPtr<ChildType> prpChild)
 {
     RefPtr<ChildType> child = prpChild;
 
@@ -433,7 +433,7 @@ void HTMLConstructionSite::findFosterSite(AttachmentSite& site)
     HTMLElementStack::ElementRecord* lastTableElementRecord = m_openElements.topmost(tableTag.localName());
     if (lastTableElementRecord) {
         Element* lastTableElement = lastTableElementRecord->element();
-        if (Node* parent = lastTableElement->parent()) {
+        if (ContainerNode* parent = static_cast<ContainerNode*>(lastTableElement->parent())) {
             site.parent = parent;
             site.nextChild = lastTableElement;
             return;
diff --git a/WebCore/html/HTMLConstructionSite.h b/WebCore/html/HTMLConstructionSite.h
index c195a65..2e746b4 100644
--- a/WebCore/html/HTMLConstructionSite.h
+++ b/WebCore/html/HTMLConstructionSite.h
@@ -111,12 +111,12 @@ public:
 
 private:
     struct AttachmentSite {
-        Node* parent;
+        ContainerNode* parent;
         Node* nextChild;
     };
 
     template<typename ChildType>
-    PassRefPtr<ChildType> attach(Node* parent, PassRefPtr<ChildType> child);
+    PassRefPtr<ChildType> attach(ContainerNode* parent, PassRefPtr<ChildType> child);
     PassRefPtr<Element> attachToCurrent(PassRefPtr<Element>);
 
     void attachAtSite(const AttachmentSite&, PassRefPtr<Node> child);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list