[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

kocienda kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:48:55 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit d6b46e18dc700ad26d327a6949210bf5f46e8932
Author: kocienda <kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jul 6 17:58:38 2004 +0000

            Reviewed by John
    
            Simple change. I switched the arguments of the appendNode helper function
            and the AppendNodeCommand and AppendNodeCommandImpl classes. The node to
            insert now comes before the parent node in the argument list. I did this
            to make this function match the convention of others in the HTML editing code.
            This was the only one that was "different" in the way that it ordered arguments.
            As a result, I was always looking to see that I was passing things in the right
            order.
    
            * khtml/editing/htmlediting.cpp:
            (khtml::AppendNodeCommand::AppendNodeCommand):
            (khtml::AppendNodeCommand::appendChild):
            (khtml::AppendNodeCommand::parentNode):
            * khtml/editing/htmlediting.h:
            * khtml/editing/htmlediting_impl.cpp:
            (khtml::CompositeEditCommandImpl::insertNodeAfter):
            (khtml::CompositeEditCommandImpl::insertNodeAt):
            (khtml::CompositeEditCommandImpl::appendNode):
            (khtml::AppendNodeCommandImpl::AppendNodeCommandImpl):
            (khtml::AppendNodeCommandImpl::~AppendNodeCommandImpl):
            (khtml::AppendNodeCommandImpl::doApply):
            (khtml::AppendNodeCommandImpl::doUnapply):
            (khtml::ApplyStyleCommandImpl::surroundNodeRangeWithElement):
            (khtml::DeleteSelectionCommandImpl::doApply):
            (khtml::InputNewlineCommandImpl::insertNodeAfterPosition):
            (khtml::InputNewlineCommandImpl::insertNodeBeforePosition):
            (khtml::InputTextCommandImpl::prepareForTextInsertion):
            * khtml/editing/htmlediting_impl.h:
            (khtml::AppendNodeCommandImpl::parentNode):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6965 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 1a24a00..7496d72 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,5 +1,38 @@
 2004-07-06  Ken Kocienda  <kocienda at apple.com>
 
+        Reviewed by John
+        
+        Simple change. I switched the arguments of the appendNode helper function
+        and the AppendNodeCommand and AppendNodeCommandImpl classes. The node to 
+        insert now comes before the parent node in the argument list. I did this
+        to make this function match the convention of others in the HTML editing code.
+        This was the only one that was "different" in the way that it ordered arguments.
+        As a result, I was always looking to see that I was passing things in the right
+        order.
+        
+        * khtml/editing/htmlediting.cpp:
+        (khtml::AppendNodeCommand::AppendNodeCommand):
+        (khtml::AppendNodeCommand::appendChild):
+        (khtml::AppendNodeCommand::parentNode):
+        * khtml/editing/htmlediting.h:
+        * khtml/editing/htmlediting_impl.cpp:
+        (khtml::CompositeEditCommandImpl::insertNodeAfter):
+        (khtml::CompositeEditCommandImpl::insertNodeAt):
+        (khtml::CompositeEditCommandImpl::appendNode):
+        (khtml::AppendNodeCommandImpl::AppendNodeCommandImpl):
+        (khtml::AppendNodeCommandImpl::~AppendNodeCommandImpl):
+        (khtml::AppendNodeCommandImpl::doApply):
+        (khtml::AppendNodeCommandImpl::doUnapply):
+        (khtml::ApplyStyleCommandImpl::surroundNodeRangeWithElement):
+        (khtml::DeleteSelectionCommandImpl::doApply):
+        (khtml::InputNewlineCommandImpl::insertNodeAfterPosition):
+        (khtml::InputNewlineCommandImpl::insertNodeBeforePosition):
+        (khtml::InputTextCommandImpl::prepareForTextInsertion):
+        * khtml/editing/htmlediting_impl.h:
+        (khtml::AppendNodeCommandImpl::parentNode):
+
+2004-07-06  Ken Kocienda  <kocienda at apple.com>
+
         Reviewed by Trey
 
         Fixed several problems with traversal classes. For one, NodeIterators treat
diff --git a/WebCore/khtml/editing/htmlediting.cpp b/WebCore/khtml/editing/htmlediting.cpp
index d503010..afce837 100644
--- a/WebCore/khtml/editing/htmlediting.cpp
+++ b/WebCore/khtml/editing/htmlediting.cpp
@@ -210,8 +210,8 @@ CompositeEditCommandImpl *CompositeEditCommand::impl() const
 //------------------------------------------------------------------------------------------
 // AppendNodeCommand
 
-AppendNodeCommand::AppendNodeCommand(DocumentImpl *document, NodeImpl *parentNode, NodeImpl *appendChild)
-    : EditCommand(new AppendNodeCommandImpl(document, parentNode, appendChild))
+AppendNodeCommand::AppendNodeCommand(DocumentImpl *document, NodeImpl *appendChild, NodeImpl *parentNode)
+    : EditCommand(new AppendNodeCommandImpl(document, appendChild, parentNode))
 {
 }
 
@@ -224,16 +224,16 @@ AppendNodeCommandImpl *AppendNodeCommand::impl() const
     return static_cast<AppendNodeCommandImpl *>(get());
 }
 
-NodeImpl *AppendNodeCommand::parentNode() const
+NodeImpl *AppendNodeCommand::appendChild() const
 {
     IF_IMPL_NULL_RETURN_ARG(0);
-    return impl()->parentNode();
+    return impl()->appendChild();
 }
 
-NodeImpl *AppendNodeCommand::appendChild() const
+NodeImpl *AppendNodeCommand::parentNode() const
 {
     IF_IMPL_NULL_RETURN_ARG(0);
-    return impl()->appendChild();
+    return impl()->parentNode();
 }
 
 //------------------------------------------------------------------------------------------
diff --git a/WebCore/khtml/editing/htmlediting.h b/WebCore/khtml/editing/htmlediting.h
index 7b8216a..734ce92 100644
--- a/WebCore/khtml/editing/htmlediting.h
+++ b/WebCore/khtml/editing/htmlediting.h
@@ -185,11 +185,11 @@ private:
 class AppendNodeCommand : public EditCommand
 {
 public:
-    AppendNodeCommand(DOM::DocumentImpl *, DOM::NodeImpl *parentNode, DOM::NodeImpl *appendChild);
+    AppendNodeCommand(DOM::DocumentImpl *, DOM::NodeImpl *appendChild, DOM::NodeImpl *parentNode);
 	virtual ~AppendNodeCommand();
 
-    DOM::NodeImpl *parentNode() const;
     DOM::NodeImpl *appendChild() const;
+    DOM::NodeImpl *parentNode() const;
     
 private:
     inline AppendNodeCommandImpl *impl() const;
diff --git a/WebCore/khtml/editing/htmlediting_impl.cpp b/WebCore/khtml/editing/htmlediting_impl.cpp
index ecf218c..c1d1279 100644
--- a/WebCore/khtml/editing/htmlediting_impl.cpp
+++ b/WebCore/khtml/editing/htmlediting_impl.cpp
@@ -394,7 +394,7 @@ void CompositeEditCommandImpl::insertNodeBefore(NodeImpl *insertChild, NodeImpl
 void CompositeEditCommandImpl::insertNodeAfter(NodeImpl *insertChild, NodeImpl *refChild)
 {
     if (refChild->parentNode()->lastChild() == refChild) {
-        appendNode(refChild->parentNode(), insertChild);
+        appendNode(insertChild, refChild->parentNode());
     }
     else {
         ASSERT(refChild->nextSibling());
@@ -411,7 +411,7 @@ void CompositeEditCommandImpl::insertNodeAt(NodeImpl *insertChild, NodeImpl *ref
         if (child)
             insertNodeBefore(insertChild, child);
         else
-            appendNode(refChild, insertChild);
+            appendNode(insertChild, refChild);
     } 
     else if (refChild->caretMinOffset() >= offset) {
         insertNodeBefore(insertChild, refChild);
@@ -425,9 +425,9 @@ void CompositeEditCommandImpl::insertNodeAt(NodeImpl *insertChild, NodeImpl *ref
     }
 }
 
-void CompositeEditCommandImpl::appendNode(NodeImpl *parent, NodeImpl *appendChild)
+void CompositeEditCommandImpl::appendNode(NodeImpl *appendChild, NodeImpl *parent)
 {
-    AppendNodeCommand cmd(document(), parent, appendChild);
+    AppendNodeCommand cmd(document(), appendChild, parent);
     applyCommandToComposite(cmd);
 }
 
@@ -554,22 +554,22 @@ ElementImpl *CompositeEditCommandImpl::createTypingStyleElement() const
 //------------------------------------------------------------------------------------------
 // AppendNodeCommandImpl
 
-AppendNodeCommandImpl::AppendNodeCommandImpl(DocumentImpl *document, NodeImpl *parentNode, NodeImpl *appendChild)
-    : EditCommandImpl(document), m_parentNode(parentNode), m_appendChild(appendChild)
+AppendNodeCommandImpl::AppendNodeCommandImpl(DocumentImpl *document, NodeImpl *appendChild, NodeImpl *parentNode)
+    : EditCommandImpl(document), m_appendChild(appendChild), m_parentNode(parentNode)
 {
-    ASSERT(m_parentNode);
-    m_parentNode->ref();
-
     ASSERT(m_appendChild);
     m_appendChild->ref();
+
+    ASSERT(m_parentNode);
+    m_parentNode->ref();
 }
 
 AppendNodeCommandImpl::~AppendNodeCommandImpl()
 {
-    if (m_parentNode)
-        m_parentNode->deref();
     if (m_appendChild)
         m_appendChild->deref();
+    if (m_parentNode)
+        m_parentNode->deref();
 }
 
 int AppendNodeCommandImpl::commandID() const
@@ -579,8 +579,8 @@ int AppendNodeCommandImpl::commandID() const
 
 void AppendNodeCommandImpl::doApply()
 {
-    ASSERT(m_parentNode);
     ASSERT(m_appendChild);
+    ASSERT(m_parentNode);
 
     int exceptionCode = 0;
     m_parentNode->appendChild(m_appendChild, exceptionCode);
@@ -589,8 +589,8 @@ void AppendNodeCommandImpl::doApply()
 
 void AppendNodeCommandImpl::doUnapply()
 {
-    ASSERT(m_parentNode);
     ASSERT(m_appendChild);
+    ASSERT(m_parentNode);
     ASSERT(state() == Applied);
 
     int exceptionCode = 0;
@@ -798,7 +798,7 @@ void ApplyStyleCommandImpl::surroundNodeRangeWithElement(NodeImpl *startNode, No
         NodeImpl *next = node->traverseNextNode();
         if (node->childNodeCount() == 0 && node->renderer() && node->renderer()->isInline()) {
             removeNode(node);
-            appendNode(element, node);
+            appendNode(node, element);
         }
         if (node == endNode)
             break;
@@ -1355,7 +1355,7 @@ void DeleteSelectionCommandImpl::doApply()
             NodeImpl *moveNode = node;
             node = node->nextSibling();
             removeNode(moveNode);
-            appendNode(startBlock, moveNode);
+            appendNode(moveNode, startBlock);
         }
     }
 
@@ -1441,7 +1441,7 @@ void InputNewlineCommandImpl::insertNodeAfterPosition(NodeImpl *node, const Posi
     Position upstream(pos.equivalentUpstreamPosition());
     NodeImpl *cb = pos.node()->enclosingBlockFlowElement();
     if (cb == pos.node())
-        appendNode(cb, node);
+        appendNode(node, cb);
     else
         insertNodeAfter(node, pos.node());
 }
@@ -1454,7 +1454,7 @@ void InputNewlineCommandImpl::insertNodeBeforePosition(NodeImpl *node, const Pos
     Position upstream(pos.equivalentUpstreamPosition());
     NodeImpl *cb = pos.node()->enclosingBlockFlowElement();
     if (cb == pos.node())
-        appendNode(cb, node);
+        appendNode(node, cb);
     else
         insertNodeBefore(node, pos.node());
 }
@@ -1590,7 +1590,7 @@ Position InputTextCommandImpl::prepareForTextInsertion(bool adjustDownstream)
         // Now insert the node in the right place
         if (pos.node()->isEditableBlock()) {
             LOG(Editing, "prepareForTextInsertion case 1");
-            appendNode(pos.node(), nodeToInsert);
+            appendNode(nodeToInsert, pos.node());
         }
         else if (pos.node()->id() == ID_BR && pos.offset() == 1) {
             LOG(Editing, "prepareForTextInsertion case 2");
diff --git a/WebCore/khtml/editing/htmlediting_impl.h b/WebCore/khtml/editing/htmlediting_impl.h
index 8fe67bc..757f047 100644
--- a/WebCore/khtml/editing/htmlediting_impl.h
+++ b/WebCore/khtml/editing/htmlediting_impl.h
@@ -116,7 +116,7 @@ protected:
     //
     // sugary-sweet convenience functions to help create and apply edit commands in composite commands
     //
-    void appendNode(DOM::NodeImpl *parent, DOM::NodeImpl *appendChild);
+    void appendNode(DOM::NodeImpl *appendChild, DOM::NodeImpl *parentNode);
     void applyCommandToComposite(EditCommand &);
     void deleteCollapsibleWhitespace();
     void deleteCollapsibleWhitespace(const DOM::Selection &selection);
@@ -152,7 +152,7 @@ protected:
 class AppendNodeCommandImpl : public EditCommandImpl
 {
 public:
-    AppendNodeCommandImpl(DOM::DocumentImpl *, DOM::NodeImpl *parentNode, DOM::NodeImpl *appendChild);
+    AppendNodeCommandImpl(DOM::DocumentImpl *, DOM::NodeImpl *appendChild, DOM::NodeImpl *parentNode);
 	virtual ~AppendNodeCommandImpl();
 
     virtual int commandID() const;
@@ -160,12 +160,12 @@ public:
 	virtual void doApply();
 	virtual void doUnapply();
 
-    DOM::NodeImpl *parentNode() const { return m_parentNode; }
     DOM::NodeImpl *appendChild() const { return m_appendChild; }
+    DOM::NodeImpl *parentNode() const { return m_parentNode; }
 
 private:
-    DOM::NodeImpl *m_parentNode;    
     DOM::NodeImpl *m_appendChild;
+    DOM::NodeImpl *m_parentNode;    
 };
 
 //------------------------------------------------------------------------------------------

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list