Bug 1454233: Add a comment about why IsDocument() is the way it is. r=me
authorEmilio Cobos Álvarez <emilio@crisal.io>
Fri, 20 Apr 2018 03:56:02 +0200
changeset 468256 6bec96422fe4ba15e76247e7e8b83e506daf1f6d
parent 468255 cb757c8237f0ae635266eb247032bf9147eb4e38
child 468257 7549ebecdf7e78e3560382a2b25fddb34c0ba60f
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1454233
milestone61.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 1454233: Add a comment about why IsDocument() is the way it is. r=me MozReview-Commit-ID: LYkYnKF9M2c
dom/base/nsINode.h
--- a/dom/base/nsINode.h
+++ b/dom/base/nsINode.h
@@ -448,16 +448,17 @@ public:
     return IsElement() || IsText();
   }
 
   /**
    * Returns true if this is a document node.
    */
   bool IsDocument() const
   {
+    // One less pointer-chase than checking NodeType().
     return !GetParentNode() && IsInUncomposedDoc();
   }
 
   /**
    * Return this node as a document. Asserts IsDocument().
    *
    * This is defined inline in nsIDocument.h.
    */