Bug 748725 - nsINode::GetParentElement() should return dom::Element*; r=smaug
authorAryeh Gregor <ayg@aryeh.name>
Fri, 27 Apr 2012 16:21:12 +0300
changeset 92629 64fe2f3a7465e5797f6c72c671724dd85d604343
parent 92628 6b5668320ce422d41400d4c96b595cf14471aa20
child 92630 d15db51bf2704ac965b5adefd556b12468636831
push id22549
push userryanvm@gmail.com
push dateSun, 29 Apr 2012 20:42:32 +0000
treeherdermozilla-central@32a0e99932b2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs748725
milestone15.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 748725 - nsINode::GetParentElement() should return dom::Element*; r=smaug
content/base/public/nsINode.h
--- a/content/base/public/nsINode.h
+++ b/content/base/public/nsINode.h
@@ -397,17 +397,17 @@ public:
    * Return whether the node is an Element node
    */
   bool IsElement() const {
     return GetBoolFlag(NodeIsElement);
   }
 
   /**
    * Return this node as an Element.  Should only be used for nodes
-   * for which IsElement() is true.
+   * for which IsElement() is true.  This is defined inline in Element.h.
    */
   mozilla::dom::Element* AsElement();
 
   virtual nsIDOMNode* AsDOMNode() = 0;
 
   /**
    * Return if this node has any children.
    */
@@ -750,19 +750,19 @@ public:
   {
     return mParent;
   }
   
   /**
    * Get the parent nsINode for this node if it is an Element.
    * @return the parent node
    */
-  nsINode* GetElementParent() const
+  mozilla::dom::Element* GetElementParent() const
   {
-    return mParent && mParent->IsElement() ? mParent : nsnull;
+    return mParent && mParent->IsElement() ? mParent->AsElement() : nsnull;
   }
 
   /**
    * Get the root of the subtree this node belongs to.  This never returns
    * null.  It may return 'this' (e.g. for document nodes, and nodes that
    * are the roots of disconnected subtrees).
    */
   nsINode* SubtreeRoot() const