Logo Search packages:      
Sourcecode: xulrunner-1.9 version File versions

virtual nsresult nsINode::InsertChildAt ( nsIContent aKid,
PRUint32  aIndex,
PRBool  aNotify 
) [pure virtual]

Insert a content node at a particular index. This method handles calling BindToTree on the child appropriately.

aKid the content to insert
aIndex the index it is being inserted at (the index it will have after it is inserted)
aNotify whether to notify the document (current document for nsIContent, and |this| for nsIDocument) that the insert has occurred
NS_ERROR_DOM_HIERARCHY_REQUEST_ERR if one attempts to have more than one element node as a child of a document. Doing this will also assert -- you shouldn't be doing it! Check with nsIDocument::GetRootContent() first if you're not sure. Apart from this one constraint, this doesn't do any checking on whether aKid is a valid child of |this|.
NS_ERROR_OUT_OF_MEMORY in some cases (from BindToTree).

Implemented in nsGenericElement, nsHTMLOptGroupElement, and nsHTMLSelectElement.

Referenced by AppendChildTo(), nsXULDocument::CreateAndInsertPI(), nsGenericElement::doReplaceOrInsertBefore(), nsXULContentBuilder::InsertSortedNode(), nsXULDocument::InsertXMLStylesheetPI(), and nsXULDocument::InsertXULOverlayPI().

Generated by  Doxygen 1.6.0   Back to index