Bug 1220822 - Rewrite the nsINode::OwnerDoc comment to not contradict itself and relate it to HTML5 terms. r=baku

This commit is contained in:
Jonathan Watt 2015-10-02 17:16:49 +01:00
parent 16db592cf7
commit a0434bc1d8

View File

@ -471,10 +471,18 @@ public:
virtual int32_t IndexOf(const nsINode* aPossibleChild) const = 0;
/**
* Return the "owner document" of this node. Note that this is not the same
* as the DOM ownerDocument -- that's null for Document nodes, whereas for a
* nsIDocument GetOwnerDocument returns the document itself. For nsIContent
* implementations the two are the same.
* Returns the "node document" of this node.
*
* https://dom.spec.whatwg.org/#concept-node-document
*
* Note that in the case that this node is a document node this method
* will return |this|. That is different to the Node.ownerDocument DOM
* attribute (implemented by nsINode::GetOwnerDocument) which is specified to
* be null in that case:
*
* https://dom.spec.whatwg.org/#dom-node-ownerdocument
*
* For all other cases GetOwnerDoc and GetOwnerDocument behave identically.
*/
nsIDocument *OwnerDoc() const
{