Bug 1535297 - Remove some unnecessary namespace qualification in Document.h r=smaug
☠☠ backed out by 6ccfa8614ddd ☠ ☠
authorEmilio Cobos Álvarez <emilio@crisal.io>
Thu, 14 Mar 2019 14:44:52 +0000
changeset 521881 99cde26aca85a66f102dfbc618d475b78dcf3d1c
parent 521880 482fe5ca8245bdc67c2e61a0e369342583b32bfc
child 521882 6ccfa8614ddda99124d4b08bfd2cd886ff88e202
push id10870
push usernbeleuzu@mozilla.com
push dateFri, 15 Mar 2019 20:00:07 +0000
treeherdermozilla-beta@c594aee5b7a4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1535297
milestone67.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 1535297 - Remove some unnecessary namespace qualification in Document.h r=smaug Only kept the ones needed to not conflict with method names. Differential Revision: https://phabricator.services.mozilla.com/D23486
dom/base/Document.h
--- a/dom/base/Document.h
+++ b/dom/base/Document.h
@@ -444,18 +444,17 @@ class Document : public nsINode,
  protected:
   explicit Document(const char* aContentType);
   virtual ~Document();
 
   Document(const Document&) = delete;
   Document& operator=(const Document&) = delete;
 
  public:
-  typedef mozilla::dom::ExternalResourceMap::ExternalResourceLoad
-      ExternalResourceLoad;
+  typedef dom::ExternalResourceMap::ExternalResourceLoad ExternalResourceLoad;
   typedef net::ReferrerPolicy ReferrerPolicyEnum;
 
   MOZ_DECLARE_WEAKREFERENCE_TYPENAME(Document)
 
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOCUMENT_IID)
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
 
@@ -480,38 +479,36 @@ class Document : public nsINode,
 
   // nsIRadioGroupContainer
   NS_IMETHOD WalkRadioGroup(const nsAString& aName, nsIRadioVisitor* aVisitor,
                             bool aFlushContent) final {
     return DocumentOrShadowRoot::WalkRadioGroup(aName, aVisitor, aFlushContent);
   }
 
   void SetCurrentRadioButton(const nsAString& aName,
-                             mozilla::dom::HTMLInputElement* aRadio) final {
+                             HTMLInputElement* aRadio) final {
     DocumentOrShadowRoot::SetCurrentRadioButton(aName, aRadio);
   }
 
-  mozilla::dom::HTMLInputElement* GetCurrentRadioButton(
-      const nsAString& aName) final {
+  HTMLInputElement* GetCurrentRadioButton(const nsAString& aName) final {
     return DocumentOrShadowRoot::GetCurrentRadioButton(aName);
   }
 
   NS_IMETHOD
   GetNextRadioButton(const nsAString& aName, const bool aPrevious,
-                     mozilla::dom::HTMLInputElement* aFocusedRadio,
-                     mozilla::dom::HTMLInputElement** aRadioOut) final {
+                     HTMLInputElement* aFocusedRadio,
+                     HTMLInputElement** aRadioOut) final {
     return DocumentOrShadowRoot::GetNextRadioButton(aName, aPrevious,
                                                     aFocusedRadio, aRadioOut);
   }
-  void AddToRadioGroup(const nsAString& aName,
-                       mozilla::dom::HTMLInputElement* aRadio) final {
+  void AddToRadioGroup(const nsAString& aName, HTMLInputElement* aRadio) final {
     DocumentOrShadowRoot::AddToRadioGroup(aName, aRadio);
   }
   void RemoveFromRadioGroup(const nsAString& aName,
-                            mozilla::dom::HTMLInputElement* aRadio) final {
+                            HTMLInputElement* aRadio) final {
     DocumentOrShadowRoot::RemoveFromRadioGroup(aName, aRadio);
   }
   uint32_t GetRequiredRadioCount(const nsAString& aName) const final {
     return DocumentOrShadowRoot::GetRequiredRadioCount(aName);
   }
   void RadioRequiredWillChange(const nsAString& aName,
                                bool aRequiredAdded) final {
     DocumentOrShadowRoot::RadioRequiredWillChange(aName, aRequiredAdded);
@@ -522,19 +519,19 @@ class Document : public nsINode,
   void SetValueMissingState(const nsAString& aName, bool aValue) final {
     return DocumentOrShadowRoot::SetValueMissingState(aName, aValue);
   }
 
   // nsIScriptObjectPrincipal
   nsIPrincipal* GetPrincipal() final { return NodePrincipal(); }
 
   // EventTarget
-  void GetEventTargetParent(mozilla::EventChainPreVisitor& aVisitor) override;
-  mozilla::EventListenerManager* GetOrCreateListenerManager() override;
-  mozilla::EventListenerManager* GetExistingListenerManager() const override;
+  void GetEventTargetParent(EventChainPreVisitor& aVisitor) override;
+  EventListenerManager* GetOrCreateListenerManager() override;
+  EventListenerManager* GetExistingListenerManager() const override;
 
   // This helper class must be set when we dispatch beforeunload and unload
   // events in order to avoid unterminate sync XHRs.
   class MOZ_RAII PageUnloadingEventTimeStamp {
     RefPtr<Document> mDocument;
     bool mSet;
 
    public:
@@ -604,18 +601,17 @@ class Document : public nsINode,
   virtual void SetSuppressParserErrorConsoleMessages(bool aSuppress) {}
   virtual bool SuppressParserErrorConsoleMessages() { return false; }
 
   // nsINode
   bool IsNodeOfType(uint32_t aFlags) const final;
   nsresult InsertChildBefore(nsIContent* aKid, nsIContent* aBeforeThis,
                              bool aNotify) override;
   void RemoveChildNode(nsIContent* aKid, bool aNotify) final;
-  nsresult Clone(mozilla::dom::NodeInfo* aNodeInfo,
-                 nsINode** aResult) const override {
+  nsresult Clone(dom::NodeInfo* aNodeInfo, nsINode** aResult) const override {
     return NS_ERROR_NOT_IMPLEMENTED;
   }
   nsresult CloneDocHelper(Document* clone) const;
 
   Document* GetLatestStaticClone() const { return mLatestStaticClone; }
 
   /**
    * Signal that the document title may have changed
@@ -809,17 +805,17 @@ class Document : public nsINode,
 
   /**
    * Return the URL data which style system needs for resolving url value.
    * This method attempts to use the cached object in mCachedURLData, but
    * if the base URI, document URI, or principal has changed since last
    * call to this function, or the function is called the first time for
    * the document, a new one is created.
    */
-  mozilla::URLExtraData* DefaultStyleAttrURLData();
+  URLExtraData* DefaultStyleAttrURLData();
 
   /**
    * Get/Set the base target of a link in a document.
    */
   void GetBaseTarget(nsAString& aBaseTarget) const {
     aBaseTarget = mBaseTarget;
   }
 
@@ -999,19 +995,17 @@ class Document : public nsINode,
    */
   void SetHasUnsafeEvalCSP(bool aHasUnsafeEvalCSP) {
     mHasUnsafeEvalCSP = aHasUnsafeEvalCSP;
   }
 
   /**
    * Get the content blocking log.
    */
-  mozilla::dom::ContentBlockingLog* GetContentBlockingLog() {
-    return &mContentBlockingLog;
-  }
+  ContentBlockingLog* GetContentBlockingLog() { return &mContentBlockingLog; }
 
   /**
    * Get tracking content blocked flag for this document.
    */
   bool GetHasTrackingContentBlocked() {
     return mContentBlockingLog.HasBlockedAnyOfType(
         nsIWebProgressListener::STATE_BLOCKED_TRACKING_CONTENT);
   }
@@ -1321,29 +1315,27 @@ class Document : public nsINode,
   /**
    * Find the content node for which aDocument is a sub document.
    */
   Element* FindContentForSubDocument(Document* aDocument) const;
 
   /**
    * Return the doctype for this document.
    */
-  mozilla::dom::DocumentType* GetDoctype() const;
+  DocumentType* GetDoctype() const;
 
   /**
    * Return the root element for this document.
    */
   Element* GetRootElement() const;
 
-  mozilla::dom::Selection* GetSelection(mozilla::ErrorResult& aRv);
-
-  already_AddRefed<mozilla::dom::Promise> HasStorageAccess(
-      mozilla::ErrorResult& aRv);
-  already_AddRefed<mozilla::dom::Promise> RequestStorageAccess(
-      mozilla::ErrorResult& aRv);
+  Selection* GetSelection(ErrorResult& aRv);
+
+  already_AddRefed<Promise> HasStorageAccess(ErrorResult& aRv);
+  already_AddRefed<Promise> RequestStorageAccess(ErrorResult& aRv);
 
   /**
    * Gets the event target to dispatch key events to if there is no focused
    * content in the document.
    */
   virtual Element* GetUnfocusedKeyEventTarget();
 
   /**
@@ -1354,17 +1346,17 @@ class Document : public nsINode,
    * of returning it directly.
    *
    * @param aDisplaySize size of the on-screen display area for this
    * document, in device pixels.
    *
    * NOTE: If the site is optimized for mobile (via the doctype), this
    * will return viewport information that specifies default information.
    */
-  nsViewportInfo GetViewportInfo(const mozilla::ScreenIntSize& aDisplaySize);
+  nsViewportInfo GetViewportInfo(const ScreenIntSize& aDisplaySize);
 
   /**
    * It updates the viewport overflow type with the given two widths
    * and the viewport setting of the document.
    * This should only be called when there is out-of-reach overflow
    * happens on the viewport, i.e. the viewport should be using
    * `overflow: hidden`. And it should only be called on a top level
    * content document.
@@ -1393,37 +1385,36 @@ class Document : public nsINode,
 
   /*
    * Gets the srcdoc string from within the channel (assuming both exist).
    * Returns a void string if this isn't a srcdoc document or if
    * the channel has not been set.
    */
   nsresult GetSrcdocData(nsAString& aSrcdocData);
 
-  already_AddRefed<mozilla::dom::AnonymousContent> InsertAnonymousContent(
-      mozilla::dom::Element& aElement, mozilla::ErrorResult& aError);
-  void RemoveAnonymousContent(mozilla::dom::AnonymousContent& aContent,
-                              mozilla::ErrorResult& aError);
+  already_AddRefed<AnonymousContent> InsertAnonymousContent(
+      Element& aElement, ErrorResult& aError);
+  void RemoveAnonymousContent(AnonymousContent& aContent, ErrorResult& aError);
   /**
    * If aNode is a descendant of anonymous content inserted by
    * InsertAnonymousContent, this method returns the root element of the
    * inserted anonymous content (in other words, the clone of the aElement
    * that was passed to InsertAnonymousContent).
    */
   Element* GetAnonRootIfInAnonymousContentContainer(nsINode* aNode) const;
-  nsTArray<RefPtr<mozilla::dom::AnonymousContent>>& GetAnonymousContents() {
+  nsTArray<RefPtr<AnonymousContent>>& GetAnonymousContents() {
     return mAnonymousContents;
   }
 
-  mozilla::TimeStamp GetPageUnloadingEventTimeStamp() const {
+  TimeStamp GetPageUnloadingEventTimeStamp() const {
     if (!mParentDocument) {
       return mPageUnloadingEventTimeStamp;
     }
 
-    mozilla::TimeStamp parentTimeStamp(
+    TimeStamp parentTimeStamp(
         mParentDocument->GetPageUnloadingEventTimeStamp());
     if (parentTimeStamp.IsNull()) {
       return mPageUnloadingEventTimeStamp;
     }
 
     if (!mPageUnloadingEventTimeStamp ||
         parentTimeStamp < mPageUnloadingEventTimeStamp) {
       return parentTimeStamp;
@@ -1449,19 +1440,19 @@ class Document : public nsINode,
   // when it is destroyed)
   void UnscheduleSVGForPresAttrEvaluation(SVGElement* aSVG) {
     mLazySVGPresElements.RemoveEntry(aSVG);
   }
 
   // Resolve all SVG pres attrs scheduled in ScheduleSVGForPresAttrEvaluation
   void ResolveScheduledSVGPresAttrs();
 
-  mozilla::Maybe<mozilla::dom::ClientInfo> GetClientInfo() const;
-  mozilla::Maybe<mozilla::dom::ClientState> GetClientState() const;
-  mozilla::Maybe<mozilla::dom::ServiceWorkerDescriptor> GetController() const;
+  Maybe<ClientInfo> GetClientInfo() const;
+  Maybe<ClientState> GetClientState() const;
+  Maybe<ServiceWorkerDescriptor> GetController() const;
 
   // Returns the size of the mBlockedNodesByClassifier array.
   //
   // This array contains nodes that have been blocked to prevent user tracking,
   // fingerprinting, cryptomining, etc. They most likely have had their
   // nsIChannel canceled by the URL classifier (Safebrowsing).
   //
   // A script can subsequently use GetBlockedNodesByClassifier()
@@ -1526,35 +1517,35 @@ class Document : public nsINode,
   void RetrieveRelevantHeaders(nsIChannel* aChannel);
 
   void TryChannelCharset(nsIChannel* aChannel, int32_t& aCharsetSource,
                          NotNull<const Encoding*>& aEncoding,
                          nsHtml5TreeOpExecutor* aExecutor);
 
   void DispatchContentLoadedEvents();
 
-  void DispatchPageTransition(mozilla::dom::EventTarget* aDispatchTarget,
+  void DispatchPageTransition(EventTarget* aDispatchTarget,
                               const nsAString& aType, bool aPersisted,
                               bool aOnlySystemGroup = false);
 
   // Call this before the document does something that will unbind all content.
   // That will stop us from doing a lot of work as each element is removed.
   void DestroyElementMaps();
 
   Element* GetRootElementInternal() const;
   void DoNotifyPossibleTitleChange();
 
   void SetPageUnloadingEventTimeStamp() {
     MOZ_ASSERT(!mPageUnloadingEventTimeStamp);
-    mPageUnloadingEventTimeStamp = mozilla::TimeStamp::NowLoRes();
+    mPageUnloadingEventTimeStamp = TimeStamp::NowLoRes();
   }
 
   void CleanUnloadEventsTimeStamp() {
     MOZ_ASSERT(mPageUnloadingEventTimeStamp);
-    mPageUnloadingEventTimeStamp = mozilla::TimeStamp();
+    mPageUnloadingEventTimeStamp = TimeStamp();
   }
 
   /**
    * Clears any Servo element data stored on Elements in the document.
    */
   void ClearStaleServoData();
 
   /**
@@ -1614,128 +1605,125 @@ class Document : public nsINode,
     ~SelectorCache();
 
    private:
     nsDataHashtable<nsStringHashKey, SelectorList> mTable;
   };
 
   SelectorCache& GetSelectorCache() {
     if (!mSelectorCache) {
-      mSelectorCache = mozilla::MakeUnique<SelectorCache>(
-          EventTargetFor(mozilla::TaskCategory::Other));
+      mSelectorCache =
+          MakeUnique<SelectorCache>(EventTargetFor(TaskCategory::Other));
     }
     return *mSelectorCache;
   }
   // Get the root <html> element, or return null if there isn't one (e.g.
   // if the root isn't <html>)
   Element* GetHtmlElement() const;
   // Returns the first child of GetHtmlContent which has the given tag,
   // or nullptr if that doesn't exist.
   Element* GetHtmlChildElement(nsAtom* aTag);
   // Get the canonical <body> element, or return null if there isn't one (e.g.
   // if the root isn't <html> or if the <body> isn't there)
-  mozilla::dom::HTMLBodyElement* GetBodyElement();
+  HTMLBodyElement* GetBodyElement();
   // Get the canonical <head> element, or return null if there isn't one (e.g.
   // if the root isn't <html> or if the <head> isn't there)
   Element* GetHeadElement() { return GetHtmlChildElement(nsGkAtoms::head); }
   // Get the "body" in the sense of document.body: The first <body> or
   // <frameset> that's a child of a root <html>
   nsGenericHTMLElement* GetBody();
   // Set the "body" in the sense of document.body.
-  void SetBody(nsGenericHTMLElement* aBody, mozilla::ErrorResult& rv);
+  void SetBody(nsGenericHTMLElement* aBody, ErrorResult& rv);
   // Get the "head" element in the sense of document.head.
-  mozilla::dom::HTMLSharedElement* GetHead();
+  HTMLSharedElement* GetHead();
 
   /**
    * Accessors to the collection of stylesheets owned by this document.
    * Style sheets are ordered, most significant last.
    */
 
-  mozilla::dom::StyleSheetList* StyleSheets() {
+  StyleSheetList* StyleSheets() {
     return &DocumentOrShadowRoot::EnsureDOMStyleSheets();
   }
 
-  void InsertSheetAt(size_t aIndex, mozilla::StyleSheet&);
+  void InsertSheetAt(size_t aIndex, StyleSheet&);
 
   /**
    * Replace the stylesheets in aOldSheets with the stylesheets in
    * aNewSheets. The two lists must have equal length, and the sheet
    * at positon J in the first list will be replaced by the sheet at
    * position J in the second list.  Some sheets in the second list
    * may be null; if so the corresponding sheets in the first list
    * will simply be removed.
    */
-  void UpdateStyleSheets(nsTArray<RefPtr<mozilla::StyleSheet>>& aOldSheets,
-                         nsTArray<RefPtr<mozilla::StyleSheet>>& aNewSheets);
+  void UpdateStyleSheets(nsTArray<RefPtr<StyleSheet>>& aOldSheets,
+                         nsTArray<RefPtr<StyleSheet>>& aNewSheets);
 
   /**
    * Add a stylesheet to the document
    *
    * TODO(emilio): This is only used by parts of editor that are no longer in
    * use by m-c or c-c, so remove.
    */
-  void AddStyleSheet(mozilla::StyleSheet* aSheet) {
+  void AddStyleSheet(StyleSheet* aSheet) {
     MOZ_ASSERT(aSheet);
     InsertSheetAt(SheetCount(), *aSheet);
   }
 
   /**
    * Remove a stylesheet from the document
    */
-  void RemoveStyleSheet(mozilla::StyleSheet* aSheet);
+  void RemoveStyleSheet(StyleSheet* aSheet);
 
   /**
    * Notify the document that the applicable state of the sheet changed
    * and that observers should be notified and style sets updated
    */
-  void SetStyleSheetApplicableState(mozilla::StyleSheet* aSheet,
-                                    bool aApplicable);
+  void SetStyleSheetApplicableState(StyleSheet* aSheet, bool aApplicable);
 
   enum additionalSheetType {
     eAgentSheet,
     eUserSheet,
     eAuthorSheet,
     AdditionalSheetTypeCount
   };
 
   nsresult LoadAdditionalStyleSheet(additionalSheetType aType,
                                     nsIURI* aSheetURI);
   nsresult AddAdditionalStyleSheet(additionalSheetType aType,
-                                   mozilla::StyleSheet* aSheet);
+                                   StyleSheet* aSheet);
   void RemoveAdditionalStyleSheet(additionalSheetType aType, nsIURI* sheetURI);
 
-  mozilla::StyleSheet* GetFirstAdditionalAuthorSheet() {
+  StyleSheet* GetFirstAdditionalAuthorSheet() {
     return mAdditionalSheets[eAuthorSheet].SafeElementAt(0);
   }
 
   /**
    * Assuming that aDocSheets is an array of document-level style
    * sheets for this document, returns the index that aSheet should
    * be inserted at to maintain document ordering.
    *
    * Type T has to cast to StyleSheet*.
    *
    * Defined in DocumentInlines.h.
    */
   template <typename T>
   size_t FindDocStyleSheetInsertionPoint(const nsTArray<T>& aDocSheets,
-                                         const mozilla::StyleSheet& aSheet);
+                                         const StyleSheet& aSheet);
 
   /**
    * Get this document's CSSLoader.  This is guaranteed to not return null.
    */
-  mozilla::css::Loader* CSSLoader() const { return mCSSLoader; }
+  css::Loader* CSSLoader() const { return mCSSLoader; }
 
   /**
    * Get this document's StyleImageLoader.  This is guaranteed to not return
    * null.
    */
-  mozilla::css::ImageLoader* StyleImageLoader() const {
-    return mStyleImageLoader;
-  }
+  css::ImageLoader* StyleImageLoader() const { return mStyleImageLoader; }
 
   /**
    * Get the channel that was passed to StartDocumentLoad or Reset for this
    * document.  Note that this may be null in some cases (eg if
    * StartDocumentLoad or Reset were never called)
    */
   nsIChannel* GetChannel() const { return mChannel; }
 
@@ -1819,17 +1807,17 @@ class Document : public nsINode,
     return window ? window->WindowID() : 0;
   }
 
   bool IsTopLevelWindowInactive() const;
 
   /**
    * Get the script loader for this document
    */
-  mozilla::dom::ScriptLoader* ScriptLoader() { return mScriptLoader; }
+  ScriptLoader* ScriptLoader() { return mScriptLoader; }
 
   /**
    * Add/Remove an element to the document's id and name hashes
    */
   void AddToIdTable(Element* aElement, nsAtom* aId);
   void RemoveFromIdTable(Element* aElement, nsAtom* aId);
   void AddToNameTable(Element* aElement, nsAtom* aName);
   void RemoveFromNameTable(Element* aElement, nsAtom* aName);
@@ -1876,17 +1864,17 @@ class Document : public nsINode,
   void FullscreenStackPop();
 
   /**
    * Called when a frame in a child process has entered fullscreen or when a
    * fullscreen frame in a child process changes to another origin.
    * aFrameElement is the frame element which contains the child-process
    * fullscreen document.
    */
-  nsresult RemoteFrameFullscreenChanged(mozilla::dom::Element* aFrameElement);
+  nsresult RemoteFrameFullscreenChanged(Element* aFrameElement);
 
   /**
    * Called when a frame in a remote child document has rolled back fullscreen
    * so that all its fullscreen element stacks are empty; we must continue the
    * rollback in this parent process' doc tree branch which is fullscreen.
    * Note that only one branch of the document tree can have its documents in
    * fullscreen state at one time. We're in inconsistent state if a
    * fullscreen document has a parent and that parent isn't fullscreen. We
@@ -1954,28 +1942,27 @@ class Document : public nsINode,
 
   void RequestPointerLock(Element* aElement, CallerType);
   bool SetPointerLock(Element* aElement, StyleCursorKind);
 
   static void UnlockPointer(Document* aDoc = nullptr);
 
   // ScreenOrientation related APIs
 
-  void SetCurrentOrientation(mozilla::dom::OrientationType aType,
-                             uint16_t aAngle) {
+  void SetCurrentOrientation(OrientationType aType, uint16_t aAngle) {
     mCurrentOrientationType = aType;
     mCurrentOrientationAngle = aAngle;
   }
 
   uint16_t CurrentOrientationAngle() const { return mCurrentOrientationAngle; }
-  mozilla::dom::OrientationType CurrentOrientationType() const {
+  OrientationType CurrentOrientationType() const {
     return mCurrentOrientationType;
   }
-  void SetOrientationPendingPromise(mozilla::dom::Promise* aPromise);
-  mozilla::dom::Promise* GetOrientationPendingPromise() const {
+  void SetOrientationPendingPromise(Promise* aPromise);
+  Promise* GetOrientationPendingPromise() const {
     return mOrientationPendingPromise;
   }
 
   //----------------------------------------------------------------------
 
   // Document notification API's
 
   /**
@@ -2019,54 +2006,50 @@ class Document : public nsINode,
 
   void SetAncestorLoading(bool aAncestorIsLoading);
   void NotifyLoading(const bool& aCurrentParentIsLoading,
                      bool aNewParentIsLoading, const ReadyState& aCurrentState,
                      ReadyState aNewState);
 
   // notify that a content node changed state.  This must happen under
   // a scriptblocker but NOT within a begin/end update.
-  void ContentStateChanged(nsIContent* aContent,
-                           mozilla::EventStates aStateMask);
+  void ContentStateChanged(nsIContent* aContent, EventStates aStateMask);
 
   // Notify that a document state has changed.
   // This should only be called by callers whose state is also reflected in the
   // implementation of Document::GetDocumentState.
-  void DocumentStatesChanged(mozilla::EventStates aStateMask);
+  void DocumentStatesChanged(EventStates aStateMask);
 
   // Observation hooks for style data to propagate notifications
   // to document observers
-  void StyleRuleChanged(mozilla::StyleSheet* aStyleSheet,
-                        mozilla::css::Rule* aStyleRule);
-  void StyleRuleAdded(mozilla::StyleSheet* aStyleSheet,
-                      mozilla::css::Rule* aStyleRule);
-  void StyleRuleRemoved(mozilla::StyleSheet* aStyleSheet,
-                        mozilla::css::Rule* aStyleRule);
+  void StyleRuleChanged(StyleSheet* aStyleSheet, css::Rule* aStyleRule);
+  void StyleRuleAdded(StyleSheet* aStyleSheet, css::Rule* aStyleRule);
+  void StyleRuleRemoved(StyleSheet* aStyleSheet, css::Rule* aStyleRule);
 
   /**
    * Flush notifications for this document and its parent documents
    * (since those may affect the layout of this one).
    */
-  void FlushPendingNotifications(mozilla::FlushType aType);
+  void FlushPendingNotifications(FlushType aType);
 
   /**
    * Another variant of the above FlushPendingNotifications.  This function
    * takes a ChangesToFlush to specify whether throttled animations are flushed
    * or not.
    * If in doublt, use the above FlushPendingNotifications.
    */
-  void FlushPendingNotifications(mozilla::ChangesToFlush aFlush);
+  void FlushPendingNotifications(ChangesToFlush aFlush);
 
   /**
    * Calls FlushPendingNotifications on any external resources this document
    * has. If this document has no external resources or is an external resource
    * itself this does nothing. This should only be called with
    * aType >= FlushType::Style.
    */
-  void FlushExternalResources(mozilla::FlushType aType);
+  void FlushExternalResources(FlushType aType);
 
   // Triggers an update of <svg:use> element shadow trees.
   void UpdateSVGUseElementShadowTrees() {
     if (mSVGUseElementsNeedingShadowTreeUpdate.IsEmpty()) {
       return;
     }
     DoUpdateSVGUseElementShadowTrees();
   }
@@ -2316,64 +2299,62 @@ class Document : public nsINode,
    * PageTransitionEvent.webidl for a description of the |aPersisted|
    * parameter. If aDispatchStartTarget is null, the pageshow event is
    * dispatched on the ScriptGlobalObject for this document, otherwise it's
    * dispatched on aDispatchStartTarget. If |aOnlySystemGroup| is true, the
    * event is only dispatched to listeners in the system group.
    * Note: if aDispatchStartTarget isn't null, the showing state of the
    * document won't be altered.
    */
-  virtual void OnPageShow(bool aPersisted,
-                          mozilla::dom::EventTarget* aDispatchStartTarget,
+  virtual void OnPageShow(bool aPersisted, EventTarget* aDispatchStartTarget,
                           bool aOnlySystemGroup = false);
 
   /**
    * Notification that the page has been hidden, for documents which are loaded
    * into a DOM window.  This corresponds to the unloading of the document, or
    * to the document's presentation being saved but removed from an existing
    * DOM window.  This notification fires applicable DOM events to the content
    * window.  See PageTransitionEvent.webidl for a description of the
    * |aPersisted| parameter. If aDispatchStartTarget is null, the pagehide
    * event is dispatched on the ScriptGlobalObject for this document,
    * otherwise it's dispatched on aDispatchStartTarget. If |aOnlySystemGroup| is
    * true, the event is only dispatched to listeners in the system group.
    * Note: if aDispatchStartTarget isn't null, the showing state of the
    * document won't be altered.
    */
-  void OnPageHide(bool aPersisted,
-                  mozilla::dom::EventTarget* aDispatchStartTarget,
+  void OnPageHide(bool aPersisted, EventTarget* aDispatchStartTarget,
                   bool aOnlySystemGroup = false);
 
   /*
    * We record the set of links in the document that are relevant to
    * style.
    */
   /**
    * Notification that an element is a link that is relevant to style.
    */
-  void AddStyleRelevantLink(mozilla::dom::Link* aLink) {
+  void AddStyleRelevantLink(Link* aLink) {
     NS_ASSERTION(aLink, "Passing in a null link.  Expect crashes RSN!");
 #ifdef DEBUG
-    nsPtrHashKey<mozilla::dom::Link>* entry = mStyledLinks.GetEntry(aLink);
+    nsPtrHashKey<Link>* entry = mStyledLinks.GetEntry(aLink);
     NS_ASSERTION(!entry, "Document already knows about this Link!");
     mStyledLinksCleared = false;
 #endif
     mStyledLinks.PutEntry(aLink);
   }
 
   /**
    * Notification that an element is a link and its URI might have been
    * changed or the element removed. If the element is still a link relevant
    * to style, then someone must ensure that AddStyleRelevantLink is
    * (eventually) called on it again.
    */
-  void ForgetLink(mozilla::dom::Link* aLink) {
+  void ForgetLink(Link* aLink) {
     NS_ASSERTION(aLink, "Passing in a null link.  Expect crashes RSN!");
 #ifdef DEBUG
-    nsPtrHashKey<mozilla::dom::Link>* entry = mStyledLinks.GetEntry(aLink);
+    nsPtrHashKey<Link>* entry = mStyledLinks.GetEntry(aLink);
     NS_ASSERTION(entry || mStyledLinksCleared,
                  "Document knows nothing about this Link!");
 #endif
     mStyledLinks.RemoveEntry(aLink);
   }
 
   // Refreshes the hrefs of all the links in the document.
   void RefreshLinkHrefs();
@@ -2384,29 +2365,27 @@ class Document : public nsINode,
    * @param aElement canonical nsIContent pointer of the box object's element
    */
   void ClearBoxObjectFor(nsIContent* aContent);
 
   /**
    * Get the box object for an element. This is not exposed through a
    * scriptable interface except for XUL documents.
    */
-  already_AddRefed<mozilla::dom::BoxObject> GetBoxObjectFor(
-      mozilla::dom::Element* aElement, mozilla::ErrorResult& aRv);
+  already_AddRefed<BoxObject> GetBoxObjectFor(Element* aElement,
+                                              ErrorResult& aRv);
 
   /**
    * Support for window.matchMedia()
    */
 
-  already_AddRefed<mozilla::dom::MediaQueryList> MatchMedia(
-      const nsAString& aMediaQueryList, mozilla::dom::CallerType aCallerType);
-
-  mozilla::LinkedList<mozilla::dom::MediaQueryList>& MediaQueryLists() {
-    return mDOMMediaQueryLists;
-  }
+  already_AddRefed<MediaQueryList> MatchMedia(const nsAString& aMediaQueryList,
+                                              CallerType aCallerType);
+
+  LinkedList<MediaQueryList>& MediaQueryLists() { return mDOMMediaQueryLists; }
 
   /**
    * Get the compatibility mode for this document
    */
   nsCompatibility GetCompatibilityMode() const { return mCompatMode; }
 
   /**
    * Check whether we've ever fired a DOMTitleChanged event for this
@@ -2571,17 +2550,17 @@ class Document : public nsINode,
 
   /**
    * Enumerate the external resource documents associated with this document.
    * The enumerator callback should return true to continue enumerating, or
    * false to stop.  This callback will never get passed a null aDocument.
    */
   void EnumerateExternalResources(SubDocEnumFunc aCallback, void* aData);
 
-  mozilla::dom::ExternalResourceMap& ExternalResourceMap() {
+  dom::ExternalResourceMap& ExternalResourceMap() {
     return mExternalResourceMap;
   }
 
   /**
    * Return whether the document is currently showing (in the sense of
    * OnPageShow() having been called already and OnPageHide() not having been
    * called yet.
    */
@@ -2651,30 +2630,30 @@ class Document : public nsINode,
   // will have a non-null return value.
   bool HasAnimationController() { return !!mAnimationController; }
 
   // Getter for this document's SMIL Animation Controller. Performs lazy
   // initialization, if this document supports animation and if
   // mAnimationController isn't yet initialized.
   //
   // If HasAnimationController is true, this is guaranteed to return non-null.
-  mozilla::SMILAnimationController* GetAnimationController();
+  SMILAnimationController* GetAnimationController();
 
   // Gets the tracker for animations that are waiting to start.
   // Returns nullptr if there is no pending animation tracker for this document
   // which will be the case if there have never been any CSS animations or
   // transitions on elements in the document.
-  mozilla::PendingAnimationTracker* GetPendingAnimationTracker() {
+  PendingAnimationTracker* GetPendingAnimationTracker() {
     return mPendingAnimationTracker;
   }
 
   // Gets the tracker for animations that are waiting to start and
   // creates it if it doesn't already exist. As a result, the return value
   // will never be nullptr.
-  mozilla::PendingAnimationTracker* GetOrCreatePendingAnimationTracker();
+  PendingAnimationTracker* GetOrCreatePendingAnimationTracker();
 
   /**
    * Prevents user initiated events from being dispatched to the document and
    * subdocuments.
    */
   void SuppressEventHandling(uint32_t aIncrease = 1);
 
   /**
@@ -2697,17 +2676,17 @@ class Document : public nsINode,
   }
 
   /**
    * Note a ChannelEventQueue which has been suspended on the document's behalf
    * to prevent XHRs from running content scripts while event handling is
    * suppressed. The document is responsible for resuming the queue after
    * event handling is unsuppressed.
    */
-  void AddSuspendedChannelEventQueue(mozilla::net::ChannelEventQueue* aQueue);
+  void AddSuspendedChannelEventQueue(net::ChannelEventQueue* aQueue);
 
   void SetHasDelayedRefreshEvent() { mHasDelayedRefreshEvent = true; }
 
   /**
    * Flag whether we're about to fire the window's load event for this document.
    */
   void SetLoadEventFiring(bool aFiring) { mLoadEventFiring = aFiring; }
 
@@ -2855,45 +2834,45 @@ class Document : public nsINode,
    */
   void ForgetImagePreload(nsIURI* aURI);
 
   /**
    * Called by nsParser to preload style sheets.  Can also be merged into the
    * parser if and when the parser is merged with libgklayout.  aCrossOriginAttr
    * should be a void string if the attr is not present.
    */
-  void PreloadStyle(nsIURI* aURI, const mozilla::Encoding* aEncoding,
+  void PreloadStyle(nsIURI* aURI, const Encoding* aEncoding,
                     const nsAString& aCrossOriginAttr,
                     ReferrerPolicyEnum aReferrerPolicy,
                     const nsAString& aIntegrity);
 
   /**
    * Called by the chrome registry to load style sheets.  Can be put
    * back there if and when when that module is merged with libgklayout.
    *
    * This always does a synchronous load.  If aIsAgentSheet is true,
    * it also uses the system principal and enables unsafe rules.
    * DO NOT USE FOR UNTRUSTED CONTENT.
    */
   nsresult LoadChromeSheetSync(nsIURI* aURI, bool aIsAgentSheet,
-                               RefPtr<mozilla::StyleSheet>* aSheet);
+                               RefPtr<StyleSheet>* aSheet);
 
   /**
    * Returns true if the locale used for the document specifies a direction of
    * right to left. For chrome documents, this comes from the chrome registry.
    * This is used to determine the current state for the :-moz-locale-dir
    * pseudoclass so once can know whether a document is expected to be rendered
    * left-to-right or right-to-left.
    */
   virtual bool IsDocumentRightToLeft() { return false; }
 
   /**
    * Called by Parser for link rel=preconnect
    */
-  void MaybePreconnect(nsIURI* uri, mozilla::CORSMode aCORSMode);
+  void MaybePreconnect(nsIURI* uri, CORSMode aCORSMode);
 
   enum DocumentTheme {
     Doc_Theme_Uninitialized,  // not determined yet
     Doc_Theme_None,
     Doc_Theme_Neutral,
     Doc_Theme_Dark,
     Doc_Theme_Bright
   };
@@ -2926,17 +2905,17 @@ class Document : public nsINode,
     return MediaDocumentKind::NotMedia;
   }
 
   /**
    * Returns the document state.
    * Document state bits have the form NS_DOCUMENT_STATE_* and are declared in
    * Document.h.
    */
-  mozilla::EventStates GetDocumentState() const { return mDocumentState; }
+  EventStates GetDocumentState() const { return mDocumentState; }
 
   nsISupports* GetCurrentContentSink();
 
   void SetAutoFocusElement(Element* aAutoFocusElement);
   void TriggerAutoFocus();
 
   void SetScrollToRef(nsIURI* aDocumentURI);
   void ScrollToRef();
@@ -2947,17 +2926,17 @@ class Document : public nsINode,
   }
 
   using DocumentOrShadowRoot::GetElementById;
   using DocumentOrShadowRoot::GetElementsByClassName;
   using DocumentOrShadowRoot::GetElementsByTagName;
   using DocumentOrShadowRoot::GetElementsByTagNameNS;
 
   DocumentTimeline* Timeline();
-  mozilla::LinkedList<DocumentTimeline>& Timelines() { return mTimelines; }
+  LinkedList<DocumentTimeline>& Timelines() { return mTimelines; }
 
   void GetAnimations(nsTArray<RefPtr<Animation>>& aAnimations);
 
   SVGSVGElement* GetSVGRootElement() const;
 
   nsresult ScheduleFrameRequestCallback(FrameRequestCallback& aCallback,
                                         int32_t* aHandle);
   void CancelFrameRequestCallback(int32_t aHandle);
@@ -2974,17 +2953,17 @@ class Document : public nsINode,
    * throttled. We throttle requestAnimationFrame for documents which aren't
    * visible (e.g. scrolled out of the viewport).
    */
   bool ShouldThrottleFrameRequests();
 
   // This returns true when the document tree is being teared down.
   bool InUnlinkOrDeletion() { return mInUnlinkOrDeletion; }
 
-  mozilla::dom::ImageTracker* ImageTracker();
+  dom::ImageTracker* ImageTracker();
 
   // AddPlugin adds a plugin-related element to mPlugins when the element is
   // added to the tree.
   void AddPlugin(nsIObjectLoadingContent* aPlugin) {
     MOZ_ASSERT(aPlugin);
     mPlugins.PutEntry(aPlugin);
   }
 
@@ -3142,18 +3121,18 @@ class Document : public nsINode,
    * Creates a new element in the HTML namespace with a local name given by
    * aTag.
    */
   already_AddRefed<Element> CreateHTMLElement(nsAtom* aTag);
 
   // WebIDL API
   nsIGlobalObject* GetParentObject() const { return GetScopeObject(); }
   static already_AddRefed<Document> Constructor(const GlobalObject& aGlobal,
-                                                mozilla::ErrorResult& rv);
-  DOMImplementation* GetImplementation(mozilla::ErrorResult& rv);
+                                                ErrorResult& rv);
+  DOMImplementation* GetImplementation(ErrorResult& rv);
   MOZ_MUST_USE nsresult GetURL(nsString& retval) const;
   MOZ_MUST_USE nsresult GetDocumentURI(nsString& retval) const;
   // Return the URI for the document.
   // The returned value may differ if the document is loaded via XHR, and
   // when accessed from chrome privileged script and
   // from content privileged script for compatibility.
   void GetDocumentURIFromJS(nsString& aDocumentURI, CallerType aCallerType,
                             ErrorResult& aRv) const;
@@ -3186,68 +3165,67 @@ class Document : public nsINode,
   already_AddRefed<Element> CreateXULElement(
       const nsAString& aTagName, const ElementCreationOptionsOrString& aOptions,
       ErrorResult& aRv);
   already_AddRefed<DocumentFragment> CreateDocumentFragment() const;
   already_AddRefed<nsTextNode> CreateTextNode(const nsAString& aData) const;
   already_AddRefed<nsTextNode> CreateEmptyTextNode() const;
   already_AddRefed<Comment> CreateComment(const nsAString& aData) const;
   already_AddRefed<ProcessingInstruction> CreateProcessingInstruction(
-      const nsAString& target, const nsAString& data,
-      mozilla::ErrorResult& rv) const;
+      const nsAString& target, const nsAString& data, ErrorResult& rv) const;
   already_AddRefed<nsINode> ImportNode(nsINode& aNode, bool aDeep,
-                                       mozilla::ErrorResult& rv) const;
-  nsINode* AdoptNode(nsINode& aNode, mozilla::ErrorResult& rv);
+                                       ErrorResult& rv) const;
+  nsINode* AdoptNode(nsINode& aNode, ErrorResult& rv);
   already_AddRefed<Event> CreateEvent(const nsAString& aEventType,
                                       CallerType aCallerType,
-                                      mozilla::ErrorResult& rv) const;
-  already_AddRefed<nsRange> CreateRange(mozilla::ErrorResult& rv);
-  already_AddRefed<NodeIterator> CreateNodeIterator(
-      nsINode& aRoot, uint32_t aWhatToShow, NodeFilter* aFilter,
-      mozilla::ErrorResult& rv) const;
+                                      ErrorResult& rv) const;
+  already_AddRefed<nsRange> CreateRange(ErrorResult& rv);
+  already_AddRefed<NodeIterator> CreateNodeIterator(nsINode& aRoot,
+                                                    uint32_t aWhatToShow,
+                                                    NodeFilter* aFilter,
+                                                    ErrorResult& rv) const;
   already_AddRefed<TreeWalker> CreateTreeWalker(nsINode& aRoot,
                                                 uint32_t aWhatToShow,
                                                 NodeFilter* aFilter,
-                                                mozilla::ErrorResult& rv) const;
+                                                ErrorResult& rv) const;
   // Deprecated WebIDL bits
   already_AddRefed<CDATASection> CreateCDATASection(const nsAString& aData,
-                                                    mozilla::ErrorResult& rv);
+                                                    ErrorResult& rv);
   already_AddRefed<Attr> CreateAttribute(const nsAString& aName,
-                                         mozilla::ErrorResult& rv);
+                                         ErrorResult& rv);
   already_AddRefed<Attr> CreateAttributeNS(const nsAString& aNamespaceURI,
                                            const nsAString& aQualifiedName,
-                                           mozilla::ErrorResult& rv);
+                                           ErrorResult& rv);
   void GetInputEncoding(nsAString& aInputEncoding) const;
   already_AddRefed<Location> GetLocation() const;
   void GetReferrer(nsAString& aReferrer) const;
   void GetLastModified(nsAString& aLastModified) const;
   void GetReadyState(nsAString& aReadyState) const;
 
   void GetTitle(nsAString& aTitle);
-  void SetTitle(const nsAString& aTitle, mozilla::ErrorResult& rv);
+  void SetTitle(const nsAString& aTitle, ErrorResult& rv);
   void GetDir(nsAString& aDirection) const;
   void SetDir(const nsAString& aDirection);
   nsIHTMLCollection* Images();
   nsIHTMLCollection* Embeds();
   nsIHTMLCollection* Plugins() { return Embeds(); }
   nsIHTMLCollection* Links();
   nsIHTMLCollection* Forms();
   nsIHTMLCollection* Scripts();
   already_AddRefed<nsContentList> GetElementsByName(const nsAString& aName) {
     return GetFuncStringContentList<nsCachableElementsByNameNodeList>(
         this, MatchNameAttribute, nullptr, UseExistingNameString, aName);
   }
-  mozilla::dom::Nullable<mozilla::dom::WindowProxyHolder> GetDefaultView()
-      const;
+  Nullable<WindowProxyHolder> GetDefaultView() const;
   Element* GetActiveElement();
-  bool HasFocus(mozilla::ErrorResult& rv) const;
+  bool HasFocus(ErrorResult& rv) const;
   nsIHTMLCollection* Applets();
   nsIHTMLCollection* Anchors();
-  mozilla::TimeStamp LastFocusTime() const;
-  void SetLastFocusTime(const mozilla::TimeStamp& aFocusTime);
+  TimeStamp LastFocusTime() const;
+  void SetLastFocusTime(const TimeStamp& aFocusTime);
   // Event handlers are all on nsINode already
   bool MozSyntheticDocument() const { return IsSyntheticDocument(); }
   Element* GetCurrentScript();
   void ReleaseCapture() const;
   void MozSetImageElement(const nsAString& aImageElementId, Element* aElement);
   nsIURI* GetDocumentURIObject() const;
   // Not const because all the fullscreen goop is not const
   bool FullscreenEnabled(CallerType aCallerType);
@@ -3266,19 +3244,17 @@ class Document : public nsINode,
                                                        JSObject* aObject);
   static bool AreWebAnimationsTimelinesEnabled(JSContext* aCx,
                                                JSObject* aObject);
   // Checks that the caller is either chrome or some addon.
   static bool IsCallerChromeOrAddon(JSContext* aCx, JSObject* aObject);
 
 #ifdef MOZILLA_INTERNAL_API
   bool Hidden() const { return mVisibilityState != VisibilityState::Visible; }
-  mozilla::dom::VisibilityState VisibilityState() const {
-    return mVisibilityState;
-  }
+  dom::VisibilityState VisibilityState() const { return mVisibilityState; }
 #endif
   void GetSelectedStyleSheetSet(nsAString& aSheetSet);
   void SetSelectedStyleSheetSet(const nsAString& aSheetSet);
   void GetLastStyleSheetSet(nsAString& aSheetSet) {
     aSheetSet = mLastStyleSheetSet;
   }
   const nsString& GetCurrentStyleSheetSet() const {
     return mLastStyleSheetSet.IsEmpty() ? mPreferredStyleSheetSet
@@ -3312,62 +3288,59 @@ class Document : public nsINode,
 
   // QuerySelector and QuerySelectorAll already defined on nsINode
   nsINodeList* GetAnonymousNodes(Element& aElement);
   Element* GetAnonymousElementByAttribute(Element& aElement,
                                           const nsAString& aAttrName,
                                           const nsAString& aAttrValue);
   Element* GetBindingParent(nsINode& aNode);
   void LoadBindingDocument(const nsAString& aURI,
-                           nsIPrincipal& aSubjectPrincipal,
-                           mozilla::ErrorResult& rv);
+                           nsIPrincipal& aSubjectPrincipal, ErrorResult& rv);
   XPathExpression* CreateExpression(const nsAString& aExpression,
                                     XPathNSResolver* aResolver,
-                                    mozilla::ErrorResult& rv);
+                                    ErrorResult& rv);
   nsINode* CreateNSResolver(nsINode& aNodeResolver);
   already_AddRefed<XPathResult> Evaluate(
       JSContext* aCx, const nsAString& aExpression, nsINode& aContextNode,
       XPathNSResolver* aResolver, uint16_t aType, JS::Handle<JSObject*> aResult,
-      mozilla::ErrorResult& rv);
+      ErrorResult& rv);
   // Touch event handlers already on nsINode
-  already_AddRefed<Touch> CreateTouch(
-      nsGlobalWindowInner* aView, mozilla::dom::EventTarget* aTarget,
-      int32_t aIdentifier, int32_t aPageX, int32_t aPageY, int32_t aScreenX,
-      int32_t aScreenY, int32_t aClientX, int32_t aClientY, int32_t aRadiusX,
-      int32_t aRadiusY, float aRotationAngle, float aForce);
-  already_AddRefed<mozilla::dom::TouchList> CreateTouchList();
-  already_AddRefed<mozilla::dom::TouchList> CreateTouchList(
-      mozilla::dom::Touch& aTouch,
-      const mozilla::dom::Sequence<mozilla::OwningNonNull<mozilla::dom::Touch>>&
-          aTouches);
-  already_AddRefed<mozilla::dom::TouchList> CreateTouchList(
-      const mozilla::dom::Sequence<mozilla::OwningNonNull<mozilla::dom::Touch>>&
-          aTouches);
+  already_AddRefed<Touch> CreateTouch(nsGlobalWindowInner* aView,
+                                      EventTarget* aTarget, int32_t aIdentifier,
+                                      int32_t aPageX, int32_t aPageY,
+                                      int32_t aScreenX, int32_t aScreenY,
+                                      int32_t aClientX, int32_t aClientY,
+                                      int32_t aRadiusX, int32_t aRadiusY,
+                                      float aRotationAngle, float aForce);
+  already_AddRefed<TouchList> CreateTouchList();
+  already_AddRefed<TouchList> CreateTouchList(
+      Touch& aTouch, const Sequence<OwningNonNull<Touch>>& aTouches);
+  already_AddRefed<TouchList> CreateTouchList(
+      const Sequence<OwningNonNull<Touch>>& aTouches);
 
   void SetStyleSheetChangeEventsEnabled(bool aValue) {
     mStyleSheetChangeEventsEnabled = aValue;
   }
 
   bool StyleSheetChangeEventsEnabled() const {
     return mStyleSheetChangeEventsEnabled;
   }
 
-  already_AddRefed<mozilla::dom::Promise> BlockParsing(
-      mozilla::dom::Promise& aPromise,
-      const mozilla::dom::BlockParsingOptions& aOptions,
-      mozilla::ErrorResult& aRv);
+  already_AddRefed<Promise> BlockParsing(Promise& aPromise,
+                                         const BlockParsingOptions& aOptions,
+                                         ErrorResult& aRv);
 
   already_AddRefed<nsIURI> GetMozDocumentURIIfNotForErrorPages();
 
-  mozilla::dom::Promise* GetDocumentReadyForIdle(mozilla::ErrorResult& aRv);
+  Promise* GetDocumentReadyForIdle(ErrorResult& aRv);
 
   nsIDOMXULCommandDispatcher* GetCommandDispatcher();
   bool HasXULBroadcastManager() const { return mXULBroadcastManager; };
   void InitializeXULBroadcastManager();
-  mozilla::dom::XULBroadcastManager* GetXULBroadcastManager() const {
+  XULBroadcastManager* GetXULBroadcastManager() const {
     return mXULBroadcastManager;
   }
   already_AddRefed<nsINode> GetPopupNode();
   void SetPopupNode(nsINode* aNode);
   nsINode* GetPopupRangeParent(ErrorResult& aRv);
   int32_t GetPopupRangeOffset(ErrorResult& aRv);
   already_AddRefed<nsINode> GetTooltipNode();
   void SetTooltipNode(nsINode* aNode) { /* do nothing */
@@ -3382,23 +3355,23 @@ class Document : public nsINode,
    * Defined inline in nsHTMLDocument.h
    */
   inline nsHTMLDocument* AsHTMLDocument();
 
   /**
    * Asserts IsSVGDocument, and can't return null.
    * Defined inline in SVGDocument.h
    */
-  inline mozilla::dom::SVGDocument* AsSVGDocument();
+  inline SVGDocument* AsSVGDocument();
 
   /**
    * Asserts IsXULDocument, and can't return null.
    * Defined inline in XULDocument.h
    */
-  inline mozilla::dom::XULDocument* AsXULDocument();
+  inline XULDocument* AsXULDocument();
 
   /*
    * Given a node, get a weak reference to it and append that reference to
    * mBlockedNodesByClassifier. Can be used later on to look up a node in it.
    * (e.g., by the UI)
    */
   void AddBlockedNodeByClassifier(nsINode* node) {
     if (!node) {
@@ -3410,20 +3383,20 @@ class Document : public nsINode,
     if (weakNode) {
       mBlockedNodesByClassifier.AppendElement(weakNode);
     }
   }
 
   gfxUserFontSet* GetUserFontSet();
   void FlushUserFontSet();
   void MarkUserFontSetDirty();
-  mozilla::dom::FontFaceSet* GetFonts() { return mFontFaceSet; }
+  FontFaceSet* GetFonts() { return mFontFaceSet; }
 
   // FontFaceSource
-  mozilla::dom::FontFaceSet* Fonts();
+  FontFaceSet* Fonts();
 
   bool DidFireDOMContentLoaded() const { return mDidFireDOMContentLoaded; }
 
   bool IsSynthesized();
 
   enum class UseCounterReportKind {
     // Flush the document's use counters only; the use counters for any
     // external resource documents will be flushed when the external
@@ -3434,44 +3407,44 @@ class Document : public nsINode,
     // documents. (Should only be necessary for tests, where we need
     // flushing to happen synchronously and deterministically.)
     eIncludeExternalResources,
   };
 
   void ReportUseCounters(
       UseCounterReportKind aKind = UseCounterReportKind::eDefault);
 
-  void SetDocumentUseCounter(mozilla::UseCounter aUseCounter) {
+  void SetDocumentUseCounter(UseCounter aUseCounter) {
     if (!mUseCounters[aUseCounter]) {
       mUseCounters[aUseCounter] = true;
     }
   }
 
   const StyleUseCounters* GetStyleUseCounters() {
     return mStyleUseCounters.get();
   }
 
-  void SetPageUseCounter(mozilla::UseCounter aUseCounter);
-
-  void SetDocumentAndPageUseCounter(mozilla::UseCounter aUseCounter) {
+  void SetPageUseCounter(UseCounter aUseCounter);
+
+  void SetDocumentAndPageUseCounter(UseCounter aUseCounter) {
     SetDocumentUseCounter(aUseCounter);
     SetPageUseCounter(aUseCounter);
   }
 
   void PropagateUseCounters(Document* aParentDocument);
 
   // Called to track whether this document has had any interaction.
   // This is used to track whether we should permit "beforeunload".
   void SetUserHasInteracted();
   bool UserHasInteracted() { return mUserHasInteracted; }
   void ResetUserInteractionTimer();
 
   // This method would return current autoplay policy, it would be "allowed"
   // , "allowed-muted" or "disallowed".
-  mozilla::dom::DocumentAutoplayPolicy AutoplayPolicy() const;
+  DocumentAutoplayPolicy AutoplayPolicy() const;
 
   // This should be called when this document receives events which are likely
   // to be user interaction with the document, rather than the byproduct of
   // interaction with the browser (i.e. a keypress to scroll the view port,
   // keyboard shortcuts, etc). This is used to decide whether we should
   // permit autoplay audible media. This also gesture activates all other
   // content documents in this tab.
   void NotifyUserGestureActivation();
@@ -3491,71 +3464,69 @@ class Document : public nsINode,
 
   bool HasScriptsBlockedBySandbox();
 
   bool InlineScriptAllowedByCSP();
 
   void ReportHasScrollLinkedEffect();
   bool HasScrollLinkedEffect() const { return mHasScrollLinkedEffect; }
 
-  mozilla::dom::DocGroup* GetDocGroup() const;
-
-  void AddIntersectionObserver(
-      mozilla::dom::DOMIntersectionObserver* aObserver) {
+  DocGroup* GetDocGroup() const;
+
+  void AddIntersectionObserver(DOMIntersectionObserver* aObserver) {
     MOZ_ASSERT(!mIntersectionObservers.Contains(aObserver),
                "Intersection observer already in the list");
     mIntersectionObservers.PutEntry(aObserver);
   }
 
-  void RemoveIntersectionObserver(
-      mozilla::dom::DOMIntersectionObserver* aObserver) {
+  void RemoveIntersectionObserver(DOMIntersectionObserver* aObserver) {
     mIntersectionObservers.RemoveEntry(aObserver);
   }
 
   bool HasIntersectionObservers() const {
     return !mIntersectionObservers.IsEmpty();
   }
 
   void UpdateIntersectionObservations();
   void ScheduleIntersectionObserverNotification();
   void NotifyIntersectionObservers();
 
   // Dispatch a runnable related to the document.
-  nsresult Dispatch(mozilla::TaskCategory aCategory,
+  nsresult Dispatch(TaskCategory aCategory,
                     already_AddRefed<nsIRunnable>&& aRunnable) final;
 
   virtual nsISerialEventTarget* EventTargetFor(
-      mozilla::TaskCategory aCategory) const override;
-
-  virtual mozilla::AbstractThread* AbstractMainThreadFor(
-      mozilla::TaskCategory aCategory) override;
+      TaskCategory aCategory) const override;
+
+  virtual AbstractThread* AbstractMainThreadFor(
+      TaskCategory aCategory) override;
 
   // The URLs passed to these functions should match what
   // JS::DescribeScriptedCaller() returns, since these APIs are used to
   // determine whether some code is being called from a tracking script.
   void NoteScriptTrackingStatus(const nsACString& aURL, bool isTracking);
   bool IsScriptTracking(const nsACString& aURL) const;
 
   // For more information on Flash classification, see
   // toolkit/components/url-classifier/flash-block-lists.rst
-  mozilla::dom::FlashClassification DocumentFlashClassification();
+  FlashClassification DocumentFlashClassification();
 
   /**
    * Localization
    *
    * For more information on DocumentL10n see
    * intl/l10n/docs/fluent_tutorial.rst
    */
 
  public:
   /**
    * This is a public method exposed on Document WebIDL
    * to chrome only documents.
    */
-  mozilla::dom::DocumentL10n* GetL10n();
+  DocumentL10n* GetL10n();
 
   /**
    * This method should be called when the container
    * of l10n resources parsing is completed.
    *
    * It triggers initial async fetch of the resources
    * as early as possible.
    *
@@ -3598,26 +3569,26 @@ class Document : public nsINode,
    * It unblocks the layout.
    *
    * This method is virtual so that XULDocument can
    * override it.
    */
   virtual void InitialDocumentTranslationCompleted();
 
  protected:
-  RefPtr<mozilla::dom::DocumentL10n> mDocumentL10n;
+  RefPtr<DocumentL10n> mDocumentL10n;
 
  private:
   void InitializeLocalization(nsTArray<nsString>& aResourceIds);
 
   void ParseWidthAndHeightInMetaViewport(const nsAString& aWidthString,
                                          const nsAString& aHeightString,
                                          const nsAString& aScaleString);
 
-  mozilla::dom::FlashClassification DocumentFlashClassificationInternal();
+  FlashClassification DocumentFlashClassificationInternal();
 
   nsTArray<nsString> mL10nResources;
 
   // The application cache that this document is associated with, if
   // any.  This can change during the lifetime of the document.
   nsCOMPtr<nsIApplicationCache> mApplicationCache;
 
  public:
@@ -3698,17 +3669,17 @@ class Document : public nsINode,
   }
 
   bool AllowPaymentRequest() const { return mAllowPaymentRequest; }
 
   void SetAllowPaymentRequest(bool aAllowPaymentRequest) {
     mAllowPaymentRequest = aAllowPaymentRequest;
   }
 
-  mozilla::dom::FeaturePolicy* Policy() const;
+  FeaturePolicy* Policy() const;
 
   bool ModuleScriptsEnabled();
 
   /**
    * Find the (non-anonymous) content in this document for aFrame. It will
    * be aFrame's content node if that content is in this document and not
    * anonymous. Otherwise, when aFrame is in a subdocument, we use the frame
    * element containing the subdocument containing aFrame, and/or find the
@@ -3722,17 +3693,17 @@ class Document : public nsINode,
   // When the doc is blocked permanantly, we would dispatch event to notify
   // front-end side to show blocking icon.
   void MaybeNotifyAutoplayBlocked();
 
   // Sets flags for media autoplay telemetry.
   void SetDocTreeHadAudibleMedia();
   void SetDocTreeHadPlayRevoked();
 
-  mozilla::dom::XPathEvaluator* XPathEvaluator();
+  dom::XPathEvaluator* XPathEvaluator();
 
   void MaybeInitializeFinalizeFrameLoaders();
 
   void SetDelayFrameLoaderInitialization(bool aDelayFrameLoaderInitialization) {
     mDelayFrameLoaderInitialization = aDelayFrameLoaderInitialization;
   }
 
   void SetPrototypeDocument(nsXULPrototypeDocument* aPrototype);
@@ -3764,54 +3735,52 @@ class Document : public nsINode,
 
   void RecordNavigationTiming(ReadyState aReadyState);
 
   // This method may fire a DOM event; if it does so it will happen
   // synchronously.
   void UpdateVisibilityState();
 
   // Recomputes the visibility state but doesn't set the new value.
-  mozilla::dom::VisibilityState ComputeVisibilityState() const;
+  dom::VisibilityState ComputeVisibilityState() const;
 
   // Since we wouldn't automatically play media from non-visited page, we need
   // to notify window when the page was first visited.
   void MaybeActiveMediaComponents();
 
   // Apply the fullscreen state to the document, and trigger related
   // events. It returns false if the fullscreen element ready check
   // fails and nothing gets changed.
   bool ApplyFullscreen(UniquePtr<FullscreenRequest>);
 
-  bool GetUseCounter(mozilla::UseCounter aUseCounter) {
+  bool GetUseCounter(UseCounter aUseCounter) {
     return mUseCounters[aUseCounter];
   }
 
-  void SetChildDocumentUseCounter(mozilla::UseCounter aUseCounter) {
+  void SetChildDocumentUseCounter(UseCounter aUseCounter) {
     if (!mChildDocumentUseCounters[aUseCounter]) {
       mChildDocumentUseCounters[aUseCounter] = true;
     }
   }
 
-  bool GetChildDocumentUseCounter(mozilla::UseCounter aUseCounter) {
+  bool GetChildDocumentUseCounter(UseCounter aUseCounter) {
     return mChildDocumentUseCounters[aUseCounter];
   }
 
-  void UpdateDocumentStates(mozilla::EventStates);
+  void UpdateDocumentStates(EventStates);
 
   void RemoveDocStyleSheetsFromStyleSets();
   void RemoveStyleSheetsFromStyleSets(
-      const nsTArray<RefPtr<mozilla::StyleSheet>>& aSheets,
-      mozilla::SheetType aType);
+      const nsTArray<RefPtr<StyleSheet>>& aSheets, SheetType aType);
   void ResetStylesheetsToURI(nsIURI* aURI);
-  void FillStyleSet(mozilla::ServoStyleSet* aStyleSet);
-  void AddStyleSheetToStyleSets(mozilla::StyleSheet* aSheet);
-  void RemoveStyleSheetFromStyleSets(mozilla::StyleSheet* aSheet);
-  void NotifyStyleSheetAdded(mozilla::StyleSheet* aSheet, bool aDocumentSheet);
-  void NotifyStyleSheetRemoved(mozilla::StyleSheet* aSheet,
-                               bool aDocumentSheet);
+  void FillStyleSet(ServoStyleSet* aStyleSet);
+  void AddStyleSheetToStyleSets(StyleSheet* aSheet);
+  void RemoveStyleSheetFromStyleSets(StyleSheet* aSheet);
+  void NotifyStyleSheetAdded(StyleSheet* aSheet, bool aDocumentSheet);
+  void NotifyStyleSheetRemoved(StyleSheet* aSheet, bool aDocumentSheet);
   void NotifyStyleSheetApplicableStateChanged();
   // Just like EnableStyleSheetsForSet, but doesn't check whether
   // aSheetSet is null and allows the caller to control whether to set
   // aSheetSet as the preferred set in the CSSLoader.
   void EnableStyleSheetsForSetInternal(const nsAString& aSheetSet,
                                        bool aUpdateCSSLoader);
 
  private:
@@ -3868,29 +3837,28 @@ class Document : public nsINode,
   // schedule or unschedule them, if necessary, and update
   // mFrameRequestCallbacksScheduled.  aOldShell should only be passed when
   // mPresShell is becoming null; in that case it will be used to get hold of
   // the relevant refresh driver.
   void UpdateFrameRequestCallbackSchedulingState(
       nsIPresShell* aOldShell = nullptr);
 
   // Helper for GetScrollingElement/IsScrollingElement.
-  bool IsPotentiallyScrollable(mozilla::dom::HTMLBodyElement* aBody);
+  bool IsPotentiallyScrollable(HTMLBodyElement* aBody);
 
   // Return the same type parent docuement if exists, or return null.
   Document* GetSameTypeParentDocument();
 
   void MaybeAllowStorageForOpenerAfterUserInteraction();
 
   void MaybeStoreUserInteractionAsPermission();
 
   // Helpers for GetElementsByName.
-  static bool MatchNameAttribute(mozilla::dom::Element* aElement,
-                                 int32_t aNamespaceID, nsAtom* aAtom,
-                                 void* aData);
+  static bool MatchNameAttribute(Element* aElement, int32_t aNamespaceID,
+                                 nsAtom* aAtom, void* aData);
   static void* UseExistingNameString(nsINode* aRootNode, const nsString* aName);
 
   void MaybeResolveReadyForIdle();
 
   nsCString mReferrer;
   nsString mLastModified;
 
   nsCOMPtr<nsIURI> mDocumentURI;
@@ -3898,92 +3866,90 @@ class Document : public nsINode,
   nsCOMPtr<nsIURI> mChromeXHRDocURI;
   nsCOMPtr<nsIURI> mDocumentBaseURI;
   nsCOMPtr<nsIURI> mChromeXHRDocBaseURI;
 
   // The base domain of the document for third-party checks.
   nsCString mBaseDomain;
 
   // A lazily-constructed URL data for style system to resolve URL value.
-  RefPtr<mozilla::URLExtraData> mCachedURLData;
+  RefPtr<URLExtraData> mCachedURLData;
 
   nsWeakPtr mDocumentLoadGroup;
 
   bool mReferrerPolicySet;
   ReferrerPolicyEnum mReferrerPolicy;
 
   bool mBlockAllMixedContent;
   bool mBlockAllMixedContentPreloads;
   bool mUpgradeInsecureRequests;
   bool mUpgradeInsecurePreloads;
 
-  mozilla::WeakPtr<nsDocShell> mDocumentContainer;
+  WeakPtr<nsDocShell> mDocumentContainer;
 
   NotNull<const Encoding*> mCharacterSet;
   int32_t mCharacterSetSource;
 
   // This is just a weak pointer; the parent document owns its children.
   Document* mParentDocument;
 
   // A reference to the element last returned from GetRootElement().
-  mozilla::dom::Element* mCachedRootElement;
+  Element* mCachedRootElement;
 
   // This is a weak reference, but we hold a strong reference to mNodeInfo,
   // which in turn holds a strong reference to this mNodeInfoManager.
   nsNodeInfoManager* mNodeInfoManager;
-  RefPtr<mozilla::css::Loader> mCSSLoader;
-  RefPtr<mozilla::css::ImageLoader> mStyleImageLoader;
+  RefPtr<css::Loader> mCSSLoader;
+  RefPtr<css::ImageLoader> mStyleImageLoader;
   RefPtr<nsHTMLStyleSheet> mAttrStyleSheet;
   RefPtr<nsHTMLCSSStyleSheet> mStyleAttrStyleSheet;
 
   // Tracking for images in the document.
-  RefPtr<mozilla::dom::ImageTracker> mImageTracker;
+  RefPtr<dom::ImageTracker> mImageTracker;
 
   // A hashtable of ShadowRoots belonging to the composed doc.
   //
   // See ShadowRoot::Bind and ShadowRoot::Unbind.
   ShadowRootSet mComposedShadowRoots;
 
-  using SVGUseElementSet =
-      nsTHashtable<nsPtrHashKey<mozilla::dom::SVGUseElement>>;
+  using SVGUseElementSet = nsTHashtable<nsPtrHashKey<SVGUseElement>>;
 
   // The set of <svg:use> elements that need a shadow tree reclone because the
   // tree they map to has changed.
   SVGUseElementSet mSVGUseElementsNeedingShadowTreeUpdate;
 
   // The set of all object, embed, video/audio elements or
-  // nsIObjectLoadingContent or mozilla::dom::DocumentActivity for which this is
+  // nsIObjectLoadingContent or DocumentActivity for which this is
   // the owner document. (They might not be in the document.)
   //
   // These are non-owning pointers, the elements are responsible for removing
   // themselves when they go away.
   nsAutoPtr<nsTHashtable<nsPtrHashKey<nsISupports>>> mActivityObservers;
 
   // A hashtable of styled links keyed by address pointer.
-  nsTHashtable<nsPtrHashKey<mozilla::dom::Link>> mStyledLinks;
+  nsTHashtable<nsPtrHashKey<Link>> mStyledLinks;
 #ifdef DEBUG
   // Indicates whether mStyledLinks was cleared or not.  This is used to track
   // state so we can provide useful assertions to consumers of ForgetLink and
   // AddStyleRelevantLink.
   bool mStyledLinksCleared;
 #endif
 
   // The array of all links that need their status resolved.  Links must add
   // themselves to this set by calling RegisterPendingLinkUpdate when added to a
   // document.
   static const size_t kSegmentSize = 128;
 
-  typedef mozilla::SegmentedVector<nsCOMPtr<mozilla::dom::Link>, kSegmentSize,
-                                   InfallibleAllocPolicy>
+  typedef SegmentedVector<nsCOMPtr<Link>, kSegmentSize, InfallibleAllocPolicy>
       LinksToUpdateList;
 
   LinksToUpdateList mLinksToUpdate;
 
   // SMIL Animation Controller, lazily-initialized in GetAnimationController
-  RefPtr<mozilla::SMILAnimationController> mAnimationController;
+  RefPtr<SMILAnimationController> mAnimationController;
 
   // Table of element properties for this document.
   nsPropertyTable mPropertyTable;
 
   // Our cached .children collection
   nsCOMPtr<nsIHTMLCollection> mChildrenCollection;
 
   // Various DOM lists
@@ -3991,27 +3957,27 @@ class Document : public nsINode,
   RefPtr<nsContentList> mEmbeds;
   RefPtr<nsContentList> mLinks;
   RefPtr<nsContentList> mForms;
   RefPtr<nsContentList> mScripts;
   nsCOMPtr<nsIHTMLCollection> mApplets;
   RefPtr<nsContentList> mAnchors;
 
   // container for per-context fonts (downloadable, SVG, etc.)
-  RefPtr<mozilla::dom::FontFaceSet> mFontFaceSet;
+  RefPtr<FontFaceSet> mFontFaceSet;
 
   // Last time this document or a one of its sub-documents was focused.  If
   // focus has never occurred then mLastFocusTime.IsNull() will be true.
-  mozilla::TimeStamp mLastFocusTime;
-
-  mozilla::EventStates mDocumentState;
-
-  RefPtr<mozilla::dom::Promise> mReadyForIdle;
-
-  RefPtr<mozilla::dom::FeaturePolicy> mFeaturePolicy;
+  TimeStamp mLastFocusTime;
+
+  EventStates mDocumentState;
+
+  RefPtr<Promise> mReadyForIdle;
+
+  RefPtr<FeaturePolicy> mFeaturePolicy;
 
   // True if BIDI is enabled.
   bool mBidiEnabled : 1;
   // True if mLangGroupFontPrefs is not initialized or dirty in some other way.
   bool mFontGroupCacheDirty : 1;
   // True if a MathML element has ever been owned by this document.
   bool mMathMLEnabled : 1;
 
@@ -4281,24 +4247,18 @@ class Document : public nsINode,
   nsCompatibility mCompatMode;
 
   // Our readyState
   ReadyState mReadyState;
 
   // Ancestor's loading state
   bool mAncestorIsLoading;
 
-#ifdef MOZILLA_INTERNAL_API
   // Our visibility state
-  mozilla::dom::VisibilityState mVisibilityState;
-  static_assert(sizeof(mozilla::dom::VisibilityState) == sizeof(uint8_t),
-                "Error size of mVisibilityState and mDummy");
-#else
-  uint8_t mDummy;
-#endif
+  dom::VisibilityState mVisibilityState;
 
   enum Type {
     eUnknown,  // should never be used
     eHTML,
     eXHTML,
     eGenericXML,
     eSVG,
     eXUL
@@ -4385,17 +4345,17 @@ class Document : public nsINode,
   // point to our "display document": the one that all resource lookups should
   // go to.
   RefPtr<Document> mDisplayDocument;
 
   uint32_t mEventsSuppressed;
 
   // Any XHR ChannelEventQueues that were suspended on this document while
   // events were suppressed.
-  nsTArray<RefPtr<mozilla::net::ChannelEventQueue>> mSuspendedQueues;
+  nsTArray<RefPtr<net::ChannelEventQueue>> mSuspendedQueues;
 
   RefPtr<EventListener> mSuppressedEventListener;
 
   /**
    * https://html.spec.whatwg.org/#ignore-destructive-writes-counter
    */
   uint32_t mIgnoreDestructiveWritesCounter;
 
@@ -4436,60 +4396,60 @@ class Document : public nsINode,
   // Our base target.
   nsString mBaseTarget;
 
   nsCOMPtr<nsIStructuredCloneContainer> mStateObjectContainer;
   nsCOMPtr<nsIVariant> mStateObjectCached;
 
   uint32_t mInSyncOperationCount;
 
-  UniquePtr<mozilla::dom::XPathEvaluator> mXPathEvaluator;
+  UniquePtr<dom::XPathEvaluator> mXPathEvaluator;
 
   nsTArray<RefPtr<AnonymousContent>> mAnonymousContents;
 
   uint32_t mBlockDOMContentLoaded;
 
   // Our live MediaQueryLists
-  mozilla::LinkedList<mozilla::dom::MediaQueryList> mDOMMediaQueryLists;
+  LinkedList<MediaQueryList> mDOMMediaQueryLists;
 
   // Array of observers
   nsTObserverArray<nsIDocumentObserver*> mObservers;
 
   // Flags for use counters used directly by this document.
-  std::bitset<mozilla::eUseCounter_Count> mUseCounters;
+  std::bitset<eUseCounter_Count> mUseCounters;
   // Flags for use counters used by any child documents of this document.
-  std::bitset<mozilla::eUseCounter_Count> mChildDocumentUseCounters;
+  std::bitset<eUseCounter_Count> mChildDocumentUseCounters;
   // Flags for whether we've notified our top-level "page" of a use counter
   // for this child document.
-  std::bitset<mozilla::eUseCounter_Count> mNotifiedPageForUseCounter;
+  std::bitset<eUseCounter_Count> mNotifiedPageForUseCounter;
 
   // The CSS property use counters.
-  mozilla::UniquePtr<StyleUseCounters> mStyleUseCounters;
+  UniquePtr<StyleUseCounters> mStyleUseCounters;
 
   // Whether the user has interacted with the document or not:
   bool mUserHasInteracted;
 
   // We constantly update the user-interaction anti-tracking permission at any
   // user-interaction using a timer. This boolean value is set to true when this
   // timer is scheduled.
   bool mHasUserInteractionTimerScheduled;
 
-  mozilla::TimeStamp mPageUnloadingEventTimeStamp;
-
-  RefPtr<mozilla::dom::DocGroup> mDocGroup;
+  TimeStamp mPageUnloadingEventTimeStamp;
+
+  RefPtr<DocGroup> mDocGroup;
 
   // The set of all the tracking script URLs.  URLs are added to this set by
   // calling NoteScriptTrackingStatus().  Currently we assume that a URL not
   // existing in the set means the corresponding script isn't a tracking script.
   nsTHashtable<nsCStringHashKey> mTrackingScripts;
 
   // The log of all content blocking actions taken on this document.  This is
   // only stored on top-level documents and includes the activity log for all of
   // the nested subdocuments as well.
-  mozilla::dom::ContentBlockingLog mContentBlockingLog;
+  ContentBlockingLog mContentBlockingLog;
 
   // List of ancestor principals.  This is set at the point a document
   // is connected to a docshell and not mutated thereafter.
   nsTArray<nsCOMPtr<nsIPrincipal>> mAncestorPrincipals;
   // List of ancestor outerWindowIDs that correspond to the ancestor principals.
   nsTArray<uint64_t> mAncestorOuterWindowIDs;
 
   // Pointer to our parser if we're currently in the process of being
@@ -4539,119 +4499,116 @@ class Document : public nsINode,
   ViewportOverflowType mViewportOverflowType;
 
   PLDHashTable* mSubDocuments;
 
   DocHeaderData* mHeaderData;
 
   // For determining if this is a flash document which should be
   // blocked based on its principal.
-  mozilla::dom::FlashClassification mFlashClassification;
+  FlashClassification mFlashClassification;
 
   // Do not use this value directly. Call the |IsThirdPartyForFlashClassifier()|
   // method, which caches its result here.
-  mozilla::Maybe<bool> mIsThirdPartyForFlashClassifier;
+  Maybe<bool> mIsThirdPartyForFlashClassifier;
 
   nsRevocableEventPtr<nsRunnableMethod<Document, void, false>>
       mPendingTitleChangeEvent;
 
   RefPtr<nsDOMNavigationTiming> mTiming;
 
   // Recorded time of change to 'loading' state.
-  mozilla::TimeStamp mLoadingTimeStamp;
+  TimeStamp mLoadingTimeStamp;
 
   nsWeakPtr mAutoFocusElement;
 
   nsCString mScrollToRef;
 
   nscoord mScrollAnchorAdjustmentLength;
   int32_t mScrollAnchorAdjustmentCount;
 
   // Weak reference to the scope object (aka the script global object)
   // that, unlike mScriptGlobalObject, is never unset once set. This
   // is a weak reference to avoid leaks due to circular references.
   nsWeakPtr mScopeObject;
 
   // Array of intersection observers
-  nsTHashtable<nsPtrHashKey<mozilla::dom::DOMIntersectionObserver>>
-      mIntersectionObservers;
+  nsTHashtable<nsPtrHashKey<DOMIntersectionObserver>> mIntersectionObservers;
 
   // Stack of fullscreen elements. When we request fullscreen we push the
   // fullscreen element onto this stack, and when we cancel fullscreen we
   // pop one off this stack, restoring the previous fullscreen state
   nsTArray<nsWeakPtr> mFullscreenStack;
 
   // The root of the doc tree in which this document is in. This is only
   // non-null when this document is in fullscreen mode.
   nsWeakPtr mFullscreenRoot;
 
-  RefPtr<mozilla::dom::DOMImplementation> mDOMImplementation;
+  RefPtr<DOMImplementation> mDOMImplementation;
 
   RefPtr<nsContentList> mImageMaps;
 
   // A set of responsive images keyed by address pointer.
-  nsTHashtable<nsPtrHashKey<mozilla::dom::HTMLImageElement>> mResponsiveContent;
+  nsTHashtable<nsPtrHashKey<HTMLImageElement>> mResponsiveContent;
 
   // Tracking for plugins in the document.
   nsTHashtable<nsPtrHashKey<nsIObjectLoadingContent>> mPlugins;
 
-  RefPtr<mozilla::dom::DocumentTimeline> mDocumentTimeline;
-  mozilla::LinkedList<mozilla::dom::DocumentTimeline> mTimelines;
-
-  RefPtr<mozilla::dom::ScriptLoader> mScriptLoader;
-
-  nsRefPtrHashtable<nsPtrHashKey<nsIContent>, mozilla::dom::BoxObject>*
-      mBoxObjectTable;
+  RefPtr<DocumentTimeline> mDocumentTimeline;
+  LinkedList<DocumentTimeline> mTimelines;
+
+  RefPtr<dom::ScriptLoader> mScriptLoader;
+
+  nsRefPtrHashtable<nsPtrHashKey<nsIContent>, BoxObject>* mBoxObjectTable;
 
   // Tracker for animations that are waiting to start.
   // nullptr until GetOrCreatePendingAnimationTracker is called.
-  RefPtr<mozilla::PendingAnimationTracker> mPendingAnimationTracker;
+  RefPtr<PendingAnimationTracker> mPendingAnimationTracker;
 
   // A document "without a browsing context" that owns the content of
   // HTMLTemplateElement.
   RefPtr<Document> mTemplateContentsOwner;
 
-  mozilla::dom::ExternalResourceMap mExternalResourceMap;
+  dom::ExternalResourceMap mExternalResourceMap;
 
   // ScreenOrientation "pending promise" as described by
   // http://www.w3.org/TR/screen-orientation/
-  RefPtr<mozilla::dom::Promise> mOrientationPendingPromise;
+  RefPtr<Promise> mOrientationPendingPromise;
 
   uint16_t mCurrentOrientationAngle;
-  mozilla::dom::OrientationType mCurrentOrientationType;
+  OrientationType mCurrentOrientationType;
 
   nsTArray<RefPtr<nsFrameLoader>> mInitializableFrameLoaders;
   nsTArray<nsCOMPtr<nsIRunnable>> mFrameLoaderFinalizers;
   RefPtr<nsRunnableMethod<Document>> mFrameLoaderRunner;
 
   // The layout history state that should be used by nodes in this
   // document.  We only actually store a pointer to it when:
   // 1)  We have no script global object.
   // 2)  We haven't had Destroy() called on us yet.
   nsCOMPtr<nsILayoutHistoryState> mLayoutHistoryState;
 
   // These member variables cache information about the viewport so we don't
   // have to recalculate it each time.
-  mozilla::LayoutDeviceToScreenScale mScaleMinFloat;
-  mozilla::LayoutDeviceToScreenScale mScaleMaxFloat;
-  mozilla::LayoutDeviceToScreenScale mScaleFloat;
-  mozilla::CSSToLayoutDeviceScale mPixelRatio;
-
-  mozilla::CSSCoord mMinWidth;
-  mozilla::CSSCoord mMaxWidth;
-  mozilla::CSSCoord mMinHeight;
-  mozilla::CSSCoord mMaxHeight;
-
-  RefPtr<mozilla::EventListenerManager> mListenerManager;
+  LayoutDeviceToScreenScale mScaleMinFloat;
+  LayoutDeviceToScreenScale mScaleMaxFloat;
+  LayoutDeviceToScreenScale mScaleFloat;
+  CSSToLayoutDeviceScale mPixelRatio;
+
+  CSSCoord mMinWidth;
+  CSSCoord mMaxWidth;
+  CSSCoord mMinHeight;
+  CSSCoord mMaxHeight;
+
+  RefPtr<EventListenerManager> mListenerManager;
 
   nsCOMPtr<nsIRunnable> mMaybeEndOutermostXBLUpdateRunner;
   nsCOMPtr<nsIRequest> mOnloadBlocker;
 
-  nsTArray<RefPtr<mozilla::StyleSheet>>
-      mAdditionalSheets[AdditionalSheetTypeCount];
+  nsTArray<RefPtr<StyleSheet>> mAdditionalSheets[AdditionalSheetTypeCount];
 
   // Member to store out last-selected stylesheet set.
   nsString mLastStyleSheetSet;
   nsString mPreferredStyleSheetSet;
 
   RefPtr<DOMStyleSheetSetList> mStyleSheetSetList;
 
   // We lazily calculate declaration blocks for SVG elements with mapped
@@ -4688,18 +4645,18 @@ class Document : public nsINode,
   uint32_t mThrowOnDynamicMarkupInsertionCounter;
 
   // Count of unload/beforeunload/pagehide operations in progress.
   uint32_t mIgnoreOpensDuringUnloadCounter;
 
   nsCOMPtr<nsIDOMXULCommandDispatcher>
       mCommandDispatcher;  // [OWNER] of the focus tracker
 
-  RefPtr<mozilla::dom::XULBroadcastManager> mXULBroadcastManager;
-  RefPtr<mozilla::dom::XULPersist> mXULPersist;
+  RefPtr<XULBroadcastManager> mXULBroadcastManager;
+  RefPtr<XULPersist> mXULPersist;
 
   // document lightweight theme for use with :-moz-lwtheme,
   // :-moz-lwtheme-brighttext and :-moz-lwtheme-darktext
   DocumentTheme mDocLWTheme;
 
   // Pres shell resolution saved before entering fullscreen mode.
   float mSavedResolution;