Bug 1460940 - Remove nsIDOMDocument uses in accessible/. r=bz
authorAdrian Wielgosik <adrian.wielgosik@gmail.com>
Fri, 11 May 2018 19:46:15 +0200
changeset 418173 1b58640450884d282a25f7318c8ce115d6eba31c
parent 418172 85d61067345b4ba153ae793eb43bdffdaa062def
child 418174 eb2845258fb5d6ce16ada36b7c4069f5edb9bd93
push id33994
push usernbeleuzu@mozilla.com
push dateMon, 14 May 2018 21:35:03 +0000
treeherdermozilla-central@237b7b5faa03 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs1460940
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 1460940 - Remove nsIDOMDocument uses in accessible/. r=bz MozReview-Commit-ID: LQ91rgrJIy
accessible/base/DocManager.cpp
accessible/generic/ApplicationAccessible.cpp
accessible/generic/DocAccessible.cpp
accessible/generic/RootAccessible.cpp
accessible/interfaces/nsIAccessibleDocument.idl
accessible/xpcom/xpcAccessibleDocument.cpp
accessible/xpcom/xpcAccessibleDocument.h
--- a/accessible/base/DocManager.cpp
+++ b/accessible/base/DocManager.cpp
@@ -21,17 +21,16 @@
 #endif
 
 #include "mozilla/EventListenerManager.h"
 #include "mozilla/dom/Event.h" // for Event
 #include "nsContentUtils.h"
 #include "nsCURILoader.h"
 #include "nsDocShellLoadTypes.h"
 #include "nsIChannel.h"
-#include "nsIDOMDocument.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIWebNavigation.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIWebProgress.h"
 #include "nsCoreUtils.h"
 #include "nsXULAppAPI.h"
 #include "mozilla/dom/TabChild.h"
 
--- a/accessible/generic/ApplicationAccessible.cpp
+++ b/accessible/generic/ApplicationAccessible.cpp
@@ -9,17 +9,16 @@
 
 #include "nsAccessibilityService.h"
 #include "nsAccUtils.h"
 #include "Relation.h"
 #include "Role.h"
 #include "States.h"
 
 #include "nsIComponentManager.h"
-#include "nsIDOMDocument.h"
 #include "nsIWindowMediator.h"
 #include "nsServiceManagerUtils.h"
 #include "mozilla/Services.h"
 #include "nsGlobalWindow.h"
 #include "nsIStringBundle.h"
 
 using namespace mozilla::a11y;
 
--- a/accessible/generic/DocAccessible.cpp
+++ b/accessible/generic/DocAccessible.cpp
@@ -18,17 +18,16 @@
 #include "RootAccessible.h"
 #include "TreeWalker.h"
 #include "xpcAccessibleDocument.h"
 
 #include "nsIMutableArray.h"
 #include "nsICommandManager.h"
 #include "nsIDocShell.h"
 #include "nsIDocument.h"
-#include "nsIDOMDocument.h"
 #include "nsPIDOMWindow.h"
 #include "nsIEditingSession.h"
 #include "nsIFrame.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsImageFrame.h"
 #include "nsIPersistentProperties2.h"
 #include "nsIPresShell.h"
 #include "nsIServiceManager.h"
--- a/accessible/generic/RootAccessible.cpp
+++ b/accessible/generic/RootAccessible.cpp
@@ -3,17 +3,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 "RootAccessible.h"
 
 #include "mozilla/ArrayUtils.h"
 
 #define CreateEvent CreateEventA
-#include "nsIDOMDocument.h"
 
 #include "Accessible-inl.h"
 #include "DocAccessible-inl.h"
 #include "nsAccessibilityService.h"
 #include "nsAccUtils.h"
 #include "nsCoreUtils.h"
 #include "nsEventShell.h"
 #include "Relation.h"
--- a/accessible/interfaces/nsIAccessibleDocument.idl
+++ b/accessible/interfaces/nsIAccessibleDocument.idl
@@ -1,19 +1,20 @@
 /* -*- Mode: C++; 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 "nsISupports.idl"
 
 interface nsIAccessiblePivot;
-interface nsIDOMDocument;
 interface mozIDOMWindowProxy;
 
+webidl Document;
+
 /**
  * An interface for in-process accessibility clients
  * that wish to retrieve information about a document.
  * When accessibility is turned on in Gecko,
  * there is an nsIAccessibleDocument for each document
  * whether it is XUL, HTML or whatever.
  * You can QueryInterface to nsIAccessibleDocument from the nsIAccessible for
  * the root node of a document or you can get one from
@@ -38,19 +39,19 @@ interface nsIAccessibleDocument : nsISup
   readonly attribute AString mimeType;
 
   /**
    * The doc type of the document, as specified in the document.
    */
   readonly attribute AString docType;
 
   /**
-   * The nsIDOMDocument interface associated with this document.
+   * The Document interface associated with this document.
    */
-  readonly attribute nsIDOMDocument DOMDocument;
+  readonly attribute Document DOMDocument;
 
   /**
    * The nsIDOMWindow that the document resides in.
    */
   readonly attribute mozIDOMWindowProxy window;
 
   /**
    * Return the parent document accessible.
--- a/accessible/xpcom/xpcAccessibleDocument.cpp
+++ b/accessible/xpcom/xpcAccessibleDocument.cpp
@@ -6,17 +6,16 @@
 
 #include "xpcAccessibleDocument.h"
 #include "xpcAccessibleImage.h"
 #include "xpcAccessibleTable.h"
 #include "xpcAccessibleTableCell.h"
 
 #include "mozilla/a11y/DocAccessibleParent.h"
 #include "DocAccessible-inl.h"
-#include "nsIDOMDocument.h"
 
 using namespace mozilla;
 using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsISupports
 
 NS_IMPL_QUERY_INTERFACE_INHERITED(xpcAccessibleDocument, xpcAccessibleHyperText,
@@ -81,26 +80,26 @@ xpcAccessibleDocument::GetDocType(nsAStr
   if (!Intl())
     return NS_ERROR_FAILURE;
 
   Intl()->DocType(aType);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-xpcAccessibleDocument::GetDOMDocument(nsIDOMDocument** aDOMDocument)
+xpcAccessibleDocument::GetDOMDocument(nsIDocument** aDOMDocument)
 {
   NS_ENSURE_ARG_POINTER(aDOMDocument);
   *aDOMDocument = nullptr;
 
   if (!Intl())
     return NS_ERROR_FAILURE;
 
   if (Intl()->DocumentNode())
-    CallQueryInterface(Intl()->DocumentNode(), aDOMDocument);
+    NS_ADDREF(*aDOMDocument = Intl()->DocumentNode());
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleDocument::GetWindow(mozIDOMWindowProxy** aDOMWindow)
 {
   NS_ENSURE_ARG_POINTER(aDOMWindow);
--- a/accessible/xpcom/xpcAccessibleDocument.h
+++ b/accessible/xpcom/xpcAccessibleDocument.h
@@ -33,17 +33,17 @@ public:
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIAccessibleDocument
   NS_IMETHOD GetURL(nsAString& aURL) final;
   NS_IMETHOD GetTitle(nsAString& aTitle) final;
   NS_IMETHOD GetMimeType(nsAString& aType) final;
   NS_IMETHOD GetDocType(nsAString& aType) final;
-  NS_IMETHOD GetDOMDocument(nsIDOMDocument** aDOMDocument) final;
+  NS_IMETHOD GetDOMDocument(nsIDocument** aDOMDocument) final;
   NS_IMETHOD GetWindow(mozIDOMWindowProxy** aDOMWindow) final;
   NS_IMETHOD GetParentDocument(nsIAccessibleDocument** aDocument)
     final;
   NS_IMETHOD GetChildDocumentCount(uint32_t* aCount) final;
   NS_IMETHOD GetChildDocumentAt(uint32_t aIndex,
                                 nsIAccessibleDocument** aDocument)
     final;
   NS_IMETHOD GetVirtualCursor(nsIAccessiblePivot** aVirtualCursor)