Bug 830221 - Remove nsIDOMDOMImplementation. r?bz draft
authorAdrian Wielgosik <adrian.wielgosik@gmail.com>
Mon, 12 Feb 2018 21:49:07 +0100
changeset 754127 e544dc366990c99918d9fc7710b11ade0dafff61
parent 753976 165474ef313b106f0364cf1941a0030c41855876
push id98751
push userbmo:adrian.wielgosik@gmail.com
push dateMon, 12 Feb 2018 20:49:34 +0000
reviewersbz
bugs830221
milestone60.0a1
Bug 830221 - Remove nsIDOMDOMImplementation. r?bz MozReview-Commit-ID: 3SCN1mHiMMn
dom/base/DOMImplementation.cpp
dom/base/DOMImplementation.h
dom/base/nsDocument.cpp
dom/interfaces/base/domstubs.idl
dom/interfaces/core/moz.build
dom/interfaces/core/nsIDOMDOMImplementation.idl
layout/build/nsLayoutModule.cpp
--- a/dom/base/DOMImplementation.cpp
+++ b/dom/base/DOMImplementation.cpp
@@ -16,40 +16,30 @@
 #include "nsTextNode.h"
 
 namespace mozilla {
 namespace dom {
 
 // QueryInterface implementation for DOMImplementation
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMImplementation)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
-  NS_INTERFACE_MAP_ENTRY(nsIDOMDOMImplementation)
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(DOMImplementation, mOwner)
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(DOMImplementation)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(DOMImplementation)
 
 JSObject*
 DOMImplementation::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
   return DOMImplementationBinding::Wrap(aCx, this, aGivenProto);
 }
 
-NS_IMETHODIMP
-DOMImplementation::HasFeature(const nsAString& aFeature,
-                              const nsAString& aVersion,
-                              bool* aReturn)
-{
-  *aReturn = true;
-  return NS_OK;
-}
-
 already_AddRefed<DocumentType>
 DOMImplementation::CreateDocumentType(const nsAString& aQualifiedName,
                                       const nsAString& aPublicId,
                                       const nsAString& aSystemId,
                                       ErrorResult& aRv)
 {
   if (!mOwner) {
     aRv.Throw(NS_ERROR_UNEXPECTED);
@@ -69,37 +59,23 @@ DOMImplementation::CreateDocumentType(co
 
   // Indicate that there is no internal subset (not just an empty one)
   RefPtr<DocumentType> docType =
     NS_NewDOMDocumentType(mOwner->NodeInfoManager(), name, aPublicId,
                           aSystemId, VoidString(), aRv);
   return docType.forget();
 }
 
-NS_IMETHODIMP
-DOMImplementation::CreateDocumentType(const nsAString& aQualifiedName,
-                                      const nsAString& aPublicId,
-                                      const nsAString& aSystemId,
-                                      nsIDOMDocumentType** aReturn)
-{
-  ErrorResult rv;
-  *aReturn =
-    CreateDocumentType(aQualifiedName, aPublicId, aSystemId, rv).take();
-  return rv.StealNSResult();
-}
-
 nsresult
 DOMImplementation::CreateDocument(const nsAString& aNamespaceURI,
                                   const nsAString& aQualifiedName,
                                   nsIDOMDocumentType* aDoctype,
-                                  nsIDocument** aDocument,
-                                  nsIDOMDocument** aDOMDocument)
+                                  nsIDocument** aDocument)
 {
   *aDocument = nullptr;
-  *aDOMDocument = nullptr;
 
   nsresult rv;
   if (!aQualifiedName.IsEmpty()) {
     const nsString& qName = PromiseFlatString(aQualifiedName);
     const char16_t *colon;
     rv = nsContentUtils::CheckQName(qName, true, &colon);
     NS_ENSURE_SUCCESS(rv, rv);
 
@@ -138,51 +114,36 @@ DOMImplementation::CreateDocument(const 
     doc->SetContentType(NS_LITERAL_STRING("image/svg+xml"));
   } else {
     doc->SetContentType(NS_LITERAL_STRING("application/xml"));
   }
 
   doc->SetReadyStateInternal(nsIDocument::READYSTATE_COMPLETE);
 
   doc.forget(aDocument);
-  document.forget(aDOMDocument);
   return NS_OK;
 }
 
 already_AddRefed<nsIDocument>
 DOMImplementation::CreateDocument(const nsAString& aNamespaceURI,
                                   const nsAString& aQualifiedName,
                                   nsIDOMDocumentType* aDoctype,
                                   ErrorResult& aRv)
 {
   nsCOMPtr<nsIDocument> document;
-  nsCOMPtr<nsIDOMDocument> domDocument;
   aRv = CreateDocument(aNamespaceURI, aQualifiedName, aDoctype,
-                       getter_AddRefs(document), getter_AddRefs(domDocument));
+                       getter_AddRefs(document));
   return document.forget();
 }
 
-NS_IMETHODIMP
-DOMImplementation::CreateDocument(const nsAString& aNamespaceURI,
-                                  const nsAString& aQualifiedName,
-                                  nsIDOMDocumentType* aDoctype,
-                                  nsIDOMDocument** aReturn)
-{
-  nsCOMPtr<nsIDocument> document;
-  return CreateDocument(aNamespaceURI, aQualifiedName, aDoctype,
-                        getter_AddRefs(document), aReturn);
-}
-
 nsresult
 DOMImplementation::CreateHTMLDocument(const nsAString& aTitle,
-                                      nsIDocument** aDocument,
-                                      nsIDOMDocument** aDOMDocument)
+                                      nsIDocument** aDocument)
 {
   *aDocument = nullptr;
-  *aDOMDocument = nullptr;
 
   NS_ENSURE_STATE(mOwner);
 
   nsCOMPtr<nsIDOMDocumentType> doctype;
   // Indicate that there is no internal subset (not just an empty one)
   nsresult rv = NS_NewDOMDocumentType(getter_AddRefs(doctype),
                                       mOwner->NodeInfoManager(),
                                       nsGkAtoms::html, // aName
@@ -234,34 +195,23 @@ DOMImplementation::CreateHTMLDocument(co
   nsCOMPtr<Element> body = doc->CreateElem(NS_LITERAL_STRING("body"), nullptr,
                                            kNameSpaceID_XHTML);
   rv = root->AppendChildTo(body, false);
   NS_ENSURE_SUCCESS(rv, rv);
 
   doc->SetReadyStateInternal(nsIDocument::READYSTATE_COMPLETE);
 
   doc.forget(aDocument);
-  document.forget(aDOMDocument);
   return NS_OK;
 }
 
 already_AddRefed<nsIDocument>
 DOMImplementation::CreateHTMLDocument(const Optional<nsAString>& aTitle,
                                       ErrorResult& aRv)
 {
   nsCOMPtr<nsIDocument> document;
-  nsCOMPtr<nsIDOMDocument> domDocument;
   aRv = CreateHTMLDocument(aTitle.WasPassed() ? aTitle.Value() : VoidString(),
-                           getter_AddRefs(document),
-                           getter_AddRefs(domDocument));
+                           getter_AddRefs(document));
   return document.forget();
 }
 
-NS_IMETHODIMP
-DOMImplementation::CreateHTMLDocument(const nsAString& aTitle,
-                                      nsIDOMDocument** aReturn)
-{
-  nsCOMPtr<nsIDocument> document;
-  return CreateHTMLDocument(aTitle, getter_AddRefs(document), aReturn);
-}
-
 } // namespace dom
 } // namespace mozilla
--- a/dom/base/DOMImplementation.h
+++ b/dom/base/DOMImplementation.h
@@ -2,36 +2,33 @@
 /* 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/. */
 
 #ifndef mozilla_dom_DOMImplementation_h
 #define mozilla_dom_DOMImplementation_h
 
-#include "nsIDOMDOMImplementation.h"
 #include "nsWrapperCache.h"
 
 #include "mozilla/Attributes.h"
 #include "mozilla/ErrorResult.h"
 #include "nsCOMPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsIDocument.h"
 #include "nsIScriptGlobalObject.h"
 #include "nsIURI.h"
 #include "nsIWeakReferenceUtils.h"
 #include "nsString.h"
 
-class nsIDOMDocument;
-
 namespace mozilla {
 namespace dom {
 class DocumentType;
 
-class DOMImplementation final : public nsIDOMDOMImplementation
+class DOMImplementation final : public nsISupports
                               , public nsWrapperCache
 {
   ~DOMImplementation()
   {
   }
 
 public:
   DOMImplementation(nsIDocument* aOwner,
@@ -51,19 +48,16 @@ public:
 
   nsIDocument* GetParentObject() const
   {
     return mOwner;
   }
 
   virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
 
-  // nsIDOMDOMImplementation
-  NS_DECL_NSIDOMDOMIMPLEMENTATION
-
   bool HasFeature()
   {
     return true;
   }
 
   already_AddRefed<DocumentType>
   CreateDocumentType(const nsAString& aQualifiedName,
                      const nsAString& aPublicId,
@@ -78,21 +72,19 @@ public:
 
   already_AddRefed<nsIDocument>
   CreateHTMLDocument(const Optional<nsAString>& aTitle, ErrorResult& aRv);
 
 private:
   nsresult CreateDocument(const nsAString& aNamespaceURI,
                           const nsAString& aQualifiedName,
                           nsIDOMDocumentType* aDoctype,
-                          nsIDocument** aDocument,
-                          nsIDOMDocument** aDOMDocument);
+                          nsIDocument** aDocument);
   nsresult CreateHTMLDocument(const nsAString& aTitle,
-                              nsIDocument** aDocument,
-                              nsIDOMDocument** aDOMDocument);
+                              nsIDocument** aDocument);
 
   nsCOMPtr<nsIDocument> mOwner;
   nsWeakPtr mScriptObject;
   nsCOMPtr<nsIURI> mDocumentURI;
   nsCOMPtr<nsIURI> mBaseURI;
 };
 
 } // namespace dom
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -54,17 +54,16 @@
 
 #include "mozilla/AsyncEventDispatcher.h"
 #include "mozilla/BasicEvents.h"
 #include "mozilla/EventListenerManager.h"
 #include "mozilla/EventStateManager.h"
 
 #include "mozilla/dom/Attr.h"
 #include "mozilla/dom/BindingDeclarations.h"
-#include "nsIDOMDOMImplementation.h"
 #include "nsIDOMDocumentXBL.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/FramingChecker.h"
 #include "nsGenericHTMLElement.h"
 #include "mozilla/dom/CDATASection.h"
 #include "mozilla/dom/ProcessingInstruction.h"
 #include "nsDOMString.h"
 #include "nsNodeUtils.h"
--- a/dom/interfaces/base/domstubs.idl
+++ b/dom/interfaces/base/domstubs.idl
@@ -13,17 +13,16 @@ class nsWrapperCache;
 
 typedef unsigned long long DOMTimeStamp;
 typedef double DOMHighResTimeStamp;
 typedef unsigned long long nsViewID;
 
 // Core
 interface nsIDOMCharacterData;
 interface nsIDOMComment;
-interface nsIDOMDOMImplementation;
 interface nsIDOMDocument;
 interface nsIDOMDocumentFragment;
 interface nsIDOMDocumentType;
 interface nsIDOMElement;
 interface nsIDOMNode;
 interface nsIDOMNodeList;
 interface nsIDOMProcessingInstruction;
 interface nsIDOMText;
--- a/dom/interfaces/core/moz.build
+++ b/dom/interfaces/core/moz.build
@@ -9,17 +9,16 @@ with Files("**"):
 
 XPIDL_SOURCES += [
     'nsIDOMCharacterData.idl',
     'nsIDOMComment.idl',
     'nsIDOMDocument.idl',
     'nsIDOMDocumentFragment.idl',
     'nsIDOMDocumentType.idl',
     'nsIDOMDOMException.idl',
-    'nsIDOMDOMImplementation.idl',
     'nsIDOMElement.idl',
     'nsIDOMNode.idl',
     'nsIDOMNodeList.idl',
     'nsIDOMNSEditableElement.idl',
     'nsIDOMProcessingInstruction.idl',
     'nsIDOMText.idl',
     'nsIDOMXMLDocument.idl',
 ]
deleted file mode 100644
--- a/dom/interfaces/core/nsIDOMDOMImplementation.idl
+++ /dev/null
@@ -1,42 +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 "domstubs.idl"
-
-/**
- * The nsIDOMDOMImplementation interface provides a number of methods for 
- * performing operations that are independent of any particular instance 
- * of the document object model.
- *
- * For more information on this interface please see 
- * http://www.w3.org/TR/DOM-Level-2-Core/
- */
-
-[uuid(03a6f574-99ec-42f8-9e6c-812a4a9bcbf7)]
-interface nsIDOMDOMImplementation : nsISupports
-{
-  boolean                   hasFeature(in DOMString feature, 
-                                       in DOMString version);
-
-  nsIDOMDocumentType        createDocumentType(in DOMString qualifiedName,
-                                               in DOMString publicId,
-                                               in DOMString systemId)
-                                  raises(DOMException);
-
-  nsIDOMDocument            createDocument(in DOMString namespaceURI,
-                                           in DOMString qualifiedName,
-                                           in nsIDOMDocumentType doctype)
-                                  raises(DOMException);
-
-  /**
-   * Returns an HTML document with a basic DOM already constructed and with an
-   * appropriate title element.
-   *
-   * @param title the title of the Document
-   * @see <http://www.whatwg.org/html/#creating-documents>
-   */
-  nsIDOMDocument            createHTMLDocument([Null(Stringify)]
-                                               in DOMString title);
-};
--- a/layout/build/nsLayoutModule.cpp
+++ b/layout/build/nsLayoutModule.cpp
@@ -19,17 +19,16 @@
 #include "nsHTMLContentSerializer.h"
 #include "nsHTMLParts.h"
 #include "nsIComponentManager.h"
 #include "nsIContentIterator.h"
 #include "nsIContentSerializer.h"
 #include "nsIContentViewer.h"
 #include "nsIController.h"
 #include "nsIControllers.h"
-#include "nsIDOMDOMImplementation.h"
 #include "nsIDocument.h"
 #include "nsIDocumentEncoder.h"
 #include "nsIFactory.h"
 #include "nsIIdleService.h"
 #include "nsHTMLStyleSheet.h"
 #include "nsILayoutDebugger.h"
 #include "nsNameSpaceManager.h"
 #include "nsIObserver.h"