Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug
authorEmilio Cobos Álvarez <emilio@crisal.io>
Wed, 02 Jan 2019 14:05:23 +0100
changeset 452430 f0a91d36587266d7454a450c6044d573664fbed5
parent 452429 f87383555d10739ed96ff1a11acc5ed375965215
child 452431 120fccb288c0839bde15c42987c247c39e0b6b50
push id110886
push useremilio@crisal.io
push dateThu, 03 Jan 2019 16:49:55 +0000
treeherdermozilla-inbound@f0a91d365872 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1517241
milestone66.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 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.
accessible/android/DocAccessibleWrap.cpp
accessible/android/DocAccessibleWrap.h
accessible/android/RootAccessibleWrap.cpp
accessible/android/RootAccessibleWrap.h
accessible/atk/DocAccessibleWrap.cpp
accessible/atk/DocAccessibleWrap.h
accessible/base/DocManager.cpp
accessible/base/DocManager.h
accessible/base/FocusManager.cpp
accessible/base/FocusManager.h
accessible/base/Logging.cpp
accessible/base/Logging.h
accessible/base/SelectionManager.cpp
accessible/base/nsAccUtils.cpp
accessible/base/nsAccessibilityService.cpp
accessible/base/nsCoreUtils.cpp
accessible/base/nsCoreUtils.h
accessible/generic/Accessible.cpp
accessible/generic/ApplicationAccessible.cpp
accessible/generic/DocAccessible-inl.h
accessible/generic/DocAccessible.cpp
accessible/generic/DocAccessible.h
accessible/generic/HyperTextAccessible.cpp
accessible/generic/ImageAccessible.cpp
accessible/generic/OuterDocAccessible.cpp
accessible/generic/RootAccessible.cpp
accessible/generic/RootAccessible.h
accessible/html/HTMLTableAccessible.cpp
accessible/mac/DocAccessibleWrap.h
accessible/mac/DocAccessibleWrap.mm
accessible/mac/RootAccessibleWrap.h
accessible/mac/RootAccessibleWrap.mm
accessible/windows/msaa/AccessibleWrap.cpp
accessible/windows/msaa/DocAccessibleWrap.cpp
accessible/windows/msaa/DocAccessibleWrap.h
accessible/windows/msaa/RootAccessibleWrap.cpp
accessible/windows/msaa/RootAccessibleWrap.h
accessible/windows/msaa/nsWinUtils.cpp
accessible/xpcom/xpcAccessibilityService.cpp
accessible/xpcom/xpcAccessibleDocument.cpp
accessible/xpcom/xpcAccessibleDocument.h
accessible/xul/XULElementAccessibles.cpp
accessible/xul/XULTabAccessible.cpp
browser/components/shell/nsMacShellService.cpp
caps/BasePrincipal.cpp
caps/BasePrincipal.h
caps/SystemPrincipal.cpp
caps/SystemPrincipal.h
caps/nsScriptSecurityManager.cpp
chrome/nsChromeRegistry.cpp
devtools/client/shared/widgets/Chart.js
devtools/docs/getting-started/README.md
docshell/base/nsDSURIContentListener.cpp
docshell/base/nsDocShell.cpp
docshell/base/nsDocShell.h
docshell/base/nsDocShellEditorData.cpp
docshell/base/nsDocShellTreeOwner.cpp
docshell/base/nsIDocShellTreeItem.idl
docshell/base/nsIDocumentLoaderFactory.idl
docshell/base/nsPingListener.cpp
docshell/shistory/nsSHEntryShared.cpp
docshell/shistory/nsSHEntryShared.h
dom/animation/Animation.cpp
dom/animation/Animation.h
dom/animation/AnimationEffect.cpp
dom/animation/AnimationEffect.h
dom/animation/AnimationTimeline.h
dom/animation/AnimationUtils.cpp
dom/animation/AnimationUtils.h
dom/animation/CSSPseudoElement.cpp
dom/animation/DocumentTimeline.cpp
dom/animation/DocumentTimeline.h
dom/animation/KeyframeEffect.cpp
dom/animation/KeyframeEffect.h
dom/animation/KeyframeUtils.cpp
dom/animation/KeyframeUtils.h
dom/animation/PendingAnimationTracker.h
dom/animation/TimingParams.cpp
dom/animation/TimingParams.h
dom/audiochannel/AudioChannelAgent.cpp
dom/audiochannel/AudioChannelService.cpp
dom/base/AnonymousContent.cpp
dom/base/AnonymousContent.h
dom/base/Attr.cpp
dom/base/Attr.h
dom/base/AttrArray.cpp
dom/base/AttrArray.h
dom/base/CharacterData.cpp
dom/base/CharacterData.h
dom/base/ChildIterator.cpp
dom/base/ChromeNodeList.cpp
dom/base/CustomElementRegistry.cpp
dom/base/CustomElementRegistry.h
dom/base/DOMError.cpp
dom/base/DOMException.cpp
dom/base/DOMImplementation.cpp
dom/base/DOMImplementation.h
dom/base/DOMIntersectionObserver.cpp
dom/base/DOMIntersectionObserver.h
dom/base/DOMParser.cpp
dom/base/DOMParser.h
dom/base/DirectionalityUtils.cpp
dom/base/DispatcherTrait.h
dom/base/DocGroup.cpp
dom/base/DocGroup.h
dom/base/Document.cpp
dom/base/Document.h
dom/base/DocumentFragment.cpp
dom/base/DocumentFragment.h
dom/base/DocumentInlines.h
dom/base/DocumentOrShadowRoot.cpp
dom/base/DocumentOrShadowRoot.h
dom/base/Element.cpp
dom/base/Element.h
dom/base/ElementInlines.h
dom/base/EventSource.cpp
dom/base/FlushType.h
dom/base/FragmentOrElement.cpp
dom/base/FragmentOrElement.h
dom/base/FullscreenChange.h
dom/base/GeneratedImageContent.cpp
dom/base/GeneratedImageContent.h
dom/base/IDTracker.cpp
dom/base/IDTracker.h
dom/base/InProcessTabChildMessageManager.cpp
dom/base/Link.cpp
dom/base/Link.h
dom/base/Location.cpp
dom/base/Navigator.cpp
dom/base/NodeInfo.cpp
dom/base/NodeInfo.h
dom/base/NodeIterator.cpp
dom/base/NodeUbiReporting.cpp
dom/base/NodeUbiReporting.h
dom/base/PopupBlocker.h
dom/base/PostMessageEvent.cpp
dom/base/PostMessageEvent.h
dom/base/ResponsiveImageSelector.cpp
dom/base/ResponsiveImageSelector.h
dom/base/ScreenOrientation.cpp
dom/base/ScreenOrientation.h
dom/base/Selection.cpp
dom/base/Selection.h
dom/base/SelectionChangeEventDispatcher.cpp
dom/base/SelectionChangeEventDispatcher.h
dom/base/ShadowRoot.cpp
dom/base/TabGroup.cpp
dom/base/TabGroup.h
dom/base/Text.cpp
dom/base/TimeoutManager.cpp
dom/base/VisualViewport.cpp
dom/base/moz.build
dom/base/mozAutoDocUpdate.h
dom/base/nsAttrValue.cpp
dom/base/nsAttrValue.h
dom/base/nsCCUncollectableMarker.cpp
dom/base/nsContentAreaDragDrop.cpp
dom/base/nsContentCreatorFunctions.h
dom/base/nsContentList.cpp
dom/base/nsContentList.h
dom/base/nsContentPermissionHelper.cpp
dom/base/nsContentPolicy.cpp
dom/base/nsContentPolicyUtils.h
dom/base/nsContentSink.cpp
dom/base/nsContentSink.h
dom/base/nsContentUtils.cpp
dom/base/nsContentUtils.h
dom/base/nsCopySupport.cpp
dom/base/nsCopySupport.h
dom/base/nsDOMAttributeMap.cpp
dom/base/nsDOMAttributeMap.h
dom/base/nsDOMMutationObserver.h
dom/base/nsDOMSerializer.cpp
dom/base/nsDOMWindowList.cpp
dom/base/nsDOMWindowUtils.cpp
dom/base/nsDOMWindowUtils.h
dom/base/nsDataDocumentContentPolicy.cpp
dom/base/nsDeprecatedOperationList.h
dom/base/nsDocElementCreatedNotificationRunner.h
dom/base/nsDocument.cpp
dom/base/nsDocumentEncoder.cpp
dom/base/nsDocumentWarningList.h
dom/base/nsFocusManager.cpp
dom/base/nsFocusManager.h
dom/base/nsFrameLoader.cpp
dom/base/nsFrameLoader.h
dom/base/nsGlobalWindowCommands.cpp
dom/base/nsGlobalWindowInner.cpp
dom/base/nsGlobalWindowInner.h
dom/base/nsGlobalWindowOuter.cpp
dom/base/nsGlobalWindowOuter.h
dom/base/nsHTMLContentSerializer.cpp
dom/base/nsHTMLContentSerializer.h
dom/base/nsHistory.cpp
dom/base/nsIContent.h
dom/base/nsIContentInlines.h
dom/base/nsIContentSerializer.h
dom/base/nsIDocument.h
dom/base/nsIDocumentEncoder.idl
dom/base/nsIDocumentInlines.h
dom/base/nsIDocumentObserver.h
dom/base/nsIImageLoadingContent.idl
dom/base/nsIMutationObserver.h
dom/base/nsINode.cpp
dom/base/nsINode.h
dom/base/nsIStyleSheetLinkingElement.h
dom/base/nsIdentifierMapEntry.h
dom/base/nsImageLoadingContent.cpp
dom/base/nsImageLoadingContent.h
dom/base/nsJSEnvironment.cpp
dom/base/nsJSTimeoutHandler.cpp
dom/base/nsMappedAttributeElement.cpp
dom/base/nsMappedAttributeElement.h
dom/base/nsMappedAttributes.cpp
dom/base/nsMappedAttributes.h
dom/base/nsNameSpaceManager.cpp
dom/base/nsNameSpaceManager.h
dom/base/nsNodeInfoManager.cpp
dom/base/nsNodeInfoManager.h
dom/base/nsNodeUtils.cpp
dom/base/nsObjectLoadingContent.cpp
dom/base/nsObjectLoadingContent.h
dom/base/nsPIDOMWindow.h
dom/base/nsPlainTextSerializer.cpp
dom/base/nsPlainTextSerializer.h
dom/base/nsPluginArray.cpp
dom/base/nsRange.cpp
dom/base/nsRange.h
dom/base/nsScreen.cpp
dom/base/nsStyleLinkElement.cpp
dom/base/nsStyleLinkElement.h
dom/base/nsStyledElement.cpp
dom/base/nsStyledElement.h
dom/base/nsSyncLoadService.cpp
dom/base/nsSyncLoadService.h
dom/base/nsTextNode.cpp
dom/base/nsTextNode.h
dom/base/nsTreeSanitizer.cpp
dom/base/nsTreeSanitizer.h
dom/base/nsViewportInfo.h
dom/base/nsWindowMemoryReporter.cpp
dom/base/nsXHTMLContentSerializer.cpp
dom/base/nsXHTMLContentSerializer.h
dom/base/nsXMLContentSerializer.cpp
dom/base/nsXMLContentSerializer.h
dom/battery/BatteryManager.cpp
dom/bindings/BindingUtils.cpp
dom/bindings/BindingUtils.h
dom/bindings/Bindings.conf
dom/bindings/Codegen.py
dom/bindings/test/TestFunctions.cpp
dom/broadcastchannel/BroadcastChannel.cpp
dom/cache/CacheStorage.cpp
dom/canvas/CanvasRenderingContext2D.cpp
dom/canvas/CanvasUtils.cpp
dom/canvas/CanvasUtils.h
dom/canvas/ImageBitmap.cpp
dom/canvas/WebGLContext.cpp
dom/canvas/WebGLContext.h
dom/chrome-webidl/ChannelWrapper.webidl
dom/clients/manager/ClientNavigateOpChild.cpp
dom/clients/manager/ClientOpenWindowUtils.cpp
dom/clients/manager/ClientSource.cpp
dom/console/Console.cpp
dom/console/ConsoleReportCollector.cpp
dom/console/ConsoleReportCollector.h
dom/console/nsIConsoleReportCollector.h
dom/credentialmanagement/CredentialsContainer.cpp
dom/events/AsyncEventDispatcher.cpp
dom/events/AsyncEventDispatcher.h
dom/events/Clipboard.cpp
dom/events/ContentEventHandler.h
dom/events/DOMEventTargetHelper.cpp
dom/events/DOMEventTargetHelper.h
dom/events/DataTransfer.cpp
dom/events/Event.cpp
dom/events/Event.h
dom/events/EventDispatcher.cpp
dom/events/EventListenerManager.cpp
dom/events/EventListenerManager.h
dom/events/EventStateManager.cpp
dom/events/EventStateManager.h
dom/events/IMEContentObserver.cpp
dom/events/IMEContentObserver.h
dom/events/IMEStateManager.cpp
dom/events/KeyboardEvent.cpp
dom/events/PendingFullscreenEvent.h
dom/events/PointerEvent.cpp
dom/events/PointerEventHandler.cpp
dom/events/WheelHandlingHelper.cpp
dom/fetch/BodyExtractor.cpp
dom/fetch/BodyExtractor.h
dom/fetch/ChannelInfo.cpp
dom/fetch/ChannelInfo.h
dom/fetch/Fetch.cpp
dom/fetch/FetchDriver.cpp
dom/fetch/FetchDriver.h
dom/fetch/FetchUtil.cpp
dom/fetch/FetchUtil.h
dom/fetch/InternalRequest.cpp
dom/fetch/Request.cpp
dom/fetch/Response.cpp
dom/geolocation/nsGeolocation.cpp
dom/html/HTMLAllCollection.cpp
dom/html/HTMLAnchorElement.cpp
dom/html/HTMLAnchorElement.h
dom/html/HTMLAreaElement.cpp
dom/html/HTMLAreaElement.h
dom/html/HTMLAudioElement.cpp
dom/html/HTMLBodyElement.cpp
dom/html/HTMLBodyElement.h
dom/html/HTMLButtonElement.cpp
dom/html/HTMLButtonElement.h
dom/html/HTMLCanvasElement.cpp
dom/html/HTMLEmbedElement.cpp
dom/html/HTMLEmbedElement.h
dom/html/HTMLFormControlsCollection.cpp
dom/html/HTMLFormElement.cpp
dom/html/HTMLFormElement.h
dom/html/HTMLFormSubmission.cpp
dom/html/HTMLIFrameElement.cpp
dom/html/HTMLIFrameElement.h
dom/html/HTMLImageElement.cpp
dom/html/HTMLImageElement.h
dom/html/HTMLInputElement.cpp
dom/html/HTMLInputElement.h
dom/html/HTMLLabelElement.cpp
dom/html/HTMLLegendElement.cpp
dom/html/HTMLLegendElement.h
dom/html/HTMLLinkElement.cpp
dom/html/HTMLLinkElement.h
dom/html/HTMLMarqueeElement.cpp
dom/html/HTMLMarqueeElement.h
dom/html/HTMLMediaElement.cpp
dom/html/HTMLMediaElement.h
dom/html/HTMLMenuElement.cpp
dom/html/HTMLMenuItemElement.cpp
dom/html/HTMLMenuItemElement.h
dom/html/HTMLMetaElement.cpp
dom/html/HTMLMetaElement.h
dom/html/HTMLObjectElement.cpp
dom/html/HTMLObjectElement.h
dom/html/HTMLOptionElement.cpp
dom/html/HTMLOptionElement.h
dom/html/HTMLOptionsCollection.cpp
dom/html/HTMLOutputElement.cpp
dom/html/HTMLOutputElement.h
dom/html/HTMLScriptElement.cpp
dom/html/HTMLScriptElement.h
dom/html/HTMLSelectElement.cpp
dom/html/HTMLSelectElement.h
dom/html/HTMLSharedElement.cpp
dom/html/HTMLSharedElement.h
dom/html/HTMLSlotElement.cpp
dom/html/HTMLSlotElement.h
dom/html/HTMLSourceElement.cpp
dom/html/HTMLSourceElement.h
dom/html/HTMLStyleElement.cpp
dom/html/HTMLStyleElement.h
dom/html/HTMLTableElement.cpp
dom/html/HTMLTableElement.h
dom/html/HTMLTemplateElement.cpp
dom/html/HTMLTextAreaElement.cpp
dom/html/HTMLTextAreaElement.h
dom/html/HTMLTitleElement.cpp
dom/html/HTMLTitleElement.h
dom/html/HTMLTrackElement.cpp
dom/html/HTMLTrackElement.h
dom/html/HTMLUnknownElement.cpp
dom/html/ImageDocument.cpp
dom/html/MediaDocument.cpp
dom/html/MediaError.cpp
dom/html/PluginDocument.cpp
dom/html/VideoDocument.cpp
dom/html/input/SingleLineTextInputTypes.cpp
dom/html/nsGenericHTMLElement.cpp
dom/html/nsGenericHTMLElement.h
dom/html/nsGenericHTMLFrameElement.cpp
dom/html/nsGenericHTMLFrameElement.h
dom/html/nsHTMLContentSink.cpp
dom/html/nsHTMLDNSPrefetch.cpp
dom/html/nsHTMLDNSPrefetch.h
dom/html/nsHTMLDocument.cpp
dom/html/nsHTMLDocument.h
dom/html/nsIHTMLDocument.h
dom/html/nsTextEditorState.cpp
dom/indexedDB/ActorsChild.cpp
dom/indexedDB/IDBDatabase.cpp
dom/indexedDB/IDBDatabase.h
dom/indexedDB/IDBFactory.cpp
dom/interfaces/base/nsIDOMWindowUtils.idl
dom/interfaces/base/nsIFocusManager.idl
dom/interfaces/base/nsIServiceWorkerManager.idl
dom/interfaces/base/nsIStructuredCloneContainer.idl
dom/ipc/ColorPickerParent.cpp
dom/ipc/ContentChild.cpp
dom/ipc/ContentParent.cpp
dom/ipc/FilePickerParent.cpp
dom/ipc/TabChild.cpp
dom/ipc/TabChild.h
dom/ipc/TabParent.cpp
dom/jsurl/nsJSProtocolHandler.cpp
dom/localstorage/LSObject.cpp
dom/mathml/nsMathMLElement.cpp
dom/mathml/nsMathMLElement.h
dom/media/AutoplayPolicy.cpp
dom/media/AutoplayPolicy.h
dom/media/BackgroundVideoDecodingPermissionObserver.cpp
dom/media/BackgroundVideoDecodingPermissionObserver.h
dom/media/DOMMediaStream.cpp
dom/media/MediaDecoder.cpp
dom/media/MediaDecoderOwner.h
dom/media/MediaManager.cpp
dom/media/MediaRecorder.cpp
dom/media/MediaRecorder.h
dom/media/TextTrackCue.h
dom/media/doctor/DDLoggedTypeTraits.h
dom/media/doctor/DecoderDoctorDiagnostics.cpp
dom/media/doctor/DecoderDoctorDiagnostics.h
dom/media/eme/MediaKeySystemAccessManager.cpp
dom/media/gmp/GMPService.cpp
dom/media/gmp/GMPService.h
dom/media/imagecapture/ImageCapture.cpp
dom/media/mediacapabilities/MediaCapabilities.cpp
dom/media/webaudio/AudioContext.cpp
dom/media/webaudio/MediaBufferDecoder.cpp
dom/media/webaudio/MediaStreamAudioDestinationNode.cpp
dom/media/webaudio/MediaStreamAudioSourceNode.cpp
dom/media/webspeech/recognition/SpeechRecognition.cpp
dom/media/webspeech/synth/SpeechSynthesis.cpp
dom/media/webspeech/synth/nsSynthVoiceRegistry.cpp
dom/messagechannel/MessageChannel.cpp
dom/messagechannel/MessagePort.cpp
dom/midi/MIDIAccess.cpp
dom/midi/MIDIAccessManager.cpp
dom/midi/MIDIInput.cpp
dom/midi/MIDIOutput.cpp
dom/network/UDPSocket.cpp
dom/notification/Notification.cpp
dom/payments/PaymentRequest.cpp
dom/performance/PerformanceObserver.cpp
dom/performance/PerformanceTiming.cpp
dom/permission/PermissionStatus.cpp
dom/permission/Permissions.cpp
dom/plugins/base/nsIPluginInstanceOwner.idl
dom/plugins/base/nsJSNPRuntime.cpp
dom/plugins/base/nsNPAPIPlugin.cpp
dom/plugins/base/nsNPAPIPluginInstance.cpp
dom/plugins/base/nsPluginHost.cpp
dom/plugins/base/nsPluginInstanceOwner.cpp
dom/plugins/base/nsPluginStreamListenerPeer.cpp
dom/plugins/ipc/PluginModuleParent.cpp
dom/power/WakeLock.cpp
dom/presentation/Presentation.cpp
dom/presentation/PresentationConnection.cpp
dom/presentation/PresentationRequest.cpp
dom/presentation/PresentationRequest.h
dom/quota/StorageManager.cpp
dom/script/ScriptElement.cpp
dom/script/ScriptLoader.cpp
dom/script/ScriptLoader.h
dom/script/ScriptSettings.cpp
dom/script/ScriptSettings.h
dom/script/nsIScriptElement.h
dom/security/CSPEvalChecker.cpp
dom/security/FramingChecker.cpp
dom/security/featurepolicy/FeaturePolicy.cpp
dom/security/featurepolicy/FeaturePolicy.h
dom/security/featurepolicy/FeaturePolicyParser.cpp
dom/security/featurepolicy/FeaturePolicyParser.h
dom/security/featurepolicy/FeaturePolicyUtils.cpp
dom/security/featurepolicy/FeaturePolicyUtils.h
dom/security/nsCSPContext.cpp
dom/security/nsCSPParser.cpp
dom/security/nsContentSecurityManager.cpp
dom/security/nsContentSecurityManager.h
dom/security/nsMixedContentBlocker.cpp
dom/serviceworkers/ServiceWorker.cpp
dom/serviceworkers/ServiceWorkerContainer.cpp
dom/serviceworkers/ServiceWorkerContainer.h
dom/serviceworkers/ServiceWorkerRegistrationImpl.cpp
dom/serviceworkers/ServiceWorkerRegistrationImpl.h
dom/smil/SMILAnimationController.cpp
dom/smil/SMILAnimationController.h
dom/smil/SMILCSSValueType.cpp
dom/smil/SMILCompositorTable.h
dom/smil/SMILTimedElement.cpp
dom/svg/SVGAElement.cpp
dom/svg/SVGAElement.h
dom/svg/SVGAnimationElement.cpp
dom/svg/SVGAnimationElement.h
dom/svg/SVGContentUtils.cpp
dom/svg/SVGContentUtils.h
dom/svg/SVGDocument.cpp
dom/svg/SVGDocument.h
dom/svg/SVGElement.cpp
dom/svg/SVGElement.h
dom/svg/SVGFEImageElement.cpp
dom/svg/SVGFEImageElement.h
dom/svg/SVGFragmentIdentifier.cpp
dom/svg/SVGFragmentIdentifier.h
dom/svg/SVGGraphicsElement.cpp
dom/svg/SVGImageElement.cpp
dom/svg/SVGImageElement.h
dom/svg/SVGMPathElement.cpp
dom/svg/SVGMPathElement.h
dom/svg/SVGSVGElement.cpp
dom/svg/SVGSVGElement.h
dom/svg/SVGScriptElement.cpp
dom/svg/SVGScriptElement.h
dom/svg/SVGStyleElement.cpp
dom/svg/SVGStyleElement.h
dom/svg/SVGTitleElement.cpp
dom/svg/SVGTitleElement.h
dom/svg/SVGTransformableElement.cpp
dom/svg/SVGUseElement.cpp
dom/svg/SVGUseElement.h
dom/svg/SVGViewportElement.cpp
dom/system/nsDeviceSensors.cpp
dom/system/nsDeviceSensors.h
dom/u2f/U2F.cpp
dom/url/URL.cpp
dom/webauthn/WebAuthnManager.cpp
dom/webauthn/WebAuthnManagerBase.cpp
dom/webauthn/WebAuthnUtil.cpp
dom/webbrowserpersist/WebBrowserPersistDocumentChild.cpp
dom/webbrowserpersist/WebBrowserPersistDocumentChild.h
dom/webbrowserpersist/WebBrowserPersistLocalDocument.cpp
dom/webbrowserpersist/WebBrowserPersistLocalDocument.h
dom/webbrowserpersist/nsWebBrowserPersist.cpp
dom/webidl/Animatable.webidl
dom/webidl/Animation.webidl
dom/webidl/AnimationEffect.webidl
dom/webidl/AnimationPlaybackEvent.webidl
dom/webidl/AnimationTimeline.webidl
dom/webidl/CSSAnimation.webidl
dom/webidl/CSSPseudoElement.webidl
dom/webidl/CSSTransition.webidl
dom/webidl/Document.webidl
dom/webidl/DocumentOrShadowRoot.webidl
dom/webidl/DocumentTimeline.webidl
dom/webidl/Element.webidl
dom/webidl/KeyframeEffect.webidl
dom/websocket/WebSocket.cpp
dom/workers/RuntimeService.cpp
dom/workers/ScriptLoader.cpp
dom/workers/ScriptLoader.h
dom/workers/WorkerNavigator.cpp
dom/workers/WorkerPrivate.cpp
dom/workers/WorkerPrivate.h
dom/workers/WorkerScope.cpp
dom/workers/sharedworkers/SharedWorker.cpp
dom/worklet/Worklet.cpp
dom/xbl/XBLChildrenElement.cpp
dom/xbl/nsBindingManager.cpp
dom/xbl/nsBindingManager.h
dom/xbl/nsXBLBinding.cpp
dom/xbl/nsXBLBinding.h
dom/xbl/nsXBLContentSink.cpp
dom/xbl/nsXBLContentSink.h
dom/xbl/nsXBLDocumentInfo.cpp
dom/xbl/nsXBLDocumentInfo.h
dom/xbl/nsXBLProtoImpl.cpp
dom/xbl/nsXBLProtoImplMethod.cpp
dom/xbl/nsXBLPrototypeBinding.cpp
dom/xbl/nsXBLPrototypeBinding.h
dom/xbl/nsXBLPrototypeHandler.cpp
dom/xbl/nsXBLPrototypeResources.cpp
dom/xbl/nsXBLResourceLoader.cpp
dom/xbl/nsXBLResourceLoader.h
dom/xbl/nsXBLService.cpp
dom/xbl/nsXBLService.h
dom/xbl/nsXBLWindowKeyHandler.cpp
dom/xhr/XMLHttpRequest.h
dom/xhr/XMLHttpRequestMainThread.cpp
dom/xhr/XMLHttpRequestMainThread.h
dom/xhr/XMLHttpRequestWorker.h
dom/xml/XMLDocument.cpp
dom/xml/XMLDocument.h
dom/xml/XMLStylesheetProcessingInstruction.cpp
dom/xml/XMLStylesheetProcessingInstruction.h
dom/xml/nsIXMLContentSink.h
dom/xml/nsXMLContentSink.cpp
dom/xml/nsXMLContentSink.h
dom/xml/nsXMLFragmentContentSink.cpp
dom/xml/nsXMLPrettyPrinter.cpp
dom/xml/nsXMLPrettyPrinter.h
dom/xslt/base/txURIUtils.cpp
dom/xslt/base/txURIUtils.h
dom/xslt/nsIDocumentTransformer.h
dom/xslt/xml/txXMLParser.cpp
dom/xslt/xpath/XPathEvaluator.cpp
dom/xslt/xpath/XPathEvaluator.h
dom/xslt/xpath/XPathExpression.cpp
dom/xslt/xpath/XPathExpression.h
dom/xslt/xpath/XPathResult.h
dom/xslt/xpath/txMozillaXPathTreeWalker.cpp
dom/xslt/xpath/txXPathNode.h
dom/xslt/xpath/txXPathTreeWalker.h
dom/xslt/xslt/txEXSLTFunctions.cpp
dom/xslt/xslt/txMozillaStylesheetCompiler.cpp
dom/xslt/xslt/txMozillaTextOutput.cpp
dom/xslt/xslt/txMozillaTextOutput.h
dom/xslt/xslt/txMozillaXMLOutput.cpp
dom/xslt/xslt/txMozillaXMLOutput.h
dom/xslt/xslt/txMozillaXSLTProcessor.cpp
dom/xslt/xslt/txMozillaXSLTProcessor.h
dom/xslt/xslt/txXMLEventHandler.h
dom/xul/XULBroadcastManager.cpp
dom/xul/XULBroadcastManager.h
dom/xul/XULDocument.cpp
dom/xul/XULDocument.h
dom/xul/XULFrameElement.cpp
dom/xul/XULFrameElement.h
dom/xul/XULPersist.cpp
dom/xul/XULPersist.h
dom/xul/XULScrollElement.cpp
dom/xul/nsXULCommandDispatcher.cpp
dom/xul/nsXULCommandDispatcher.h
dom/xul/nsXULContentSink.cpp
dom/xul/nsXULContentSink.h
dom/xul/nsXULContentUtils.cpp
dom/xul/nsXULContentUtils.h
dom/xul/nsXULElement.cpp
dom/xul/nsXULElement.h
dom/xul/nsXULPopupListener.cpp
editor/composer/moz.build
editor/composer/nsEditingSession.cpp
editor/libeditor/CSSEditUtils.cpp
editor/libeditor/EditorBase.cpp
editor/libeditor/EditorBase.h
editor/libeditor/EditorCommands.cpp
editor/libeditor/EditorEventListener.cpp
editor/libeditor/EditorUtils.cpp
editor/libeditor/HTMLAnonymousNodeEditor.cpp
editor/libeditor/HTMLEditRules.cpp
editor/libeditor/HTMLEditRules.h
editor/libeditor/HTMLEditor.cpp
editor/libeditor/HTMLEditor.h
editor/libeditor/HTMLEditorDataTransfer.cpp
editor/libeditor/HTMLEditorDocumentCommands.cpp
editor/libeditor/HTMLEditorEventListener.cpp
editor/libeditor/HTMLEditorObjectResizer.cpp
editor/libeditor/ManualNAC.h
editor/libeditor/TextEditRules.cpp
editor/libeditor/TextEditor.cpp
editor/libeditor/TextEditor.h
editor/libeditor/TextEditorDataTransfer.cpp
editor/libeditor/WSRunObject.cpp
editor/libeditor/WSRunObject.h
editor/spellchecker/EditorSpellCheck.cpp
editor/spellchecker/TextServicesDocument.cpp
editor/spellchecker/TextServicesDocument.h
extensions/cookie/nsPermissionManager.cpp
extensions/spellcheck/src/mozInlineSpellChecker.cpp
extensions/spellcheck/src/mozInlineSpellChecker.h
extensions/spellcheck/src/mozInlineSpellWordUtil.h
gfx/layers/apz/src/FocusTarget.cpp
gfx/layers/apz/util/APZCCallbackHelper.cpp
gfx/layers/apz/util/APZCCallbackHelper.h
gfx/layers/apz/util/APZEventState.cpp
gfx/layers/apz/util/APZEventState.h
gfx/layers/apz/util/ActiveElementManager.cpp
gfx/layers/apz/util/ChromeProcessController.cpp
gfx/layers/apz/util/ChromeProcessController.h
gfx/layers/apz/util/ContentProcessController.cpp
gfx/layers/apz/util/DoubleTapToZoom.cpp
gfx/layers/apz/util/DoubleTapToZoom.h
gfx/layers/apz/util/ScrollLinkedEffectDetector.cpp
gfx/layers/apz/util/ScrollLinkedEffectDetector.h
gfx/thebes/gfxSVGGlyphs.cpp
gfx/thebes/gfxSVGGlyphs.h
gfx/thebes/gfxUserFontSet.cpp
gfx/vr/VRDisplayPresentation.cpp
gfx/vr/ipc/VRManagerChild.cpp
hal/Hal.cpp
image/DynamicImage.cpp
image/ImageCacheKey.cpp
image/ImageCacheKey.h
image/ImageWrapper.cpp
image/RasterImage.cpp
image/SVGDocumentWrapper.cpp
image/VectorImage.cpp
image/imgICache.idl
image/imgIContainer.idl
image/imgLoader.cpp
image/imgLoader.h
image/imgRequest.cpp
image/imgRequestProxy.cpp
image/imgRequestProxy.h
image/imgTools.cpp
intl/l10n/DocumentL10n.cpp
intl/l10n/DocumentL10n.h
intl/l10n/docs/fluent_tutorial.rst
intl/unicharutil/util/ICUUtils.cpp
js/ipc/WrapperOwner.cpp
js/src/devtools/rootAnalysis/analyzeHeapWrites.js
js/xpconnect/loader/ScriptPreloader.cpp
js/xpconnect/src/XPCJSRuntime.cpp
layout/base/AccessibleCaret.cpp
layout/base/AccessibleCaret.h
layout/base/AccessibleCaretEventHub.cpp
layout/base/AccessibleCaretEventHub.h
layout/base/AccessibleCaretManager.cpp
layout/base/AccessibleCaretManager.h
layout/base/GeometryUtils.cpp
layout/base/MobileViewportManager.cpp
layout/base/MobileViewportManager.h
layout/base/PresShell.cpp
layout/base/PresShell.h
layout/base/RestyleManager.cpp
layout/base/TouchManager.cpp
layout/base/TouchManager.h
layout/base/ZoomConstraintsClient.cpp
layout/base/ZoomConstraintsClient.h
layout/base/nsCSSFrameConstructor.cpp
layout/base/nsCSSFrameConstructor.h
layout/base/nsCaret.cpp
layout/base/nsDocumentViewer.cpp
layout/base/nsFrameManager.cpp
layout/base/nsIDocumentViewerPrint.h
layout/base/nsILayoutDebugger.h
layout/base/nsIPresShell.h
layout/base/nsIPresShellInlines.h
layout/base/nsLayoutUtils.cpp
layout/base/nsLayoutUtils.h
layout/base/nsPresContext.cpp
layout/base/nsPresContext.h
layout/base/nsRefreshDriver.cpp
layout/base/nsRefreshDriver.h
layout/build/nsContentDLF.cpp
layout/build/nsContentDLF.h
layout/doc/obsolete/layout.xml
layout/forms/nsColorControlFrame.cpp
layout/forms/nsComboboxControlFrame.cpp
layout/forms/nsComboboxControlFrame.h
layout/forms/nsFileControlFrame.cpp
layout/forms/nsMeterFrame.cpp
layout/forms/nsNumberControlFrame.cpp
layout/forms/nsProgressFrame.cpp
layout/forms/nsRangeFrame.cpp
layout/forms/nsTextControlFrame.cpp
layout/generic/AutoCopyListener.h
layout/generic/ViewportFrame.cpp
layout/generic/nsBulletFrame.cpp
layout/generic/nsBulletFrame.h
layout/generic/nsCanvasFrame.cpp
layout/generic/nsContainerFrame.cpp
layout/generic/nsFrame.cpp
layout/generic/nsFrameSelection.cpp
layout/generic/nsGfxScrollFrame.cpp
layout/generic/nsHTMLParts.h
layout/generic/nsIStatefulFrame.h
layout/generic/nsImageFrame.cpp
layout/generic/nsImageMap.cpp
layout/generic/nsSubDocumentFrame.cpp
layout/inspector/InspectorUtils.cpp
layout/inspector/InspectorUtils.h
layout/inspector/ServoStyleRuleMap.cpp
layout/inspector/inDeepTreeWalker.cpp
layout/inspector/inLayoutUtils.cpp
layout/inspector/inLayoutUtils.h
layout/ipc/RenderFrame.cpp
layout/painting/ActiveLayerTracker.cpp
layout/painting/RetainedDisplayListBuilder.cpp
layout/painting/nsCSSRendering.cpp
layout/painting/nsCSSRenderingBorders.cpp
layout/painting/nsCSSRenderingBorders.h
layout/painting/nsDisplayList.cpp
layout/printing/nsPagePrintTimer.h
layout/printing/nsPrintJob.cpp
layout/printing/nsPrintJob.h
layout/printing/nsPrintObject.cpp
layout/printing/nsPrintObject.h
layout/printing/nsPrintPreviewListener.cpp
layout/style/BorrowedTypeList.h
layout/style/CSS.cpp
layout/style/CSSKeyframeRule.cpp
layout/style/CSSMozDocumentRule.cpp
layout/style/CSSMozDocumentRule.h
layout/style/CSSPageRule.cpp
layout/style/CSSPageRule.h
layout/style/CSSStyleRule.cpp
layout/style/CSSStyleRule.h
layout/style/ComputedStyle.cpp
layout/style/DocumentStyleRootIterator.cpp
layout/style/DocumentStyleRootIterator.h
layout/style/ErrorReporter.cpp
layout/style/ErrorReporter.h
layout/style/FontFace.cpp
layout/style/FontFaceSet.cpp
layout/style/FontFaceSet.h
layout/style/GeckoBindings.cpp
layout/style/GeckoBindings.h
layout/style/ImageLoader.cpp
layout/style/ImageLoader.h
layout/style/Loader.cpp
layout/style/Loader.h
layout/style/MappedDeclarations.cpp
layout/style/MappedDeclarations.h
layout/style/MediaList.h
layout/style/MediaQueryList.cpp
layout/style/MediaQueryList.h
layout/style/Rule.cpp
layout/style/Rule.h
layout/style/ServoBindingTypes.h
layout/style/ServoBindings.toml
layout/style/ServoCSSParser.cpp
layout/style/ServoCSSParser.h
layout/style/ServoCSSRuleList.cpp
layout/style/ServoStyleSet.cpp
layout/style/ServoStyleSet.h
layout/style/StyleAnimationValue.cpp
layout/style/StyleSheet.cpp
layout/style/StyleSheet.h
layout/style/nsAnimationManager.cpp
layout/style/nsCSSValue.cpp
layout/style/nsCSSValue.h
layout/style/nsComputedDOMStyle.cpp
layout/style/nsComputedDOMStyle.h
layout/style/nsDOMCSSAttrDeclaration.cpp
layout/style/nsDOMCSSAttrDeclaration.h
layout/style/nsDOMCSSDeclaration.cpp
layout/style/nsDOMCSSDeclaration.h
layout/style/nsHTMLStyleSheet.cpp
layout/style/nsHTMLStyleSheet.h
layout/style/nsMediaFeatures.cpp
layout/style/nsStyleStruct.cpp
layout/style/nsTransitionManager.h
layout/svg/AutoReferenceChainGuard.h
layout/svg/SVGContextPaint.cpp
layout/svg/SVGContextPaint.h
layout/svg/nsSVGOuterSVGFrame.cpp
layout/svg/nsSVGUtils.cpp
layout/svg/nsSVGUtils.h
layout/tools/layout-debug/src/nsLayoutDebuggingTools.cpp
layout/xul/BoxObject.cpp
layout/xul/nsDocElementBoxFrame.cpp
layout/xul/nsImageBoxFrame.cpp
layout/xul/nsMenuBarFrame.cpp
layout/xul/nsMenuFrame.cpp
layout/xul/nsMenuPopupFrame.cpp
layout/xul/nsRepeatService.cpp
layout/xul/nsRepeatService.h
layout/xul/nsResizerFrame.cpp
layout/xul/nsSplitterFrame.cpp
layout/xul/nsTitleBarFrame.cpp
layout/xul/nsXULPopupManager.cpp
layout/xul/nsXULPopupManager.h
layout/xul/nsXULTooltipListener.cpp
layout/xul/tree/nsTreeBodyFrame.cpp
layout/xul/tree/nsTreeContentView.cpp
layout/xul/tree/nsTreeContentView.h
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp
memory/mozalloc/mozalloc_oom.cpp
mobile/android/components/geckoview/GeckoViewHistory.cpp
mobile/android/components/geckoview/GeckoViewHistory.h
netwerk/base/LoadInfo.cpp
netwerk/base/Predictor.cpp
netwerk/base/RequestContextService.cpp
netwerk/base/nsILoadGroup.idl
netwerk/base/nsILoadInfo.idl
netwerk/base/nsINetworkPredictor.idl
netwerk/base/nsNetUtil.cpp
netwerk/ipc/ChannelEventQueue.cpp
netwerk/protocol/http/HttpBaseChannel.cpp
netwerk/protocol/http/HttpBaseChannel.h
netwerk/protocol/http/HttpChannelChild.cpp
netwerk/protocol/http/HttpChannelParent.cpp
netwerk/protocol/http/nsHttpChannel.cpp
netwerk/url-classifier/UrlClassifierCommon.cpp
parser/html/nsHtml5DocumentBuilder.cpp
parser/html/nsHtml5DocumentBuilder.h
parser/html/nsHtml5Module.cpp
parser/html/nsHtml5Module.h
parser/html/nsHtml5Parser.cpp
parser/html/nsHtml5Parser.h
parser/html/nsHtml5SVGLoadDispatcher.cpp
parser/html/nsHtml5SVGLoadDispatcher.h
parser/html/nsHtml5StringParser.cpp
parser/html/nsHtml5StringParser.h
parser/html/nsHtml5TreeOpExecutor.cpp
parser/html/nsHtml5TreeOpExecutor.h
parser/html/nsHtml5TreeOperation.cpp
parser/html/nsParserUtils.cpp
parser/htmlparser/nsExpatDriver.cpp
parser/htmlparser/nsIFragmentContentSink.h
servo/components/style/element_state.rs
servo/components/style/gecko/data.rs
servo/components/style/gecko/media_queries.rs
servo/components/style/gecko/wrapper.rs
servo/ports/geckolib/glue.rs
toolkit/components/antitracking/AntiTrackingCommon.cpp
toolkit/components/browser/nsWebBrowser.cpp
toolkit/components/extensions/ExtensionPolicyService.cpp
toolkit/components/extensions/ExtensionPolicyService.h
toolkit/components/extensions/WebExtensionPolicy.cpp
toolkit/components/find/nsFind.cpp
toolkit/components/find/nsWebBrowserFind.cpp
toolkit/components/find/nsWebBrowserFind.h
toolkit/components/places/History.cpp
toolkit/components/places/History.h
toolkit/components/places/tests/gtest/mock_Link.h
toolkit/components/printingui/ipc/PrintingParent.cpp
toolkit/components/resistfingerprinting/nsRFPService.cpp
toolkit/components/resistfingerprinting/nsRFPService.h
toolkit/components/satchel/nsFormFillController.cpp
toolkit/components/satchel/nsFormFillController.h
toolkit/components/sessionstore/nsSessionStoreUtils.cpp
toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
toolkit/components/windowwatcher/nsAutoWindowStateHelper.cpp
toolkit/components/windowwatcher/nsWindowWatcher.cpp
toolkit/content/contentAreaUtils.js
toolkit/mozapps/extensions/AddonContentPolicy.cpp
toolkit/mozapps/extensions/AddonManagerWebAPI.cpp
uriloader/base/nsDocLoader.cpp
uriloader/exthandler/ExternalHelperAppParent.cpp
uriloader/prefetch/OfflineCacheUpdateChild.cpp
uriloader/prefetch/OfflineCacheUpdateChild.h
uriloader/prefetch/OfflineCacheUpdateGlue.cpp
uriloader/prefetch/OfflineCacheUpdateGlue.h
uriloader/prefetch/nsOfflineCacheUpdate.cpp
uriloader/prefetch/nsOfflineCacheUpdate.h
uriloader/prefetch/nsOfflineCacheUpdateService.cpp
uriloader/prefetch/nsPrefetchService.cpp
view/nsViewManager.cpp
widget/android/GeckoSystemStateListener.h
widget/android/nsAppShell.cpp
widget/cocoa/nsChangeObserver.h
widget/cocoa/nsDragService.mm
widget/cocoa/nsMenuBarX.h
widget/cocoa/nsMenuBarX.mm
widget/cocoa/nsMenuGroupOwnerX.mm
widget/cocoa/nsMenuItemIconX.mm
widget/cocoa/nsMenuItemX.mm
widget/cocoa/nsMenuUtilsX.mm
widget/cocoa/nsMenuX.mm
widget/cocoa/nsNativeThemeCocoa.mm
widget/gtk/nsDragService.cpp
widget/nsBaseDragService.cpp
widget/nsBaseDragService.h
widget/nsBaseWidget.cpp
widget/nsBaseWidget.h
widget/nsClipboardHelper.cpp
widget/nsDragServiceProxy.cpp
widget/nsITransferable.idl
widget/nsNativeTheme.cpp
widget/tests/TestAppShellSteadyState.cpp
widget/windows/nsDragService.cpp
xpcom/base/CycleCollectedJSContext.cpp
xpcom/rust/xpcom/src/interfaces/nonidl.rs
xpcom/tests/gtest/TestThreadMetrics.cpp
xpfe/appshell/nsAppShellWindowEnumerator.cpp
xpfe/appshell/nsContentTreeOwner.cpp
xpfe/appshell/nsWebShellWindow.cpp
xpfe/appshell/nsXULWindow.cpp
--- a/accessible/android/DocAccessibleWrap.cpp
+++ b/accessible/android/DocAccessibleWrap.cpp
@@ -17,17 +17,17 @@
 using namespace mozilla::a11y;
 
 const uint32_t kCacheRefreshInterval = 500;
 
 ////////////////////////////////////////////////////////////////////////////////
 // DocAccessibleWrap
 ////////////////////////////////////////////////////////////////////////////////
 
-DocAccessibleWrap::DocAccessibleWrap(nsIDocument* aDocument,
+DocAccessibleWrap::DocAccessibleWrap(Document* aDocument,
                                      nsIPresShell* aPresShell)
     : DocAccessible(aDocument, aPresShell) {
   nsCOMPtr<nsIDocShellTreeItem> treeItem(aDocument->GetDocShell());
 
   nsCOMPtr<nsIDocShellTreeItem> parentTreeItem;
   treeItem->GetParent(getter_AddRefs(parentTreeItem));
 
   if (treeItem->ItemType() == nsIDocShellTreeItem::typeContent &&
--- a/accessible/android/DocAccessibleWrap.h
+++ b/accessible/android/DocAccessibleWrap.h
@@ -9,17 +9,17 @@
 #include "DocAccessible.h"
 #include "nsITimer.h"
 
 namespace mozilla {
 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;
 
   /**
    * Manage the mapping from id to Accessible.
    */
   void AddID(uint32_t aID, AccessibleWrap* aAcc) {
--- a/accessible/android/RootAccessibleWrap.cpp
+++ b/accessible/android/RootAccessibleWrap.cpp
@@ -8,17 +8,17 @@
 #include "Accessible-inl.h"
 #include "AccessibleOrProxy.h"
 #include "DocAccessibleParent.h"
 #include "ProxyAccessibleWrap.h"
 #include "SessionAccessibility.h"
 
 using namespace mozilla::a11y;
 
-RootAccessibleWrap::RootAccessibleWrap(nsIDocument* aDoc,
+RootAccessibleWrap::RootAccessibleWrap(mozilla::dom::Document* aDoc,
                                        nsIPresShell* aPresShell)
     : RootAccessible(aDoc, aPresShell) {}
 
 RootAccessibleWrap::~RootAccessibleWrap() {}
 
 AccessibleWrap* RootAccessibleWrap::GetContentAccessible() {
   if (ProxyAccessible* proxy = GetPrimaryRemoteTopLevelContentDoc()) {
     return WrapperFor(proxy);
--- a/accessible/android/RootAccessibleWrap.h
+++ b/accessible/android/RootAccessibleWrap.h
@@ -10,17 +10,17 @@
 
 namespace mozilla {
 namespace a11y {
 
 class DocProxyAccessibleWrap;
 
 class RootAccessibleWrap : public RootAccessible {
  public:
-  RootAccessibleWrap(nsIDocument* aDocument, nsIPresShell* aPresShell);
+  RootAccessibleWrap(dom::Document* aDocument, nsIPresShell* aPresShell);
   virtual ~RootAccessibleWrap();
 
   AccessibleWrap* GetContentAccessible();
 
   AccessibleWrap* FindAccessibleById(int32_t aID);
 
   // Recursively searches for the accessible ID within the document tree.
   AccessibleWrap* FindAccessibleById(DocAccessibleWrap* aDocument, int32_t aID);
--- a/accessible/atk/DocAccessibleWrap.cpp
+++ b/accessible/atk/DocAccessibleWrap.cpp
@@ -8,13 +8,13 @@
 #include "DocAccessibleWrap.h"
 
 using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
 // DocAccessibleWrap
 ////////////////////////////////////////////////////////////////////////////////
 
-DocAccessibleWrap::DocAccessibleWrap(nsIDocument* aDocument,
+DocAccessibleWrap::DocAccessibleWrap(dom::Document* aDocument,
                                      nsIPresShell* aPresShell)
     : DocAccessible(aDocument, aPresShell), mActivated(false) {}
 
 DocAccessibleWrap::~DocAccessibleWrap() {}
--- a/accessible/atk/DocAccessibleWrap.h
+++ b/accessible/atk/DocAccessibleWrap.h
@@ -13,17 +13,17 @@
 
 #include "DocAccessible.h"
 
 namespace mozilla {
 namespace a11y {
 
 class DocAccessibleWrap : public DocAccessible {
  public:
-  DocAccessibleWrap(nsIDocument* aDocument, nsIPresShell* aPresShell);
+  DocAccessibleWrap(dom::Document* aDocument, nsIPresShell* aPresShell);
   virtual ~DocAccessibleWrap();
 
   bool mActivated;
 };
 
 }  // namespace a11y
 }  // namespace mozilla
 
--- a/accessible/base/DocManager.cpp
+++ b/accessible/base/DocManager.cpp
@@ -47,17 +47,17 @@ nsRefPtrHashtable<nsPtrHashKey<const Doc
 // DocManager
 ////////////////////////////////////////////////////////////////////////////////
 
 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);
   if (docAcc) return docAcc;
 
   return CreateDocOrRootAccessible(aDocument);
 }
 
@@ -85,17 +85,17 @@ void DocManager::RemoveFromXPCDocumentCa
 
     if (!HasXPCDocuments()) {
       MaybeShutdownAccService(nsAccessibilityService::eXPCOM);
     }
   }
 }
 
 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);
 
   // Document will already be removed when accessibility service is shutting
   // down so we do not need to remove it twice.
   if (nsAccessibilityService::IsShutdown()) {
     return;
@@ -213,17 +213,17 @@ DocManager::OnStateChange(nsIWebProgress
 
   nsCOMPtr<mozIDOMWindowProxy> DOMWindow;
   aWebProgress->GetDOMWindow(getter_AddRefs(DOMWindow));
   NS_ENSURE_STATE(DOMWindow);
 
   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.
   if (aStateFlags & STATE_STOP) {
 #ifdef A11Y_LOG
     if (logging::IsEnabled(logging::eDocLoad))
       logging::DocLoad("document loaded", aWebProgress, aRequest, aStateFlags);
 #endif
@@ -311,17 +311,17 @@ DocManager::OnSecurityChange(nsIWebProgr
 ////////////////////////////////////////////////////////////////////////////////
 // nsIDOMEventListener
 
 NS_IMETHODIMP
 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;
 
   if (type.EqualsLiteral("pagehide")) {
     // 'pagehide' event is registered on every DOM document we create an
     // accessible for, process the event for the target. This document
     // accessible and all its sub document accessible are shutdown as result of
     // processing.
@@ -356,30 +356,30 @@ DocManager::HandleEvent(Event* aEvent) {
   }
 
   return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // 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.
   DocAccessible* docAcc = GetExistingDocAccessible(aDocument);
   if (!docAcc) {
     docAcc = CreateDocOrRootAccessible(aDocument);
     if (!docAcc) return;
   }
 
   docAcc->NotifyOfLoad(aLoadEventType);
 }
 
-void DocManager::AddListeners(nsIDocument* aDocument,
+void DocManager::AddListeners(Document* aDocument,
                               bool aAddDOMContentLoadedListener) {
   nsPIDOMWindowOuter* window = aDocument->GetWindow();
   EventTarget* target = window->GetChromeEventHandler();
   EventListenerManager* elm = target->GetOrCreateListenerManager();
   elm->AddEventListenerByType(this, NS_LITERAL_STRING("pagehide"),
                               TrustedEventsAtCapture());
 
 #ifdef A11Y_LOG
@@ -392,32 +392,32 @@ void DocManager::AddListeners(nsIDocumen
                                 TrustedEventsAtCapture());
 #ifdef A11Y_LOG
     if (logging::IsEnabled(logging::eDocCreate))
       logging::Text("added 'DOMContentLoaded' listener");
 #endif
   }
 }
 
-void DocManager::RemoveListeners(nsIDocument* aDocument) {
+void DocManager::RemoveListeners(Document* aDocument) {
   nsPIDOMWindowOuter* window = aDocument->GetWindow();
   if (!window) return;
 
   EventTarget* target = window->GetChromeEventHandler();
   if (!target) return;
 
   EventListenerManager* elm = target->GetOrCreateListenerManager();
   elm->RemoveEventListenerByType(this, NS_LITERAL_STRING("pagehide"),
                                  TrustedEventsAtCapture());
 
   elm->RemoveEventListenerByType(this, NS_LITERAL_STRING("DOMContentLoaded"),
                                  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() ||
       aDocument->IsResourceDoc() || aDocument->IsStaticDocument() ||
       !aDocument->IsActive()) {
     return nullptr;
   }
 
--- a/accessible/base/DocManager.h
+++ b/accessible/base/DocManager.h
@@ -1,17 +1,17 @@
 /* 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_a11_DocManager_h_
 #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"
 #include "nsWeakReference.h"
 #include "nsIPresShell.h"
 #include "mozilla/StaticPtr.h"
 
 namespace mozilla {
@@ -31,17 +31,17 @@ class DocManager : public nsIWebProgress
  public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIWEBPROGRESSLISTENER
   NS_DECL_NSIDOMEVENTLISTENER
 
   /**
    * Return document accessible for the given DOM node.
    */
-  DocAccessible* GetDocAccessible(nsIDocument* aDocument);
+  DocAccessible* GetDocAccessible(dom::Document* aDocument);
 
   /**
    * Return document accessible for the given presshell.
    */
   DocAccessible* GetDocAccessible(const nsIPresShell* aPresShell) {
     if (!aPresShell) return nullptr;
 
     DocAccessible* doc = aPresShell->GetDocAccessible();
@@ -55,17 +55,17 @@ class DocManager : public nsIWebProgress
    * unique id.
    */
   Accessible* FindAccessibleInCache(nsINode* aNode) const;
 
   /**
    * Called by document accessible when it gets shutdown.
    */
   void NotifyOfDocumentShutdown(DocAccessible* aDocument,
-                                nsIDocument* aDOMDocument);
+                                dom::Document* aDOMDocument);
 
   void RemoveFromXPCDocumentCache(DocAccessible* aDocument);
 
   /**
    * Return XPCOM accessible document.
    */
   xpcAccessibleDocument* GetXPCDocument(DocAccessible* aDocument);
   xpcAccessibleDocument* GetCachedXPCDocument(DocAccessible* aDocument) const {
@@ -137,35 +137,35 @@ class DocManager : public nsIWebProgress
   /**
    * Create an accessible document if it was't created and fire accessibility
    * events if needed.
    *
    * @param  aDocument       [in] loaded DOM document
    * @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;
 
   typedef nsRefPtrHashtable<nsPtrHashKey<const DocAccessible>,
                             xpcAccessibleDocument>
       XPCDocumentHashtable;
   XPCDocumentHashtable mXPCDocumentCache;
   static nsRefPtrHashtable<nsPtrHashKey<const DocAccessibleParent>,
@@ -177,17 +177,17 @@ class DocManager : public nsIWebProgress
   static StaticAutoPtr<nsTArray<DocAccessibleParent*>> sRemoteDocuments;
 };
 
 /**
  * Return the existing document accessible for the document if any.
  * 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;
 }
 
 }  // namespace a11y
 }  // namespace mozilla
 
 #endif  // mozilla_a11_DocManager_h_
--- a/accessible/base/FocusManager.cpp
+++ b/accessible/base/FocusManager.cpp
@@ -129,17 +129,17 @@ void FocusManager::NotifyOfDOMBlur(nsISu
 #endif
 
   mActiveItem = nullptr;
 
   // If DOM document stays focused then fire accessible focus event to process
   // 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.
       if (targetNode->IsElement())
         SelectionMgr()->ClearControlSelectionListener();
 
       document->HandleNotification<FocusManager, nsINode>(
           this, &FocusManager::ProcessDOMFocus, DOMDoc);
@@ -371,15 +371,15 @@ nsINode* FocusManager::FocusedDOMNode() 
     return focusedElm;
   }
 
   // Otherwise the focus can be on DOM document.
   nsPIDOMWindowOuter* focusedWnd = DOMFocusManager->GetFocusedWindow();
   return focusedWnd ? focusedWnd->GetExtantDoc() : nullptr;
 }
 
-nsIDocument* FocusManager::FocusedDOMDocument() const {
+dom::Document* FocusManager::FocusedDOMDocument() const {
   nsINode* focusedNode = FocusedDOMNode();
   return focusedNode ? focusedNode->OwnerDoc() : nullptr;
 }
 
 }  // namespace a11y
 }  // namespace mozilla
--- a/accessible/base/FocusManager.h
+++ b/accessible/base/FocusManager.h
@@ -3,20 +3,23 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_a11y_FocusManager_h_
 #define mozilla_a11y_FocusManager_h_
 
 #include "mozilla/RefPtr.h"
 
 class nsINode;
-class nsIDocument;
 class nsISupports;
 
 namespace mozilla {
+namespace dom {
+class Document;
+}
+
 namespace a11y {
 
 class AccEvent;
 class Accessible;
 class DocAccessible;
 
 /**
  * Manage the accessible focus. Used to fire and process accessible events.
@@ -112,17 +115,17 @@ class FocusManager {
 
  private:
   FocusManager(const FocusManager&);
   FocusManager& operator=(const FocusManager&);
 
   /**
    * Return DOM document having DOM focus.
    */
-  nsIDocument* FocusedDOMDocument() const;
+  dom::Document* FocusedDOMDocument() const;
 
  private:
   RefPtr<Accessible> mActiveItem;
   RefPtr<Accessible> mActiveARIAMenubar;
 };
 
 }  // namespace a11y
 }  // namespace mozilla
--- a/accessible/base/Logging.cpp
+++ b/accessible/base/Logging.cpp
@@ -77,21 +77,21 @@ static void EnableLogging(const char* aM
       }
     }
     token += tokenLen;
 
     if (*token == ',') token++;  // skip ',' char
   }
 }
 
-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;
   nsCOMPtr<nsIDocShell> docShell = aDocumentNode->GetDocShell();
   nsIDocShell::BusyFlags busyFlags = nsIDocShell::BUSY_FLAGS_NONE;
   docShell->GetBusyFlags(&busyFlags);
   if (busyFlags == nsIDocShell::BUSY_FLAGS_NONE) {
     printf("'none'");
@@ -102,52 +102,52 @@ static void LogDocShellState(nsIDocument
   if (busyFlags & nsIDocShell::BUSY_FLAGS_BEFORE_PAGE_LOAD) {
     printf(", 'before page load'");
   }
   if (busyFlags & nsIDocShell::BUSY_FLAGS_PAGE_LOADING) {
     printf(", 'page loading'");
   }
 }
 
-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"));
   } else {
     printf("document type: [failed]");
   }
 }
 
-static void LogDocShellTree(nsIDocument* aDocumentNode) {
+static void LogDocShellTree(dom::Document* aDocumentNode) {
   if (aDocumentNode->IsActive()) {
     nsCOMPtr<nsIDocShellTreeItem> treeItem(aDocumentNode->GetDocShell());
     nsCOMPtr<nsIDocShellTreeItem> parentTreeItem;
     treeItem->GetParent(getter_AddRefs(parentTreeItem));
     nsCOMPtr<nsIDocShellTreeItem> rootTreeItem;
     treeItem->GetRootTreeItem(getter_AddRefs(rootTreeItem));
     printf("docshell hierarchy, parent: %p, root: %p, is tab document: %s;",
            static_cast<void*>(parentTreeItem), static_cast<void*>(rootTreeItem),
            (nsCoreUtils::IsTabDocument(aDocumentNode) ? "yes" : "no"));
   }
 }
 
-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;
   }
 
   printf("doc state: %s", docState);
   printf(", %sinitial", aDocumentNode->IsInitialDocument() ? "" : "not ");
   printf(", %sshowing", aDocumentNode->IsShowing() ? "" : "not ");
   printf(", %svisible", aDocumentNode->IsVisible() ? "" : "not ");
@@ -158,46 +158,46 @@ static void LogDocState(nsIDocument* aDo
 
   dom::Element* rootEl = aDocumentNode->GetBodyElement();
   if (!rootEl) {
     rootEl = aDocumentNode->GetRootElement();
   }
   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));
 
   nsIScrollableFrame* sf = nullptr;
   if (ps) {
     printf(", is %s destroying", (ps->IsDestroying() ? "" : "not"));
     sf = ps->GetRootScrollFrameAsScrollable();
   }
   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",
            static_cast<void*>(GetExistingDocAccessible(parentDoc)));
     printf("\n    parent ");
     LogDocURI(parentDoc);
     printf("\n");
   }
 }
 
-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));
 
   // log document info
   if (aDocumentNode) {
     LogDocURI(aDocumentNode);
     printf("\n    ");
     LogDocShellState(aDocumentNode);
@@ -365,17 +365,17 @@ void logging::DocLoad(const char* aMsg, 
   nsCOMPtr<mozIDOMWindowProxy> DOMWindow;
   aWebProgress->GetDOMWindow(getter_AddRefs(DOMWindow));
   nsPIDOMWindowOuter* window = nsPIDOMWindowOuter::From(DOMWindow);
   if (!window) {
     MsgEnd();
     return;
   }
 
-  nsCOMPtr<nsIDocument> documentNode = window->GetDoc();
+  nsCOMPtr<dom::Document> documentNode = window->GetDoc();
   if (!documentNode) {
     MsgEnd();
     return;
   }
 
   DocAccessible* document = GetExistingDocAccessible(documentNode);
 
   LogDocInfo(documentNode, document);
@@ -389,17 +389,17 @@ void logging::DocLoad(const char* aMsg, 
   printf("    state flags: %x", aStateFlags);
   bool isDocLoading;
   aWebProgress->GetIsLoadingDocument(&isDocLoading);
   printf(", document is %sloading\n", (isDocLoading ? "" : "not "));
 
   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);
   LogDocInfo(aDocumentNode, document);
 
   MsgEnd();
 }
 
@@ -439,27 +439,27 @@ void logging::DocLoadEventHandled(AccEve
   MsgBegin(sDocEventTitle, "handled '%s' event", strEventType.get());
 
   DocAccessible* document = aEvent->GetAccessible()->AsDoc();
   if (document) LogDocInfo(document->DocumentNode(), document);
 
   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);
 
   MsgBegin(sDocCreateTitle, "%s", aMsg);
   LogDocInfo(aDocumentNode, document);
   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);
 
   MsgBegin(sDocDestroyTitle, "%s", aMsg);
   LogDocInfo(aDocumentNode, document);
   MsgEnd();
 }
@@ -708,17 +708,17 @@ void logging::Text(const char* aText) { 
 
 void logging::Address(const char* aDescr, Accessible* aAcc) {
   if (!aAcc->IsDoc()) {
     printf("    %s accessible: %p, node: %p\n", aDescr,
            static_cast<void*>(aAcc), static_cast<void*>(aAcc->GetNode()));
   }
 
   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));
 
   printf("    ");
   LogDocURI(docNode);
   printf("\n");
 }
 
--- a/accessible/base/Logging.h
+++ b/accessible/base/Logging.h
@@ -6,25 +6,25 @@
 
 #ifndef mozilla_a11y_logs_h__
 #define mozilla_a11y_logs_h__
 
 #include "nscore.h"
 #include "nsStringFwd.h"
 #include "mozilla/Attributes.h"
 
-class nsIDocument;
 class nsINode;
 class nsIRequest;
 class nsISupports;
 class nsIWebProgress;
 
 namespace mozilla {
 
 namespace dom {
+class Document;
 class Selection;
 }  // namespace dom
 
 namespace a11y {
 
 class AccEvent;
 class Accessible;
 class DocAccessible;
@@ -69,39 +69,39 @@ bool IsEnabledAll(uint32_t aModules);
  */
 bool IsEnabled(const nsAString& aModules);
 
 /**
  * Log the document loading progress.
  */
 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);
 
 /**
  * Log that document load event was fired.
  */
 void DocLoadEventFired(AccEvent* aEvent);
 
 /**
  * Log that document laod event was handled.
  */
 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);
 
 /**
  * Log the outer document was destroyed.
  */
 void OuterDocDestroy(OuterDocAccessible* OuterDoc);
 
 /**
--- a/accessible/base/SelectionManager.cpp
+++ b/accessible/base/SelectionManager.cpp
@@ -10,17 +10,17 @@
 #include "HyperTextAccessible-inl.h"
 #include "nsAccessibilityService.h"
 #include "nsAccUtils.h"
 #include "nsCoreUtils.h"
 #include "nsEventShell.h"
 #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"
 
 using namespace mozilla;
 using namespace mozilla::a11y;
 using mozilla::dom::Selection;
 
@@ -133,17 +133,17 @@ void SelectionManager::ProcessTextSelCha
   if (mCaretOffset != -1) {
     RefPtr<AccCaretMoveEvent> caretMoveEvent =
         new AccCaretMoveEvent(caretCntr, mCaretOffset, aEvent->FromUserInput());
     nsEventShell::FireEvent(caretMoveEvent);
   }
 }
 
 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)) {
     return NS_ERROR_INVALID_ARG;
   }
 
   DocAccessible* document = GetAccService()->GetDocAccessible(aDocument);
 
--- a/accessible/base/nsAccUtils.cpp
+++ b/accessible/base/nsAccUtils.cpp
@@ -444,17 +444,17 @@ bool nsAccUtils::IsARIALive(const Access
   // Get computed aria-live property based on the closest container with the
   // attribute. Inner nodes override outer nodes within the same
   // document, but nodes in outer documents override nodes in inner documents.
   // This should be the same as the container-live attribute, but we don't need
   // the other container-* attributes, so we can't use the same function.
   nsAutoString live;
   nsIContent* startContent = aAccessible->GetContent();
   while (startContent) {
-    nsIDocument* doc = startContent->GetComposedDoc();
+    dom::Document* doc = startContent->GetComposedDoc();
     if (!doc) {
       break;
     }
 
     dom::Element* aTopEl = doc->GetRootElement();
     nsIContent* ancestor = startContent;
     while (ancestor) {
       nsAutoString docLive;
@@ -490,17 +490,17 @@ bool nsAccUtils::IsARIALive(const Access
     }
 
     nsCOMPtr<nsIDocShellTreeItem> sameTypeParent;
     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);
   }
 
   return !live.IsEmpty() && !live.EqualsLiteral("off");
--- a/accessible/base/nsAccessibilityService.cpp
+++ b/accessible/base/nsAccessibilityService.cpp
@@ -277,17 +277,17 @@ nsAccessibilityService::ListenersChanged
       continue;
     }
 
     uint32_t changeCount;
     change->GetCountOfEventListenerChangesAffectingAccessibility(&changeCount);
     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
       // handler.
       if (document && !document->HasAccessible(node) &&
           nsCoreUtils::HasClickListener(node)) {
         document->ContentInserted(node, node->GetNextSibling());
         break;
@@ -313,32 +313,32 @@ nsAccessibilityService::Observe(nsISuppo
   if (!nsCRT::strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID)) {
     Shutdown();
   }
 
   return NS_OK;
 }
 
 void nsAccessibilityService::NotifyOfAnchorJumpTo(nsIContent* aTargetNode) {
-  nsIDocument* documentNode = aTargetNode->GetUncomposedDoc();
+  Document* documentNode = aTargetNode->GetUncomposedDoc();
   if (documentNode) {
     DocAccessible* document = GetDocAccessible(documentNode);
     if (document) document->SetAnchorJump(aTargetNode);
   }
 }
 
 void nsAccessibilityService::FireAccessibleEvent(uint32_t aEvent,
                                                  Accessible* aTarget) {
   nsEventShell::FireEvent(aEvent, aTarget);
 }
 
 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) {
       nsCOMPtr<nsIDocShellTreeItem> rootTreeItem;
       treeItem->GetRootTreeItem(getter_AddRefs(rootTreeItem));
       if (treeItem != rootTreeItem) {
         nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(rootTreeItem));
         ps = docShell->GetPresShell();
--- a/accessible/base/nsCoreUtils.cpp
+++ b/accessible/base/nsCoreUtils.cpp
@@ -4,17 +4,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsCoreUtils.h"
 
 #include "nsIAccessibleTypes.h"
 
 #include "nsIBaseWindow.h"
 #include "nsIDocShellTreeOwner.h"
-#include "nsIDocument.h"
+#include "mozilla/dom/Document.h"
 #include "nsRange.h"
 #include "nsIBoxObject.h"
 #include "nsXULElement.h"
 #include "mozilla/dom/BoxObject.h"
 #include "nsIDocShell.h"
 #include "nsIObserverService.h"
 #include "nsIPresShell.h"
 #include "nsPresContext.h"
@@ -65,17 +65,17 @@ bool nsCoreUtils::HasClickListener(nsICo
 
 void nsCoreUtils::DispatchClickEvent(nsITreeBoxObject *aTreeBoxObj,
                                      int32_t aRowIndex, nsTreeColumn *aColumn,
                                      const nsAString &aPseudoElt) {
   RefPtr<dom::Element> tcElm;
   aTreeBoxObj->GetTreeBody(getter_AddRefs(tcElm));
   if (!tcElm) return;
 
-  nsIDocument *document = tcElm->GetUncomposedDoc();
+  Document *document = tcElm->GetUncomposedDoc();
   if (!document) return;
 
   nsCOMPtr<nsIPresShell> presShell = document->GetShell();
   if (!presShell) return;
 
   // Ensure row is visible.
   aTreeBoxObj->EnsureRowIsVisible(aRowIndex);
 
@@ -335,50 +335,50 @@ nsIntPoint nsCoreUtils::GetScreenCoordsF
 
 already_AddRefed<nsIDocShell> nsCoreUtils::GetDocShellFor(nsINode *aNode) {
   if (!aNode) return nullptr;
 
   nsCOMPtr<nsIDocShell> docShell = aNode->OwnerDoc()->GetDocShell();
   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!");
 
   nsCOMPtr<nsIDocShellTreeItem> parentTreeItem;
   docShellTreeItem->GetParent(getter_AddRefs(parentTreeItem));
 
   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;
   treeItem->GetParent(getter_AddRefs(parentTreeItem));
 
   // Tab document running in own process doesn't have parent.
   if (XRE_IsContentProcess()) return !parentTreeItem;
 
   // Parent of docshell for tab document running in chrome process is root.
   nsCOMPtr<nsIDocShellTreeItem> rootTreeItem;
   treeItem->GetRootTreeItem(getter_AddRefs(rootTreeItem));
 
   return parentTreeItem == rootTreeItem;
 }
 
-bool nsCoreUtils::IsErrorPage(nsIDocument *aDocument) {
+bool nsCoreUtils::IsErrorPage(Document *aDocument) {
   nsIURI *uri = aDocument->GetDocumentURI();
   bool isAboutScheme = false;
   uri->SchemeIs("about", &isAboutScheme);
   if (!isAboutScheme) return false;
 
   nsAutoCString path;
   uri->GetPathQueryRef(path);
 
--- a/accessible/base/nsCoreUtils.h
+++ b/accessible/base/nsCoreUtils.h
@@ -5,17 +5,17 @@
 
 #ifndef nsCoreUtils_h_
 #define nsCoreUtils_h_
 
 #include "mozilla/EventForwards.h"
 #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"
 #include "nsTArray.h"
 
 class nsRange;
 class nsTreeColumn;
 class nsIBoxObject;
@@ -24,16 +24,18 @@ class nsIDocShell;
 class nsITreeBoxObject;
 class nsIWidget;
 
 /**
  * Core utils.
  */
 class nsCoreUtils {
  public:
+  typedef mozilla::dom::Document Document;
+
   /**
    * Return true if the given node is a label of a control.
    */
   static bool IsLabelWithControl(nsIContent *aContent);
 
   /**
    * Return true if the given node has registered click, mousedown or mouseup
    * event listeners.
@@ -180,32 +182,32 @@ class nsCoreUtils {
   /**
    * Return document shell for the given DOM node.
    */
   static already_AddRefed<nsIDocShell> GetDocShellFor(nsINode *aNode);
 
   /**
    * 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.
    */
   static nsIPresShell *GetPresShellFor(nsINode *aNode) {
     return aNode->OwnerDoc()->GetShell();
   }
 
--- a/accessible/generic/Accessible.cpp
+++ b/accessible/generic/Accessible.cpp
@@ -32,17 +32,17 @@
 #include "XULDocument.h"
 
 #include "nsIDOMXULButtonElement.h"
 #include "nsIDOMXULSelectCntrlEl.h"
 #include "nsIDOMXULSelectCntrlItemEl.h"
 #include "nsINodeList.h"
 #include "nsPIDOMWindow.h"
 
-#include "nsIDocument.h"
+#include "mozilla/dom/Document.h"
 #include "nsIContent.h"
 #include "nsIForm.h"
 #include "nsIFormControl.h"
 
 #include "nsDeckFrame.h"
 #include "nsLayoutUtils.h"
 #include "nsIPresShell.h"
 #include "nsIStringBundle.h"
@@ -260,17 +260,17 @@ KeyBinding Accessible::AccessKey() const
       return KeyBinding(key, KeyBinding::kAlt);
     case dom::KeyboardEvent_Binding::DOM_VK_META:
       return KeyBinding(key, KeyBinding::kMeta);
     default:
       return KeyBinding();
   }
 
   // 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());
   if (!treeItem) return KeyBinding();
 
   nsresult rv = NS_ERROR_FAILURE;
   int32_t modifierMask = 0;
   switch (treeItem->ItemType()) {
@@ -1020,31 +1020,31 @@ already_AddRefed<nsIPersistentProperties
   // Get container-foo computed live region properties based on the closest
   // container with the live region attribute. Inner nodes override outer nodes
   // within the same document. The inner nodes can be used to override live
   // region behavior on more general outer nodes. However, nodes in outer
   // documents override nodes in inner documents: outer doc author may want to
   // 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,
                                            doc->GetRootElement());
 
     // Allow ARIA live region markup from outer documents to override
     nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem = doc->GetDocShell();
     if (!docShellTreeItem) break;
 
     nsCOMPtr<nsIDocShellTreeItem> sameTypeParent;
     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);
   }
 
   if (!mContent->IsElement()) return attributes.forget();
 
   nsAutoString id;
@@ -1682,17 +1682,17 @@ Relation Accessible::RelationByType(Rela
           if (form) {
             nsCOMPtr<nsIContent> formContent =
                 do_QueryInterface(form->GetDefaultSubmitElement());
             return Relation(mDoc, formContent);
           }
         }
       } 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()) {
           dom::XULDocument* xulDoc = doc->AsXULDocument();
           nsCOMPtr<nsIHTMLCollection> possibleDefaultButtons =
               xulDoc->GetElementsByAttribute(NS_LITERAL_STRING("default"),
                                              NS_LITERAL_STRING("true"));
           if (possibleDefaultButtons) {
             uint32_t length = possibleDefaultButtons->Length();
@@ -2388,17 +2388,17 @@ Accessible* Accessible::CurrentItem() co
   // Check for aria-activedescendant, which changes which element has focus.
   // For activedescendant, the ARIA spec does not require that the user agent
   // checks whether pointed node is actually a DOM descendant of the element
   // with the aria-activedescendant attribute.
   nsAutoString id;
   if (HasOwnContent() && mContent->IsElement() &&
       mContent->AsElement()->GetAttr(kNameSpaceID_None,
                                      nsGkAtoms::aria_activedescendant, id)) {
-    nsIDocument* DOMDoc = mContent->OwnerDoc();
+    dom::Document* DOMDoc = mContent->OwnerDoc();
     dom::Element* activeDescendantElm = DOMDoc->GetElementById(id);
     if (activeDescendantElm) {
       DocAccessible* document = Document();
       if (document) return document->GetAccessible(activeDescendantElm);
     }
   }
   return nullptr;
 }
--- a/accessible/generic/ApplicationAccessible.cpp
+++ b/accessible/generic/ApplicationAccessible.cpp
@@ -120,19 +120,17 @@ void ApplicationAccessible::Init() {
 
   if (!windowsById) {
     return;
   }
 
   for (auto iter = windowsById->Iter(); !iter.Done(); iter.Next()) {
     nsGlobalWindowOuter* window = iter.Data();
     if (window->GetDocShell() && window->IsRootOuterWindow()) {
-      nsCOMPtr<nsIDocument> docNode = window->GetExtantDoc();
-
-      if (docNode) {
+      if (RefPtr<dom::Document> docNode = window->GetExtantDoc()) {
         GetAccService()->GetDocAccessible(docNode);  // ensure creation
       }
     }
   }
 }
 
 Accessible* ApplicationAccessible::GetSiblingAtOffset(int32_t aOffset,
                                                       nsresult* aError) const {
--- a/accessible/generic/DocAccessible-inl.h
+++ b/accessible/generic/DocAccessible-inl.h
@@ -8,17 +8,17 @@
 #define mozilla_a11y_DocAccessible_inl_h_
 
 #include "DocAccessible.h"
 #include "nsAccessibilityService.h"
 #include "nsAccessiblePivot.h"
 #include "NotificationController.h"
 #include "States.h"
 #include "nsIScrollableFrame.h"
-#include "nsIDocumentInlines.h"
+#include "mozilla/dom/DocumentInlines.h"
 
 #ifdef A11Y_LOG
 #include "Logging.h"
 #endif
 
 namespace mozilla {
 namespace a11y {
 
--- a/accessible/generic/DocAccessible.cpp
+++ b/accessible/generic/DocAccessible.cpp
@@ -18,17 +18,17 @@
 #include "RootAccessible.h"
 #include "TreeWalker.h"
 #include "xpcAccessibleDocument.h"
 
 #include "nsContentUtils.h"
 #include "nsIMutableArray.h"
 #include "nsICommandManager.h"
 #include "nsIDocShell.h"
-#include "nsIDocument.h"
+#include "mozilla/dom/Document.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"
@@ -65,17 +65,17 @@ static nsStaticAtom* const kRelationAttr
                                                nsGkAtoms::_for,
                                                nsGkAtoms::control};
 
 static const uint32_t kRelationAttrsLen = ArrayLength(kRelationAttrs);
 
 ////////////////////////////////////////////////////////////////////////////////
 // Constructor/desctructor
 
-DocAccessible::DocAccessible(nsIDocument* aDocument, nsIPresShell* aPresShell)
+DocAccessible::DocAccessible(dom::Document* aDocument, nsIPresShell* aPresShell)
     :  // XXX don't pass a document to the Accessible constructor so that we
        // don't set mDoc until our vtable is fully setup.  If we set mDoc before
        // setting up the vtable we will call Accessible::AddRef() but not the
        // overrides of it for subclasses.  It is important to call those
        // overrides to avoid confusing leak checking machinary.
       HyperTextAccessibleWrap(nullptr, nullptr),
       // XXX aaronl should we use an algorithm for the initial cache size?
       mAccessibleCache(kDefaultCacheLength),
@@ -367,17 +367,17 @@ void DocAccessible::Init() {
 #endif
 
   // Initialize notification controller.
   mNotificationController = new NotificationController(this, mPresShell);
 
   // Mark the document accessible as loaded if its DOM document was loaded at
   // this point (this can happen because a11y is started late or DOM document
   // having no container was loaded.
-  if (mDocumentNode->GetReadyStateEnum() == nsIDocument::READYSTATE_COMPLETE)
+  if (mDocumentNode->GetReadyStateEnum() == dom::Document::READYSTATE_COMPLETE)
     mLoadState |= eDOMLoaded;
 
   AddEventListeners();
 }
 
 void DocAccessible::Shutdown() {
   if (!mPresShell)  // already shutdown
     return;
@@ -456,18 +456,18 @@ nsIFrame* DocAccessible::GetFrame() cons
 
   return root;
 }
 
 // DocAccessible protected member
 nsRect DocAccessible::RelativeBounds(nsIFrame** aRelativeFrame) const {
   *aRelativeFrame = GetFrame();
 
-  nsIDocument* document = mDocumentNode;
-  nsIDocument* parentDoc = nullptr;
+  dom::Document* document = mDocumentNode;
+  dom::Document* parentDoc = nullptr;
 
   nsRect bounds;
   while (document) {
     nsIPresShell* presShell = document->GetShell();
     if (!presShell) return nsRect();
 
     nsRect scrollPort;
     nsIScrollableFrame* sf = presShell->GetRootScrollFrameAsScrollable();
@@ -1015,17 +1015,17 @@ void DocAccessible::ARIAActiveDescendant
                                         aAccessible);
     }
 #endif
   }
 }
 
 void DocAccessible::ContentAppended(nsIContent* aFirstNewContent) {}
 
-void DocAccessible::ContentStateChanged(nsIDocument* aDocument,
+void DocAccessible::ContentStateChanged(dom::Document* aDocument,
                                         nsIContent* aContent,
                                         EventStates aStateMask) {
   Accessible* accessible = GetAccessible(aContent);
   if (!accessible) return;
 
   if (aStateMask.HasState(NS_EVENT_STATE_CHECKED)) {
     Accessible* widget = accessible->ContainerWidget();
     if (widget && widget->IsSelect()) {
@@ -1053,17 +1053,17 @@ void DocAccessible::ContentStateChanged(
 
   if (aStateMask.HasState(NS_EVENT_STATE_VISITED)) {
     RefPtr<AccEvent> event =
         new AccStateChangeEvent(accessible, states::TRAVERSED, true);
     FireDelayedEvent(event);
   }
 }
 
-void DocAccessible::DocumentStatesChanged(nsIDocument* aDocument,
+void DocAccessible::DocumentStatesChanged(dom::Document* aDocument,
                                           EventStates aStateMask) {}
 
 void DocAccessible::CharacterDataWillChange(nsIContent* aContent,
                                             const CharacterDataChangeInfo&) {}
 
 void DocAccessible::CharacterDataChanged(nsIContent* aContent,
                                          const CharacterDataChangeInfo&) {}
 
--- a/accessible/generic/DocAccessible.h
+++ b/accessible/generic/DocAccessible.h
@@ -9,31 +9,35 @@
 #include "nsIAccessiblePivot.h"
 
 #include "HyperTextAccessibleWrap.h"
 #include "AccEvent.h"
 
 #include "nsAutoPtr.h"
 #include "nsClassHashtable.h"
 #include "nsDataHashtable.h"
-#include "nsIDocument.h"
+#include "mozilla/dom/Document.h"
 #include "nsIDocumentObserver.h"
 #include "nsIObserver.h"
 #include "nsIScrollPositionListener.h"
 #include "nsITimer.h"
 #include "nsIWeakReference.h"
 
 class nsAccessiblePivot;
 
 const uint32_t kDefaultCacheLength = 128;
 
 namespace mozilla {
 
 class TextEditor;
 
+namespace dom {
+class Document;
+}
+
 namespace a11y {
 
 class DocManager;
 class NotificationController;
 class DocAccessibleChild;
 class RelatedAccIterator;
 template <class Class, class... Args>
 class TNotification;
@@ -45,32 +49,35 @@ class DocAccessible : public HyperTextAc
                       public nsSupportsWeakReference,
                       public nsIAccessiblePivotObserver {
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(DocAccessible, Accessible)
 
   NS_DECL_NSIOBSERVER
   NS_DECL_NSIACCESSIBLEPIVOTOBSERVER
 
+ protected:
+  typedef mozilla::dom::Document Document;
+
  public:
-  DocAccessible(nsIDocument* aDocument, nsIPresShell* aPresShell);
+  DocAccessible(Document* aDocument, nsIPresShell* aPresShell);
 
   // nsIScrollPositionListener
   virtual void ScrollPositionWillChange(nscoord aX, nscoord aY) override {}
   virtual void ScrollPositionDidChange(nscoord aX, nscoord aY) override;
 
   // nsIDocumentObserver
   NS_DECL_NSIDOCUMENTOBSERVER
 
   // Accessible
   virtual void Init();
   virtual void Shutdown() override;
   virtual nsIFrame* GetFrame() const override;
   virtual nsINode* GetNode() const override { return mDocumentNode; }
-  nsIDocument* DocumentNode() const { return mDocumentNode; }
+  Document* DocumentNode() const { return mDocumentNode; }
 
   virtual mozilla::a11y::ENameValueFlag Name(nsString& aName) const override;
   virtual void Description(nsString& aDescription) override;
   virtual Accessible* FocusedChild() override;
   virtual mozilla::a11y::role NativeRole() const override;
   virtual uint64_t NativeState() const override;
   virtual uint64_t NativeInteractiveState() const override;
   virtual bool NativelyUnavailable() const override;
@@ -128,17 +135,17 @@ class DocAccessible : public HyperTextAc
   nsPresContext* PresContext() const { return mPresShell->GetPresContext(); }
 
   /**
    * Return true if associated DOM document was loaded and isn't unloading.
    */
   bool IsContentLoaded() const {
     // eDOMLoaded flag check is used for error pages as workaround to make this
     // method return correct result since error pages do not receive 'pageshow'
-    // event and as consequence nsIDocument::IsShowing() returns false.
+    // event and as consequence Document::IsShowing() returns false.
     return mDocumentNode && mDocumentNode->IsVisible() &&
            (mDocumentNode->IsShowing() || HasLoadState(eDOMLoaded));
   }
 
   bool IsHidden() const { return mDocumentNode->Hidden(); }
 
   /**
    * Document load states.
@@ -591,17 +598,17 @@ class DocAccessible : public HyperTextAc
 
   /**
    * Cache of accessibles within this document accessible.
    */
   AccessibleHashtable mAccessibleCache;
   nsDataHashtable<nsPtrHashKey<const nsINode>, Accessible*>
       mNodeToAccessibleMap;
 
-  nsIDocument* mDocumentNode;
+  Document* mDocumentNode;
   nsCOMPtr<nsITimer> mScrollWatchTimer;
   uint16_t mScrollPositionChangedTicks;  // Used for tracking scroll events
   TimeStamp mLastScrollingDispatch;
 
   /**
    * Bit mask of document load states (@see LoadState).
    */
   uint32_t mLoadState : 3;
--- a/accessible/generic/HyperTextAccessible.cpp
+++ b/accessible/generic/HyperTextAccessible.cpp
@@ -1233,17 +1233,17 @@ already_AddRefed<TextEditor> HyperTextAc
     return nullptr;
   }
 
   nsCOMPtr<nsIDocShell> docShell = nsCoreUtils::GetDocShellFor(mContent);
   nsCOMPtr<nsIEditingSession> editingSession;
   docShell->GetEditingSession(getter_AddRefs(editingSession));
   if (!editingSession) return nullptr;  // No editing session interface
 
-  nsIDocument* docNode = mDoc->DocumentNode();
+  dom::Document* docNode = mDoc->DocumentNode();
   RefPtr<HTMLEditor> htmlEditor =
       editingSession->GetHTMLEditorForWindow(docNode->GetWindow());
   return htmlEditor.forget();
 }
 
 /**
  * =================== Caret & Selection ======================
  */
@@ -1283,17 +1283,17 @@ nsresult HyperTextAccessible::SetSelecti
   // When selection is done, move the focus to the selection if accessible is
   // not focusable. That happens when selection is set within hypertext
   // accessible.
   if (isFocusable) return NS_OK;
 
   nsFocusManager* DOMFocusManager = nsFocusManager::GetFocusManager();
   if (DOMFocusManager) {
     NS_ENSURE_TRUE(mDoc, NS_ERROR_FAILURE);
-    nsIDocument* docNode = mDoc->DocumentNode();
+    dom::Document* docNode = mDoc->DocumentNode();
     NS_ENSURE_TRUE(docNode, NS_ERROR_FAILURE);
     nsCOMPtr<nsPIDOMWindowOuter> window = docNode->GetWindow();
     RefPtr<dom::Element> result;
     DOMFocusManager->MoveFocus(
         window, nullptr, nsIFocusManager::MOVEFOCUS_CARET,
         nsIFocusManager::FLAG_BYMOVEFOCUS, getter_AddRefs(result));
   }
 
--- a/accessible/generic/ImageAccessible.cpp
+++ b/accessible/generic/ImageAccessible.cpp
@@ -8,17 +8,17 @@
 #include "nsAccUtils.h"
 #include "Role.h"
 #include "AccIterator.h"
 #include "States.h"
 
 #include "imgIContainer.h"
 #include "imgIRequest.h"
 #include "nsGenericHTMLElement.h"
-#include "nsIDocument.h"
+#include "mozilla/dom/Document.h"
 #include "nsIImageLoadingContent.h"
 #include "nsIPresShell.h"
 #include "nsIServiceManager.h"
 #include "nsIPersistentProperties2.h"
 #include "nsPIDOMWindow.h"
 #include "nsIURI.h"
 
 using namespace mozilla::a11y;
@@ -101,17 +101,17 @@ bool ImageAccessible::DoAction(uint8_t a
 
   nsCOMPtr<nsIURI> uri = GetLongDescURI();
   if (!uri) return false;
 
   nsAutoCString utf8spec;
   uri->GetSpec(utf8spec);
   NS_ConvertUTF8toUTF16 spec(utf8spec);
 
-  nsIDocument* document = mContent->OwnerDoc();
+  dom::Document* document = mContent->OwnerDoc();
   nsCOMPtr<nsPIDOMWindowOuter> piWindow = document->GetWindow();
   if (!piWindow) return false;
 
   nsCOMPtr<nsPIDOMWindowOuter> tmp;
   return NS_SUCCEEDED(piWindow->Open(spec, EmptyString(), EmptyString(),
                                      /* aLoadInfo = */ nullptr,
                                      /* aForceNoOpener = */ false,
                                      getter_AddRefs(tmp)));
--- a/accessible/generic/OuterDocAccessible.cpp
+++ b/accessible/generic/OuterDocAccessible.cpp
@@ -32,19 +32,19 @@ OuterDocAccessible::OuterDocAccessible(n
 #ifdef XP_WIN
   if (DocAccessibleParent* remoteDoc = RemoteChildDoc()) {
     remoteDoc->SendParentCOMProxy();
   }
 #endif
 
   // Request document accessible for the content document to make sure it's
   // created. It will appended to outerdoc accessible children asynchronously.
-  nsIDocument* outerDoc = mContent->GetUncomposedDoc();
+  dom::Document* outerDoc = mContent->GetUncomposedDoc();
   if (outerDoc) {
-    nsIDocument* innerDoc = outerDoc->GetSubDocumentFor(mContent);
+    dom::Document* innerDoc = outerDoc->GetSubDocumentFor(mContent);
     if (innerDoc) GetAccService()->GetDocAccessible(innerDoc);
   }
 }
 
 OuterDocAccessible::~OuterDocAccessible() {}
 
 ////////////////////////////////////////////////////////////////////////////////
 // Accessible public (DON'T add methods here)
--- a/accessible/generic/RootAccessible.cpp
+++ b/accessible/generic/RootAccessible.cpp
@@ -27,17 +27,17 @@
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/ScriptSettings.h"
 
 #include "nsIDocShellTreeItem.h"
 #include "nsIDocShellTreeOwner.h"
 #include "mozilla/dom/Event.h"
 #include "mozilla/dom/EventTarget.h"
 #include "nsIDOMXULMultSelectCntrlEl.h"
-#include "nsIDocument.h"
+#include "mozilla/dom/Document.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIPropertyBag2.h"
 #include "nsIServiceManager.h"
 #include "nsPIDOMWindow.h"
 #include "nsIWebBrowserChrome.h"
 #include "nsReadableUtils.h"
 #include "nsFocusManager.h"
 #include "nsGlobalWindow.h"
@@ -53,17 +53,17 @@ using namespace mozilla::dom;
 ////////////////////////////////////////////////////////////////////////////////
 // nsISupports
 
 NS_IMPL_ISUPPORTS_INHERITED(RootAccessible, DocAccessible, nsIDOMEventListener)
 
 ////////////////////////////////////////////////////////////////////////////////
 // Constructor/destructor
 
-RootAccessible::RootAccessible(nsIDocument* aDocument, nsIPresShell* aPresShell)
+RootAccessible::RootAccessible(Document* aDocument, nsIPresShell* aPresShell)
     : DocAccessibleWrap(aDocument, aPresShell) {
   mType = eRootType;
 }
 
 RootAccessible::~RootAccessible() {}
 
 ////////////////////////////////////////////////////////////////////////////////
 // Accessible
@@ -443,17 +443,17 @@ void RootAccessible::Shutdown() {
 Relation RootAccessible::RelationByType(RelationType aType) const {
   if (!mDocumentNode || aType != RelationType::EMBEDS)
     return DocAccessibleWrap::RelationByType(aType);
 
   if (nsPIDOMWindowOuter* rootWindow = mDocumentNode->GetWindow()) {
     nsCOMPtr<nsPIDOMWindowOuter> contentWindow =
         nsGlobalWindowOuter::Cast(rootWindow)->GetContent();
     if (contentWindow) {
-      nsCOMPtr<nsIDocument> contentDocumentNode = contentWindow->GetDoc();
+      RefPtr<Document> contentDocumentNode = contentWindow->GetDoc();
       if (contentDocumentNode) {
         DocAccessible* contentDocument =
             GetAccService()->GetDocAccessible(contentDocumentNode);
         if (contentDocument) return Relation(contentDocument);
       }
     }
   }
 
--- a/accessible/generic/RootAccessible.h
+++ b/accessible/generic/RootAccessible.h
@@ -6,26 +6,24 @@
 #ifndef mozilla_a11y_RootAccessible_h__
 #define mozilla_a11y_RootAccessible_h__
 
 #include "HyperTextAccessible.h"
 #include "DocAccessibleWrap.h"
 
 #include "nsIDOMEventListener.h"
 
-class nsIDocument;
-
 namespace mozilla {
 namespace a11y {
 
 class RootAccessible : public DocAccessibleWrap, public nsIDOMEventListener {
   NS_DECL_ISUPPORTS_INHERITED
 
  public:
-  RootAccessible(nsIDocument* aDocument, nsIPresShell* aPresShell);
+  RootAccessible(dom::Document* aDocument, nsIPresShell* aPresShell);
 
   // nsIDOMEventListener
   NS_DECL_NSIDOMEVENTLISTENER
 
   // Accessible
   virtual void Shutdown() override;
   virtual mozilla::a11y::ENameValueFlag Name(nsString& aName) const override;
   virtual Relation RelationByType(RelationType aType) const override;
--- a/accessible/html/HTMLTableAccessible.cpp
+++ b/accessible/html/HTMLTableAccessible.cpp
@@ -14,17 +14,17 @@
 #include "nsTextEquivUtils.h"
 #include "Relation.h"
 #include "Role.h"
 #include "States.h"
 #include "TreeWalker.h"
 
 #include "mozilla/dom/HTMLTableElement.h"
 #include "nsIHTMLCollection.h"
-#include "nsIDocument.h"
+#include "mozilla/dom/Document.h"
 #include "nsIMutableArray.h"
 #include "nsIPersistentProperties2.h"
 #include "nsIPresShell.h"
 #include "nsITableCellLayout.h"
 #include "nsFrameSelection.h"
 #include "nsError.h"
 #include "nsArrayUtils.h"
 #include "nsComponentManagerUtils.h"
--- a/accessible/mac/DocAccessibleWrap.h
+++ b/accessible/mac/DocAccessibleWrap.h
@@ -8,16 +8,16 @@
 
 #include "DocAccessible.h"
 
 namespace mozilla {
 namespace a11y {
 
 class DocAccessibleWrap : public DocAccessible {
  public:
-  DocAccessibleWrap(nsIDocument* aDocument, nsIPresShell* aPresShell);
+  DocAccessibleWrap(dom::Document* aDocument, nsIPresShell* aPresShell);
   virtual ~DocAccessibleWrap();
 };
 
 }  // namespace a11y
 }  // namespace mozilla
 
 #endif
--- a/accessible/mac/DocAccessibleWrap.mm
+++ b/accessible/mac/DocAccessibleWrap.mm
@@ -5,17 +5,17 @@
 
 #include "DocAccessibleWrap.h"
 
 #import "mozAccessible.h"
 
 using namespace mozilla::a11y;
 
 DocAccessibleWrap::
-  DocAccessibleWrap(nsIDocument* aDocument, nsIPresShell* aPresShell) :
+  DocAccessibleWrap(mozilla::dom::Document* aDocument, nsIPresShell* aPresShell) :
   DocAccessible(aDocument, aPresShell)
 {
 }
 
 DocAccessibleWrap::~DocAccessibleWrap()
 {
 }
 
--- a/accessible/mac/RootAccessibleWrap.h
+++ b/accessible/mac/RootAccessibleWrap.h
@@ -12,17 +12,17 @@
 
 #include "RootAccessible.h"
 
 namespace mozilla {
 namespace a11y {
 
 class RootAccessibleWrap : public RootAccessible {
  public:
-  RootAccessibleWrap(nsIDocument* aDocument, nsIPresShell* aPresShell);
+  RootAccessibleWrap(dom::Document* aDocument, nsIPresShell* aPresShell);
   virtual ~RootAccessibleWrap();
 
   Class GetNativeType();
 
   // let's our native accessible get in touch with the
   // native cocoa view that is our accessible parent.
   void GetNativeWidget(void** aOutView);
 };
--- a/accessible/mac/RootAccessibleWrap.mm
+++ b/accessible/mac/RootAccessibleWrap.mm
@@ -11,17 +11,17 @@
 #include "nsObjCExceptions.h"
 #include "nsIFrame.h"
 #include "nsView.h"
 #include "nsIWidget.h"
 
 using namespace mozilla::a11y;
 
 RootAccessibleWrap::
-  RootAccessibleWrap(nsIDocument* aDocument, nsIPresShell* aPresShell) :
+  RootAccessibleWrap(mozilla::dom::Document* aDocument, nsIPresShell* aPresShell) :
   RootAccessible(aDocument, aPresShell)
 {
 }
 
 RootAccessibleWrap::~RootAccessibleWrap()
 {
 }
 
--- a/accessible/windows/msaa/AccessibleWrap.cpp
+++ b/accessible/windows/msaa/AccessibleWrap.cpp
@@ -476,17 +476,17 @@ AccessibleWrap::get_accRole(
     nsAutoString roleString;
     // Try the role attribute.
     content->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::role,
                                   roleString);
 
     if (roleString.IsEmpty()) {
       // No role attribute (or it is an empty string).
       // Use the tag name.
-      nsIDocument* document = content->GetUncomposedDoc();
+      dom::Document* document = content->GetUncomposedDoc();
       if (!document) return E_FAIL;
 
       dom::NodeInfo* nodeInfo = content->NodeInfo();
       nodeInfo->GetName(roleString);
 
       // Only append name space if different from that of current document.
       if (!nodeInfo->NamespaceEquals(document->GetDefaultNamespaceID())) {
         nsAutoString nameSpaceURI;
--- a/accessible/windows/msaa/DocAccessibleWrap.cpp
+++ b/accessible/windows/msaa/DocAccessibleWrap.cpp
@@ -20,17 +20,17 @@
 
 using namespace mozilla;
 using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
 // DocAccessibleWrap
 ////////////////////////////////////////////////////////////////////////////////
 
-DocAccessibleWrap::DocAccessibleWrap(nsIDocument* aDocument,
+DocAccessibleWrap::DocAccessibleWrap(dom::Document* aDocument,
                                      nsIPresShell* aPresShell)
     : DocAccessible(aDocument, aPresShell), mHWND(nullptr) {}
 
 DocAccessibleWrap::~DocAccessibleWrap() {}
 
 IMPL_IUNKNOWN_QUERY_HEAD(DocAccessibleWrap)
 if (aIID == IID_ISimpleDOMDocument) {
   statistics::ISimpleDOMUsed();
--- a/accessible/windows/msaa/DocAccessibleWrap.h
+++ b/accessible/windows/msaa/DocAccessibleWrap.h
@@ -9,17 +9,17 @@
 
 #include "DocAccessible.h"
 
 namespace mozilla {
 namespace a11y {
 
 class DocAccessibleWrap : public DocAccessible {
  public:
-  DocAccessibleWrap(nsIDocument* aDocument, nsIPresShell* aPresShell);
+  DocAccessibleWrap(dom::Document* aDocument, nsIPresShell* aPresShell);
   virtual ~DocAccessibleWrap();
 
   DECL_IUNKNOWN_INHERITED
 
   // IAccessible
 
   // Override get_accParent for e10s
   virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_accParent(
--- a/accessible/windows/msaa/RootAccessibleWrap.cpp
+++ b/accessible/windows/msaa/RootAccessibleWrap.cpp
@@ -10,17 +10,17 @@
 #include "nsCoreUtils.h"
 #include "nsWinUtils.h"
 
 using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
 // Constructor/destructor
 
-RootAccessibleWrap::RootAccessibleWrap(nsIDocument* aDocument,
+RootAccessibleWrap::RootAccessibleWrap(dom::Document* aDocument,
                                        nsIPresShell* aPresShell)
     : RootAccessible(aDocument, aPresShell), mOuter(&mInternalUnknown) {}
 
 RootAccessibleWrap::~RootAccessibleWrap() {}
 
 ////////////////////////////////////////////////////////////////////////////////
 // Aggregated IUnknown
 HRESULT
--- a/accessible/windows/msaa/RootAccessibleWrap.h
+++ b/accessible/windows/msaa/RootAccessibleWrap.h
@@ -9,17 +9,17 @@
 #include "mozilla/mscom/Aggregation.h"
 #include "RootAccessible.h"
 
 namespace mozilla {
 namespace a11y {
 
 class RootAccessibleWrap : public RootAccessible {
  public:
-  RootAccessibleWrap(nsIDocument* aDocument, nsIPresShell* aPresShell);
+  RootAccessibleWrap(dom::Document* aDocument, nsIPresShell* aPresShell);
   virtual ~RootAccessibleWrap();
 
   // RootAccessible
   virtual void DocumentActivated(DocAccessible* aDocument);
 
   /**
    * This method enables a RootAccessibleWrap to be wrapped by a
    * LazyInstantiator.
--- a/accessible/windows/msaa/nsWinUtils.cpp
+++ b/accessible/windows/msaa/nsWinUtils.cpp
@@ -12,17 +12,17 @@
 #include "nsAccessibilityService.h"
 #include "nsCoreUtils.h"
 
 #include "mozilla/a11y/DocAccessibleParent.h"
 #include "mozilla/Preferences.h"
 #include "nsArrayUtils.h"
 #include "nsIArray.h"
 #include "nsICSSDeclaration.h"
-#include "nsIDocument.h"
+#include "mozilla/dom/Document.h"
 #include "nsIDocShellTreeItem.h"
 #include "mozilla/dom/Element.h"
 #include "nsXULAppAPI.h"
 #include "ProxyWrappers.h"
 
 using namespace mozilla;
 using namespace mozilla::a11y;
 using mozilla::dom::Element;
--- a/accessible/xpcom/xpcAccessibilityService.cpp
+++ b/accessible/xpcom/xpcAccessibilityService.cpp
@@ -187,21 +187,18 @@ xpcAccessibilityService::GetAccessibleFr
 
   // Search for an accessible in each of our per document accessible object
   // caches. If we don't find it, and the given node is itself a document, check
   // our cache of document accessibles (document cache). Note usually shutdown
   // document accessibles are not stored in the document cache, however an
   // "unofficially" shutdown document (i.e. not from DocManager) can still
   // exist in the document cache.
   Accessible* accessible = accService->FindAccessibleInCache(aNode);
-  if (!accessible) {
-    nsCOMPtr<nsIDocument> document(do_QueryInterface(aNode));
-    if (document) {
-      accessible = mozilla::a11y::GetExistingDocAccessible(document);
-    }
+  if (!accessible && aNode->IsDocument()) {
+    accessible = mozilla::a11y::GetExistingDocAccessible(aNode->AsDocument());
   }
 
   NS_IF_ADDREF(*aAccessible = ToXPC(accessible));
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibilityService::CreateAccessiblePivot(nsIAccessible* aRoot,
--- a/accessible/xpcom/xpcAccessibleDocument.cpp
+++ b/accessible/xpcom/xpcAccessibleDocument.cpp
@@ -71,17 +71,17 @@ NS_IMETHODIMP
 xpcAccessibleDocument::GetDocType(nsAString& aType) {
   if (!Intl()) return NS_ERROR_FAILURE;
 
   Intl()->DocType(aType);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-xpcAccessibleDocument::GetDOMDocument(nsIDocument** aDOMDocument) {
+xpcAccessibleDocument::GetDOMDocument(dom::Document** aDOMDocument) {
   NS_ENSURE_ARG_POINTER(aDOMDocument);
   *aDOMDocument = nullptr;
 
   if (!Intl()) return NS_ERROR_FAILURE;
 
   if (Intl()->DocumentNode()) NS_ADDREF(*aDOMDocument = Intl()->DocumentNode());
 
   return NS_OK;
--- a/accessible/xpcom/xpcAccessibleDocument.h
+++ b/accessible/xpcom/xpcAccessibleDocument.h
@@ -35,17 +35,17 @@ class xpcAccessibleDocument : public xpc
 
   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(nsIDocument** aDOMDocument) final;
+  NS_IMETHOD GetDOMDocument(dom