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

virtual nsresult nsIContent::BindToTree ( nsIDocument *  aDocument,
nsIContent aParent,
nsIContent aBindingParent,
PRBool  aCompileEventHandlers 
) [pure virtual]

Bind this content node to a tree. If this method throws, the caller must call UnbindFromTree() on the node. In the typical case of a node being appended to a parent, this will be called after the node has been added to the parent's child list and before nsIDocumentObserver notifications for the addition are dispatched.

Parameters:
aDocument The new document for the content node. Must match the current document of aParent, if aParent is not null. May not be null if aParent is null.
aParent The new parent for the content node. May be null if the node is being bound as a direct child of the document.
aBindingParent The new binding parent for the content node. This is allowed to be null. In that case, the binding parent of aParent, if any, will be used.
aCompileEventHandlers whether to initialize the event handlers in the document (used by nsXULElement)
Note:
either aDocument or aParent must be non-null. If both are null, this method _will_ crash.

This method must not be called by consumers of nsIContent on a node that is already bound to a tree. Call UnbindFromTree first.

This method will handle rebinding descendants appropriately (eg changing their binding parent as needed).

This method does not add the content node to aParent's child list

Exceptions:
NS_ERROR_OUT_OF_MEMORY if that happens

Implemented in nsGenericElement, nsAttributeTextNode, nsGenericHTMLElement, nsGenericHTMLFormElement, and nsGenericHTMLFrameElement.

Referenced by nsGenericElement::BindToTree(), and nsGenericElement::doInsertChildAt().


Generated by  Doxygen 1.6.0   Back to index