Bug 1455676 part 14. Remove most use of nsIDOMNode in dom/. r=qdot
authorBoris Zbarsky <bzbarsky@mit.edu>
Tue, 29 May 2018 22:58:49 -0400
changeset 420396 e46b5b3027713125c2e472c3d1d9dc0ba8a3387a
parent 420395 3b02b634a18a41be902312d9096eff92c6cb6d62
child 420397 a81f7f1c0303ca30fd2157bff30937fad653577d
push id34071
push userncsoregi@mozilla.com
push dateWed, 30 May 2018 09:25:30 +0000
treeherdermozilla-central@5866d6685849 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersqdot
bugs1455676
milestone62.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 1455676 part 14. Remove most use of nsIDOMNode in dom/. r=qdot
dom/base/FragmentOrElement.cpp
dom/base/FragmentOrElement.h
dom/base/IDTracker.cpp
dom/base/NodeInfo.h
dom/base/NodeIterator.cpp
dom/base/NodeIterator.h
dom/base/Selection.cpp
dom/base/TreeWalker.cpp
dom/base/TreeWalker.h
dom/base/nsContentAreaDragDrop.cpp
dom/base/nsContentIterator.cpp
dom/base/nsContentList.cpp
dom/base/nsContentPolicy.cpp
dom/base/nsContentPolicyUtils.h
dom/base/nsContentSink.cpp
dom/base/nsContentUtils.cpp
dom/base/nsContentUtils.h
dom/base/nsCopySupport.cpp
dom/base/nsDocumentEncoder.cpp
dom/base/nsFocusManager.cpp
dom/base/nsINode.cpp
dom/base/nsImageLoadingContent.cpp
dom/base/nsRange.cpp
dom/base/nsRange.h
dom/base/nsStyleLinkElement.cpp
dom/base/nsTraversal.cpp
dom/events/DataTransfer.cpp
dom/events/DataTransfer.h
dom/events/EventStateManager.cpp
dom/events/InternalMutationEvent.h
dom/events/MutationEvent.cpp
dom/events/MutationEvent.h
dom/events/UIEvent.cpp
dom/html/HTMLFormControlsCollection.cpp
dom/html/HTMLInputElement.cpp
dom/html/nsHTMLDocument.cpp
dom/security/nsCSPContext.cpp
dom/svg/SVGAnimateElement.cpp
dom/svg/SVGAnimateElement.h
dom/svg/SVGAnimateMotionElement.cpp
dom/svg/SVGAnimateMotionElement.h
dom/svg/SVGAnimateTransformElement.cpp
dom/svg/SVGAnimateTransformElement.h
dom/svg/SVGCircleElement.cpp
dom/svg/SVGClipPathElement.cpp
dom/svg/SVGDefsElement.cpp
dom/svg/SVGDescElement.cpp
dom/svg/SVGEllipseElement.cpp
dom/svg/SVGFEBlendElement.cpp
dom/svg/SVGFEColorMatrixElement.cpp
dom/svg/SVGFEComponentTransferElement.cpp
dom/svg/SVGFECompositeElement.cpp
dom/svg/SVGFEConvolveMatrixElement.cpp
dom/svg/SVGFEDiffuseLightingElement.cpp
dom/svg/SVGFEDisplacementMapElement.cpp
dom/svg/SVGFEDistantLightElement.cpp
dom/svg/SVGFEDropShadowElement.cpp
dom/svg/SVGFEFloodElement.cpp
dom/svg/SVGFEGaussianBlurElement.cpp
dom/svg/SVGFEImageElement.cpp
dom/svg/SVGFEMergeNodeElement.cpp
dom/svg/SVGFEMorphologyElement.cpp
dom/svg/SVGFEOffsetElement.cpp
dom/svg/SVGFEPointLightElement.cpp
dom/svg/SVGFESpecularLightingElement.cpp
dom/svg/SVGFESpotLightElement.cpp
dom/svg/SVGFETileElement.cpp
dom/svg/SVGFETurbulenceElement.cpp
dom/svg/SVGFilterElement.cpp
dom/svg/SVGForeignObjectElement.cpp
dom/svg/SVGGElement.cpp
dom/svg/SVGGradientElement.cpp
dom/svg/SVGImageElement.cpp
dom/svg/SVGLineElement.cpp
dom/svg/SVGMPathElement.cpp
dom/svg/SVGMarkerElement.cpp
dom/svg/SVGMaskElement.cpp
dom/svg/SVGMetadataElement.cpp
dom/svg/SVGPathElement.cpp
dom/svg/SVGPatternElement.cpp
dom/svg/SVGPolygonElement.cpp
dom/svg/SVGPolylineElement.cpp
dom/svg/SVGRectElement.cpp
dom/svg/SVGSVGElement.cpp
dom/svg/SVGScriptElement.cpp
dom/svg/SVGSetElement.cpp
dom/svg/SVGSetElement.h
dom/svg/SVGStopElement.cpp
dom/svg/SVGStyleElement.cpp
dom/svg/SVGSwitchElement.cpp
dom/svg/SVGSymbolElement.cpp
dom/svg/SVGTSpanElement.cpp
dom/svg/SVGTextElement.cpp
dom/svg/SVGTextPathElement.cpp
dom/svg/SVGTitleElement.cpp
dom/svg/SVGUseElement.cpp
dom/svg/SVGViewElement.cpp
dom/webbrowserpersist/WebBrowserPersistLocalDocument.cpp
dom/xbl/nsXBLContentSink.cpp
dom/xbl/nsXBLProtoImpl.cpp
dom/xml/XMLStylesheetProcessingInstruction.cpp
dom/xml/XMLStylesheetProcessingInstruction.h
dom/xslt/xpath/XPathResult.cpp
dom/xslt/xpath/txXPathTreeWalker.h
dom/xslt/xslt/txEXSLTFunctions.cpp
dom/xslt/xslt/txMozillaStylesheetCompiler.cpp
dom/xslt/xslt/txMozillaXSLTProcessor.cpp
dom/xul/XULDocument.cpp
dom/xul/nsXULCommandDispatcher.h
dom/xul/nsXULElement.cpp
--- a/dom/base/FragmentOrElement.cpp
+++ b/dom/base/FragmentOrElement.cpp
@@ -1321,17 +1321,17 @@ FragmentOrElement::FireNodeInserted(nsID
 {
   uint32_t count = aNodes.Length();
   for (uint32_t i = 0; i < count; ++i) {
     nsIContent* childContent = aNodes[i];
 
     if (nsContentUtils::HasMutationListeners(childContent,
           NS_EVENT_BITS_MUTATION_NODEINSERTED, aParent)) {
       InternalMutationEvent mutation(true, eLegacyNodeInserted);
-      mutation.mRelatedNode = do_QueryInterface(aParent);
+      mutation.mRelatedNode = aParent;
 
       mozAutoSubtreeModified subtree(aDoc, aParent);
       (new AsyncEventDispatcher(childContent, mutation))->RunDOMEventWhenSafe();
     }
   }
 }
 
 //----------------------------------------------------------------------
--- a/dom/base/FragmentOrElement.h
+++ b/dom/base/FragmentOrElement.h
@@ -1,17 +1,17 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * Base class for all element classes as well as nsDocumentFragment.  This
- * provides an implementation of nsIDOMNode, implements nsIContent, provides
+ * provides an implementation of nsINode, implements nsIContent, provides
  * utility methods for subclasses, and so forth.
  */
 
 #ifndef FragmentOrElement_h___
 #define FragmentOrElement_h___
 
 #include "mozilla/Attributes.h"
 #include "mozilla/MemoryReporting.h"
@@ -66,17 +66,17 @@ public:
 private:
   ~nsNodeSupportsWeakRefTearoff() {}
 
   nsCOMPtr<nsINode> mNode;
 };
 
 /**
  * A generic base class for DOM elements and document fragments,
- * implementing many nsIContent, nsIDOMNode and Element methods.
+ * implementing many nsIContent, nsINode and Element methods.
  */
 namespace mozilla {
 namespace dom {
 
 class ShadowRoot;
 
 class FragmentOrElement : public nsIContent
 {
--- a/dom/base/IDTracker.cpp
+++ b/dom/base/IDTracker.cpp
@@ -7,17 +7,16 @@
 #include "IDTracker.h"
 
 #include "mozilla/Encoding.h"
 #include "nsContentUtils.h"
 #include "nsIURI.h"
 #include "nsBindingManager.h"
 #include "nsEscape.h"
 #include "nsXBLPrototypeBinding.h"
-#include "nsIDOMNode.h"
 #include "nsCycleCollectionParticipant.h"
 
 namespace mozilla {
 namespace dom {
 
 void
 IDTracker::Reset(nsIContent* aFromContent, nsIURI* aURI,
                  bool aWatch, bool aReferenceImage)
--- a/dom/base/NodeInfo.h
+++ b/dom/base/NodeInfo.h
@@ -115,18 +115,18 @@ public:
    * returns kNameSpaceID_None.
    */
   int32_t NamespaceID() const
   {
     return mInner.mNamespaceID;
   }
 
   /*
-   * Get the nodetype for the node. Returns the values specified in nsIDOMNode
-   * for nsIDOMNode.nodeType
+   * Get the nodetype for the node. Returns the values specified in Node
+   * for Node.nodeType
    */
   uint16_t NodeType() const
   {
     return mInner.mNodeType;
   }
 
   /*
    * Get the extra name, used by PIs and DocTypes, for the node.
@@ -297,17 +297,17 @@ protected:
             mName ? mName->hash() : mozilla::HashString(*mNameString));
       }
       return mHash.value();
     }
 
     nsAtom* const MOZ_OWNING_REF mName;
     nsAtom* MOZ_OWNING_REF mPrefix;
     int32_t             mNamespaceID;
-    uint16_t            mNodeType; // As defined by nsIDOMNode.nodeType
+    uint16_t            mNodeType; // As defined by Node.nodeType
     const nsAString* const mNameString;
     nsAtom* MOZ_OWNING_REF mExtraName; // Only used by PIs and DocTypes
     mutable mozilla::Maybe<const uint32_t> mHash;
   };
 
   // nsNodeInfoManager needs to pass mInner to the hash table.
   friend class ::nsNodeInfoManager;
 
--- a/dom/base/NodeIterator.cpp
+++ b/dom/base/NodeIterator.cpp
@@ -5,17 +5,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * Implementation of DOM Traversal's NodeIterator
  */
 
 #include "mozilla/dom/NodeIterator.h"
 
-#include "nsIDOMNode.h"
 #include "nsError.h"
 
 #include "nsIContent.h"
 #include "nsIDocument.h"
 #include "nsContentUtils.h"
 #include "nsCOMPtr.h"
 #include "mozilla/dom/NodeFilterBinding.h"
 #include "mozilla/dom/NodeIteratorBinding.h"
--- a/dom/base/NodeIterator.h
+++ b/dom/base/NodeIterator.h
@@ -11,17 +11,16 @@
 #ifndef mozilla_dom_NodeIterator_h
 #define mozilla_dom_NodeIterator_h
 
 #include "nsTraversal.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsStubMutationObserver.h"
 
 class nsINode;
-class nsIDOMNode;
 
 namespace mozilla {
 namespace dom {
 
 class NodeIterator final : public nsStubMutationObserver,
                            public nsTraversal
 {
 public:
--- a/dom/base/Selection.cpp
+++ b/dom/base/Selection.cpp
@@ -18,17 +18,16 @@
 
 #include "nsCOMPtr.h"
 #include "nsString.h"
 #include "nsFrameSelection.h"
 #include "nsISelectionListener.h"
 #include "nsContentCID.h"
 #include "nsDeviceContext.h"
 #include "nsIContent.h"
-#include "nsIDOMNode.h"
 #include "nsRange.h"
 #include "nsITableCellLayout.h"
 #include "nsTArray.h"
 #include "nsTableWrapperFrame.h"
 #include "nsTableCellFrame.h"
 #include "nsIScrollableFrame.h"
 #include "nsCCUncollectableMarker.h"
 #include "nsIContentIterator.h"
--- a/dom/base/TreeWalker.cpp
+++ b/dom/base/TreeWalker.cpp
@@ -6,17 +6,16 @@
 
 /*
  * Implementation of DOM Traversal's TreeWalker
  */
 
 #include "mozilla/dom/TreeWalker.h"
 
 #include "nsIContent.h"
-#include "nsIDOMNode.h"
 #include "nsError.h"
 #include "nsINode.h"
 #include "nsContentUtils.h"
 #include "mozilla/dom/NodeFilterBinding.h"
 #include "mozilla/dom/TreeWalkerBinding.h"
 
 namespace mozilla {
 namespace dom {
--- a/dom/base/TreeWalker.h
+++ b/dom/base/TreeWalker.h
@@ -13,17 +13,16 @@
 
 #include "nsISupports.h"
 #include "nsTraversal.h"
 #include "nsCOMPtr.h"
 #include "nsTArray.h"
 #include "nsCycleCollectionParticipant.h"
 
 class nsINode;
-class nsIDOMNode;
 
 namespace mozilla {
 namespace dom {
 
 class TreeWalker final : public nsISupports, public nsTraversal
 {
     virtual ~TreeWalker();
 
--- a/dom/base/nsContentAreaDragDrop.cpp
+++ b/dom/base/nsContentAreaDragDrop.cpp
@@ -10,17 +10,16 @@
 #include "nsContentAreaDragDrop.h"
 
 // Helper Classes
 #include "nsString.h"
 
 // Interfaces needed to be included
 #include "nsCopySupport.h"
 #include "nsISelectionController.h"
-#include "nsIDOMNode.h"
 #include "nsPIDOMWindow.h"
 #include "nsIFormControl.h"
 #include "nsITransferable.h"
 #include "nsComponentManagerUtils.h"
 #include "nsXPCOM.h"
 #include "nsISupportsPrimitives.h"
 #include "nsServiceManagerUtils.h"
 #include "nsNetUtil.h"
--- a/dom/base/nsContentIterator.cpp
+++ b/dom/base/nsContentIterator.cpp
@@ -1011,17 +1011,17 @@ nsContentSubtreeIterator::InitWithRange(
     if (!child || startOffset == endOffset) {
       // Text node, empty container, or collapsed
       MakeEmpty();
       return NS_OK;
     }
   }
 
   // cache ancestors
-  nsContentUtils::GetAncestorsAndOffsets(endContainer->AsDOMNode(), endOffset,
+  nsContentUtils::GetAncestorsAndOffsets(endContainer, endOffset,
                                          &mEndNodes, &mEndOffsets);
 
   nsIContent* firstCandidate = nullptr;
   nsIContent* lastCandidate = nullptr;
 
   // find first node in range
   int32_t offset = mRange->StartOffset();
 
--- a/dom/base/nsContentList.cpp
+++ b/dom/base/nsContentList.cpp
@@ -7,17 +7,16 @@
 /*
  * nsBaseContentList is a basic list of content nodes; nsContentList
  * is a commonly used NodeList implementation (used for
  * getElementsByTagName, some properties on HTMLDocument/Document, etc).
  */
 
 #include "nsContentList.h"
 #include "nsIContent.h"
-#include "nsIDOMNode.h"
 #include "nsIDocument.h"
 #include "mozilla/dom/Element.h"
 #include "nsWrapperCacheInlines.h"
 #include "nsContentUtils.h"
 #include "nsCCUncollectableMarker.h"
 #include "nsGkAtoms.h"
 #include "mozilla/dom/HTMLCollectionBinding.h"
 #include "mozilla/dom/NodeListBinding.h"
--- a/dom/base/nsContentPolicy.cpp
+++ b/dom/base/nsContentPolicy.cpp
@@ -12,17 +12,16 @@
 
 #include "nsISupports.h"
 #include "nsXPCOM.h"
 #include "nsContentPolicyUtils.h"
 #include "mozilla/dom/nsCSPService.h"
 #include "nsContentPolicy.h"
 #include "nsIURI.h"
 #include "nsIDocShell.h"
-#include "nsIDOMNode.h"
 #include "nsIDOMWindow.h"
 #include "nsITabChild.h"
 #include "nsIContent.h"
 #include "nsIImageLoadingContent.h"
 #include "nsILoadContext.h"
 #include "nsCOMArray.h"
 #include "nsContentUtils.h"
 #include "mozilla/dom/nsMixedContentBlocker.h"
@@ -89,17 +88,17 @@ nsContentPolicy::CheckPolicy(CPMethod   
 
     //sanity-check passed-through parameters
     MOZ_ASSERT(decision, "Null out pointer");
     WARN_IF_URI_UNINITIALIZED(contentLocation, "Request URI");
     WARN_IF_URI_UNINITIALIZED(requestingLocation, "Requesting URI");
 
 #ifdef DEBUG
     {
-        nsCOMPtr<nsIDOMNode> node(do_QueryInterface(requestingContext));
+        nsCOMPtr<nsINode> node(do_QueryInterface(requestingContext));
         nsCOMPtr<nsIDOMWindow> window(do_QueryInterface(requestingContext));
         nsCOMPtr<nsITabChild> tabChild(do_QueryInterface(requestingContext));
         NS_ASSERTION(!requestingContext || node || window || tabChild,
                      "Context should be a DOM node, DOM window or a tabChild!");
     }
 #endif
 
     /*
--- a/dom/base/nsContentPolicyUtils.h
+++ b/dom/base/nsContentPolicyUtils.h
@@ -280,18 +280,17 @@ NS_CP_GetDocShellFromContext(nsISupports
 {
     if (!aContext) {
         return nullptr;
     }
 
     nsCOMPtr<nsPIDOMWindowOuter> window = do_QueryInterface(aContext);
 
     if (!window) {
-        // our context might be a document (which also QIs to nsIDOMNode), so
-        // try that first
+        // Our context might be a document.
         nsCOMPtr<nsIDocument> doc = do_QueryInterface(aContext);
         if (!doc) {
             // we were not a document after all, get our ownerDocument,
             // hopefully
             nsCOMPtr<nsIContent> content = do_QueryInterface(aContext);
             if (content) {
                 doc = content->OwnerDoc();
             }
--- a/dom/base/nsContentSink.cpp
+++ b/dom/base/nsContentSink.cpp
@@ -35,17 +35,16 @@
 #include "nsIApplicationCacheChannel.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsICookieService.h"
 #include "nsContentUtils.h"
 #include "nsNodeInfoManager.h"
 #include "nsIAppShell.h"
 #include "nsIWidget.h"
 #include "nsWidgetsCID.h"
-#include "nsIDOMNode.h"
 #include "mozAutoDocUpdate.h"
 #include "nsIWebNavigation.h"
 #include "nsGenericHTMLElement.h"
 #include "nsHTMLDNSPrefetch.h"
 #include "nsIObserverService.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/dom/ServiceWorkerDescriptor.h"
 #include "mozilla/dom/ScriptLoader.h"
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -128,17 +128,16 @@
 #include "nsIContentSecurityPolicy.h"
 #include "nsIContentSink.h"
 #include "nsIContentViewer.h"
 #include "nsIDocShell.h"
 #include "nsIDocShellTreeOwner.h"
 #include "nsIDocument.h"
 #include "nsIDocumentEncoder.h"
 #include "nsIDOMChromeWindow.h"
-#include "nsIDOMNode.h"
 #include "nsIDOMWindowUtils.h"
 #include "nsIDragService.h"
 #include "nsIFormControl.h"
 #include "nsIForm.h"
 #include "nsIFragmentContentSink.h"
 #include "nsContainerFrame.h"
 #include "nsIHTMLDocument.h"
 #include "nsIIdleService.h"
@@ -2066,20 +2065,17 @@ nsContentUtils::Shutdown()
   }
 
   HTMLInputElement::Shutdown();
   nsMappedAttributes::Shutdown();
 }
 
 /**
  * Checks whether two nodes come from the same origin. aTrustedNode is
- * considered 'safe' in that a user can operate on it and that it isn't
- * a js-object that implements nsIDOMNode.
- * Never call this function with the first node provided by script, it
- * must always be known to be a 'real' node!
+ * considered 'safe' in that a user can operate on it.
  */
 // static
 nsresult
 nsContentUtils::CheckSameOrigin(const nsINode* aTrustedNode,
                                 const nsINode* unTrustedNode)
 {
   MOZ_ASSERT(aTrustedNode);
   MOZ_ASSERT(unTrustedNode);
@@ -2121,25 +2117,16 @@ nsContentUtils::CanCallerAccess(nsIPrinc
 
   // The subject doesn't subsume aPrincipal. Allow access only if the subject
   // is chrome.
   return IsCallerChrome();
 }
 
 // static
 bool
-nsContentUtils::CanCallerAccess(nsIDOMNode *aNode)
-{
-  nsCOMPtr<nsINode> node = do_QueryInterface(aNode);
-  NS_ENSURE_TRUE(node, false);
-  return CanCallerAccess(node);
-}
-
-// static
-bool
 nsContentUtils::CanCallerAccess(nsINode* aNode)
 {
   return CanCallerAccess(SubjectPrincipal(), aNode->NodePrincipal());
 }
 
 // static
 bool
 nsContentUtils::CanCallerAccess(nsPIDOMWindowInner* aWindow)
@@ -2592,75 +2579,55 @@ nsContentUtils::GetAncestors(nsINode* aN
     aArray.AppendElement(aNode);
     aNode = aNode->GetParentNode();
   }
   return NS_OK;
 }
 
 // static
 nsresult
-nsContentUtils::GetAncestorsAndOffsets(nsIDOMNode* aNode,
+nsContentUtils::GetAncestorsAndOffsets(nsINode* aNode,
                                        int32_t aOffset,
                                        nsTArray<nsIContent*>* aAncestorNodes,
                                        nsTArray<int32_t>* aAncestorOffsets)
 {
   NS_ENSURE_ARG_POINTER(aNode);
 
-  nsCOMPtr<nsIContent> content(do_QueryInterface(aNode));
-
-  if (!content) {
+  if (!aNode->IsContent()) {
     return NS_ERROR_FAILURE;
   }
+  nsIContent* content = aNode->AsContent();
 
   if (!aAncestorNodes->IsEmpty()) {
     NS_WARNING("aAncestorNodes is not empty");
     aAncestorNodes->Clear();
   }
 
   if (!aAncestorOffsets->IsEmpty()) {
     NS_WARNING("aAncestorOffsets is not empty");
     aAncestorOffsets->Clear();
   }
 
   // insert the node itself
-  aAncestorNodes->AppendElement(content.get());
+  aAncestorNodes->AppendElement(content);
   aAncestorOffsets->AppendElement(aOffset);
 
   // insert all the ancestors
   nsIContent* child = content;
   nsIContent* parent = child->GetParent();
   while (parent) {
     aAncestorNodes->AppendElement(parent);
     aAncestorOffsets->AppendElement(parent->ComputeIndexOf(child));
     child = parent;
     parent = parent->GetParent();
   }
 
   return NS_OK;
 }
 
-// static
-nsresult
-nsContentUtils::GetCommonAncestor(nsIDOMNode *aNode,
-                                  nsIDOMNode *aOther,
-                                  nsIDOMNode** aCommonAncestor)
-{
-  *aCommonAncestor = nullptr;
-
-  nsCOMPtr<nsINode> node1 = do_QueryInterface(aNode);
-  nsCOMPtr<nsINode> node2 = do_QueryInterface(aOther);
-
-  NS_ENSURE_TRUE(node1 && node2, NS_ERROR_UNEXPECTED);
-
-  nsINode* common = GetCommonAncestor(node1, node2);
-  NS_ENSURE_TRUE(common, NS_ERROR_NOT_AVAILABLE);
-
-  return CallQueryInterface(common, aCommonAncestor);
-}
-
 template <typename Node, typename GetParentFunc>
 static Node*
 GetCommonAncestorInternal(Node* aNode1,
                           Node* aNode2,
                           GetParentFunc aGetParentFunc)
 {
   MOZ_ASSERT(aNode1 != aNode2);
 
@@ -2799,28 +2766,16 @@ nsContentUtils::ComparePoints(nsINode* a
   nsINode* child1 = parents1.ElementAt(--pos1);
   // XXX aOffset2 may be -1 as mentioned above.  So, why does this return it's
   //     *after* of the valid DOM point?
   return parent->ComputeIndexOf(child1) < aOffset2 ? -1 : 1;
 }
 
 /* static */
 int32_t
-nsContentUtils::ComparePoints(nsIDOMNode* aParent1, int32_t aOffset1,
-                              nsIDOMNode* aParent2, int32_t aOffset2,
-                              bool* aDisconnected)
-{
-  nsCOMPtr<nsINode> parent1 = do_QueryInterface(aParent1);
-  nsCOMPtr<nsINode> parent2 = do_QueryInterface(aParent2);
-  NS_ENSURE_TRUE(parent1 && parent2, -1);
-  return ComparePoints(parent1, aOffset1, parent2, aOffset2);
-}
-
-/* static */
-int32_t
 nsContentUtils::ComparePoints(const RawRangeBoundary& aFirst,
                               const RawRangeBoundary& aSecond,
                               bool* aDisconnected)
 {
   if (NS_WARN_IF(!aFirst.IsSet()) || NS_WARN_IF(!aSecond.IsSet())) {
     return -1;
   }
   return ComparePoints(aFirst.Container(), aFirst.Offset(),
@@ -4795,17 +4750,17 @@ nsContentUtils::MaybeFireNodeRemoved(nsI
       WarnScriptWasIgnored(aChild->OwnerDoc());
     }
     return;
   }
 
   if (HasMutationListeners(aChild,
         NS_EVENT_BITS_MUTATION_NODEREMOVED, aParent)) {
     InternalMutationEvent mutation(true, eLegacyNodeRemoved);
-    mutation.mRelatedNode = do_QueryInterface(aParent);
+    mutation.mRelatedNode = aParent;
 
     mozAutoSubtreeModified subtree(aParent->OwnerDoc(), aParent);
     EventDispatcher::Dispatch(aChild, nullptr, &mutation);
   }
 }
 
 void
 nsContentUtils::UnmarkGrayJSListenersInCCGenerationDocuments()
--- a/dom/base/nsContentUtils.h
+++ b/dom/base/nsContentUtils.h
@@ -64,17 +64,16 @@ class nsHtml5StringParser;
 class nsAtom;
 class nsIChannel;
 class nsIConsoleService;
 class nsIContent;
 class nsIContentPolicy;
 class nsIContentSecurityPolicy;
 class nsIDocShellTreeItem;
 class nsIDocumentLoaderFactory;
-class nsIDOMNode;
 class nsIDragSession;
 class nsIEventTarget;
 class nsIFragmentContentSink;
 class nsIFrame;
 class nsIImageLoadingContent;
 class nsIInterfaceRequestor;
 class nsIIOService;
 class nsILoadInfo;
@@ -381,31 +380,21 @@ public:
   /*
    * This method fills |aAncestorNodes| with all ancestor nodes of |aNode|
    * including |aNode| (QI'd to nsIContent) at the zero index.
    * For each ancestor, there is a corresponding element in |aAncestorOffsets|
    * which is the IndexOf the child in relation to its parent.
    *
    * This method just sucks.
    */
-  static nsresult GetAncestorsAndOffsets(nsIDOMNode* aNode,
+  static nsresult GetAncestorsAndOffsets(nsINode* aNode,
                                          int32_t aOffset,
                                          nsTArray<nsIContent*>* aAncestorNodes,
                                          nsTArray<int32_t>* aAncestorOffsets);
 
-  /*
-   * The out parameter, |aCommonAncestor| will be the closest node, if any,
-   * to both |aNode| and |aOther| which is also an ancestor of each.
-   * Returns an error if the two nodes are disconnected and don't have
-   * a common ancestor.
-   */
-  static nsresult GetCommonAncestor(nsIDOMNode *aNode,
-                                    nsIDOMNode *aOther,
-                                    nsIDOMNode** aCommonAncestor);
-
   /**
    * Returns the common ancestor, if any, for two nodes.
    *
    * Returns null if the nodes are disconnected.
    */
   static nsINode* GetCommonAncestor(nsINode* aNode1, nsINode* aNode2)
   {
     if (aNode1 == aNode2) {
@@ -456,19 +445,16 @@ public:
    *      negative offset values!  E.g., when aOffset1 is -1 and aOffset is 0,
    *      these methods return -1.  Some root callers depend on this behavior.
    *      On the other hand, nsINode can have ATTRCHILD_ARRAY_MAX_CHILD_COUN
    *      (0x3FFFFF) at most.  Therefore, they can be int32_t for now.
    */
   static int32_t ComparePoints(nsINode* aParent1, int32_t aOffset1,
                                nsINode* aParent2, int32_t aOffset2,
                                bool* aDisconnected = nullptr);
-  static int32_t ComparePoints(nsIDOMNode* aParent1, int32_t aOffset1,
-                               nsIDOMNode* aParent2, int32_t aOffset2,
-                               bool* aDisconnected = nullptr);
   static int32_t ComparePoints(const mozilla::RawRangeBoundary& aFirst,
                                const mozilla::RawRangeBoundary& aSecond,
                                bool* aDisconnected = nullptr);
 
   /**
    * Brute-force search of the element subtree rooted at aContent for
    * an element with the given id.  aId must be nonempty, otherwise
    * this method may return nodes even if they have no id!
@@ -482,17 +468,17 @@ public:
 
   /**
    * Reverses the document position flags passed in.
    *
    * @param   aDocumentPosition   The document position flags to be reversed.
    *
    * @return  The reversed document position flags.
    *
-   * @see nsIDOMNode
+   * @see Node
    */
   static uint16_t ReverseDocumentPosition(uint16_t aDocumentPosition);
 
   /**
    * Returns a subdocument for aDocument with a particular outer window ID.
    *
    * @param aDocument
    *        The document whose subdocuments will be searched.
@@ -588,17 +574,16 @@ public:
 
   /**
    * Checks whether two nodes come from the same origin.
    */
   static nsresult CheckSameOrigin(const nsINode* aTrustedNode,
                                   const nsINode* unTrustedNode);
 
   // Check if the (JS) caller can access aNode.
-  static bool CanCallerAccess(nsIDOMNode *aNode);
   static bool CanCallerAccess(nsINode* aNode);
 
   // Check if the (JS) caller can access aWindow.
   // aWindow can be either outer or inner window.
   static bool CanCallerAccess(nsPIDOMWindowInner* aWindow);
 
   // Check if the principal is chrome or an addon with the permission.
   static bool PrincipalHasPermission(nsIPrincipal* aPrincipal, const nsAtom* aPerm);
--- a/dom/base/nsCopySupport.cpp
+++ b/dom/base/nsCopySupport.cpp
@@ -24,17 +24,16 @@
 
 #include "nsIDocShell.h"
 #include "nsIContentViewerEdit.h"
 #include "nsIClipboardHelper.h"
 #include "nsISelectionController.h"
 
 #include "nsPIDOMWindow.h"
 #include "nsIDocument.h"
-#include "nsIDOMNode.h"
 #include "nsIHTMLDocument.h"
 #include "nsGkAtoms.h"
 #include "nsIFrame.h"
 #include "nsIURI.h"
 #include "nsIURIMutator.h"
 #include "nsISimpleEnumerator.h"
 
 // image copy stuff
--- a/dom/base/nsDocumentEncoder.cpp
+++ b/dom/base/nsDocumentEncoder.cpp
@@ -824,21 +824,19 @@ nsDocumentEncoder::SerializeRangeToStrin
   mStartDepth = mEndDepth = 0;
   mCommonAncestors.Clear();
   mStartNodes.Clear();
   mStartOffsets.Clear();
   mEndNodes.Clear();
   mEndOffsets.Clear();
 
   nsContentUtils::GetAncestors(mCommonParent, mCommonAncestors);
-  nsCOMPtr<nsIDOMNode> sp = do_QueryInterface(startContainer);
-  nsContentUtils::GetAncestorsAndOffsets(sp, startOffset,
+  nsContentUtils::GetAncestorsAndOffsets(startContainer, startOffset,
                                          &mStartNodes, &mStartOffsets);
-  nsCOMPtr<nsIDOMNode> ep = do_QueryInterface(endContainer);
-  nsContentUtils::GetAncestorsAndOffsets(ep, endOffset,
+  nsContentUtils::GetAncestorsAndOffsets(endContainer, endOffset,
                                          &mEndNodes, &mEndOffsets);
 
   nsCOMPtr<nsIContent> commonContent = do_QueryInterface(mCommonParent);
   mStartRootIndex = mStartNodes.IndexOf(commonContent);
   mEndRootIndex = mEndNodes.IndexOf(commonContent);
 
   nsresult rv = NS_OK;
 
@@ -1144,23 +1142,21 @@ protected:
 
   nsresult PromoteRange(nsRange* inRange);
   nsresult PromoteAncestorChain(nsCOMPtr<nsINode>* ioNode,
                                 int32_t* ioStartOffset,
                                 int32_t* ioEndOffset);
   nsresult GetPromotedPoint(Endpoint aWhere, nsINode* aNode, int32_t aOffset,
                             nsCOMPtr<nsINode>* outNode, int32_t* outOffset, nsINode* aCommon);
   nsCOMPtr<nsINode> GetChildAt(nsINode *aParent, int32_t aOffset);
-  bool IsMozBR(nsIDOMNode* aNode);
   bool IsMozBR(Element* aNode);
   nsresult GetNodeLocation(nsINode *inChild, nsCOMPtr<nsINode> *outParent, int32_t *outOffset);
   bool IsRoot(nsINode* aNode);
   bool IsFirstNode(nsINode *aNode);
   bool IsLastNode(nsINode *aNode);
-  bool IsEmptyTextContent(nsIDOMNode* aNode);
   virtual bool IncludeInContext(nsINode *aNode) override;
   virtual int32_t
   GetImmediateContextCount(const nsTArray<nsINode*>& aAncestorArray) override;
 
   bool mIsTextWidget;
 };
 
 nsHTMLCopyEncoder::nsHTMLCopyEncoder()
@@ -1727,24 +1723,16 @@ nsHTMLCopyEncoder::GetChildAt(nsINode *a
   MOZ_ASSERT(content, "null content in nsHTMLCopyEncoder::GetChildAt");
 
   resultNode = content->GetChildAt_Deprecated(aOffset);
 
   return resultNode;
 }
 
 bool
-nsHTMLCopyEncoder::IsMozBR(nsIDOMNode* aNode)
-{
-  MOZ_ASSERT(aNode);
-  nsCOMPtr<Element> element = do_QueryInterface(aNode);
-  return element && IsMozBR(element);
-}
-
-bool
 nsHTMLCopyEncoder::IsMozBR(Element* aElement)
 {
   return aElement->IsHTMLElement(nsGkAtoms::br) &&
          aElement->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
                                NS_LITERAL_STRING("_moz"), eIgnoreCase);
 }
 
 nsresult
@@ -1826,23 +1814,16 @@ nsHTMLCopyEncoder::IsLastNode(nsINode *a
     if (!sibling->TextIsOnlyWhitespace()) {
       return false;
     }
   }
 
   return true;
 }
 
-bool
-nsHTMLCopyEncoder::IsEmptyTextContent(nsIDOMNode* aNode)
-{
-  nsCOMPtr<nsIContent> cont = do_QueryInterface(aNode);
-  return cont && cont->TextIsOnlyWhitespace();
-}
-
 nsresult NS_NewHTMLCopyTextEncoder(nsIDocumentEncoder** aResult); // make mac compiler happy
 
 nsresult
 NS_NewHTMLCopyTextEncoder(nsIDocumentEncoder** aResult)
 {
   *aResult = new nsHTMLCopyEncoder;
  NS_ADDREF(*aResult);
  return NS_OK;
--- a/dom/base/nsFocusManager.cpp
+++ b/dom/base/nsFocusManager.cpp
@@ -1340,23 +1340,22 @@ nsFocusManager::SetFocusInner(Element* a
   //  * isn't called by trusted event (i.e., called by untrusted event or by js)
   //  * the focus is moved to another document's element
   // we need to check the permission.
   if (sendFocusEvent && mFocusedElement && !nsContentUtils::LegacyIsCallerNativeCode() &&
       mFocusedElement->OwnerDoc() != aNewContent->OwnerDoc()) {
     // If the caller cannot access the current focused node, the caller should
     // not be able to steal focus from it. E.g., When the current focused node
     // is in chrome, any web contents should not be able to steal the focus.
-    nsCOMPtr<nsIDOMNode> domNode(do_QueryInterface(mFocusedElement));
-    sendFocusEvent = nsContentUtils::CanCallerAccess(domNode);
+    sendFocusEvent = nsContentUtils::CanCallerAccess(mFocusedElement);
     if (!sendFocusEvent && mMouseButtonEventHandlingDocument) {
       // However, while mouse button event is handling, the handling document's
       // script should be able to steal focus.
-      domNode = do_QueryInterface(mMouseButtonEventHandlingDocument);
-      sendFocusEvent = nsContentUtils::CanCallerAccess(domNode);
+      sendFocusEvent =
+        nsContentUtils::CanCallerAccess(mMouseButtonEventHandlingDocument);
     }
   }
 
   LOGCONTENT("Shift Focus: %s", elementToFocus.get());
   LOGFOCUS((" Flags: %x Current Window: %p New Window: %p Current Element: %p",
            aFlags, mFocusedWindow.get(), newWindow.get(), mFocusedElement.get()));
   LOGFOCUS((" In Active Window: %d In Focused Window: %d SendFocus: %d",
            isElementInActiveWindow, isElementInFocusedWindow, sendFocusEvent));
--- a/dom/base/nsINode.cpp
+++ b/dom/base/nsINode.cpp
@@ -1372,17 +1372,17 @@ nsINode::doInsertChildAt(nsIContent* aKi
       nsNodeUtils::ContentAppended(parent, aKid);
     } else {
       nsNodeUtils::ContentInserted(this, aKid);
     }
 
     if (nsContentUtils::HasMutationListeners(aKid,
           NS_EVENT_BITS_MUTATION_NODEINSERTED, this)) {
       InternalMutationEvent mutation(true, eLegacyNodeInserted);
-      mutation.mRelatedNode = do_QueryInterface(this);
+      mutation.mRelatedNode = this;
 
       mozAutoSubtreeModified subtree(OwnerDoc(), this);
       (new AsyncEventDispatcher(aKid, mutation))->RunDOMEventWhenSafe();
     }
   }
 
   return NS_OK;
 }
--- a/dom/base/nsImageLoadingContent.cpp
+++ b/dom/base/nsImageLoadingContent.cpp
@@ -29,17 +29,16 @@
 #include "nsSVGImageFrame.h"
 
 #include "nsIPresShell.h"
 
 #include "nsIChannel.h"
 #include "nsIStreamListener.h"
 
 #include "nsIFrame.h"
-#include "nsIDOMNode.h"
 
 #include "nsContentUtils.h"
 #include "nsLayoutUtils.h"
 #include "nsIContentPolicy.h"
 #include "SVGObserverUtils.h"
 
 #include "gfxPrefs.h"
 
--- a/dom/base/nsRange.cpp
+++ b/dom/base/nsRange.cpp
@@ -8,17 +8,16 @@
  * Implementation of the DOM Range object.
  */
 
 #include "nscore.h"
 #include "nsRange.h"
 
 #include "nsString.h"
 #include "nsReadableUtils.h"
-#include "nsIDOMNode.h"
 #include "nsIContent.h"
 #include "nsIDocument.h"
 #include "nsError.h"
 #include "nsIContentIterator.h"
 #include "nsINodeList.h"
 #include "nsGkAtoms.h"
 #include "nsContentUtils.h"
 #include "nsTextFrame.h"
--- a/dom/base/nsRange.h
+++ b/dom/base/nsRange.h
@@ -9,17 +9,16 @@
  */
 
 #ifndef nsRange_h___
 #define nsRange_h___
 
 #include "nsCOMPtr.h"
 #include "nsINode.h"
 #include "nsIDocument.h"
-#include "nsIDOMNode.h"
 #include "nsLayoutUtils.h"
 #include "prmon.h"
 #include "nsStubMutationObserver.h"
 #include "nsWrapperCache.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/GuardObjects.h"
 #include "mozilla/LinkedList.h"
 #include "mozilla/RangeBoundary.h"
--- a/dom/base/nsStyleLinkElement.cpp
+++ b/dom/base/nsStyleLinkElement.cpp
@@ -18,17 +18,16 @@
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/FragmentOrElement.h"
 #include "mozilla/dom/HTMLLinkElement.h"
 #include "mozilla/dom/ShadowRoot.h"
 #include "mozilla/dom/SRILogHelper.h"
 #include "mozilla/Preferences.h"
 #include "nsIContent.h"
 #include "nsIDocument.h"
-#include "nsIDOMNode.h"
 #include "nsUnicharUtils.h"
 #include "nsCRT.h"
 #include "nsXPCOMCIDInternal.h"
 #include "nsUnicharInputStream.h"
 #include "nsContentUtils.h"
 #include "nsStyleUtil.h"
 #include "nsQueryObject.h"
 
--- a/dom/base/nsTraversal.cpp
+++ b/dom/base/nsTraversal.cpp
@@ -1,17 +1,16 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsTraversal.h"
 
-#include "nsIDOMNode.h"
 #include "nsError.h"
 #include "nsINode.h"
 #include "mozilla/AutoRestore.h"
 #include "mozilla/dom/NodeFilterBinding.h"
 
 #include "nsGkAtoms.h"
 
 using namespace mozilla;
--- a/dom/events/DataTransfer.cpp
+++ b/dom/events/DataTransfer.cpp
@@ -816,26 +816,21 @@ DataTransfer::Clone(nsISupports* aParent
                      mClipboardType, mItems, mDragImage, mDragImageX,
                      mDragImageY);
 
   newDataTransfer.forget(aNewDataTransfer);
   return NS_OK;
 }
 
 already_AddRefed<nsIArray>
-DataTransfer::GetTransferables(nsIDOMNode* aDragTarget)
+DataTransfer::GetTransferables(nsINode* aDragTarget)
 {
   MOZ_ASSERT(aDragTarget);
 
-  nsCOMPtr<nsINode> dragNode = do_QueryInterface(aDragTarget);
-  if (!dragNode) {
-    return nullptr;
-  }
-
-  nsIDocument* doc = dragNode->GetComposedDoc();
+  nsIDocument* doc = aDragTarget->GetComposedDoc();
   if (!doc) {
     return nullptr;
   }
 
   return GetTransferables(doc->GetLoadContext());
 }
 
 already_AddRefed<nsIArray>
--- a/dom/events/DataTransfer.h
+++ b/dom/events/DataTransfer.h
@@ -16,17 +16,16 @@
 
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/Assertions.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/EventForwards.h"
 #include "mozilla/dom/BindingDeclarations.h"
 #include "mozilla/dom/File.h"
 
-class nsIDOMNode;
 class nsINode;
 class nsITransferable;
 class nsILoadContext;
 
 namespace mozilla {
 
 class EventStateManager;
 
@@ -338,17 +337,17 @@ public:
     return mEventMessage;
   }
   bool IsCrossDomainSubFrameDrop() const {
     return mIsCrossDomainSubFrameDrop;
   }
 
   // converts the data into an array of nsITransferable objects to be used for
   // drag and drop or clipboard operations.
-  already_AddRefed<nsIArray> GetTransferables(nsIDOMNode* aDragTarget);
+  already_AddRefed<nsIArray> GetTransferables(nsINode* aDragTarget);
 
   already_AddRefed<nsIArray>
   GetTransferables(nsILoadContext* aLoadContext);
 
   // converts the data for a single item at aIndex into an nsITransferable
   // object.
   already_AddRefed<nsITransferable>
   GetTransferable(uint32_t aIndex, nsILoadContext* aLoadContext);
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -2101,18 +2101,17 @@ EventStateManager::DoDefaultDragStart(ns
     action = nsIDragService::DRAGDROP_ACTION_COPY |
              nsIDragService::DRAGDROP_ACTION_MOVE |
              nsIDragService::DRAGDROP_ACTION_LINK;
 
   // get any custom drag image that was set
   int32_t imageX, imageY;
   Element* dragImage = aDataTransfer->GetDragImage(&imageX, &imageY);
 
-  nsCOMPtr<nsIArray> transArray =
-    aDataTransfer->GetTransferables(dragTarget->AsDOMNode());
+  nsCOMPtr<nsIArray> transArray = aDataTransfer->GetTransferables(dragTarget);
   if (!transArray)
     return false;
 
   // After this function returns, the DataTransfer will be cleared so it appears
   // empty to content. We need to pass a DataTransfer into the Drag Session, so
   // we need to make a copy.
   RefPtr<DataTransfer> dataTransfer;
   aDataTransfer->Clone(aDragTarget, eDrop, aDataTransfer->MozUserCancelled(),
--- a/dom/events/InternalMutationEvent.h
+++ b/dom/events/InternalMutationEvent.h
@@ -5,17 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_MutationEvent_h__
 #define mozilla_MutationEvent_h__
 
 #include "mozilla/BasicEvents.h"
 #include "nsCOMPtr.h"
 #include "nsAtom.h"
-#include "nsIDOMNode.h"
+#include "nsINode.h"
 
 namespace mozilla {
 
 class InternalMutationEvent : public WidgetEvent
 {
 public:
   virtual InternalMutationEvent* AsMutationEvent() override { return this; }
 
@@ -31,17 +31,17 @@ public:
     MOZ_ASSERT(mClass == eMutationEventClass,
                "Duplicate() must be overridden by sub class");
     InternalMutationEvent* result = new InternalMutationEvent(false, mMessage);
     result->AssignMutationEventData(*this, true);
     result->mFlags = mFlags;
     return result;
   }
 
-  nsCOMPtr<nsIDOMNode> mRelatedNode;
+  nsCOMPtr<nsINode> mRelatedNode;
   RefPtr<nsAtom>    mAttrName;
   RefPtr<nsAtom>    mPrevAttrValue;
   RefPtr<nsAtom>    mNewAttrValue;
   unsigned short       mAttrChange;
 
   void AssignMutationEventData(const InternalMutationEvent& aEvent,
                                bool aCopyTargets)
   {
--- a/dom/events/MutationEvent.cpp
+++ b/dom/events/MutationEvent.cpp
@@ -17,22 +17,20 @@ MutationEvent::MutationEvent(EventTarget
                              nsPresContext* aPresContext,
                              InternalMutationEvent* aEvent)
   : Event(aOwner, aPresContext,
           aEvent ? aEvent : new InternalMutationEvent(false, eVoidEvent))
 {
   mEventIsInternal = (aEvent == nullptr);
 }
 
-already_AddRefed<nsINode>
+nsINode*
 MutationEvent::GetRelatedNode()
 {
-  nsCOMPtr<nsINode> n =
-    do_QueryInterface(mEvent->AsMutationEvent()->mRelatedNode);
-  return n.forget();
+  return mEvent->AsMutationEvent()->mRelatedNode;
 }
 
 void
 MutationEvent::GetPrevValue(nsAString& aPrevValue) const
 {
   InternalMutationEvent* mutation = mEvent->AsMutationEvent();
   if (mutation->mPrevAttrValue)
     mutation->mPrevAttrValue->ToString(aPrevValue);
@@ -70,17 +68,17 @@ MutationEvent::InitMutationEvent(const n
                                  uint16_t& aAttrChange,
                                  ErrorResult& aRv)
 {
   NS_ENSURE_TRUE_VOID(!mEvent->mFlags.mIsBeingDispatched);
 
   Event::InitEvent(aType, aCanBubble, aCancelable);
 
   InternalMutationEvent* mutation = mEvent->AsMutationEvent();
-  mutation->mRelatedNode = aRelatedNode ? aRelatedNode->AsDOMNode() : nullptr;
+  mutation->mRelatedNode = aRelatedNode;
   if (!aPrevValue.IsEmpty())
     mutation->mPrevAttrValue = NS_Atomize(aPrevValue);
   if (!aNewValue.IsEmpty())
     mutation->mNewAttrValue = NS_Atomize(aNewValue);
   if (!aAttrName.IsEmpty()) {
     mutation->mAttrName = NS_Atomize(aAttrName);
   }
   mutation->mAttrChange = aAttrChange;
--- a/dom/events/MutationEvent.h
+++ b/dom/events/MutationEvent.h
@@ -28,17 +28,17 @@ public:
   {
     return MutationEventBinding::Wrap(aCx, this, aGivenProto);
   }
 
   void GetPrevValue(nsAString& aPrevValue) const;
   void GetNewValue(nsAString& aNewValue) const;
   void GetAttrName(nsAString& aAttrName) const;
 
-  already_AddRefed<nsINode> GetRelatedNode();
+  nsINode* GetRelatedNode();
 
   uint16_t AttrChange();
 
   void InitMutationEvent(const nsAString& aType,
                          bool aCanBubble, bool aCancelable,
                          nsINode* aRelatedNode,
                          const nsAString& aPrevValue,
                          const nsAString& aNewValue,
--- a/dom/events/UIEvent.cpp
+++ b/dom/events/UIEvent.cpp
@@ -13,17 +13,16 @@
 #include "mozilla/EventStateManager.h"
 #include "mozilla/TextEvents.h"
 #include "nsCOMPtr.h"
 #include "nsContentUtils.h"
 #include "nsIContent.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIDocShell.h"
 #include "nsIDOMWindow.h"
-#include "nsIDOMNode.h"
 #include "nsIFrame.h"
 #include "prtime.h"
 
 namespace mozilla {
 namespace dom {
 
 UIEvent::UIEvent(EventTarget* aOwner,
                  nsPresContext* aPresContext,
--- a/dom/html/HTMLFormControlsCollection.cpp
+++ b/dom/html/HTMLFormControlsCollection.cpp
@@ -8,17 +8,16 @@
 
 #include "mozilla/FlushType.h"
 #include "mozilla/dom/BindingUtils.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/HTMLFormControlsCollectionBinding.h"
 #include "mozilla/dom/HTMLFormElement.h"
 #include "nsGenericHTMLElement.h" // nsGenericHTMLFormElement
 #include "nsIDocument.h"
-#include "nsIDOMNode.h"
 #include "nsIFormControl.h"
 #include "RadioNodeList.h"
 #include "jsfriendapi.h"
 
 namespace mozilla {
 namespace dom {
 
 /* static */ bool
--- a/dom/html/HTMLInputElement.cpp
+++ b/dom/html/HTMLInputElement.cpp
@@ -1117,17 +1117,17 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED(HTMLInputElement,
                                              nsGenericHTMLFormElementWithState,
                                              nsITextControlElement,
                                              imgINotificationObserver,
                                              nsIImageLoadingContent,
                                              nsIDOMNSEditableElement,
                                              nsIConstraintValidation)
 
-// nsIDOMNode
+// nsINode
 
 nsresult
 HTMLInputElement::Clone(mozilla::dom::NodeInfo* aNodeInfo, nsINode** aResult,
                         bool aPreallocateArrays) const
 {
   *aResult = nullptr;
 
   already_AddRefed<mozilla::dom::NodeInfo> ni = RefPtr<mozilla::dom::NodeInfo>(aNodeInfo).forget();
--- a/dom/html/nsHTMLDocument.cpp
+++ b/dom/html/nsHTMLDocument.cpp
@@ -1174,17 +1174,17 @@ nsHTMLDocument::SetCookie(const nsAStrin
 already_AddRefed<nsPIDOMWindowOuter>
 nsHTMLDocument::Open(JSContext* /* unused */,
                      const nsAString& aURL,
                      const nsAString& aName,
                      const nsAString& aFeatures,
                      bool aReplace,
                      ErrorResult& rv)
 {
-  MOZ_ASSERT(nsContentUtils::CanCallerAccess(static_cast<nsIDOMNode*>(this)),
+  MOZ_ASSERT(nsContentUtils::CanCallerAccess(this),
              "XOW should have caught this!");
 
   nsCOMPtr<nsPIDOMWindowInner> window = GetInnerWindow();
   if (!window) {
     rv.Throw(NS_ERROR_DOM_INVALID_ACCESS_ERR);
     return nullptr;
   }
   nsCOMPtr<nsPIDOMWindowOuter> outer =
@@ -1204,17 +1204,17 @@ already_AddRefed<nsIDocument>
 nsHTMLDocument::Open(JSContext* cx,
                      const Optional<nsAString>& /* unused */,
                      const nsAString& aReplace,
                      ErrorResult& aError)
 {
   // Implements the "When called with two arguments (or fewer)" steps here:
   // https://html.spec.whatwg.org/multipage/webappapis.html#opening-the-input-stream
 
-  MOZ_ASSERT(nsContentUtils::CanCallerAccess(static_cast<nsIDOMNode*>(this)),
+  MOZ_ASSERT(nsContentUtils::CanCallerAccess(this),
              "XOW should have caught this!");
   if (!IsHTMLDocument() || mDisableDocWrite) {
     // No calling document.open() on XHTML
     aError.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
     return nullptr;
   }
 
   if (ShouldThrowOnDynamicMarkupInsertion()) {
--- a/dom/security/nsCSPContext.cpp
+++ b/dom/security/nsCSPContext.cpp
@@ -14,17 +14,16 @@
 #include "nsCSPParser.h"
 #include "nsCSPService.h"
 #include "nsError.h"
 #include "nsIAsyncVerifyRedirectCallback.h"
 #include "nsIClassInfoImpl.h"
 #include "nsIDocShell.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsIDocument.h"
-#include "nsIDOMNode.h"
 #include "nsIHttpChannel.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIObjectInputStream.h"
 #include "nsIObjectOutputStream.h"
 #include "nsIObserver.h"
 #include "nsIObserverService.h"
 #include "nsIStringStream.h"
--- a/dom/svg/SVGAnimateElement.cpp
+++ b/dom/svg/SVGAnimateElement.cpp
@@ -22,17 +22,17 @@ SVGAnimateElement::WrapNode(JSContext *a
 // Implementation
 
 SVGAnimateElement::SVGAnimateElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
   : SVGAnimationElement(aNodeInfo)
 {
 }
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGAnimateElement)
 
 //----------------------------------------------------------------------
 
 nsSMILAnimationFunction&
 SVGAnimateElement::AnimationFunction()
 {
--- a/dom/svg/SVGAnimateElement.h
+++ b/dom/svg/SVGAnimateElement.h
@@ -25,17 +25,17 @@ protected:
   nsSMILAnimationFunction mAnimationFunction;
   friend nsresult
     (::NS_NewSVGAnimateElement(nsIContent **aResult,
                                already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
 
   virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
 
 public:
-  // nsIDOMNode
+  // nsINode
   virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
                          bool aPreallocateChildren) const override;
 
   // SVGAnimationElement
   virtual nsSMILAnimationFunction& AnimationFunction() override;
 };
 
 } // namespace dom
--- a/dom/svg/SVGAnimateMotionElement.cpp
+++ b/dom/svg/SVGAnimateMotionElement.cpp
@@ -22,17 +22,17 @@ SVGAnimateMotionElement::WrapNode(JSCont
 // Implementation
 
 SVGAnimateMotionElement::SVGAnimateMotionElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
   : SVGAnimationElement(aNodeInfo)
 {
 }
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGAnimateMotionElement)
 
 //----------------------------------------------------------------------
 
 nsSMILAnimationFunction&
 SVGAnimateMotionElement::AnimationFunction()
 {
--- a/dom/svg/SVGAnimateMotionElement.h
+++ b/dom/svg/SVGAnimateMotionElement.h
@@ -25,17 +25,17 @@ protected:
   SVGMotionSMILAnimationFunction mAnimationFunction;
   friend nsresult
     (::NS_NewSVGAnimateMotionElement(nsIContent **aResult,
                                      already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
 
   virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
 
 public:
-  // nsIDOMNode specializations
+  // nsINode specializations
   virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
                          bool aPreallocateChildren) const override;
 
   // SVGAnimationElement
   virtual nsSMILAnimationFunction& AnimationFunction() override;
   virtual bool GetTargetAttributeName(int32_t *aNamespaceID,
                                       nsAtom **aLocalName) const override;
 
--- a/dom/svg/SVGAnimateTransformElement.cpp
+++ b/dom/svg/SVGAnimateTransformElement.cpp
@@ -50,17 +50,17 @@ SVGAnimateTransformElement::ParseAttribu
 
   return SVGAnimationElement::ParseAttribute(aNamespaceID,
                                              aAttribute, aValue,
                                              aMaybeScriptedPrincipal,
                                              aResult);
 }
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGAnimateTransformElement)
 
 //----------------------------------------------------------------------
 
 nsSMILAnimationFunction&
 SVGAnimateTransformElement::AnimationFunction()
 {
--- a/dom/svg/SVGAnimateTransformElement.h
+++ b/dom/svg/SVGAnimateTransformElement.h
@@ -25,17 +25,17 @@ protected:
   nsSMILAnimationFunction mAnimationFunction;
   friend nsresult
     (::NS_NewSVGAnimateTransformElement(nsIContent **aResult,
                                         already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
 
   virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
 
 public:
-  // nsIDOMNode specializations
+  // nsINode specializations
   virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
                          bool aPreallocateChildren) const override;
 
   // Element specializations
   virtual bool ParseAttribute(int32_t aNamespaceID,
                               nsAtom* aAttribute,
                               const nsAString& aValue,
                               nsIPrincipal* aMaybeScriptedPrincipal,
--- a/dom/svg/SVGCircleElement.cpp
+++ b/dom/svg/SVGCircleElement.cpp
@@ -34,17 +34,17 @@ nsSVGElement::LengthInfo SVGCircleElemen
 // Implementation
 
 SVGCircleElement::SVGCircleElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
   : SVGCircleElementBase(aNodeInfo)
 {
 }
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGCircleElement)
 
 //----------------------------------------------------------------------
 
 already_AddRefed<SVGAnimatedLength>
 SVGCircleElement::Cx()
 {
--- a/dom/svg/SVGClipPathElement.cpp
+++ b/dom/svg/SVGClipPathElement.cpp
@@ -56,14 +56,14 @@ SVGClipPathElement::GetEnumInfo()
 bool
 SVGClipPathElement::IsUnitsObjectBoundingBox() const
 {
   return mEnumAttributes[CLIPPATHUNITS].GetAnimValue() == SVG_UNIT_TYPE_OBJECTBOUNDINGBOX;
 }
 
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGClipPathElement)
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/svg/SVGDefsElement.cpp
+++ b/dom/svg/SVGDefsElement.cpp
@@ -22,17 +22,17 @@ SVGDefsElement::WrapNode(JSContext* aCx,
 // Implementation
 
 SVGDefsElement::SVGDefsElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
   : SVGGraphicsElement(aNodeInfo)
 {
 }
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGDefsElement)
 
 
 //----------------------------------------------------------------------
 // nsIContent methods
 
--- a/dom/svg/SVGDescElement.cpp
+++ b/dom/svg/SVGDescElement.cpp
@@ -22,15 +22,15 @@ SVGDescElement::WrapNode(JSContext* aCx,
 // Implementation
 
 SVGDescElement::SVGDescElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
   : SVGDescElementBase(aNodeInfo)
 {
 }
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGDescElement)
 
 } // namespace dom
 } // namespace mozilla
 
--- a/dom/svg/SVGEllipseElement.cpp
+++ b/dom/svg/SVGEllipseElement.cpp
@@ -36,17 +36,17 @@ nsSVGElement::LengthInfo SVGEllipseEleme
 // Implementation
 
 SVGEllipseElement::SVGEllipseElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
   : SVGEllipseElementBase(aNodeInfo)
 {
 }
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGEllipseElement)
 
 //----------------------------------------------------------------------
 // nsIDOMSVGEllipseElement methods
 
 already_AddRefed<SVGAnimatedLength>
 SVGEllipseElement::Cx()
--- a/dom/svg/SVGFEBlendElement.cpp
+++ b/dom/svg/SVGFEBlendElement.cpp
@@ -52,17 +52,17 @@ nsSVGElement::EnumInfo SVGFEBlendElement
 nsSVGElement::StringInfo SVGFEBlendElement::sStringInfo[3] =
 {
   { &nsGkAtoms::result, kNameSpaceID_None, true },
   { &nsGkAtoms::in, kNameSpaceID_None, true },
   { &nsGkAtoms::in2, kNameSpaceID_None, true }
 };
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEBlendElement)
 
 //----------------------------------------------------------------------
 // nsIDOMSVGFEBlendElement methods
 
 already_AddRefed<SVGAnimatedString>
 SVGFEBlendElement::In1()
--- a/dom/svg/SVGFEColorMatrixElement.cpp
+++ b/dom/svg/SVGFEColorMatrixElement.cpp
@@ -47,17 +47,17 @@ nsSVGElement::StringInfo SVGFEColorMatri
 };
 
 nsSVGElement::NumberListInfo SVGFEColorMatrixElement::sNumberListInfo[1] =
 {
   { &nsGkAtoms::values }
 };
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEColorMatrixElement)
 
 
 //----------------------------------------------------------------------
 
 already_AddRefed<SVGAnimatedString>
--- a/dom/svg/SVGFEComponentTransferElement.cpp
+++ b/dom/svg/SVGFEComponentTransferElement.cpp
@@ -25,17 +25,17 @@ SVGFEComponentTransferElement::WrapNode(
 
 nsSVGElement::StringInfo SVGFEComponentTransferElement::sStringInfo[2] =
 {
   { &nsGkAtoms::result, kNameSpaceID_None, true },
   { &nsGkAtoms::in, kNameSpaceID_None, true }
 };
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEComponentTransferElement)
 
 already_AddRefed<SVGAnimatedString>
 SVGFEComponentTransferElement::In1()
 {
   return mStringAttributes[IN1].ToDOMAnimatedString(this);
 }
--- a/dom/svg/SVGFECompositeElement.cpp
+++ b/dom/svg/SVGFECompositeElement.cpp
@@ -49,17 +49,17 @@ nsSVGElement::EnumInfo SVGFECompositeEle
 nsSVGElement::StringInfo SVGFECompositeElement::sStringInfo[3] =
 {
   { &nsGkAtoms::result, kNameSpaceID_None, true },
   { &nsGkAtoms::in, kNameSpaceID_None, true },
   { &nsGkAtoms::in2, kNameSpaceID_None, true }
 };
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFECompositeElement)
 
 already_AddRefed<SVGAnimatedString>
 SVGFECompositeElement::In1()
 {
   return mStringAttributes[IN1].ToDOMAnimatedString(this);
 }
--- a/dom/svg/SVGFEConvolveMatrixElement.cpp
+++ b/dom/svg/SVGFEConvolveMatrixElement.cpp
@@ -74,17 +74,17 @@ nsSVGElement::StringInfo SVGFEConvolveMa
 };
 
 nsSVGElement::NumberListInfo SVGFEConvolveMatrixElement::sNumberListInfo[1] =
 {
   { &nsGkAtoms::kernelMatrix }
 };
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEConvolveMatrixElement)
 
 //----------------------------------------------------------------------
 
 already_AddRefed<SVGAnimatedString>
 SVGFEConvolveMatrixElement::In1()
 {
--- a/dom/svg/SVGFEDiffuseLightingElement.cpp
+++ b/dom/svg/SVGFEDiffuseLightingElement.cpp
@@ -18,17 +18,17 @@ namespace dom {
 
 JSObject*
 SVGFEDiffuseLightingElement::WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
   return SVGFEDiffuseLightingElementBinding::Wrap(aCx, this, aGivenProto);
 }
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEDiffuseLightingElement)
 
 //----------------------------------------------------------------------
 
 already_AddRefed<SVGAnimatedString>
 SVGFEDiffuseLightingElement::In1()
 {
--- a/dom/svg/SVGFEDisplacementMapElement.cpp
+++ b/dom/svg/SVGFEDisplacementMapElement.cpp
@@ -50,17 +50,17 @@ nsSVGElement::EnumInfo SVGFEDisplacement
 nsSVGElement::StringInfo SVGFEDisplacementMapElement::sStringInfo[3] =
 {
   { &nsGkAtoms::result, kNameSpaceID_None, true },
   { &nsGkAtoms::in, kNameSpaceID_None, true },
   { &nsGkAtoms::in2, kNameSpaceID_None, true }
 };
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEDisplacementMapElement)
 
 //----------------------------------------------------------------------
 
 already_AddRefed<SVGAnimatedString>
 SVGFEDisplacementMapElement::In1()
 {
--- a/dom/svg/SVGFEDistantLightElement.cpp
+++ b/dom/svg/SVGFEDistantLightElement.cpp
@@ -24,17 +24,17 @@ SVGFEDistantLightElement::WrapNode(JSCon
 nsSVGElement::NumberInfo SVGFEDistantLightElement::sNumberInfo[2] =
 {
   { &nsGkAtoms::azimuth,   0, false },
   { &nsGkAtoms::elevation, 0, false }
 };
 
 //----------------------------------------------------------------------
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEDistantLightElement)
 
 // nsFEUnstyledElement methods
 
 bool
 SVGFEDistantLightElement::AttributeAffectsRendering(int32_t aNameSpaceID,
                                                     nsAtom* aAttribute) const
--- a/dom/svg/SVGFEDropShadowElement.cpp
+++ b/dom/svg/SVGFEDropShadowElement.cpp
@@ -35,17 +35,17 @@ nsSVGElement::NumberPairInfo SVGFEDropSh
 
 nsSVGElement::StringInfo SVGFEDropShadowElement::sStringInfo[2] =
 {
   { &nsGkAtoms::result, kNameSpaceID_None, true },
   { &nsGkAtoms::in, kNameSpaceID_None, true }
 };
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEDropShadowElement)
 
 //----------------------------------------------------------------------
 
 already_AddRefed<SVGAnimatedString>
 SVGFEDropShadowElement::In1()
 {
--- a/dom/svg/SVGFEFloodElement.cpp
+++ b/dom/svg/SVGFEFloodElement.cpp
@@ -25,17 +25,17 @@ SVGFEFloodElement::WrapNode(JSContext *a
 }
 
 nsSVGElement::StringInfo SVGFEFloodElement::sStringInfo[1] =
 {
   { &nsGkAtoms::result, kNameSpaceID_None, true }
 };
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEFloodElement)
 
 FilterPrimitiveDescription
 SVGFEFloodElement::GetPrimitiveDescription(nsSVGFilterInstance* aInstance,
                                            const IntRect& aFilterSubregion,
                                            const nsTArray<bool>& aInputsAreTainted,
                                            nsTArray<RefPtr<SourceSurface>>& aInputImages)
--- a/dom/svg/SVGFEGaussianBlurElement.cpp
+++ b/dom/svg/SVGFEGaussianBlurElement.cpp
@@ -29,17 +29,17 @@ nsSVGElement::NumberPairInfo SVGFEGaussi
 
 nsSVGElement::StringInfo SVGFEGaussianBlurElement::sStringInfo[2] =
 {
   { &nsGkAtoms::result, kNameSpaceID_None, true },
   { &nsGkAtoms::in, kNameSpaceID_None, true }
 };
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEGaussianBlurElement)
 
 //----------------------------------------------------------------------
 
 already_AddRefed<SVGAnimatedString>
 SVGFEGaussianBlurElement::In1()
 {
--- a/dom/svg/SVGFEImageElement.cpp
+++ b/dom/svg/SVGFEImageElement.cpp
@@ -193,17 +193,17 @@ SVGFEImageElement::UnbindFromTree(bool a
 EventStates
 SVGFEImageElement::IntrinsicState() const
 {
   return SVGFEImageElementBase::IntrinsicState() |
     nsImageLoadingContent::ImageState();
 }
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEImageElement)
 
 already_AddRefed<SVGAnimatedString>
 SVGFEImageElement::Href()
 {
   return mStringAttributes[HREF].IsExplicitlySet()
          ? mStringAttributes[HREF].ToDOMAnimatedString(this)
--- a/dom/svg/SVGFEMergeNodeElement.cpp
+++ b/dom/svg/SVGFEMergeNodeElement.cpp
@@ -19,17 +19,17 @@ SVGFEMergeNodeElement::WrapNode(JSContex
 }
 
 nsSVGElement::StringInfo SVGFEMergeNodeElement::sStringInfo[1] =
 {
   { &nsGkAtoms::in, kNameSpaceID_None, true }
 };
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEMergeNodeElement)
 
 //----------------------------------------------------------------------
 // nsFEUnstyledElement methods
 
 bool
 SVGFEMergeNodeElement::AttributeAffectsRendering(int32_t aNameSpaceID,
--- a/dom/svg/SVGFEMorphologyElement.cpp
+++ b/dom/svg/SVGFEMorphologyElement.cpp
@@ -42,17 +42,17 @@ nsSVGElement::EnumInfo SVGFEMorphologyEl
 
 nsSVGElement::StringInfo SVGFEMorphologyElement::sStringInfo[2] =
 {
   { &nsGkAtoms::result, kNameSpaceID_None, true },
   { &nsGkAtoms::in, kNameSpaceID_None, true }
 };
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEMorphologyElement)
 
 
 //----------------------------------------------------------------------
 // SVGFEMorphologyElement methods
 
--- a/dom/svg/SVGFEOffsetElement.cpp
+++ b/dom/svg/SVGFEOffsetElement.cpp
@@ -29,17 +29,17 @@ nsSVGElement::NumberInfo SVGFEOffsetElem
 
 nsSVGElement::StringInfo SVGFEOffsetElement::sStringInfo[2] =
 {
   { &nsGkAtoms::result, kNameSpaceID_None, true },
   { &nsGkAtoms::in, kNameSpaceID_None, true }
 };
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEOffsetElement)
 
 
 //----------------------------------------------------------------------
 
 already_AddRefed<SVGAnimatedString>
--- a/dom/svg/SVGFEPointLightElement.cpp
+++ b/dom/svg/SVGFEPointLightElement.cpp
@@ -24,17 +24,17 @@ SVGFEPointLightElement::WrapNode(JSConte
 nsSVGElement::NumberInfo SVGFEPointLightElement::sNumberInfo[3] =
 {
   { &nsGkAtoms::x, 0, false },
   { &nsGkAtoms::y, 0, false },
   { &nsGkAtoms::z, 0, false }
 };
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEPointLightElement)
 
 //----------------------------------------------------------------------
 // nsFEUnstyledElement methods
 
 bool
 SVGFEPointLightElement::AttributeAffectsRendering(int32_t aNameSpaceID,
--- a/dom/svg/SVGFESpecularLightingElement.cpp
+++ b/dom/svg/SVGFESpecularLightingElement.cpp
@@ -18,17 +18,17 @@ namespace dom {
 
 JSObject*
 SVGFESpecularLightingElement::WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
   return SVGFESpecularLightingElementBinding::Wrap(aCx, this, aGivenProto);
 }
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFESpecularLightingElement)
 
 already_AddRefed<SVGAnimatedString>
 SVGFESpecularLightingElement::In1()
 {
   return mStringAttributes[IN1].ToDOMAnimatedString(this);
 }
--- a/dom/svg/SVGFESpotLightElement.cpp
+++ b/dom/svg/SVGFESpotLightElement.cpp
@@ -29,17 +29,17 @@ nsSVGElement::NumberInfo SVGFESpotLightE
   { &nsGkAtoms::pointsAtX, 0, false },
   { &nsGkAtoms::pointsAtY, 0, false },
   { &nsGkAtoms::pointsAtZ, 0, false },
   { &nsGkAtoms::specularExponent, 1, false },
   { &nsGkAtoms::limitingConeAngle, 0, false }
 };
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFESpotLightElement)
 
 //----------------------------------------------------------------------
 // nsFEUnstyledElement methods
 
 bool
 SVGFESpotLightElement::AttributeAffectsRendering(int32_t aNameSpaceID,
--- a/dom/svg/SVGFETileElement.cpp
+++ b/dom/svg/SVGFETileElement.cpp
@@ -23,17 +23,17 @@ SVGFETileElement::WrapNode(JSContext *aC
 
 nsSVGElement::StringInfo SVGFETileElement::sStringInfo[2] =
 {
   { &nsGkAtoms::result, kNameSpaceID_None, true },
   { &nsGkAtoms::in, kNameSpaceID_None, true }
 };
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFETileElement)
 
 already_AddRefed<SVGAnimatedString>
 SVGFETileElement::In1()
 {
   return mStringAttributes[IN1].ToDOMAnimatedString(this);
--- a/dom/svg/SVGFETurbulenceElement.cpp
+++ b/dom/svg/SVGFETurbulenceElement.cpp
@@ -72,17 +72,17 @@ nsSVGElement::EnumInfo SVGFETurbulenceEl
 };
 
 nsSVGElement::StringInfo SVGFETurbulenceElement::sStringInfo[1] =
 {
   { &nsGkAtoms::result, kNameSpaceID_None, true }
 };
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFETurbulenceElement)
 
 //----------------------------------------------------------------------
 
 already_AddRefed<SVGAnimatedNumber>
 SVGFETurbulenceElement::BaseFrequencyX()
 {
--- a/dom/svg/SVGFilterElement.cpp
+++ b/dom/svg/SVGFilterElement.cpp
@@ -57,17 +57,17 @@ nsSVGElement::StringInfo SVGFilterElemen
 // Implementation
 
 SVGFilterElement::SVGFilterElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
   : SVGFilterElementBase(aNodeInfo)
 {
 }
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFilterElement)
 
 
 //----------------------------------------------------------------------
 
 already_AddRefed<SVGAnimatedLength>
--- a/dom/svg/SVGForeignObjectElement.cpp
+++ b/dom/svg/SVGForeignObjectElement.cpp
@@ -35,17 +35,17 @@ nsSVGElement::LengthInfo SVGForeignObjec
 // Implementation
 
 SVGForeignObjectElement::SVGForeignObjectElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
   : SVGGraphicsElement(aNodeInfo)
 {
 }
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGForeignObjectElement)
 
 //----------------------------------------------------------------------
 
 already_AddRefed<SVGAnimatedLength>
 SVGForeignObjectElement::X()
 {
--- a/dom/svg/SVGGElement.cpp
+++ b/dom/svg/SVGGElement.cpp
@@ -23,17 +23,17 @@ SVGGElement::WrapNode(JSContext *aCx, JS
 
 SVGGElement::SVGGElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
   : SVGGraphicsElement(aNodeInfo)
 {
 }
 
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGGElement)
 
 
 //----------------------------------------------------------------------
 // nsIContent methods
 
--- a/dom/svg/SVGGradientElement.cpp
+++ b/dom/svg/SVGGradientElement.cpp
@@ -142,17 +142,17 @@ nsSVGElement::LengthInfo SVGLinearGradie
 // Implementation
 
 SVGLinearGradientElement::SVGLinearGradientElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
   : SVGLinearGradientElementBase(aNodeInfo)
 {
 }
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGLinearGradientElement)
 
 //----------------------------------------------------------------------
 
 already_AddRefed<SVGAnimatedLength>
 SVGLinearGradientElement::X1()
 {
@@ -218,17 +218,17 @@ nsSVGElement::LengthInfo SVGRadialGradie
 // Implementation
 
 SVGRadialGradientElement::SVGRadialGradientElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
   : SVGRadialGradientElementBase(aNodeInfo)
 {
 }
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGRadialGradientElement)
 
 //----------------------------------------------------------------------
 
 already_AddRefed<SVGAnimatedLength>
 SVGRadialGradientElement::Cx()
 {
--- a/dom/svg/SVGImageElement.cpp
+++ b/dom/svg/SVGImageElement.cpp
@@ -64,17 +64,17 @@ SVGImageElement::SVGImageElement(already
 }
 
 SVGImageElement::~SVGImageElement()
 {
   DestroyImageLoadingContent();
 }
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGImageElement)
 
 
 //----------------------------------------------------------------------
 
 already_AddRefed<SVGAnimatedLength>
--- a/dom/svg/SVGLineElement.cpp
+++ b/dom/svg/SVGLineElement.cpp
@@ -51,17 +51,17 @@ SVGLineElement::MaybeAdjustForZeroLength
       float tinyLength =
         strokeOptions.mLineWidth / SVG_ZERO_LENGTH_PATH_FIX_FACTOR;
       aX2 += tinyLength;
     }
   }
 }
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGLineElement)
 
 //----------------------------------------------------------------------
 
 already_AddRefed<SVGAnimatedLength>
 SVGLineElement::X1()
 {
--- a/dom/svg/SVGMPathElement.cpp
+++ b/dom/svg/SVGMPathElement.cpp
@@ -60,17 +60,17 @@ SVGMPathElement::SVGMPathElement(already
 }
 
 SVGMPathElement::~SVGMPathElement()
 {
   UnlinkHrefTarget(false);
 }
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGMPathElement)
 
 already_AddRefed<SVGAnimatedString>
 SVGMPathElement::Href()
 {
   return mStringAttributes[HREF].IsExplicitlySet()
          ? mStringAttributes[HREF].ToDOMAnimatedString(this)
--- a/dom/svg/SVGMarkerElement.cpp
+++ b/dom/svg/SVGMarkerElement.cpp
@@ -100,17 +100,17 @@ nsSVGOrientType::ToDOMAnimatedEnum(nsSVG
 }
 
 SVGMarkerElement::SVGMarkerElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
   : SVGMarkerElementBase(aNodeInfo), mCoordCtx(nullptr)
 {
 }
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGMarkerElement)
 
 //----------------------------------------------------------------------
 
 already_AddRefed<SVGAnimatedRect>
 SVGMarkerElement::ViewBox()
 {
--- a/dom/svg/SVGMaskElement.cpp
+++ b/dom/svg/SVGMaskElement.cpp
@@ -52,17 +52,17 @@ nsSVGElement::EnumInfo SVGMaskElement::s
 // Implementation
 
 SVGMaskElement::SVGMaskElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
   : SVGMaskElementBase(aNodeInfo)
 {
 }
 
 //----------------------------------------------------------------------
-// nsIDOMNode method
+// nsINode method
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGMaskElement)
 
 //----------------------------------------------------------------------
 
 already_AddRefed<SVGAnimatedEnumeration>
 SVGMaskElement::MaskUnits()
 {
--- a/dom/svg/SVGMetadataElement.cpp
+++ b/dom/svg/SVGMetadataElement.cpp
@@ -30,15 +30,15 @@ SVGMetadataElement::SVGMetadataElement(a
 nsresult
 SVGMetadataElement::Init()
 {
   return NS_OK;
 }
 
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGMetadataElement)
 
 } // namespace dom
 } // namespace mozilla
 
--- a/dom/svg/SVGPathElement.cpp
+++ b/dom/svg/SVGPathElement.cpp
@@ -51,17 +51,17 @@ void
 SVGPathElement::AddSizeOfExcludingThis(nsWindowSizes& aSizes,
                                        size_t* aNodeSize) const
 {
   SVGPathElementBase::AddSizeOfExcludingThis(aSizes, aNodeSize);
   *aNodeSize += mD.SizeOfExcludingThis(aSizes.mState.mMallocSizeOf);
 }
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGPathElement)
 
 uint32_t
 SVGPathElement::GetPathSegAtLength(float distance)
 {
   return mD.GetAnimValue().GetPathSegAtLength(distance);
 }
--- a/dom/svg/SVGPatternElement.cpp
+++ b/dom/svg/SVGPatternElement.cpp
@@ -59,17 +59,17 @@ nsSVGElement::StringInfo SVGPatternEleme
 // Implementation
 
 SVGPatternElement::SVGPatternElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
   : SVGPatternElementBase(aNodeInfo)
 {
 }
 
 //----------------------------------------------------------------------
-// nsIDOMNode method
+// nsINode method
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGPatternElement)
 
 //----------------------------------------------------------------------
 
 already_AddRefed<SVGAnimatedRect>
 SVGPatternElement::ViewBox()
 {
--- a/dom/svg/SVGPolygonElement.cpp
+++ b/dom/svg/SVGPolygonElement.cpp
@@ -27,17 +27,17 @@ SVGPolygonElement::WrapNode(JSContext *a
 // Implementation
 
 SVGPolygonElement::SVGPolygonElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
   : SVGPolygonElementBase(aNodeInfo)
 {
 }
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGPolygonElement)
 
 //----------------------------------------------------------------------
 // SVGGeometryElement methods
 
 void
 SVGPolygonElement::GetMarkPoints(nsTArray<nsSVGMark> *aMarks)
--- a/dom/svg/SVGPolylineElement.cpp
+++ b/dom/svg/SVGPolylineElement.cpp
@@ -26,17 +26,17 @@ SVGPolylineElement::WrapNode(JSContext *
 // Implementation
 
 SVGPolylineElement::SVGPolylineElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
   : SVGPolylineElementBase(aNodeInfo)
 {
 }
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGPolylineElement)
 
 //----------------------------------------------------------------------
 // SVGGeometryElement methods
 
 already_AddRefed<Path>
 SVGPolylineElement::BuildPath(PathBuilder* aBuilder)
--- a/dom/svg/SVGRectElement.cpp
+++ b/dom/svg/SVGRectElement.cpp
@@ -43,17 +43,17 @@ nsSVGElement::LengthInfo SVGRectElement:
 // Implementation
 
 SVGRectElement::SVGRectElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
   : SVGRectElementBase(aNodeInfo)
 {
 }
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGRectElement)
 
 //----------------------------------------------------------------------
 
 already_AddRefed<SVGAnimatedLength>
 SVGRectElement::X()
 {
--- a/dom/svg/SVGSVGElement.cpp
+++ b/dom/svg/SVGSVGElement.cpp
@@ -152,17 +152,17 @@ SVGSVGElement::SVGSVGElement(already_Add
 {
 }
 
 SVGSVGElement::~SVGSVGElement()
 {
 }
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT_AND_PARSER(SVGSVGElement)
 
 //----------------------------------------------------------------------
 // nsIDOMSVGSVGElement methods:
 
 already_AddRefed<SVGAnimatedLength>
 SVGSVGElement::X()
--- a/dom/svg/SVGScriptElement.cpp
+++ b/dom/svg/SVGScriptElement.cpp
@@ -47,17 +47,17 @@ SVGScriptElement::SVGScriptElement(alrea
   AddMutationObserver(this);
 }
 
 SVGScriptElement::~SVGScriptElement()
 {
 }
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 nsresult
 SVGScriptElement::Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
                         bool aPreallocateChildren) const
 {
   *aResult = nullptr;
 
   already_AddRefed<mozilla::dom::NodeInfo> ni = RefPtr<mozilla::dom::NodeInfo>(aNodeInfo).forget();
--- a/dom/svg/SVGSetElement.cpp
+++ b/dom/svg/SVGSetElement.cpp
@@ -22,17 +22,17 @@ SVGSetElement::WrapNode(JSContext *aCx, 
 // Implementation
 
 SVGSetElement::SVGSetElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
   : SVGAnimationElement(aNodeInfo)
 {
 }
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGSetElement)
 
 //----------------------------------------------------------------------
 
 nsSMILAnimationFunction&
 SVGSetElement::AnimationFunction()
 {
--- a/dom/svg/SVGSetElement.h
+++ b/dom/svg/SVGSetElement.h
@@ -25,17 +25,17 @@ protected:
   nsSMILSetAnimationFunction mAnimationFunction;
 
   friend nsresult (::NS_NewSVGSetElement(nsIContent **aResult,
                                          already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
 
   virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
 
 public:
-  // nsIDOMNode
+  // nsINode
   virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
                          bool aPreallocateChildren) const override;
 
   // SVGAnimationElement
   virtual nsSMILAnimationFunction& AnimationFunction() override;
 };
 
 } // namespace dom
--- a/dom/svg/SVGStopElement.cpp
+++ b/dom/svg/SVGStopElement.cpp
@@ -25,17 +25,17 @@ nsSVGElement::NumberInfo SVGStopElement:
 // Implementation
 
 SVGStopElement::SVGStopElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
   : SVGStopElementBase(aNodeInfo)
 {
 }
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGStopElement)
 
 //----------------------------------------------------------------------
 
 already_AddRefed<SVGAnimatedNumber>
 SVGStopElement::Offset()
 {
--- a/dom/svg/SVGStyleElement.cpp
+++ b/dom/svg/SVGStyleElement.cpp
@@ -49,17 +49,17 @@ SVGStyleElement::SVGStyleElement(already
   AddMutationObserver(this);
 }
 
 SVGStyleElement::~SVGStyleElement()
 {
 }
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGStyleElement)
 
 
 //----------------------------------------------------------------------
 // nsIContent methods
 
--- a/dom/svg/SVGSwitchElement.cpp
+++ b/dom/svg/SVGSwitchElement.cpp
@@ -68,17 +68,17 @@ SVGSwitchElement::MaybeInvalidate()
       nsChangeHint_InvalidateRenderingObservers);
     nsSVGUtils::ScheduleReflowSVG(frame);
   }
 
   mActiveChild = newActiveChild;
 }
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGSwitchElement)
 
 //----------------------------------------------------------------------
 // nsINode methods
 
 nsresult
--- a/dom/svg/SVGSymbolElement.cpp
+++ b/dom/svg/SVGSymbolElement.cpp
@@ -33,14 +33,14 @@ SVGSymbolElement::SVGSymbolElement(alrea
 {
 }
 
 SVGSymbolElement::~SVGSymbolElement()
 {
 }
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGSymbolElement)
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/svg/SVGTSpanElement.cpp
+++ b/dom/svg/SVGTSpanElement.cpp
@@ -37,17 +37,17 @@ SVGTSpanElement::GetEnumInfo()
 nsSVGElement::LengthAttributesInfo
 SVGTSpanElement::GetLengthInfo()
 {
   return LengthAttributesInfo(mLengthAttributes, sLengthInfo,
                               ArrayLength(sLengthInfo));
 }
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGTSpanElement)
 
 //----------------------------------------------------------------------
 // nsIContent methods
 
 NS_IMETHODIMP_(bool)
--- a/dom/svg/SVGTextElement.cpp
+++ b/dom/svg/SVGTextElement.cpp
@@ -36,17 +36,17 @@ SVGTextElement::GetEnumInfo()
 nsSVGElement::LengthAttributesInfo
 SVGTextElement::GetLengthInfo()
 {
   return LengthAttributesInfo(mLengthAttributes, sLengthInfo,
                               ArrayLength(sLengthInfo));
 }
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGTextElement)
 
 
 //----------------------------------------------------------------------
 // nsIContent methods
 
--- a/dom/svg/SVGTextPathElement.cpp
+++ b/dom/svg/SVGTextPathElement.cpp
@@ -86,17 +86,17 @@ nsSVGElement::StringInfo SVGTextPathElem
 // Implementation
 
 SVGTextPathElement::SVGTextPathElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
   : SVGTextPathElementBase(aNodeInfo)
 {
 }
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGTextPathElement)
 
 already_AddRefed<SVGAnimatedString>
 SVGTextPathElement::Href()
 {
   return mStringAttributes[HREF].IsExplicitlySet()
          ? mStringAttributes[HREF].ToDOMAnimatedString(this)
--- a/dom/svg/SVGTitleElement.cpp
+++ b/dom/svg/SVGTitleElement.cpp
@@ -103,15 +103,15 @@ SVGTitleElement::SendTitleChangeEvent(bo
 {
   nsIDocument* doc = GetUncomposedDoc();
   if (doc) {
     doc->NotifyPossibleTitleChange(aBound);
   }
 }
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGTitleElement)
 
 } // namespace dom
 } // namespace mozilla
 
--- a/dom/svg/SVGUseElement.cpp
+++ b/dom/svg/SVGUseElement.cpp
@@ -80,17 +80,17 @@ SVGUseElement::SVGUseElement(already_Add
 }
 
 SVGUseElement::~SVGUseElement()
 {
   UnlinkSource();
 }
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 nsresult
 SVGUseElement::Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
                      bool aPreallocateChildren) const
 {
   *aResult = nullptr;
   already_AddRefed<mozilla::dom::NodeInfo> ni = RefPtr<mozilla::dom::NodeInfo>(aNodeInfo).forget();
   SVGUseElement *it = new SVGUseElement(ni);
--- a/dom/svg/SVGViewElement.cpp
+++ b/dom/svg/SVGViewElement.cpp
@@ -38,17 +38,17 @@ nsSVGElement::EnumInfo SVGViewElement::s
 // Implementation
 
 SVGViewElement::SVGViewElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
   : SVGViewElementBase(aNodeInfo)
 {
 }
 
 //----------------------------------------------------------------------
-// nsIDOMNode methods
+// nsINode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGViewElement)
 
 void
 SVGViewElement::SetZoomAndPan(uint16_t aZoomAndPan, ErrorResult& rv)
 {
   if (aZoomAndPan == SVG_ZOOMANDPAN_DISABLE ||
       aZoomAndPan == SVG_ZOOMANDPAN_MAGNIFY) {
--- a/dom/webbrowserpersist/WebBrowserPersistLocalDocument.cpp
+++ b/dom/webbrowserpersist/WebBrowserPersistLocalDocument.cpp
@@ -25,17 +25,16 @@
 #include "nsComponentManagerUtils.h"
 #include "nsContentUtils.h"
 #include "nsContentCID.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsDOMAttributeMap.h"
 #include "nsFrameLoader.h"
 #include "nsIComponentRegistrar.h"
 #include "nsIContent.h"
-#include "nsIDOMNode.h"
 #include "nsIDOMWindowUtils.h"
 #include "nsIDocShell.h"
 #include "nsIDocument.h"
 #include "nsIDocumentEncoder.h"
 #include "nsILoadContext.h"
 #include "nsIProtocolHandler.h"
 #include "nsISHEntry.h"
 #include "nsISupportsPrimitives.h"
@@ -231,17 +230,17 @@ WebBrowserPersistLocalDocument::GetBaseU
 
 namespace {
 
 // Helper class for ReadResources().
 class ResourceReader final : public nsIWebBrowserPersistDocumentReceiver {
 public:
     ResourceReader(WebBrowserPersistLocalDocument* aParent,
                    nsIWebBrowserPersistResourceVisitor* aVisitor);
-    nsresult OnWalkDOMNode(nsIDOMNode* aNode);
+    nsresult OnWalkDOMNode(nsINode* aNode);
 
     // This is called both to indicate the end of the document walk
     // and when a subdocument is (maybe asynchronously) sent to the
     // visitor.  The call to EndVisit needs to happen after both of
     // those have finished.
     void DocumentDone(nsresult aStatus);
 
     NS_DECL_NSIWEBBROWSERPERSISTDOCUMENTRECEIVER
@@ -258,20 +257,20 @@ private:
     // being walked and any outstanding asynchronous subdocument
     // StartPersistence calls.
     size_t mOutstandingDocuments;
     // Collects the status parameters to DocumentDone calls.
     nsresult mEndStatus;
 
     nsresult OnWalkURI(const nsACString& aURISpec);
     nsresult OnWalkURI(nsIURI* aURI);
-    nsresult OnWalkAttribute(nsIDOMNode* aNode,
+    nsresult OnWalkAttribute(Element* aElement,
                              const char* aAttribute,
                              const char* aNamespaceURI = "");
-    nsresult OnWalkSubframe(nsIDOMNode* aNode);
+    nsresult OnWalkSubframe(nsINode* aNode);
 
     ~ResourceReader();
 
     using IWBP = nsIWebBrowserPersist;
 };
 
 NS_IMPL_ISUPPORTS(ResourceReader, nsIWebBrowserPersistDocumentReceiver)
 
@@ -300,17 +299,17 @@ ResourceReader::DocumentDone(nsresult aS
         mEndStatus = aStatus;
     }
     if (--mOutstandingDocuments == 0) {
         mVisitor->EndVisit(mParent, mEndStatus);
     }
 }
 
 nsresult
-ResourceReader::OnWalkSubframe(nsIDOMNode* aNode)
+ResourceReader::OnWalkSubframe(nsINode* aNode)
 {
     nsCOMPtr<nsIFrameLoaderOwner> loaderOwner = do_QueryInterface(aNode);
     NS_ENSURE_STATE(loaderOwner);
     RefPtr<nsFrameLoader> loader = loaderOwner->GetFrameLoader();
     NS_ENSURE_STATE(loader);
 
     ++mOutstandingDocuments;
     // Pass in 0 as the outer window ID so that we start
@@ -375,48 +374,45 @@ ResourceReader::OnWalkURI(const nsACStri
                    aURISpec,
                    mParent->GetCharacterSet(),
                    mCurrentBaseURI);
     NS_ENSURE_SUCCESS(rv, rv);
     return OnWalkURI(uri);
 }
 
 static void
-ExtractAttribute(nsIDOMNode* aNode,
+ExtractAttribute(Element* aElement,
                  const char* aAttribute,
                  const char* aNamespaceURI,
                  nsCString&  aValue)
 {
-    nsCOMPtr<dom::Element> element = do_QueryInterface(aNode);
-    MOZ_ASSERT(element);
-
     // Find the named URI attribute on the (element) node and store
     // a reference to the URI that maps onto a local file name
 
-    RefPtr<nsDOMAttributeMap> attrMap = element->Attributes();
+    RefPtr<nsDOMAttributeMap> attrMap = aElement->Attributes();
 
     NS_ConvertASCIItoUTF16 namespaceURI(aNamespaceURI);
     NS_ConvertASCIItoUTF16 attribute(aAttribute);
     RefPtr<dom::Attr> attr = attrMap->GetNamedItemNS(namespaceURI, attribute);
     if (attr) {
         nsAutoString value;
         attr->GetValue(value);
         CopyUTF16toUTF8(value, aValue);
     } else {
         aValue.Truncate();
     }
 }
 
 nsresult
-ResourceReader::OnWalkAttribute(nsIDOMNode* aNode,
+ResourceReader::OnWalkAttribute(Element* aElement,
                                 const char* aAttribute,
                                 const char* aNamespaceURI)
 {
     nsAutoCString uriSpec;
-    ExtractAttribute(aNode, aAttribute, aNamespaceURI, uriSpec);
+    ExtractAttribute(aElement, aAttribute, aNamespaceURI, uriSpec);
     if (uriSpec.IsEmpty()) {
         return NS_OK;
     }
     return OnWalkURI(uriSpec);
 }
 
 static nsresult
 GetXMLStyleSheetLink(dom::ProcessingInstruction *aPI, nsAString &aHref)
@@ -424,87 +420,84 @@ GetXMLStyleSheetLink(dom::ProcessingInst
     nsAutoString data;
     aPI->GetData(data);
 
     nsContentUtils::GetPseudoAttributeValue(data, nsGkAtoms::href, aHref);
     return NS_OK;
 }
 
 nsresult
-ResourceReader::OnWalkDOMNode(nsIDOMNode* aNode)
+ResourceReader::OnWalkDOMNode(nsINode* aNode)
 {
-    nsCOMPtr<nsIContent> content = do_QueryInterface(aNode);
-    if (!content) {
-        return NS_OK;
-    }
-
     // Fixup xml-stylesheet processing instructions
-    if (auto nodeAsPI = dom::ProcessingInstruction::FromNode(content)) {
+    if (auto nodeAsPI = dom::ProcessingInstruction::FromNode(aNode)) {
         nsAutoString target;
         nodeAsPI->GetTarget(target);
         if (target.EqualsLiteral("xml-stylesheet")) {
             nsAutoString href;
             GetXMLStyleSheetLink(nodeAsPI, href);
             if (!href.IsEmpty()) {
                 return OnWalkURI(NS_ConvertUTF16toUTF8(href));
             }
         }
         return NS_OK;
     }
 
     // Test the node to see if it's an image, frame, iframe, css, js
-    if (content->IsHTMLElement(nsGkAtoms::img)) {
-        return OnWalkAttribute(aNode, "src");
+    if (aNode->IsHTMLElement(nsGkAtoms::img)) {
+        return OnWalkAttribute(aNode->AsElement(), "src");
     }
 
-    if (content->IsSVGElement(nsGkAtoms::img)) {
-        return OnWalkAttribute(aNode, "href", "http://www.w3.org/1999/xlink");
+    if (aNode->IsSVGElement(nsGkAtoms::img)) {
+        return OnWalkAttribute(aNode->AsElement(), "href",
+                               "http://www.w3.org/1999/xlink");
     }
 
-    if (content->IsAnyOfHTMLElements(nsGkAtoms::audio, nsGkAtoms::video)) {
-        return OnWalkAttribute(aNode, "src");
+    if (aNode->IsAnyOfHTMLElements(nsGkAtoms::audio, nsGkAtoms::video)) {
+        return OnWalkAttribute(aNode->AsElement(), "src");
     }
 
-    if (content->IsHTMLElement(nsGkAtoms::source)) {
-        return OnWalkAttribute(aNode, "src");
+    if (aNode->IsHTMLElement(nsGkAtoms::source)) {
+        return OnWalkAttribute(aNode->AsElement(), "src");
     }
 
-    if (content->IsHTMLElement(nsGkAtoms::body)) {
-        return OnWalkAttribute(aNode, "background");
+    if (aNode->IsHTMLElement(nsGkAtoms::body)) {
+        return OnWalkAttribute(aNode->AsElement(), "background");
     }
 
-    if (content->IsHTMLElement(nsGkAtoms::table)) {
-        return OnWalkAttribute(aNode, "background");
+    if (aNode->IsHTMLElement(nsGkAtoms::table)) {
+        return OnWalkAttribute(aNode->AsElement(), "background");
     }
 
-    if (content->IsHTMLElement(nsGkAtoms::tr)) {
-        return OnWalkAttribute(aNode, "background");
+    if (aNode->IsHTMLElement(nsGkAtoms::tr)) {
+        return OnWalkAttribute(aNode->AsElement(), "background");
     }
 
-    if (content->IsAnyOfHTMLElements(nsGkAtoms::td, nsGkAtoms::th)) {
-        return OnWalkAttribute(aNode, "background");
+    if (aNode->IsAnyOfHTMLElements(nsGkAtoms::td, nsGkAtoms::th)) {
+        return OnWalkAttribute(aNode->AsElement(), "background");
     }
 
-    if (content->IsHTMLElement(nsGkAtoms::script)) {
-        return OnWalkAttribute(aNode, "src");
+    if (aNode->IsHTMLElement(nsGkAtoms::script)) {
+        return OnWalkAttribute(aNode->AsElement(), "src");
     }
 
-    if (content->IsSVGElement(nsGkAtoms::script)) {
-        return OnWalkAttribute(aNode, "href", "http://www.w3.org/1999/xlink");
+    if (aNode->IsSVGElement(nsGkAtoms::script)) {
+        return OnWalkAttribute(aNode->AsElement(), "href",
+                               "http://www.w3.org/1999/xlink");
     }
 
-    if (content->IsHTMLElement(nsGkAtoms::embed)) {
-        return OnWalkAttribute(aNode, "src");
+    if (aNode->IsHTMLElement(nsGkAtoms::embed)) {
+        return OnWalkAttribute(aNode->AsElement(), "src");
     }
 
-    if (content->IsHTMLElement(nsGkAtoms::object)) {
-        return OnWalkAttribute(aNode, "data");
+    if (aNode->IsHTMLElement(nsGkAtoms::object)) {
+        return OnWalkAttribute(aNode->AsElement(), "data");
     }
 
-    if (auto nodeAsLink = dom::HTMLLinkElement::FromNode(content)) {
+    if (auto nodeAsLink = dom::HTMLLinkElement::FromNode(aNode)) {
         // Test if the link has a rel value indicating it to be a stylesheet
         nsAutoString linkRel;
         nodeAsLink->GetRel(linkRel);
         if (!linkRel.IsEmpty()) {
             nsReadingIterator<char16_t> start;
             nsReadingIterator<char16_t> end;
             nsReadingIterator<char16_t> current;
 
@@ -522,39 +515,39 @@ ResourceReader::OnWalkDOMNode(nsIDOMNode
                 nsReadingIterator<char16_t> startWord = current;
                 do {
                     ++current;
                 } while (current != end && !nsCRT::IsAsciiSpace(*current));
 
                 // Store the link for fix up if it says "stylesheet"
                 if (Substring(startWord, current)
                         .LowerCaseEqualsLiteral("stylesheet")) {
-                    OnWalkAttribute(aNode, "href");
+                    OnWalkAttribute(aNode->AsElement(), "href");
                     return NS_OK;
                 }
                 if (current == end) {
                     break;
                 }
             }
         }
         return NS_OK;
     }
 
-    if (content->IsHTMLElement(nsGkAtoms::frame)) {
+    if (aNode->IsHTMLElement(nsGkAtoms::frame)) {
         return OnWalkSubframe(aNode);
     }
 
-    if (content->IsHTMLElement(nsGkAtoms::iframe) &&
+    if (aNode->IsHTMLElement(nsGkAtoms::iframe) &&
         !(mPersistFlags & IWBP::PERSIST_FLAGS_IGNORE_IFRAMES)) {
         return OnWalkSubframe(aNode);
     }
 
-    auto nodeAsInput = dom::HTMLInputElement::FromNode(content);
+    auto nodeAsInput = dom::HTMLInputElement::FromNode(aNode);
     if (nodeAsInput) {
-        return OnWalkAttribute(aNode, "src");
+        return OnWalkAttribute(aNode->AsElement(), "src");
     }
 
     return NS_OK;
 }
 
 // Helper class for node rewriting in writeContent().
 class PersistNodeFixup final : public nsIDocumentEncoderNodeFixup {
 public:
@@ -1156,17 +1149,17 @@ WebBrowserPersistLocalDocument::ReadReso
     if (NS_WARN_IF(err.Failed())) {
         return err.StealNSResult();
     }
     MOZ_ASSERT(walker);
 
     RefPtr<ResourceReader> reader = new ResourceReader(this, aVisitor);
     nsCOMPtr<nsINode> currentNode = walker->CurrentNode();
     do {
-        rv = reader->OnWalkDOMNode(currentNode->AsDOMNode());
+        rv = reader->OnWalkDOMNode(currentNode);
         if (NS_WARN_IF(NS_FAILED(rv))) {
             break;
         }
 
         ErrorResult err;
         currentNode = walker->NextNode(err);
         if (NS_WARN_IF(err.Failed())) {
             err.SuppressException();
--- a/dom/xbl/nsXBLContentSink.cpp
+++ b/dom/xbl/nsXBLContentSink.cpp
@@ -4,17 +4,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/ArrayUtils.h"
 
 #include "nsXBLContentSink.h"
 #include "nsIDocument.h"
 #include "nsBindingManager.h"
-#include "nsIDOMNode.h"
 #include "nsGkAtoms.h"
 #include "nsNameSpaceManager.h"
 #include "nsIURI.h"
 #include "nsTextFragment.h"
 #ifdef MOZ_XUL
 #include "nsXULElement.h"
 #endif
 #include "nsXBLProtoImplProperty.h"
--- a/dom/xbl/nsXBLProtoImpl.cpp
+++ b/dom/xbl/nsXBLProtoImpl.cpp
@@ -7,17 +7,16 @@
 #include "mozilla/DebugOnly.h"
 
 #include "nsXBLProtoImpl.h"
 #include "nsIContent.h"
 #include "nsIDocument.h"
 #include "nsContentUtils.h"
 #include "nsIXPConnect.h"
 #include "nsIServiceManager.h"
-#include "nsIDOMNode.h"
 #include "nsXBLPrototypeBinding.h"
 #include "nsXBLProtoImplProperty.h"
 #include "nsIURI.h"
 #include "mozilla/dom/ScriptSettings.h"
 #include "mozilla/dom/XULElementBinding.h"
 #include "xpcpublic.h"
 #include "js/CharacterEncoding.h"
 
--- a/dom/xml/XMLStylesheetProcessingInstruction.cpp
+++ b/dom/xml/XMLStylesheetProcessingInstruction.cpp
@@ -60,17 +60,17 @@ void
 XMLStylesheetProcessingInstruction::UnbindFromTree(bool aDeep, bool aNullParent)
 {
   nsCOMPtr<nsIDocument> oldDoc = GetUncomposedDoc();
 
   ProcessingInstruction::UnbindFromTree(aDeep, aNullParent);
   Unused << UpdateStyleSheetInternal(oldDoc, nullptr);
 }
 
-// nsIDOMNode
+// nsINode
 
 void
 XMLStylesheetProcessingInstruction::SetNodeValueInternal(const nsAString& aNodeValue,
                                                          ErrorResult& aError)
 {
   CharacterData::SetNodeValueInternal(aNodeValue, aError);
   if (!aError.Failed()) {
     Unused << UpdateStyleSheetInternal(nullptr, nullptr, ForceUpdate::Yes);
--- a/dom/xml/XMLStylesheetProcessingInstruction.h
+++ b/dom/xml/XMLStylesheetProcessingInstruction.h
@@ -38,17 +38,17 @@ public:
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // CC
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(XMLStylesheetProcessingInstruction,
                                            ProcessingInstruction)
 
-  // nsIDOMNode
+  // nsINode
   virtual void SetNodeValueInternal(const nsAString& aNodeValue,
                                     mozilla::ErrorResult& aError) override;
 
   // nsIContent
   virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
                               nsIContent* aBindingParent,
                               bool aCompileEventHandlers) override;
   virtual void UnbindFromTree(bool aDeep = true,
--- a/dom/xslt/xpath/XPathResult.cpp
+++ b/dom/xslt/xpath/XPathResult.cpp
@@ -4,17 +4,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "XPathResult.h"
 #include "txExprResult.h"
 #include "txNodeSet.h"
 #include "nsError.h"
 #include "mozilla/dom/Attr.h"
 #include "mozilla/dom/Element.h"
-#include "nsIDOMNode.h"
 #include "nsDOMString.h"
 #include "txXPathTreeWalker.h"
 #include "nsCycleCollectionParticipant.h"
 #include "mozilla/dom/XPathResultBinding.h"
 
 namespace mozilla {
 namespace dom {
 
--- a/dom/xslt/xpath/txXPathTreeWalker.h
+++ b/dom/xslt/xpath/txXPathTreeWalker.h
@@ -93,20 +93,16 @@ class txXPathNativeNode
 {
 public:
     static txXPathNode* createXPathNode(nsINode* aNode,
                                         bool aKeepRootAlive = false);
     static txXPathNode* createXPathNode(nsIContent* aContent,
                                         bool aKeepRootAlive = false);
     static txXPathNode* createXPathNode(nsIDocument* aDocument);
     static nsINode* getNode(const txXPathNode& aNode);
-    static nsresult getNode(const txXPathNode& aNode, nsIDOMNode** aResult)
-    {
-        return CallQueryInterface(getNode(aNode), aResult);
-    }
     static nsIContent* getContent(const txXPathNode& aNode);
     static nsIDocument* getDocument(const txXPathNode& aNode);
     static void addRef(const txXPathNode& aNode)
     {
         NS_ADDREF(aNode.mNode);
     }
     static void release(const txXPathNode& aNode)
     {
--- a/dom/xslt/xslt/txEXSLTFunctions.cpp
+++ b/dom/xslt/xslt/txEXSLTFunctions.cpp
@@ -93,19 +93,17 @@ createTextNode(txIEvalContext *aContext,
         return NS_ERROR_UNEXPECTED;
     }
 
     RefPtr<nsTextNode> text = new nsTextNode(doc->NodeInfoManager());
 
     nsresult rv = text->SetText(aValue, false);
     NS_ENSURE_SUCCESS(rv, rv);
 
-    // nsTextNode implements both nsIDOMNode and nsIContent, so the
-    // call would be ambiguous without the AsContent() call.
-    *aResult = txXPathNativeNode::createXPathNode(text->AsContent(), true);
+    *aResult = txXPathNativeNode::createXPathNode(text, true);
     NS_ENSURE_TRUE(*aResult, NS_ERROR_OUT_OF_MEMORY);
 
     return NS_OK;
 }
 
 static nsresult
 createAndAddToResult(nsAtom* aName, const nsAString& aValue,
                      txNodeSet* aResultSet, DocumentFragment* aResultHolder)
--- a/dom/xslt/xslt/txMozillaStylesheetCompiler.cpp
+++ b/dom/xslt/xslt/txMozillaStylesheetCompiler.cpp
@@ -1,16 +1,15 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsCOMArray.h"
 #include "nsIAuthPrompt.h"
-#include "nsIDOMNode.h"
 #include "nsIDocument.h"
 #include "nsIExpatSink.h"
 #include "nsIChannelEventSink.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsILoadGroup.h"
 #include "nsIParser.h"
 #include "nsCharsetSource.h"
 #include "nsIRequestObserver.h"
--- a/dom/xslt/xslt/txMozillaXSLTProcessor.cpp
+++ b/dom/xslt/xslt/txMozillaXSLTProcessor.cpp
@@ -815,23 +815,20 @@ txMozillaXSLTProcessor::SetParameter(con
                 nsresult rv = xpathResult->GetExprResult(getter_AddRefs(result));
                 NS_ENSURE_SUCCESS(rv, rv);
 
                 if (result->getResultType() == txAExprResult::NODESET) {
                     txNodeSet *nodeSet =
                         static_cast<txNodeSet*>
                                    (static_cast<txAExprResult*>(result));
 
-                    nsCOMPtr<nsIDOMNode> node;
                     int32_t i, count = nodeSet->size();
                     for (i = 0; i < count; ++i) {
-                        rv = txXPathNativeNode::getNode(nodeSet->get(i),
-                                                        getter_AddRefs(node));
-                        NS_ENSURE_SUCCESS(rv, rv);
-
+                        nsINode* node =
+                            txXPathNativeNode::getNode(nodeSet->get(i));
                         if (!nsContentUtils::CanCallerAccess(node)) {
                             return NS_ERROR_DOM_SECURITY_ERR;
                         }
                     }
                 }
 
                 // Clone the XPathResult so that mutations don't affect this
                 // variable.
@@ -891,17 +888,17 @@ txMozillaXSLTProcessor::SetParameter(con
                 return NS_ERROR_ILLEGAL_VALUE;
             }
 
             nsISupports** values = static_cast<nsISupports**>(array);
 
             uint32_t i;
             for (i = 0; i < count; ++i) {
                 nsISupports *supports = values[i];
-                nsCOMPtr<nsIDOMNode> node = do_QueryInterface(supports);
+                nsCOMPtr<nsINode> node = do_QueryInterface(supports);
 
                 if (node) {
                     rv = nsContentUtils::CanCallerAccess(node) ? NS_OK :
                          NS_ERROR_DOM_SECURITY_ERR;
                 }
                 else {
                     // We only support arrays of DOM nodes.
                     rv = NS_ERROR_ILLEGAL_VALUE;
--- a/dom/xul/XULDocument.cpp
+++ b/dom/xul/XULDocument.cpp
@@ -1498,17 +1498,17 @@ XULDocument::RemoveSubtreeFromDocument(n
         RemoveBroadcastListenerFor(*broadcaster, *listener, attribute);
     }
 
     return NS_OK;
 }
 
 //----------------------------------------------------------------------
 //
-// nsIDOMNode interface
+// nsINode interface
 //
 
 nsresult
 XULDocument::Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
                    bool aPreallocateChildren) const
 {
     // We don't allow cloning of a XUL document
     *aResult = nullptr;
--- a/dom/xul/nsXULCommandDispatcher.h
+++ b/dom/xul/nsXULCommandDispatcher.h
@@ -11,17 +11,16 @@
 */
 
 #ifndef nsXULCommandDispatcher_h__
 #define nsXULCommandDispatcher_h__
 
 #include "nsCOMPtr.h"
 #include "nsIDOMXULCommandDispatcher.h"
 #include "nsWeakReference.h"
-#include "nsIDOMNode.h"
 #include "nsString.h"
 #include "nsCycleCollectionParticipant.h"
 #include "mozilla/RefPtr.h"
 
 class nsPIWindowRoot;
 
 namespace mozilla {
 namespace dom {
--- a/dom/xul/nsXULElement.cpp
+++ b/dom/xul/nsXULElement.cpp
@@ -320,17 +320,17 @@ NS_IMPL_RELEASE_INHERITED(nsXULElement, 
 NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsXULElement)
     NS_INTERFACE_TABLE_INHERITED(nsXULElement, nsIDOMNode)
     NS_ELEMENT_INTERFACE_TABLE_TO_MAP_SEGUE
     NS_INTERFACE_MAP_ENTRY_TEAROFF(nsIFrameLoaderOwner,
                                    new nsXULElementTearoff(this))
 NS_INTERFACE_MAP_END_INHERITING(nsStyledElement)
 
 //----------------------------------------------------------------------
-// nsIDOMNode interface
+// nsINode interface
 
 nsresult
 nsXULElement::Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
                     bool aPreallocateChildren) const
 {
     *aResult = nullptr;
 
     RefPtr<mozilla::dom::NodeInfo> ni = aNodeInfo;