diff --git a/content/base/public/nsINode.h b/content/base/public/nsINode.h index 730e228c41d..d8b614c149a 100644 --- a/content/base/public/nsINode.h +++ b/content/base/public/nsINode.h @@ -262,7 +262,10 @@ public: * * @throws NS_ERROR_OUT_OF_MEMORY in some cases (from BindToTree). */ - virtual nsresult AppendChildTo(nsIContent* aKid, PRBool aNotify) = 0; + nsresult AppendChildTo(nsIContent* aKid, PRBool aNotify) + { + return InsertChildAt(aKid, GetChildCount(), aNotify); + } /** * Remove a child from this node. This method handles calling UnbindFromTree diff --git a/content/base/src/nsGenericDOMDataNode.cpp b/content/base/src/nsGenericDOMDataNode.cpp index 07beaba6a4e..b8657b9aea6 100644 --- a/content/base/src/nsGenericDOMDataNode.cpp +++ b/content/base/src/nsGenericDOMDataNode.cpp @@ -824,12 +824,6 @@ nsGenericDOMDataNode::InsertChildAt(nsIContent* aKid, PRUint32 aIndex, return NS_OK; } -nsresult -nsGenericDOMDataNode::AppendChildTo(nsIContent* aKid, PRBool aNotify) -{ - return NS_OK; -} - nsresult nsGenericDOMDataNode::RemoveChildAt(PRUint32 aIndex, PRBool aNotify) { diff --git a/content/base/src/nsGenericDOMDataNode.h b/content/base/src/nsGenericDOMDataNode.h index d19ad7ab289..fd58c047bcc 100644 --- a/content/base/src/nsGenericDOMDataNode.h +++ b/content/base/src/nsGenericDOMDataNode.h @@ -189,7 +189,6 @@ public: virtual PRInt32 IndexOf(nsINode* aPossibleChild) const; virtual nsresult InsertChildAt(nsIContent* aKid, PRUint32 aIndex, PRBool aNotify); - virtual nsresult AppendChildTo(nsIContent* aKid, PRBool aNotify); virtual nsresult RemoveChildAt(PRUint32 aIndex, PRBool aNotify); virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor); virtual nsresult PostHandleEvent(nsEventChainPostVisitor& aVisitor); diff --git a/content/base/src/nsGenericElement.cpp b/content/base/src/nsGenericElement.cpp index 1e5188ce950..db5fae2ec6a 100644 --- a/content/base/src/nsGenericElement.cpp +++ b/content/base/src/nsGenericElement.cpp @@ -2435,17 +2435,6 @@ nsGenericElement::doInsertChildAt(nsIContent* aKid, PRUint32 aIndex, return NS_OK; } -nsresult -nsGenericElement::AppendChildTo(nsIContent* aKid, PRBool aNotify) -{ - // Make sure to _not_ call the subclass InsertChildAt here. If - // subclasses wanted to hook into this stuff, they would have - // overridden AppendChildTo. - // XXXbz maybe this should just be a non-virtual method on nsINode? - // Feels that way to me... - return nsGenericElement::InsertChildAt(aKid, GetChildCount(), aNotify); -} - nsresult nsGenericElement::RemoveChildAt(PRUint32 aIndex, PRBool aNotify) { diff --git a/content/base/src/nsGenericElement.h b/content/base/src/nsGenericElement.h index 0fff9579172..34a828f77c5 100644 --- a/content/base/src/nsGenericElement.h +++ b/content/base/src/nsGenericElement.h @@ -325,7 +325,6 @@ public: virtual PRInt32 IndexOf(nsINode* aPossibleChild) const; virtual nsresult InsertChildAt(nsIContent* aKid, PRUint32 aIndex, PRBool aNotify); - virtual nsresult AppendChildTo(nsIContent* aKid, PRBool aNotify); virtual nsresult RemoveChildAt(PRUint32 aIndex, PRBool aNotify); virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor); virtual nsresult PostHandleEvent(nsEventChainPostVisitor& aVisitor); diff --git a/content/html/content/src/nsHTMLOptGroupElement.cpp b/content/html/content/src/nsHTMLOptGroupElement.cpp index 200a3da4f48..c091997d463 100644 --- a/content/html/content/src/nsHTMLOptGroupElement.cpp +++ b/content/html/content/src/nsHTMLOptGroupElement.cpp @@ -77,7 +77,6 @@ public: // nsGenericElement virtual nsresult InsertChildAt(nsIContent* aKid, PRUint32 aIndex, PRBool aNotify); - virtual nsresult AppendChildTo(nsIContent* aKid, PRBool aNotify); virtual nsresult RemoveChildAt(PRUint32 aIndex, PRBool aNotify); // nsIContent @@ -215,12 +214,6 @@ nsHTMLOptGroupElement::InsertChildAt(nsIContent* aKid, return nsGenericHTMLElement::InsertChildAt(aKid, aIndex, aNotify); } -nsresult -nsHTMLOptGroupElement::AppendChildTo(nsIContent* aKid, PRBool aNotify) -{ - return nsHTMLOptGroupElement::InsertChildAt(aKid, GetChildCount(), aNotify); -} - nsresult nsHTMLOptGroupElement::RemoveChildAt(PRUint32 aIndex, PRBool aNotify) { diff --git a/content/html/content/src/nsHTMLScriptElement.cpp b/content/html/content/src/nsHTMLScriptElement.cpp index bac480978e1..d0f850acd17 100644 --- a/content/html/content/src/nsHTMLScriptElement.cpp +++ b/content/html/content/src/nsHTMLScriptElement.cpp @@ -366,7 +366,6 @@ public: PRBool aCompileEventHandlers); virtual nsresult InsertChildAt(nsIContent* aKid, PRUint32 aIndex, PRBool aNotify); - virtual nsresult AppendChildTo(nsIContent* aKid, PRBool aNotify); virtual nsresult GetInnerHTML(nsAString& aInnerHTML); virtual nsresult SetInnerHTML(const nsAString& aInnerHTML); @@ -486,17 +485,6 @@ nsHTMLScriptElement::InsertChildAt(nsIContent* aKid, PRUint32 aIndex, return rv; } -nsresult -nsHTMLScriptElement::AppendChildTo(nsIContent* aKid, PRBool aNotify) -{ - nsresult rv = nsGenericHTMLElement::AppendChildTo(aKid, aNotify); - if (NS_SUCCEEDED(rv) && aNotify) { - MaybeProcessScript(); - } - - return rv; -} - nsresult nsHTMLScriptElement::Clone(nsINodeInfo *aNodeInfo, PRBool aDeep, nsIContent **aResult) const diff --git a/content/html/content/src/nsHTMLSelectElement.cpp b/content/html/content/src/nsHTMLSelectElement.cpp index e4b00d19a50..51460d7412b 100644 --- a/content/html/content/src/nsHTMLSelectElement.cpp +++ b/content/html/content/src/nsHTMLSelectElement.cpp @@ -255,7 +255,6 @@ public: virtual PRBool IsFocusable(PRInt32 *aTabIndex = nsnull); virtual nsresult InsertChildAt(nsIContent* aKid, PRUint32 aIndex, PRBool aNotify); - virtual nsresult AppendChildTo(nsIContent* aKid, PRBool aNotify); virtual nsresult RemoveChildAt(PRUint32 aIndex, PRBool aNotify); // Overriden nsIFormControl methods @@ -563,12 +562,6 @@ nsHTMLSelectElement::InsertChildAt(nsIContent* aKid, return NS_OK; } -nsresult -nsHTMLSelectElement::AppendChildTo(nsIContent* aKid, PRBool aNotify) -{ - return InsertChildAt(aKid, GetChildCount(), aNotify); -} - nsresult nsHTMLSelectElement::RemoveChildAt(PRUint32 aIndex, PRBool aNotify) { diff --git a/content/html/content/src/nsHTMLStyleElement.cpp b/content/html/content/src/nsHTMLStyleElement.cpp index 0caa76d7576..db5e1800aa9 100644 --- a/content/html/content/src/nsHTMLStyleElement.cpp +++ b/content/html/content/src/nsHTMLStyleElement.cpp @@ -76,7 +76,6 @@ public: virtual nsresult InsertChildAt(nsIContent* aKid, PRUint32 aIndex, PRBool aNotify); - virtual nsresult AppendChildTo(nsIContent* aKid, PRBool aNotify); virtual nsresult RemoveChildAt(PRUint32 aIndex, PRBool aNotify); virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent, nsIContent* aBindingParent, @@ -186,17 +185,6 @@ nsHTMLStyleElement::InsertChildAt(nsIContent* aKid, PRUint32 aIndex, return rv; } -nsresult -nsHTMLStyleElement::AppendChildTo(nsIContent* aKid, PRBool aNotify) -{ - nsresult rv = nsGenericHTMLElement::AppendChildTo(aKid, aNotify); - if (NS_SUCCEEDED(rv)) { - UpdateStyleSheet(); - } - - return rv; -} - nsresult nsHTMLStyleElement::RemoveChildAt(PRUint32 aIndex, PRBool aNotify) { diff --git a/content/html/content/src/nsHTMLTextAreaElement.cpp b/content/html/content/src/nsHTMLTextAreaElement.cpp index f5af09b27a5..5833e682783 100644 --- a/content/html/content/src/nsHTMLTextAreaElement.cpp +++ b/content/html/content/src/nsHTMLTextAreaElement.cpp @@ -123,7 +123,6 @@ public: // nsIContent virtual nsresult InsertChildAt(nsIContent* aKid, PRUint32 aIndex, PRBool aNotify); - virtual nsresult AppendChildTo(nsIContent* aKid, PRBool aNotify); virtual nsresult RemoveChildAt(PRUint32 aIndex, PRBool aNotify); virtual PRBool ParseAttribute(PRInt32 aNamespaceID, nsIAtom* aAttribute, @@ -511,17 +510,6 @@ nsHTMLTextAreaElement::InsertChildAt(nsIContent* aKid, PRUint32 aIndex, return rv; } -nsresult -nsHTMLTextAreaElement::AppendChildTo(nsIContent* aKid, PRBool aNotify) -{ - nsresult rv; - rv = nsGenericHTMLFormElement::AppendChildTo(aKid, aNotify); - if (!mValueChanged && mDoneAddingChildren) { - Reset(); - } - return rv; -} - nsresult nsHTMLTextAreaElement::RemoveChildAt(PRUint32 aIndex, PRBool aNotify) { diff --git a/content/svg/content/src/nsSVGFilterElement.cpp b/content/svg/content/src/nsSVGFilterElement.cpp index 9e7a9a27739..e71e9833057 100644 --- a/content/svg/content/src/nsSVGFilterElement.cpp +++ b/content/svg/content/src/nsSVGFilterElement.cpp @@ -221,16 +221,6 @@ nsSVGFilterElement::InsertChildAt(nsIContent* aKid, PRUint32 aIndex, return rv; } -nsresult -nsSVGFilterElement::AppendChildTo(nsIContent* aKid, PRBool aNotify) -{ - WillModify(); - nsresult rv = nsSVGFilterElementBase::AppendChildTo(aKid, aNotify); - DidModify(); - - return rv; -} - nsresult nsSVGFilterElement::RemoveChildAt(PRUint32 aIndex, PRBool aNotify) { diff --git a/content/svg/content/src/nsSVGFilterElement.h b/content/svg/content/src/nsSVGFilterElement.h index 43ea82124d3..ec754c57879 100644 --- a/content/svg/content/src/nsSVGFilterElement.h +++ b/content/svg/content/src/nsSVGFilterElement.h @@ -74,7 +74,6 @@ public: // nsIContent virtual nsresult InsertChildAt(nsIContent* aKid, PRUint32 aIndex, PRBool aNotify); - virtual nsresult AppendChildTo(nsIContent* aKid, PRBool aNotify); virtual nsresult RemoveChildAt(PRUint32 aIndex, PRBool aNotify); virtual nsresult SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, nsIAtom* aPrefix, const nsAString& aValue, diff --git a/content/svg/content/src/nsSVGFilters.cpp b/content/svg/content/src/nsSVGFilters.cpp index aa62bfd7047..284ff125bba 100644 --- a/content/svg/content/src/nsSVGFilters.cpp +++ b/content/svg/content/src/nsSVGFilters.cpp @@ -659,7 +659,6 @@ public: // nsIContent virtual nsresult InsertChildAt(nsIContent* aKid, PRUint32 aIndex, PRBool aNotify); - virtual nsresult AppendChildTo(nsIContent* aKid, PRBool aNotify); virtual nsresult RemoveChildAt(PRUint32 aIndex, PRBool aNotify); protected: @@ -843,22 +842,6 @@ nsSVGFEComponentTransferElement::InsertChildAt(nsIContent* aKid, return rv; } -nsresult -nsSVGFEComponentTransferElement::AppendChildTo(nsIContent* aKid, - PRBool aNotify) -{ - nsCOMPtr filter = do_QueryInterface(GetParent()); - nsCOMPtr value = do_QueryInterface(GetParent()); - if (filter && value) - value->BeginBatchUpdate(); - nsresult rv = nsSVGFEComponentTransferElementBase::AppendChildTo(aKid, - aNotify); - if (filter && value) - value->EndBatchUpdate(); - - return rv; -} - nsresult nsSVGFEComponentTransferElement::RemoveChildAt(PRUint32 aIndex, PRBool aNotify) { @@ -1367,7 +1350,6 @@ public: // nsIContent virtual nsresult InsertChildAt(nsIContent* aKid, PRUint32 aIndex, PRBool aNotify); - virtual nsresult AppendChildTo(nsIContent* aKid, PRBool aNotify); virtual nsresult RemoveChildAt(PRUint32 aIndex, PRBool aNotify); protected: @@ -1529,20 +1511,6 @@ nsSVGFEMergeElement::InsertChildAt(nsIContent* aKid, PRUint32 aIndex, return rv; } -nsresult -nsSVGFEMergeElement::AppendChildTo(nsIContent* aKid, PRBool aNotify) -{ - nsCOMPtr filter = do_QueryInterface(GetParent()); - nsCOMPtr value = do_QueryInterface(GetParent()); - if (filter && value) - value->BeginBatchUpdate(); - nsresult rv = nsSVGFEMergeElementBase::AppendChildTo(aKid, aNotify); - if (filter && value) - value->EndBatchUpdate(); - - return rv; -} - nsresult nsSVGFEMergeElement::RemoveChildAt(PRUint32 aIndex, PRBool aNotify) { diff --git a/content/svg/content/src/nsSVGScriptElement.cpp b/content/svg/content/src/nsSVGScriptElement.cpp index dd54a09aaa1..f9c3068353b 100644 --- a/content/svg/content/src/nsSVGScriptElement.cpp +++ b/content/svg/content/src/nsSVGScriptElement.cpp @@ -103,7 +103,6 @@ public: PRBool aCompileEventHandlers); virtual nsresult InsertChildAt(nsIContent* aKid, PRUint32 aIndex, PRBool aNotify); - virtual nsresult AppendChildTo(nsIContent* aKid, PRBool aNotify); protected: /** @@ -399,17 +398,6 @@ nsSVGScriptElement::InsertChildAt(nsIContent* aKid, PRUint32 aIndex, return rv; } -nsresult -nsSVGScriptElement::AppendChildTo(nsIContent* aKid, PRBool aNotify) -{ - nsresult rv = nsSVGScriptElementBase::AppendChildTo(aKid, aNotify); - if (NS_SUCCEEDED(rv) && aNotify) { - MaybeProcessScript(); - } - - return rv; -} - //---------------------------------------------------------------------- // implementation helpers diff --git a/content/svg/content/src/nsSVGStyleElement.cpp b/content/svg/content/src/nsSVGStyleElement.cpp index 28a1bac234a..f3691672154 100644 --- a/content/svg/content/src/nsSVGStyleElement.cpp +++ b/content/svg/content/src/nsSVGStyleElement.cpp @@ -66,7 +66,6 @@ public: // nsIContent virtual nsresult InsertChildAt(nsIContent* aKid, PRUint32 aIndex, PRBool aNotify); - virtual nsresult AppendChildTo(nsIContent* aKid, PRBool aNotify); virtual nsresult RemoveChildAt(PRUint32 aIndex, PRBool aNotify); virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent, nsIContent* aBindingParent, @@ -153,17 +152,6 @@ nsSVGStyleElement::InsertChildAt(nsIContent* aKid, PRUint32 aIndex, return rv; } -nsresult -nsSVGStyleElement::AppendChildTo(nsIContent* aKid, PRBool aNotify) -{ - nsresult rv = nsSVGStyleElementBase::AppendChildTo(aKid, aNotify); - if (NS_SUCCEEDED(rv)) { - UpdateStyleSheet(); - } - - return rv; -} - nsresult nsSVGStyleElement::RemoveChildAt(PRUint32 aIndex, PRBool aNotify) { diff --git a/content/xtf/src/nsXTFElementWrapper.cpp b/content/xtf/src/nsXTFElementWrapper.cpp index f4636bafe75..c0010d29565 100644 --- a/content/xtf/src/nsXTFElementWrapper.cpp +++ b/content/xtf/src/nsXTFElementWrapper.cpp @@ -225,24 +225,6 @@ nsXTFElementWrapper::InsertChildAt(nsIContent* aKid, PRUint32 aIndex, return rv; } -nsresult -nsXTFElementWrapper::AppendChildTo(nsIContent* aKid, PRBool aNotify) -{ - nsresult rv; - - nsCOMPtr domKid; - if (mNotificationMask & (nsIXTFElement::NOTIFY_WILL_APPEND_CHILD | - nsIXTFElement::NOTIFY_CHILD_APPENDED)) - domKid = do_QueryInterface(aKid); - - if (mNotificationMask & nsIXTFElement::NOTIFY_WILL_APPEND_CHILD) - GetXTFElement()->WillAppendChild(domKid); - rv = nsXTFElementWrapperBase::AppendChildTo(aKid, aNotify); - if (mNotificationMask & nsIXTFElement::NOTIFY_CHILD_APPENDED) - GetXTFElement()->ChildAppended(domKid); - return rv; -} - nsresult nsXTFElementWrapper::RemoveChildAt(PRUint32 aIndex, PRBool aNotify) { diff --git a/content/xtf/src/nsXTFElementWrapper.h b/content/xtf/src/nsXTFElementWrapper.h index 0f5e0ad3bdb..61ae6c81d65 100644 --- a/content/xtf/src/nsXTFElementWrapper.h +++ b/content/xtf/src/nsXTFElementWrapper.h @@ -84,7 +84,6 @@ public: PRBool aNullParent = PR_TRUE); nsresult InsertChildAt(nsIContent* aKid, PRUint32 aIndex, PRBool aNotify); - nsresult AppendChildTo(nsIContent* aKid, PRBool aNotify); nsresult RemoveChildAt(PRUint32 aIndex, PRBool aNotify); nsIAtom *GetIDAttributeName() const; nsresult SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,