Commit d2ed2608 authored by Emilio Cobos Álvarez's avatar Emilio Cobos Álvarez
Browse files

Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug

Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.

Overall it's not a very interesting patch I think.

nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.

I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.

While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.
parent ff20f251
......@@ -22,7 +22,7 @@ const uint32_t kCacheRefreshInterval = 500;
// DocAccessibleWrap
////////////////////////////////////////////////////////////////////////////////
DocAccessibleWrap::DocAccessibleWrap(nsIDocument* aDocument,
DocAccessibleWrap::DocAccessibleWrap(Document* aDocument,
nsIPresShell* aPresShell)
: DocAccessible(aDocument, aPresShell) {
nsCOMPtr<nsIDocShellTreeItem> treeItem(aDocument->GetDocShell());
......
......@@ -14,7 +14,7 @@ namespace a11y {
class DocAccessibleWrap : public DocAccessible {
public:
DocAccessibleWrap(nsIDocument* aDocument, nsIPresShell* aPresShell);
DocAccessibleWrap(Document* aDocument, nsIPresShell* aPresShell);
virtual ~DocAccessibleWrap();
virtual nsresult HandleAccEvent(AccEvent* aEvent) override;
......
......@@ -13,7 +13,7 @@
using namespace mozilla::a11y;
RootAccessibleWrap::RootAccessibleWrap(nsIDocument* aDoc,
RootAccessibleWrap::RootAccessibleWrap(mozilla::dom::Document* aDoc,
nsIPresShell* aPresShell)
: RootAccessible(aDoc, aPresShell) {}
......
......@@ -15,7 +15,7 @@ class DocProxyAccessibleWrap;
class RootAccessibleWrap : public RootAccessible {
public:
RootAccessibleWrap(nsIDocument* aDocument, nsIPresShell* aPresShell);
RootAccessibleWrap(dom::Document* aDocument, nsIPresShell* aPresShell);
virtual ~RootAccessibleWrap();
AccessibleWrap* GetContentAccessible();
......
......@@ -13,7 +13,7 @@ using namespace mozilla::a11y;
// DocAccessibleWrap
////////////////////////////////////////////////////////////////////////////////
DocAccessibleWrap::DocAccessibleWrap(nsIDocument* aDocument,
DocAccessibleWrap::DocAccessibleWrap(dom::Document* aDocument,
nsIPresShell* aPresShell)
: DocAccessible(aDocument, aPresShell), mActivated(false) {}
......
......@@ -18,7 +18,7 @@ namespace a11y {
class DocAccessibleWrap : public DocAccessible {
public:
DocAccessibleWrap(nsIDocument* aDocument, nsIPresShell* aPresShell);
DocAccessibleWrap(dom::Document* aDocument, nsIPresShell* aPresShell);
virtual ~DocAccessibleWrap();
bool mActivated;
......
......@@ -52,7 +52,7 @@ DocManager::DocManager() : mDocAccessibleCache(2), mXPCDocumentCache(0) {}
////////////////////////////////////////////////////////////////////////////////
// DocManager public
DocAccessible* DocManager::GetDocAccessible(nsIDocument* aDocument) {
DocAccessible* DocManager::GetDocAccessible(Document* aDocument) {
if (!aDocument) return nullptr;
DocAccessible* docAcc = GetExistingDocAccessible(aDocument);
......@@ -90,7 +90,7 @@ void DocManager::RemoveFromXPCDocumentCache(DocAccessible* aDocument) {
}
void DocManager::NotifyOfDocumentShutdown(DocAccessible* aDocument,
nsIDocument* aDOMDocument) {
Document* aDOMDocument) {
// We need to remove listeners in both cases, when document is being shutdown
// or when accessibility service is being shut down as well.
RemoveListeners(aDOMDocument);
......@@ -218,7 +218,7 @@ DocManager::OnStateChange(nsIWebProgress* aWebProgress, nsIRequest* aRequest,
nsPIDOMWindowOuter* piWindow = nsPIDOMWindowOuter::From(DOMWindow);
MOZ_ASSERT(piWindow);
nsCOMPtr<nsIDocument> document = piWindow->GetDoc();
nsCOMPtr<Document> document = piWindow->GetDoc();
NS_ENSURE_STATE(document);
// Document was loaded.
......@@ -316,7 +316,7 @@ DocManager::HandleEvent(Event* aEvent) {
nsAutoString type;
aEvent->GetType(type);
nsCOMPtr<nsIDocument> document = do_QueryInterface(aEvent->GetTarget());
nsCOMPtr<Document> document = do_QueryInterface(aEvent->GetTarget());
NS_ASSERTION(document, "pagehide or DOMContentLoaded for non document!");
if (!document) return NS_OK;
......@@ -361,7 +361,7 @@ DocManager::HandleEvent(Event* aEvent) {
////////////////////////////////////////////////////////////////////////////////
// DocManager private
void DocManager::HandleDOMDocumentLoad(nsIDocument* aDocument,
void DocManager::HandleDOMDocumentLoad(Document* aDocument,
uint32_t aLoadEventType) {
// Document accessible can be created before we were notified the DOM document
// was loaded completely. However if it's not created yet then create it.
......@@ -374,7 +374,7 @@ void DocManager::HandleDOMDocumentLoad(nsIDocument* aDocument,
docAcc->NotifyOfLoad(aLoadEventType);
}
void DocManager::AddListeners(nsIDocument* aDocument,
void DocManager::AddListeners(Document* aDocument,
bool aAddDOMContentLoadedListener) {
nsPIDOMWindowOuter* window = aDocument->GetWindow();
EventTarget* target = window->GetChromeEventHandler();
......@@ -397,7 +397,7 @@ void DocManager::AddListeners(nsIDocument* aDocument,
}
}
void DocManager::RemoveListeners(nsIDocument* aDocument) {
void DocManager::RemoveListeners(Document* aDocument) {
nsPIDOMWindowOuter* window = aDocument->GetWindow();
if (!window) return;
......@@ -412,7 +412,7 @@ void DocManager::RemoveListeners(nsIDocument* aDocument) {
TrustedEventsAtCapture());
}
DocAccessible* DocManager::CreateDocOrRootAccessible(nsIDocument* aDocument) {
DocAccessible* DocManager::CreateDocOrRootAccessible(Document* aDocument) {
// Ignore hidden documents, resource documents, static clone
// (printing) documents and documents without a docshell.
if (!aDocument->IsVisibleConsideringAncestors() ||
......
......@@ -6,7 +6,7 @@
#define mozilla_a11_DocManager_h_
#include "mozilla/ClearOnShutdown.h"
#include "nsIDocument.h"
#include "mozilla/dom/Document.h"
#include "nsIDOMEventListener.h"
#include "nsRefPtrHashtable.h"
#include "nsIWebProgressListener.h"
......@@ -36,7 +36,7 @@ class DocManager : public nsIWebProgressListener,
/**
* Return document accessible for the given DOM node.
*/
DocAccessible* GetDocAccessible(nsIDocument* aDocument);
DocAccessible* GetDocAccessible(dom::Document* aDocument);
/**
* Return document accessible for the given presshell.
......@@ -60,7 +60,7 @@ class DocManager : public nsIWebProgressListener,
* Called by document accessible when it gets shutdown.
*/
void NotifyOfDocumentShutdown(DocAccessible* aDocument,
nsIDocument* aDOMDocument);
dom::Document* aDOMDocument);
void RemoveFromXPCDocumentCache(DocAccessible* aDocument);
......@@ -142,25 +142,25 @@ class DocManager : public nsIWebProgressListener,
* @param aLoadEventType [in] specifies the event type to fire load event,
* if 0 then no event is fired
*/
void HandleDOMDocumentLoad(nsIDocument* aDocument, uint32_t aLoadEventType);
void HandleDOMDocumentLoad(dom::Document* aDocument, uint32_t aLoadEventType);
/**
* Add/remove 'pagehide' and 'DOMContentLoaded' event listeners.
*/
void AddListeners(nsIDocument* aDocument, bool aAddPageShowListener);
void RemoveListeners(nsIDocument* aDocument);
void AddListeners(dom::Document* aDocument, bool aAddPageShowListener);
void RemoveListeners(dom::Document* aDocument);
/**
* Create document or root accessible.
*/
DocAccessible* CreateDocOrRootAccessible(nsIDocument* aDocument);
DocAccessible* CreateDocOrRootAccessible(dom::Document* aDocument);
/**
* Clear the cache and shutdown the document accessibles.
*/
void ClearDocCache();
typedef nsRefPtrHashtable<nsPtrHashKey<const nsIDocument>, DocAccessible>
typedef nsRefPtrHashtable<nsPtrHashKey<const dom::Document>, DocAccessible>
DocAccessibleHashtable;
DocAccessibleHashtable mDocAccessibleCache;
......@@ -182,7 +182,7 @@ class DocManager : public nsIWebProgressListener,
* Note this returns the doc accessible for the primary pres shell if there is
* more than one.
*/
inline DocAccessible* GetExistingDocAccessible(const nsIDocument* aDocument) {
inline DocAccessible* GetExistingDocAccessible(const dom::Document* aDocument) {
nsIPresShell* ps = aDocument->GetShell();
return ps ? ps->GetDocAccessible() : nullptr;
}
......
......@@ -134,7 +134,7 @@ void FocusManager::NotifyOfDOMBlur(nsISupports* aTarget) {
// the case when no element within this DOM document will be focused.
nsCOMPtr<nsINode> targetNode(do_QueryInterface(aTarget));
if (targetNode && targetNode->OwnerDoc() == FocusedDOMDocument()) {
nsIDocument* DOMDoc = targetNode->OwnerDoc();
dom::Document* DOMDoc = targetNode->OwnerDoc();
DocAccessible* document = GetAccService()->GetDocAccessible(DOMDoc);
if (document) {
// Clear selection listener for previously focused element.
......@@ -376,7 +376,7 @@ nsINode* FocusManager::FocusedDOMNode() const {
return focusedWnd ? focusedWnd->GetExtantDoc() : nullptr;
}
nsIDocument* FocusManager::FocusedDOMDocument() const {
dom::Document* FocusManager::FocusedDOMDocument() const {
nsINode* focusedNode = FocusedDOMNode();
return focusedNode ? focusedNode->OwnerDoc() : nullptr;
}
......
......@@ -8,10 +8,13 @@
#include "mozilla/RefPtr.h"
class nsINode;
class nsIDocument;
class nsISupports;
namespace mozilla {
namespace dom {
class Document;
}
namespace a11y {
class AccEvent;
......@@ -117,7 +120,7 @@ class FocusManager {
/**
* Return DOM document having DOM focus.
*/
nsIDocument* FocusedDOMDocument() const;
dom::Document* FocusedDOMDocument() const;
private:
RefPtr<Accessible> mActiveItem;
......
......@@ -82,11 +82,11 @@ static void EnableLogging(const char* aModulesStr) {
}
}
static void LogDocURI(nsIDocument* aDocumentNode) {
static void LogDocURI(dom::Document* aDocumentNode) {
printf("uri: %s", aDocumentNode->GetDocumentURI()->GetSpecOrDefault().get());
}
static void LogDocShellState(nsIDocument* aDocumentNode) {
static void LogDocShellState(dom::Document* aDocumentNode) {
printf("docshell busy: ");
nsAutoCString docShellBusy;
......@@ -107,7 +107,7 @@ static void LogDocShellState(nsIDocument* aDocumentNode) {
}
}
static void LogDocType(nsIDocument* aDocumentNode) {
static void LogDocType(dom::Document* aDocumentNode) {
if (aDocumentNode->IsActive()) {
bool isContent = nsCoreUtils::IsContentDocument(aDocumentNode);
printf("%s document", (isContent ? "content" : "chrome"));
......@@ -116,7 +116,7 @@ static void LogDocType(nsIDocument* aDocumentNode) {
}
}
static void LogDocShellTree(nsIDocument* aDocumentNode) {
static void LogDocShellTree(dom::Document* aDocumentNode) {
if (aDocumentNode->IsActive()) {
nsCOMPtr<nsIDocShellTreeItem> treeItem(aDocumentNode->GetDocShell());
nsCOMPtr<nsIDocShellTreeItem> parentTreeItem;
......@@ -129,20 +129,20 @@ static void LogDocShellTree(nsIDocument* aDocumentNode) {
}
}
static void LogDocState(nsIDocument* aDocumentNode) {
static void LogDocState(dom::Document* aDocumentNode) {
const char* docState = nullptr;
nsIDocument::ReadyState docStateFlag = aDocumentNode->GetReadyStateEnum();
dom::Document::ReadyState docStateFlag = aDocumentNode->GetReadyStateEnum();
switch (docStateFlag) {
case nsIDocument::READYSTATE_UNINITIALIZED:
case dom::Document::READYSTATE_UNINITIALIZED:
docState = "uninitialized";
break;
case nsIDocument::READYSTATE_LOADING:
case dom::Document::READYSTATE_LOADING:
docState = "loading";
break;
case nsIDocument::READYSTATE_INTERACTIVE:
case dom::Document::READYSTATE_INTERACTIVE:
docState = "interactive";
break;
case nsIDocument::READYSTATE_COMPLETE:
case dom::Document::READYSTATE_COMPLETE:
docState = "complete";
break;
}
......@@ -163,7 +163,7 @@ static void LogDocState(nsIDocument* aDocumentNode) {
printf(", has %srole content", rootEl ? "" : "no ");
}
static void LogPresShell(nsIDocument* aDocumentNode) {
static void LogPresShell(dom::Document* aDocumentNode) {
nsIPresShell* ps = aDocumentNode->GetShell();
printf("presshell: %p", static_cast<void*>(ps));
......@@ -175,13 +175,13 @@ static void LogPresShell(nsIDocument* aDocumentNode) {
printf(", root scroll frame: %p", static_cast<void*>(sf));
}
static void LogDocLoadGroup(nsIDocument* aDocumentNode) {
static void LogDocLoadGroup(dom::Document* aDocumentNode) {
nsCOMPtr<nsILoadGroup> loadGroup = aDocumentNode->GetDocumentLoadGroup();
printf("load group: %p", static_cast<void*>(loadGroup));
}
static void LogDocParent(nsIDocument* aDocumentNode) {
nsIDocument* parentDoc = aDocumentNode->GetParentDocument();
static void LogDocParent(dom::Document* aDocumentNode) {
dom::Document* parentDoc = aDocumentNode->GetParentDocument();
printf("parent DOM document: %p", static_cast<void*>(parentDoc));
if (parentDoc) {
printf(", parent acc document: %p",
......@@ -192,7 +192,7 @@ static void LogDocParent(nsIDocument* aDocumentNode) {
}
}
static void LogDocInfo(nsIDocument* aDocumentNode, DocAccessible* aDocument) {
static void LogDocInfo(dom::Document* aDocumentNode, DocAccessible* aDocument) {
printf(" DOM document: %p, acc document: %p\n ",
static_cast<void*>(aDocumentNode), static_cast<void*>(aDocument));
......@@ -370,7 +370,7 @@ void logging::DocLoad(const char* aMsg, nsIWebProgress* aWebProgress,
return;
}
nsCOMPtr<nsIDocument> documentNode = window->GetDoc();
nsCOMPtr<dom::Document> documentNode = window->GetDoc();
if (!documentNode) {
MsgEnd();
return;
......@@ -394,7 +394,7 @@ void logging::DocLoad(const char* aMsg, nsIWebProgress* aWebProgress,
MsgEnd();
}
void logging::DocLoad(const char* aMsg, nsIDocument* aDocumentNode) {
void logging::DocLoad(const char* aMsg, dom::Document* aDocumentNode) {
MsgBegin(sDocLoadTitle, "%s", aMsg);
DocAccessible* document = GetExistingDocAccessible(aDocumentNode);
......@@ -444,7 +444,7 @@ void logging::DocLoadEventHandled(AccEvent* aEvent) {
MsgEnd();
}
void logging::DocCreate(const char* aMsg, nsIDocument* aDocumentNode,
void logging::DocCreate(const char* aMsg, dom::Document* aDocumentNode,
DocAccessible* aDocument) {
DocAccessible* document =
aDocument ? aDocument : GetExistingDocAccessible(aDocumentNode);
......@@ -454,7 +454,7 @@ void logging::DocCreate(const char* aMsg, nsIDocument* aDocumentNode,
MsgEnd();
}
void logging::DocDestroy(const char* aMsg, nsIDocument* aDocumentNode,
void logging::DocDestroy(const char* aMsg, dom::Document* aDocumentNode,
DocAccessible* aDocument) {
DocAccessible* document =
aDocument ? aDocument : GetExistingDocAccessible(aDocumentNode);
......@@ -713,7 +713,7 @@ void logging::Address(const char* aDescr, Accessible* aAcc) {
}
DocAccessible* doc = aAcc->Document();
nsIDocument* docNode = doc->DocumentNode();
dom::Document* docNode = doc->DocumentNode();
printf(" document: %p, node: %p\n", static_cast<void*>(doc),
static_cast<void*>(docNode));
......
......@@ -11,7 +11,6 @@
#include "nsStringFwd.h"
#include "mozilla/Attributes.h"
class nsIDocument;
class nsINode;
class nsIRequest;
class nsISupports;
......@@ -20,6 +19,7 @@ class nsIWebProgress;
namespace mozilla {
namespace dom {
class Document;
class Selection;
} // namespace dom
......@@ -74,7 +74,7 @@ bool IsEnabled(const nsAString& aModules);
*/
void DocLoad(const char* aMsg, nsIWebProgress* aWebProgress,
nsIRequest* aRequest, uint32_t aStateFlags);
void DocLoad(const char* aMsg, nsIDocument* aDocumentNode);
void DocLoad(const char* aMsg, dom::Document* aDocumentNode);
void DocCompleteLoad(DocAccessible* aDocument, bool aIsLoadEventTarget);
/**
......@@ -90,13 +90,13 @@ void DocLoadEventHandled(AccEvent* aEvent);
/**
* Log the document was created.
*/
void DocCreate(const char* aMsg, nsIDocument* aDocumentNode,
void DocCreate(const char* aMsg, dom::Document* aDocumentNode,
DocAccessible* aDocument = nullptr);
/**
* Log the document was destroyed.
*/
void DocDestroy(const char* aMsg, nsIDocument* aDocumentNode,
void DocDestroy(const char* aMsg, dom::Document* aDocumentNode,
DocAccessible* aDocument = nullptr);
/**
......
......@@ -15,7 +15,7 @@
#include "nsFrameSelection.h"
#include "nsIAccessibleTypes.h"
#include "nsIDocument.h"
#include "mozilla/dom/Document.h"
#include "nsIPresShell.h"
#include "mozilla/dom/Selection.h"
#include "mozilla/dom/Element.h"
......@@ -138,7 +138,7 @@ void SelectionManager::ProcessTextSelChangeEvent(AccEvent* aEvent) {
}
NS_IMETHODIMP
SelectionManager::NotifySelectionChanged(nsIDocument* aDocument,
SelectionManager::NotifySelectionChanged(dom::Document* aDocument,
Selection* aSelection,
int16_t aReason) {
if (NS_WARN_IF(!aDocument) || NS_WARN_IF(!aSelection)) {
......
......@@ -449,7 +449,7 @@ bool nsAccUtils::IsARIALive(const Accessible* aAccessible) {
nsAutoString live;
nsIContent* startContent = aAccessible->GetContent();
while (startContent) {
nsIDocument* doc = startContent->GetComposedDoc();
dom::Document* doc = startContent->GetComposedDoc();
if (!doc) {
break;
}
......@@ -495,7 +495,7 @@ bool nsAccUtils::IsARIALive(const Accessible* aAccessible) {
break;
}
nsIDocument* parentDoc = doc->GetParentDocument();
dom::Document* parentDoc = doc->GetParentDocument();
if (!parentDoc) {
break;
}
......
......@@ -282,7 +282,7 @@ nsAccessibilityService::ListenersChanged(nsIArray* aEventChanges) {
NS_ENSURE_SUCCESS(rv, rv);
for (uint32_t i = 0; i < changeCount; i++) {
nsIDocument* ownerDoc = node->OwnerDoc();
Document* ownerDoc = node->OwnerDoc();
DocAccessible* document = GetExistingDocAccessible(ownerDoc);
// Create an accessible for a inaccessible element having click event
......@@ -318,7 +318,7 @@ nsAccessibilityService::Observe(nsISupports* aSubject, const char* aTopic,
}
void nsAccessibilityService::NotifyOfAnchorJumpTo(nsIContent* aTargetNode) {
nsIDocument* documentNode = aTargetNode->GetUncomposedDoc();
Document* documentNode = aTargetNode->GetUncomposedDoc();
if (documentNode) {
DocAccessible* document = GetDocAccessible(documentNode);
if (document) document->SetAnchorJump(aTargetNode);
......@@ -333,7 +333,7 @@ void nsAccessibilityService::FireAccessibleEvent(uint32_t aEvent,
Accessible* nsAccessibilityService::GetRootDocumentAccessible(
nsIPresShell* aPresShell, bool aCanCreate) {
nsIPresShell* ps = aPresShell;
nsIDocument* documentNode = aPresShell->GetDocument();
Document* documentNode = aPresShell->GetDocument();
if (documentNode) {
nsCOMPtr<nsIDocShellTreeItem> treeItem(documentNode->GetDocShell());
if (treeItem) {
......
......@@ -9,7 +9,7 @@
#include "nsIBaseWindow.h"
#include "nsIDocShellTreeOwner.h"
#include "nsIDocument.h"
#include "mozilla/dom/Document.h"
#include "nsRange.h"
#include "nsIBoxObject.h"
#include "nsXULElement.h"
......@@ -70,7 +70,7 @@ void nsCoreUtils::DispatchClickEvent(nsITreeBoxObject *aTreeBoxObj,
aTreeBoxObj->GetTreeBody(getter_AddRefs(tcElm));
if (!tcElm) return;
nsIDocument *document = tcElm->GetUncomposedDoc();
Document *document = tcElm->GetUncomposedDoc();
if (!document) return;
nsCOMPtr<nsIPresShell> presShell = document->GetShell();
......@@ -340,7 +340,7 @@ already_AddRefed<nsIDocShell> nsCoreUtils::GetDocShellFor(nsINode *aNode) {
return docShell.forget();
}
bool nsCoreUtils::IsRootDocument(nsIDocument *aDocument) {
bool nsCoreUtils::IsRootDocument(Document *aDocument) {
nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem = aDocument->GetDocShell();
NS_ASSERTION(docShellTreeItem, "No document shell for document!");
......@@ -350,14 +350,14 @@ bool nsCoreUtils::IsRootDocument(nsIDocument *aDocument) {
return !parentTreeItem;
}
bool nsCoreUtils::IsContentDocument(nsIDocument *aDocument) {
bool nsCoreUtils::IsContentDocument(Document *aDocument) {
nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem = aDocument->GetDocShell();
NS_ASSERTION(docShellTreeItem, "No document shell tree item for document!");
return (docShellTreeItem->ItemType() == nsIDocShellTreeItem::typeContent);
}
bool nsCoreUtils::IsTabDocument(nsIDocument *aDocumentNode) {
bool nsCoreUtils::IsTabDocument(Document *aDocumentNode) {
nsCOMPtr<nsIDocShellTreeItem> treeItem(aDocumentNode->GetDocShell());
nsCOMPtr<nsIDocShellTreeItem> parentTreeItem;
......@@ -373,7 +373,7 @@ bool nsCoreUtils::IsTabDocument(nsIDocument *aDocumentNode) {
return parentTreeItem == rootTreeItem;
}
bool nsCoreUtils::IsErrorPage(nsIDocument *aDocument) {
bool nsCoreUtils::IsErrorPage(Document *aDocument) {
nsIURI *uri = aDocument->GetDocumentURI();
bool isAboutScheme = false;
uri->SchemeIs("about", &isAboutScheme);
......
......@@ -10,7 +10,7 @@
#include "mozilla/dom/Element.h"
#include "nsIAccessibleEvent.h"
#include "nsIContent.h"
#include "nsIDocument.h" // for GetShell()
#include "mozilla/dom/Document.h" // for GetShell()
#include "nsIPresShell.h"
#include "nsPoint.h"
......@@ -29,6 +29,8 @@ class nsIWidget;
*/
class nsCoreUtils {
public:
typedef mozilla::dom::Document Document;
/**
* Return true if the given node is a label of a control.
*/
......@@ -185,22 +187,22 @@ class nsCoreUtils {
/**
* Return true if the given document is root document.
*/
static bool IsRootDocument(nsIDocument *aDocument);
static bool IsRootDocument(Document *aDocument);
/**
* Return true if the given document is content document (not chrome).
*/
static bool IsContentDocument(nsIDocument *aDocument);
static bool IsContentDocument(Document *aDocument);
/**
* Return true if the given document node is for tab document accessible.
*/
static bool IsTabDocument(nsIDocument *aDocumentNode);
static bool IsTabDocument(Document *aDocumentNode);
/**
* Return true if the given document is an error page.
*/
static bool IsErrorPage(nsIDocument *aDocument);
static bool IsErrorPage(Document *aDocument);
/**
* Return presShell for the document containing the given DOM node.
......
......@@ -37,7 +37,7 @@
#include "nsINodeList.h"
#include "nsPIDOMWindow.h"
#include "nsIDocument.h"
#include "mozilla/dom/Document.h"
#include "nsIContent.h"
#include "nsIForm.h"
#include "nsIFormControl.h"
......@@ -265,7 +265,7 @@ KeyBinding Accessible::AccessKey() const {
}
// Determine the access modifier used in this context.
nsIDocument* document = mContent->GetUncomposedDoc();
dom::Document* document = mContent->GetUncomposedDoc();
if (!document) return KeyBinding();
nsCOMPtr<nsIDocShellTreeItem> treeItem(document->GetDocShell());
......@@ -1025,7 +1025,7 @@ already_AddRefed<nsIPersistentProperties> Accessible::NativeAttributes() {
// override properties on a widget they used in an iframe.
nsIContent* startContent = mContent;
while (startContent) {
nsIDocument* doc = startContent->GetComposedDoc();
dom::Document* doc = startContent->GetComposedDoc();
if (!doc) break;
nsAccUtils::SetLiveContainerAttributes(attributes, startContent,
......@@ -1039,7 +1039,7 @@ already_AddRefed<nsIPersistentProperties> Accessible::NativeAttributes() {
docShellTreeItem->GetSameTypeParent(getter_AddRefs(sameTypeParent));
if (!sameTypeParent || sameTypeParent == docShellTreeItem) break;
nsIDocument* parentDoc = doc->GetParentDocument();
dom::Document* parentDoc = doc->GetParentDocument();
if (!parentDoc) break;
startContent = parentDoc->FindContentForSubDocument(doc);
......@@ -1687,7 +1687,7 @@ Relation Accessible::RelationByType(RelationType aType) const {
}
} else {
// In XUL, use first <button default="true" .../> in the document
nsIDocument* doc = mContent->OwnerDoc();
dom::Document* doc = mContent->OwnerDoc();
nsIContent* buttonEl = nullptr;
if (doc->IsXULDocument()) {