Bug 1254956 - Implement Node.rootNode. r=smaug
☠☠ backed out by c4891e18a54f ☠ ☠
authorJocelyn Liu <joliu@mozilla.com>
Wed, 16 Mar 2016 09:49:10 +0800
changeset 289615 5eb1f8858a31136b13e9de2cf165d7569c770063
parent 289614 e0ab3a8fa5a48be3100cb750feaa15f7074f75b8
child 289616 95ac2b55d2961613a79859fbd3e1dc4b9b6684a1
push id30108
push usercbook@mozilla.com
push dateTue, 22 Mar 2016 11:14:31 +0000
treeherdermozilla-central@ea6298e1b4f7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1254956
milestone48.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 1254956 - Implement Node.rootNode. r=smaug MozReview-Commit-ID: HeV3qnngbTx
dom/base/nsINode.h
dom/webidl/Node.webidl
--- a/dom/base/nsINode.h
+++ b/dom/base/nsINode.h
@@ -938,16 +938,21 @@ public:
 
   /**
    * 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;
 
+  nsINode* RootNode() const
+  {
+    return SubtreeRoot();
+  }
+
   /**
    * See nsIDOMEventTarget
    */
   NS_DECL_NSIDOMEVENTTARGET
 
   virtual mozilla::EventListenerManager*
     GetExistingListenerManager() const override;
   virtual mozilla::EventListenerManager*
--- a/dom/webidl/Node.webidl
+++ b/dom/webidl/Node.webidl
@@ -32,16 +32,18 @@ interface Node : EventTarget {
   readonly attribute DOMString nodeName;
 
   [Pure]
   readonly attribute DOMString? baseURI;
 
   [Pure]
   readonly attribute Document? ownerDocument;
   [Pure]
+  readonly attribute Node rootNode;
+  [Pure]
   readonly attribute Node? parentNode;
   [Pure]
   readonly attribute Element? parentElement;
   [Pure]
   boolean hasChildNodes();
   [SameObject]
   readonly attribute NodeList childNodes;
   [Pure]