Node* Node::appendChild(Node* aNewChild) { if (!aNewChild) { return nsnull; } NSI_FROM_TX(Node); nsCOMPtr<nsIDOMNode> newChild(do_QueryInterface(aNewChild->getNSObj())); nsCOMPtr<nsIDOMNode> returnValue; nsNode->AppendChild(newChild, getter_AddRefs(returnValue)); if (!returnValue) { return nsnull; } return mOwnerDocument->createWrapper(returnValue); }
Node* appendChild(Node* newChild) { switch (newChild->getNodeType()) { case Node::ELEMENT_NODE : case Node::TEXT_NODE : case Node::COMMENT_NODE : case Node::PROCESSING_INSTRUCTION_NODE : {  NodeDefinition* pNewChild = (NodeDefinition*)newChild; if (pNewChild->getParentNode() == this) pNewChild = implRemoveChild(pNewChild);  return implAppendChild(pNewChild); }  default: break; }  return nsnull; };
Node* Node::appendChild(Node* aNewChild){    if (!aNewChild) {        return nsnull;    }    NSI_FROM_TX(Node);    nsCOMPtr<nsIDOMNode> newChild(do_QueryInterface(aNewChild->getNSObj()));    nsCOMPtr<nsIDOMNode> returnValue;    nsNode->AppendChild(newChild, getter_AddRefs(returnValue));    if (!returnValue) {        return nsnull;    }    return mOwnerDocument->createWrapper(returnValue);}