Bug 1460735 part 2. Remove nsIDOMDocument. r=qdot
authorBoris Zbarsky <bzbarsky@mit.edu>
Tue, 29 May 2018 13:39:06 -0400
changeset 420311 35a9ad46b395f60f04eb9abb3522781464f38e9d
parent 420310 3b36aa930a8a8286b24edf2deef3a92d4f76a6dc
child 420312 c9adb6e265d4231b45956b7dd182c79037599d8b
push id34069
push usernerli@mozilla.com
push dateTue, 29 May 2018 21:42:06 +0000
treeherdermozilla-central@89d79c2258be [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersqdot
bugs1460735
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 1460735 part 2. Remove nsIDOMDocument. r=qdot
accessible/interfaces/msaa/ISimpleDOMNode.idl
docshell/base/nsDocShell.cpp
dom/base/nsDocument.cpp
dom/base/nsDocument.h
dom/interfaces/base/domstubs.idl
dom/interfaces/core/moz.build
dom/interfaces/core/nsIDOMDocument.idl
dom/webidl/Document.webidl
--- a/accessible/interfaces/msaa/ISimpleDOMNode.idl
+++ b/accessible/interfaces/msaa/ISimpleDOMNode.idl
@@ -37,27 +37,27 @@ cpp_quote("//  /* [in] */ short  *nameSp
 cpp_quote("//  /* [out] */ BSTR  *attribValues);")
 cpp_quote("// ---------------------------------------------------------------------------------------------------=")
 cpp_quote("// Takes 2 arrays - the attribute names and namespace IDs, and returns an array of corresponding values")
 cpp_quote("// If the namespace ID is 0, it's the same namespace as the node's namespace")
 cpp_quote("//")
 cpp_quote("// computedStyle(  ")
 cpp_quote("//  /* [in]  */ unsigned short maxStyleProperties,")
 cpp_quote("//  /* [out] */ unsigned short *numStyleProperties, ")
-cpp_quote("//  /* [in]  */ boolean useAlternateView,  // If TRUE, returns properites for media as set in nsIDOMDocument::set_alternateViewMediaTypes")
+cpp_quote("//  /* [in]  */ boolean useAlternateView,  // If TRUE, returns properites for media as set in Document's set_alternateViewMediaTypes")
 cpp_quote("//  /* [out] */ BSTR *styleProperties, ")
 cpp_quote("//  /* [out] */ BSTR *styleValues);")
 cpp_quote("// ---------------------------------------------------------------------------------------------------=")
 cpp_quote("// Returns 2 arrays -- the style properties and their values")
 cpp_quote("//  useAlternateView=FALSE: gets properties for the default media type (usually screen)")
 cpp_quote("//  useAlternateView=TRUE: properties for media types set w/ nsIDOMSimpleDocument::set_alternateViewMediaTypes()")
 cpp_quote("//")
 cpp_quote("// computedStyleForProperties(  ")
 cpp_quote("//  /* [in] */  unsigned short numStyleProperties, ")
-cpp_quote("//  /* [in] */  boolean useAlternateView,  // If TRUE, returns properites for media as set in nsIDOMDocument::set_alternateViewMediaTypes")
+cpp_quote("//  /* [in] */  boolean useAlternateView,  // If TRUE, returns properites for media as set in Document's set_alternateViewMediaTypes")
 cpp_quote("//  /* [in] */  BSTR *styleProperties, ")
 cpp_quote("//  /* [out] */ BSTR *styleValues);")
 cpp_quote("// ---------------------------------------------------------------------------------------------------=")
 cpp_quote("// Scroll the current view so that this dom node is visible.")
 cpp_quote("//  placeTopLeft=TRUE: scroll until the top left corner of the dom node is at the top left corner of the view.")
 cpp_quote("//  placeTopLeft=FALSE: scroll minimally to make the dom node visible. Don't scroll at all if already visible.")
 cpp_quote("//")
 cpp_quote("// scrollTo( ")
@@ -136,25 +136,25 @@ interface ISimpleDOMNode : IUnknown
     [in] unsigned short numAttribs,
     [in, size_is(numAttribs), length_is(numAttribs)] BSTR *attribNames, 
     [in, size_is(numAttribs), length_is(numAttribs)] short *nameSpaceID,  
     [out, retval, size_is(numAttribs), length_is(numAttribs)] BSTR *attribValues
   );
 
   [propget] HRESULT computedStyle(  
     [in] unsigned short maxStyleProperties,
-    [in] boolean useAlternateView,  // If TRUE, returns properites for media as set in nsIDOMDocument::set_alternateViewMediaTypes
+    [in] boolean useAlternateView,  // If TRUE, returns properites for media as set in Document's set_alternateViewMediaTypes
     [out, size_is(maxStyleProperties), length_is(*numStyleProperties)] BSTR *styleProperties, 
     [out, size_is(maxStyleProperties), length_is(*numStyleProperties)] BSTR *styleValues,
     [out, retval] unsigned short *numStyleProperties
   );
 
   [propget] HRESULT computedStyleForProperties(  
     [in] unsigned short numStyleProperties, 
-    [in] boolean useAlternateView,  // If TRUE, returns properites for media as set in nsIDOMDocument::set_alternateViewMediaTypes
+    [in] boolean useAlternateView,  // If TRUE, returns properites for media as set in Document's set_alternateViewMediaTypes
     [in, size_is(numStyleProperties), length_is(numStyleProperties)] BSTR *styleProperties, 
     [out, retval, size_is(numStyleProperties), length_is(numStyleProperties)] BSTR *styleValues
   );
 
   HRESULT scrollTo([in] boolean placeTopLeft);
 
   [propget] HRESULT parentNode([out, retval] ISimpleDOMNode **node);
   [propget] HRESULT firstChild([out, retval] ISimpleDOMNode **node);
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -76,17 +76,16 @@
 #include "nsIContentSecurityPolicy.h"
 #include "nsIContentViewer.h"
 #include "nsIController.h"
 #include "nsICookieService.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsIDocShellTreeOwner.h"
 #include "nsIDocument.h"
 #include "nsIDocumentLoaderFactory.h"
-#include "nsIDOMDocument.h"
 #include "nsIDOMNode.h"
 #include "nsIDOMStorage.h"
 #include "nsIDOMWindow.h"
 #include "nsIEditingSession.h"
 #include "nsIExternalProtocolService.h"
 #include "nsIFormPOSTActionChannel.h"
 #include "nsIFrame.h"
 #include "nsIGlobalHistory2.h"
@@ -547,22 +546,16 @@ nsDocShell::GetInterface(const nsIID& aI
     *aSink = mContentListener;
   } else if ((aIID.Equals(NS_GET_IID(nsIScriptGlobalObject)) ||
               aIID.Equals(NS_GET_IID(nsIGlobalObject)) ||
               aIID.Equals(NS_GET_IID(nsPIDOMWindowOuter)) ||
               aIID.Equals(NS_GET_IID(mozIDOMWindowProxy)) ||
               aIID.Equals(NS_GET_IID(nsIDOMWindow))) &&
              NS_SUCCEEDED(EnsureScriptEnvironment())) {
     return mScriptGlobal->QueryInterface(aIID, aSink);
-  } else if (aIID.Equals(NS_GET_IID(nsIDOMDocument)) &&
-             NS_SUCCEEDED(EnsureContentViewer())) {
-    nsCOMPtr<nsIDOMDocument> doc =
-      do_QueryInterface(mContentViewer->GetDocument());
-    doc.forget(aSink);
-    return *aSink ? NS_OK : NS_NOINTERFACE;
   } else if (aIID.Equals(NS_GET_IID(nsIDocument)) &&
              NS_SUCCEEDED(EnsureContentViewer())) {
     nsCOMPtr<nsIDocument> doc = mContentViewer->GetDocument();
     doc.forget(aSink);
     return *aSink ? NS_OK : NS_NOINTERFACE;
   } else if (aIID.Equals(NS_GET_IID(nsIApplicationCacheContainer))) {
     *aSink = nullptr;
 
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -1725,17 +1725,16 @@ nsDocument::~nsDocument()
 }
 
 NS_INTERFACE_TABLE_HEAD(nsDocument)
   NS_WRAPPERCACHE_INTERFACE_TABLE_ENTRY
   NS_INTERFACE_TABLE_BEGIN
     NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(nsDocument, nsISupports, nsINode)
     NS_INTERFACE_TABLE_ENTRY(nsDocument, nsINode)
     NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDocument)
-    NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMDocument)
     NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMNode)
     NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIScriptObjectPrincipal)
     NS_INTERFACE_TABLE_ENTRY(nsDocument, mozilla::dom::EventTarget)
     NS_INTERFACE_TABLE_ENTRY(nsDocument, nsISupportsWeakReference)
     NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIRadioGroupContainer)
     NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIMutationObserver)
     NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIApplicationCacheContainer)
   NS_INTERFACE_TABLE_END
--- a/dom/base/nsDocument.h
+++ b/dom/base/nsDocument.h
@@ -16,17 +16,17 @@
 #include "jsfriendapi.h"
 #include "nsCOMPtr.h"
 #include "nsAutoPtr.h"
 #include "nsCRT.h"
 #include "nsWeakReference.h"
 #include "nsWeakPtr.h"
 #include "nsTArray.h"
 #include "nsIdentifierMapEntry.h"
-#include "nsIDOMDocument.h"
+#include "nsIDOMNode.h"
 #include "nsStubDocumentObserver.h"
 #include "nsIScriptGlobalObject.h"
 #include "nsIContent.h"
 #include "nsIPrincipal.h"
 #include "nsIParser.h"
 #include "nsBindingManager.h"
 #include "nsRefPtrHashtable.h"
 #include "nsJSThingHashtable.h"
@@ -125,17 +125,17 @@ public:
   NS_DECL_NSIREQUEST
 
 private:
   ~nsOnloadBlocker() {}
 };
 
 // Base class for our document implementations.
 class nsDocument : public nsIDocument,
-                   public nsIDOMDocument,
+                   public nsIDOMNode,
                    public nsSupportsWeakReference,
                    public nsIScriptObjectPrincipal,
                    public nsIRadioGroupContainer,
                    public nsIApplicationCacheContainer,
                    public nsStubMutationObserver
 {
   friend class nsIDocument;
 
--- a/dom/interfaces/base/domstubs.idl
+++ b/dom/interfaces/base/domstubs.idl
@@ -11,17 +11,16 @@ class nsWrapperCache;
 
 [ptr] native nsWrapperCachePtr(nsWrapperCache);
 
 typedef unsigned long long DOMTimeStamp;
 typedef double DOMHighResTimeStamp;
 typedef unsigned long long nsViewID;
 
 // Core
-interface nsIDOMDocument;
 interface nsIDOMNode;
 
 // Needed for raises() in our IDL
 %{C++
 namespace mozilla {
 namespace dom {
 class DOMException;
 }
--- a/dom/interfaces/core/moz.build
+++ b/dom/interfaces/core/moz.build
@@ -3,15 +3,14 @@
 # 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/.
 
 with Files("**"):
     BUG_COMPONENT = ("Core", "DOM")
 
 XPIDL_SOURCES += [
-    'nsIDOMDocument.idl',
     'nsIDOMNode.idl',
     'nsIDOMNSEditableElement.idl',
 ]
 
 XPIDL_MODULE = 'dom_core'
 
deleted file mode 100644
--- a/dom/interfaces/core/nsIDOMDocument.idl
+++ /dev/null
@@ -1,24 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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 "nsIDOMNode.idl"
-
-/**
- * The nsIDOMDocument interface represents the entire HTML or XML document.
- * Conceptually, it is the root of the document tree, and provides the
- * primary access to the document's data.
- * Since elements, text nodes, comments, processing instructions, etc.
- * cannot exist outside the context of a Document, the nsIDOMDocument
- * interface also contains the factory methods needed to create these
- * objects.
- *
- * For more information on this interface please see
- * http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html
- */
-
-[shim(Document), uuid(b15fa0f4-97c1-4388-af62-2ceff7a89bdf)]
-interface nsIDOMDocument : nsIDOMNode
-{
-};
--- a/dom/webidl/Document.webidl
+++ b/dom/webidl/Document.webidl
@@ -344,17 +344,17 @@ partial interface Document {
   [Func="IsChromeOrXBL"]
   Element? getAnonymousElementByAttribute(Element elt, DOMString attrName,
                                           DOMString attrValue);
   [Func="IsChromeOrXBL"]
   Element? getBindingParent(Node node);
   [Throws, Func="IsChromeOrXBL", NeedsSubjectPrincipal]
   void loadBindingDocument(DOMString documentURL);
 
-  // nsIDOMDocumentTouch
+  // Touch bits
   // XXXbz I can't find the sane spec for this stuff, so just cribbing
   // from our xpidl for now.
   [NewObject, Func="nsGenericHTMLElement::TouchEventsEnabled"]
   Touch createTouch(optional Window? view = null,
                     optional EventTarget? target = null,
                     optional long identifier = 0,
                     optional long pageX = 0,
                     optional long pageY = 0,