Bug 1600545 - Remove useless inclusions of header files generated from IDL files in accessible/, browser/, caps/, chrome/, devtools/, docshell/, editor/, extensions/, gfx/, hal/, image/, intl/, ipc/, js/, layout/, and media/ r=Ehsan
authorGabriele Svelto <gsvelto@mozilla.com>
Fri, 06 Dec 2019 09:16:44 +0000
changeset 505802 73820a049c644c3f3af58cece3bdb7cd0e4b2185
parent 505801 d235a06ca6bee8e27b6cad159d8aa00e75b3ca20
child 505803 1f438b01c7801e7d750c4297330669621d3b7a4f
push id36888
push userrgurzau@mozilla.com
push dateFri, 06 Dec 2019 16:33:05 +0000
treeherdermozilla-central@a960f4ebc0c6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersEhsan
bugs1600545
milestone73.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 1600545 - Remove useless inclusions of header files generated from IDL files in accessible/, browser/, caps/, chrome/, devtools/, docshell/, editor/, extensions/, gfx/, hal/, image/, intl/, ipc/, js/, layout/, and media/ r=Ehsan The inclusions were removed with the following very crude script and the resulting breakage was fixed up by hand. The manual fixups did either revert the changes done by the script, replace a generic header with a more specific one or replace a header with a forward declaration. find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2) if [ -n "$interfaces" ]; then if [[ "$interfaces" == *$'\n'* ]]; then regexp="\(" for i in $interfaces; do regexp="$regexp$i\|"; done regexp="${regexp%%\\\|}\)" else regexp="$interfaces" fi interface=$(basename "$path") rg -l "#include.*${interface%%.idl}.h" . | while read path2; do hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" ) if [ $hits -eq 0 ]; then echo "Removing ${interface} from ${path2}" grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp mv -f "$path2".tmp "$path2" fi done fi done Differential Revision: https://phabricator.services.mozilla.com/D55443
accessible/atk/Platform.cpp
accessible/atk/nsMaiInterfaceImage.cpp
accessible/base/DocManager.cpp
accessible/base/Logging.cpp
accessible/base/SelectionManager.cpp
accessible/base/nsAccCache.h
accessible/base/nsAccessibilityService.cpp
accessible/generic/ARIAGridAccessible.cpp
accessible/generic/Accessible.cpp
accessible/generic/ApplicationAccessible.cpp
accessible/generic/ApplicationAccessible.h
accessible/generic/DocAccessible.cpp
accessible/generic/DocAccessible.h
accessible/generic/HyperTextAccessible-inl.h
accessible/generic/HyperTextAccessible.cpp
accessible/generic/HyperTextAccessible.h
accessible/generic/ImageAccessible.cpp
accessible/generic/RootAccessible.cpp
accessible/html/HTMLElementAccessibles.cpp
accessible/html/HTMLFormControlAccessible.cpp
accessible/html/HTMLImageMapAccessible.cpp
accessible/html/HTMLTableAccessible.cpp
accessible/ipc/ProxyAccessibleBase.cpp
accessible/ipc/other/DocAccessibleChild.cpp
accessible/ipc/other/ProxyAccessible.cpp
accessible/ipc/win/COMPtrTypes.cpp
accessible/ipc/win/ProxyAccessible.cpp
accessible/ipc/win/ProxyAccessible.h
accessible/ipc/win/handler/AccessibleHandler.cpp
accessible/ipc/win/handler/HandlerDataCleanup.h
accessible/mac/mozAccessible.mm
accessible/windows/ia2/ia2AccessibleHyperlink.cpp
accessible/windows/ia2/ia2AccessibleImage.cpp
accessible/windows/ia2/ia2AccessibleTableCell.cpp
accessible/windows/ia2/ia2AccessibleText.cpp
accessible/windows/ia2/ia2AccessibleText.h
accessible/windows/msaa/AccessibleWrap.cpp
accessible/windows/msaa/AccessibleWrap.h
accessible/windows/msaa/Compatibility.cpp
accessible/windows/msaa/ImageAccessibleWrap.cpp
accessible/windows/msaa/MsaaIdGenerator.cpp
accessible/windows/msaa/Platform.cpp
accessible/windows/msaa/ServiceProvider.cpp
accessible/windows/msaa/XULListboxAccessibleWrap.h
accessible/windows/msaa/nsWinUtils.cpp
accessible/xpcom/xpcAccessibleHyperLink.cpp
accessible/xpcom/xpcAccessibleHyperText.cpp
accessible/xpcom/xpcAccessibleSelectable.cpp
accessible/xpcom/xpcAccessibleTable.cpp
accessible/xpcom/xpcAccessibleTableCell.cpp
accessible/xpcom/xpcAccessibleTextRange.cpp
accessible/xul/XULComboboxAccessible.cpp
accessible/xul/XULFormControlAccessible.cpp
accessible/xul/XULListboxAccessible.cpp
accessible/xul/XULListboxAccessible.h
accessible/xul/XULMenuAccessible.cpp
accessible/xul/XULMenuAccessible.h
accessible/xul/XULSelectControlAccessible.cpp
accessible/xul/XULSelectControlAccessible.h
accessible/xul/XULTabAccessible.cpp
accessible/xul/XULTreeAccessible.cpp
accessible/xul/XULTreeGridAccessible.cpp
accessible/xul/XULTreeGridAccessible.h
browser/app/nsBrowserApp.cpp
browser/components/about/AboutRedirector.cpp
browser/components/dirprovider/DirectoryProvider.cpp
browser/components/dirprovider/DirectoryProvider.h
browser/components/migration/nsIEHistoryEnumerator.cpp
browser/components/shell/nsGNOMEShellService.cpp
browser/components/shell/nsMacShellService.cpp
browser/components/shell/nsWindowsShellService.cpp
caps/BasePrincipal.cpp
caps/ContentPrincipal.h
caps/DomainPolicy.cpp
caps/NullPrincipal.cpp
caps/NullPrincipal.h
caps/SystemPrincipal.cpp
caps/nsJSPrincipals.cpp
caps/nsScriptSecurityManager.cpp
chrome/nsChromeProtocolHandler.cpp
chrome/nsChromeRegistry.cpp
chrome/nsChromeRegistryChrome.cpp
chrome/nsChromeRegistryContent.cpp
devtools/platform/nsJSInspector.cpp
docshell/base/CanonicalBrowsingContext.h
docshell/base/nsCTooltipTextProvider.h
docshell/base/nsDSURIContentListener.cpp
docshell/base/nsDefaultURIFixup.cpp
docshell/base/nsDocShell.cpp
docshell/base/nsDocShell.h
docshell/base/nsDocShellEditorData.cpp
docshell/base/nsDocShellLoadState.cpp
docshell/base/nsDocShellTreeOwner.cpp
docshell/base/nsDocShellTreeOwner.h
docshell/shistory/ChildSHistory.cpp
docshell/shistory/nsSHEntryShared.cpp
editor/composer/ComposerCommandsUpdater.cpp
editor/composer/nsEditingSession.cpp
editor/libeditor/CSSEditUtils.cpp
editor/libeditor/CreateElementTransaction.cpp
editor/libeditor/DeleteTextTransaction.cpp
editor/libeditor/EditorBase.cpp
editor/libeditor/EditorBase.h
editor/libeditor/EditorEventListener.cpp
editor/libeditor/EditorUtils.cpp
editor/libeditor/EditorUtils.h
editor/libeditor/HTMLAbsPositionEditor.cpp
editor/libeditor/HTMLAnonymousNodeEditor.cpp
editor/libeditor/HTMLEditSubActionHandler.cpp
editor/libeditor/HTMLEditor.cpp
editor/libeditor/HTMLEditorDataTransfer.cpp
editor/libeditor/HTMLEditorDocumentCommands.cpp
editor/libeditor/HTMLInlineTableEditor.cpp
editor/libeditor/TextEditSubActionHandler.cpp
editor/libeditor/TextEditorDataTransfer.cpp
editor/txmgr/nsTransactionManagerCID.h
extensions/auth/nsAuthGSSAPI.cpp
extensions/auth/nsAuthSASL.cpp
extensions/auth/nsAuthSSPI.cpp
extensions/auth/nsHttpNegotiateAuth.cpp
extensions/permissions/nsContentBlocker.cpp
extensions/permissions/nsPermissionManager.cpp
extensions/permissions/nsPermissionManager.h
extensions/pref/autoconfig/src/nsAutoConfig.cpp
extensions/pref/autoconfig/src/nsAutoConfig.h
extensions/pref/autoconfig/src/nsJSConfigTriggers.cpp
extensions/pref/autoconfig/src/nsReadConfig.cpp
extensions/spellcheck/hunspell/glue/mozHunspell.cpp
extensions/spellcheck/src/mozEnglishWordUtils.cpp
extensions/spellcheck/src/mozInlineSpellChecker.cpp
extensions/spellcheck/src/mozInlineSpellWordUtil.cpp
extensions/spellcheck/src/mozPersonalDictionary.cpp
extensions/spellcheck/src/mozSpellChecker.cpp
gfx/gl/GLLibraryEGL.h
gfx/ipc/GPUProcessHost.cpp
gfx/ipc/GPUProcessManager.h
gfx/layers/LayerScope.cpp
gfx/layers/PaintThread.cpp
gfx/layers/client/ClientLayerManager.h
gfx/layers/ipc/CompositorBridgeChild.cpp
gfx/layers/ipc/ImageBridgeChild.h
gfx/src/gfxCrashReporterUtils.cpp
gfx/thebes/DeviceManagerDx.cpp
gfx/thebes/gfxASurface.cpp
gfx/thebes/gfxAndroidPlatform.cpp
gfx/thebes/gfxDWriteCommon.h
gfx/thebes/gfxDWriteFontList.cpp
gfx/thebes/gfxFT2FontList.cpp
gfx/thebes/gfxFontInfoLoader.h
gfx/thebes/gfxGDIFontList.cpp
gfx/thebes/gfxUserFontSet.cpp
gfx/thebes/gfxUserFontSet.h
gfx/thebes/gfxWindowsPlatform.cpp
gfx/vr/VRDisplayClient.cpp
gfx/vr/VRDisplayClient.h
hal/Hal.cpp
image/DecodePool.cpp
image/ImageCacheKey.cpp
image/ImageFactory.cpp
image/ProgressTracker.cpp
image/RasterImage.h
image/decoders/icon/android/nsIconChannel.cpp
image/decoders/icon/android/nsIconChannel.h
image/decoders/icon/gtk/nsIconChannel.h
image/decoders/icon/mac/nsIconChannelCocoa.mm
image/decoders/icon/nsIconProtocolHandler.cpp
image/decoders/icon/win/nsIconChannel.cpp
image/decoders/nsBMPDecoder.cpp
image/decoders/nsGIFDecoder2.cpp
image/decoders/nsPNGDecoder.cpp
image/imgFrame.h
image/imgLoader.cpp
image/test/fuzzing/TestDecoders.cpp
image/test/gtest/Common.cpp
image/test/gtest/Common.h
image/test/gtest/TestContainers.cpp
image/test/gtest/TestDecodeToSurface.cpp
image/test/gtest/TestDecoders.cpp
image/test/gtest/TestMetadata.cpp
image/test/gtest/TestSurfaceCache.cpp
intl/chardet/tools/GenCyrillicClass.cpp
intl/hyphenation/glue/nsHyphenationManager.cpp
intl/locale/DateTimeFormat.cpp
intl/locale/LocaleService.cpp
intl/locale/nsCollation.cpp
intl/locale/nsLocaleConstructors.h
intl/locale/tests/gtest/TestLocaleService.cpp
intl/locale/tests/gtest/TestLocaleServiceNegotiate.cpp
intl/lwbrk/gtest/TestLineBreak.cpp
intl/strres/nsStringBundle.cpp
intl/strres/nsStringBundleService.h
intl/uconv/nsTextToSubURI.cpp
ipc/glue/BackgroundImpl.cpp
ipc/glue/BackgroundParentImpl.cpp
ipc/glue/CrashReporterHost.cpp
ipc/glue/InputStreamUtils.cpp
ipc/glue/MessageChannel.cpp
ipc/glue/MessageChannel.h
ipc/glue/MessagePump.cpp
ipc/glue/ProtocolUtils.h
ipc/glue/WindowsMessageLoop.cpp
ipc/ipdl/test/cxx/IPDLUnitTests.h
ipc/mscom/InterceptorLog.cpp
ipc/testshell/XPCShellEnvironment.cpp
js/ductwork/debugger/JSDebugger.cpp
js/ipc/JavaScriptParent.cpp
js/xpconnect/loader/AutoMemMap.h
js/xpconnect/loader/mozJSComponentLoader.cpp
js/xpconnect/src/XPCJSContext.cpp
js/xpconnect/src/XPCJSRuntime.cpp
js/xpconnect/src/XPCRuntimeService.cpp
js/xpconnect/src/XPCWrappedNativeScope.cpp
js/xpconnect/src/nsXPConnect.cpp
js/xpconnect/src/xpcprivate.h
js/xpconnect/tests/components/native/xpctest_returncode.cpp
js/xpconnect/wrappers/XrayWrapper.cpp
layout/base/PresShell.cpp
layout/base/PresShell.h
layout/base/nsPresContext.cpp
layout/base/nsPresContext.h
layout/base/nsStyleSheetService.cpp
layout/build/nsContentDLF.cpp
layout/build/nsLayoutModule.cpp
layout/forms/nsButtonFrameRenderer.h
layout/forms/nsComboboxControlFrame.cpp
layout/forms/nsDateTimeControlFrame.cpp
layout/forms/nsListControlFrame.cpp
layout/forms/nsNumberControlFrame.cpp
layout/forms/nsTextControlFrame.cpp
layout/generic/nsFrame.cpp
layout/generic/nsFrameSelection.cpp
layout/generic/nsGfxScrollFrame.cpp
layout/generic/nsImageFrame.cpp
layout/generic/nsImageMap.cpp
layout/generic/nsPluginFrame.cpp
layout/generic/nsSubDocumentFrame.cpp
layout/generic/nsTextRunTransformations.cpp
layout/inspector/InspectorUtils.cpp
layout/inspector/inLayoutUtils.cpp
layout/ipc/VsyncParent.cpp
layout/painting/nsCSSRendering.cpp
layout/painting/nsCSSRendering.h
layout/painting/nsDisplayList.cpp
layout/painting/nsDisplayListInvalidation.h
layout/printing/PrintPreviewUserEventSuppressor.cpp
layout/printing/nsPagePrintTimer.cpp
layout/printing/nsPrintData.cpp
layout/printing/nsPrintData.h
layout/printing/nsPrintJob.cpp
layout/style/CSS.cpp
layout/style/CachedInheritingStyles.cpp
layout/style/ComputedStyle.h
layout/style/DeclarationBlock.cpp
layout/style/ErrorReporter.cpp
layout/style/FontFaceSet.cpp
layout/style/GeckoBindings.cpp
layout/style/Loader.cpp
layout/style/ServoStyleSet.h
layout/style/StyleSheet.cpp
layout/style/nsCSSValue.cpp
layout/style/nsComputedDOMStyle.cpp
layout/style/nsDOMCSSAttrDeclaration.cpp
layout/style/nsDOMCSSDeclaration.cpp
layout/style/nsDOMCSSDeclaration.h
layout/style/nsFontFaceLoader.cpp
layout/style/nsStyleStruct.cpp
layout/style/nsStyleUtil.cpp
layout/svg/nsSVGImageFrame.h
layout/tables/nsTableCellFrame.cpp
layout/tables/nsTableFrame.h
layout/tables/nsTableWrapperFrame.cpp
layout/tools/layout-debug/src/nsLayoutDebugCLH.cpp
layout/tools/layout-debug/src/nsLayoutDebuggingTools.cpp
layout/xul/nsBox.cpp
layout/xul/nsBoxFrame.cpp
layout/xul/nsDocElementBoxFrame.cpp
layout/xul/nsImageBoxFrame.cpp
layout/xul/nsImageBoxFrame.h
layout/xul/nsMenuBarFrame.cpp
layout/xul/nsMenuBarListener.cpp
layout/xul/nsMenuFrame.cpp
layout/xul/nsMenuPopupFrame.cpp
layout/xul/nsMenuPopupFrame.h
layout/xul/nsRepeatService.cpp
layout/xul/nsResizerFrame.cpp
layout/xul/nsScrollbarButtonFrame.h
layout/xul/nsSliderFrame.cpp
layout/xul/nsSplitterFrame.cpp
layout/xul/nsTextBoxFrame.cpp
layout/xul/nsXULPopupManager.cpp
layout/xul/nsXULTooltipListener.cpp
layout/xul/tree/nsTreeBodyFrame.cpp
media/mtransport/WebrtcTCPSocketWrapper.cpp
media/mtransport/ipc/StunAddrsRequestParent.h
media/mtransport/ipc/WebrtcTCPSocket.cpp
media/mtransport/nr_socket_prsock.cpp
media/mtransport/nr_socket_prsock.h
media/mtransport/nricectx.cpp
media/mtransport/nricectx.h
media/mtransport/nricemediastream.h
media/mtransport/test/runnable_utils_unittest.cpp
media/mtransport/test/sockettransportservice_unittest.cpp
media/mtransport/transportlayerdtls.cpp
media/mtransport/transportlayerdtls.h
media/mtransport/transportlayerice.cpp
media/mtransport/transportlayerice.h
media/mtransport/transportlayerloopback.cpp
media/webrtc/signaling/src/media-conduit/AudioConduit.cpp
media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp
media/webrtc/signaling/src/peerconnection/MediaTransportHandler.cpp
media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.cpp
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp
netwerk/cookie/nsCookie.h
widget/android/ImageDecoderSupport.cpp
--- a/accessible/atk/Platform.cpp
+++ b/accessible/atk/Platform.cpp
@@ -3,17 +3,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "Platform.h"
 
 #include "nsIAccessibleEvent.h"
 #include "nsIGSettingsService.h"
-#include "nsIServiceManager.h"
 #include "nsMai.h"
 #include "AtkSocketAccessible.h"
 #include "prenv.h"
 #include "prlink.h"
 
 #ifdef MOZ_ENABLE_DBUS
 #  include <dbus/dbus.h>
 #endif
--- a/accessible/atk/nsMaiInterfaceImage.cpp
+++ b/accessible/atk/nsMaiInterfaceImage.cpp
@@ -6,17 +6,16 @@
 
 #include "InterfaceInitFuncs.h"
 
 #include "AccessibleWrap.h"
 #include "ImageAccessible.h"
 #include "mozilla/Likely.h"
 #include "nsMai.h"
 #include "nsIAccessibleTypes.h"
-#include "nsIURI.h"
 #include "ProxyAccessible.h"
 
 using namespace mozilla;
 using namespace mozilla::a11y;
 
 extern "C" {
 const gchar* getDescriptionCB(AtkObject* aAtkObj);
 
--- a/accessible/base/DocManager.cpp
+++ b/accessible/base/DocManager.cpp
@@ -9,17 +9,16 @@
 #include "ApplicationAccessible.h"
 #include "ARIAMap.h"
 #include "DocAccessible-inl.h"
 #include "DocAccessibleChild.h"
 #include "DocAccessibleParent.h"
 #include "nsAccessibilityService.h"
 #include "Platform.h"
 #include "RootAccessibleWrap.h"
-#include "xpcAccessibleDocument.h"
 
 #ifdef A11Y_LOG
 #  include "Logging.h"
 #endif
 
 #include "mozilla/Components.h"
 #include "mozilla/EventListenerManager.h"
 #include "mozilla/PresShell.h"
--- a/accessible/base/Logging.cpp
+++ b/accessible/base/Logging.cpp
@@ -11,22 +11,20 @@
 #include "DocAccessible.h"
 #include "nsAccessibilityService.h"
 #include "nsCoreUtils.h"
 #include "OuterDocAccessible.h"
 
 #include "nsDocShellLoadTypes.h"
 #include "nsIChannel.h"
 #include "nsIInterfaceRequestorUtils.h"
-#include "nsISelectionController.h"
 #include "nsTraceRefcnt.h"
 #include "nsIWebProgress.h"
 #include "prenv.h"
 #include "nsIDocShellTreeItem.h"
-#include "nsIURI.h"
 #include "mozilla/PresShell.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/HTMLBodyElement.h"
 #include "mozilla/dom/Selection.h"
 
 using namespace mozilla;
 using namespace mozilla::a11y;
 
--- a/accessible/base/SelectionManager.cpp
+++ b/accessible/base/SelectionManager.cpp
@@ -9,17 +9,16 @@
 #include "HyperTextAccessible.h"
 #include "HyperTextAccessible-inl.h"
 #include "nsAccessibilityService.h"
 #include "nsAccUtils.h"
 #include "nsCoreUtils.h"
 #include "nsEventShell.h"
 #include "nsFrameSelection.h"
 
-#include "nsIAccessibleTypes.h"
 #include "mozilla/PresShell.h"
 #include "mozilla/dom/Document.h"
 #include "mozilla/dom/Selection.h"
 #include "mozilla/dom/Element.h"
 
 using namespace mozilla;
 using namespace mozilla::a11y;
 using mozilla::dom::Selection;
--- a/accessible/base/nsAccCache.h
+++ b/accessible/base/nsAccCache.h
@@ -1,18 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef _nsAccCache_H_
 #define _nsAccCache_H_
 
-#include "xpcAccessibleDocument.h"
-
 ////////////////////////////////////////////////////////////////////////////////
 // Accessible cache utils
 ////////////////////////////////////////////////////////////////////////////////
 
 template <class T>
 void UnbindCacheEntriesFromDocument(
     nsRefPtrHashtable<nsPtrHashKey<const void>, T>& aCache) {
   for (auto iter = aCache.Iter(); !iter.Done(); iter.Next()) {
--- a/accessible/base/nsAccessibilityService.cpp
+++ b/accessible/base/nsAccessibilityService.cpp
@@ -21,29 +21,27 @@
 #include "HyperTextAccessibleWrap.h"
 #include "RootAccessible.h"
 #include "StyleInfo.h"
 #include "nsAccUtils.h"
 #include "nsArrayUtils.h"
 #include "nsAttrName.h"
 #include "nsDOMTokenList.h"
 #include "nsEventShell.h"
-#include "nsIURI.h"
 #include "nsTextFormatter.h"
 #include "OuterDocAccessible.h"
 #include "Role.h"
 #ifdef MOZ_ACCESSIBILITY_ATK
 #  include "RootAccessibleWrap.h"
 #endif
 #include "States.h"
 #include "Statistics.h"
 #include "TextLeafAccessibleWrap.h"
 #include "TreeWalker.h"
 #include "xpcAccessibleApplication.h"
-#include "xpcAccessibleDocument.h"
 
 #ifdef MOZ_ACCESSIBILITY_ATK
 #  include "AtkSocketAccessible.h"
 #endif
 
 #ifdef XP_WIN
 #  include "mozilla/a11y/Compatibility.h"
 #  include "mozilla/dom/ContentChild.h"
--- a/accessible/generic/ARIAGridAccessible.cpp
+++ b/accessible/generic/ARIAGridAccessible.cpp
@@ -6,17 +6,16 @@
 #include "ARIAGridAccessible-inl.h"
 
 #include "Accessible-inl.h"
 #include "AccIterator.h"
 #include "nsAccUtils.h"
 #include "Role.h"
 #include "States.h"
 
-#include "nsIMutableArray.h"
 #include "nsIPersistentProperties2.h"
 #include "nsComponentManagerUtils.h"
 
 using namespace mozilla;
 using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
 // ARIAGridAccessible
--- a/accessible/generic/Accessible.cpp
+++ b/accessible/generic/Accessible.cpp
@@ -52,19 +52,16 @@
 
 #include "nsString.h"
 #include "nsUnicharUtils.h"
 #include "nsReadableUtils.h"
 #include "prdtoa.h"
 #include "nsAtom.h"
 #include "nsIURI.h"
 #include "nsArrayUtils.h"
-#include "nsIMutableArray.h"
-#include "nsIObserverService.h"
-#include "nsIServiceManager.h"
 #include "nsWhitespaceTokenizer.h"
 #include "nsAttrName.h"
 #include "nsPersistentProperties.h"
 
 #include "mozilla/Assertions.h"
 #include "mozilla/BasicEvents.h"
 #include "mozilla/ErrorResult.h"
 #include "mozilla/EventStates.h"
--- a/accessible/generic/ApplicationAccessible.cpp
+++ b/accessible/generic/ApplicationAccessible.cpp
@@ -8,18 +8,16 @@
 #include "ApplicationAccessible.h"
 
 #include "nsAccessibilityService.h"
 #include "nsAccUtils.h"
 #include "Relation.h"
 #include "Role.h"
 #include "States.h"
 
-#include "nsIComponentManager.h"
-#include "nsIWindowMediator.h"
 #include "nsServiceManagerUtils.h"
 #include "mozilla/Services.h"
 #include "nsGlobalWindow.h"
 #include "nsIStringBundle.h"
 
 using namespace mozilla::a11y;
 
 ApplicationAccessible::ApplicationAccessible()
--- a/accessible/generic/ApplicationAccessible.h
+++ b/accessible/generic/ApplicationAccessible.h
@@ -5,17 +5,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_a11y_ApplicationAccessible_h__
 #define mozilla_a11y_ApplicationAccessible_h__
 
 #include "AccessibleWrap.h"
 
-#include "nsIMutableArray.h"
 #include "nsIXULAppInfo.h"
 
 namespace mozilla {
 namespace a11y {
 
 /**
  * ApplicationAccessible is for the whole application of Mozilla.
  * Only one instance of ApplicationAccessible exists for one Mozilla instance.
--- a/accessible/generic/DocAccessible.cpp
+++ b/accessible/generic/DocAccessible.cpp
@@ -16,26 +16,24 @@
 #include "nsTextEquivUtils.h"
 #include "Role.h"
 #include "RootAccessible.h"
 #include "TreeWalker.h"
 #include "xpcAccessibleDocument.h"
 
 #include "nsCommandManager.h"
 #include "nsContentUtils.h"
-#include "nsIMutableArray.h"
 #include "nsIDocShell.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 "nsIServiceManager.h"
 #include "nsViewManager.h"
 #include "nsIScrollableFrame.h"
 #include "nsUnicharUtils.h"
 #include "nsIURI.h"
 #include "nsIWebNavigation.h"
 #include "nsFocusManager.h"
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/Assertions.h"
--- a/accessible/generic/DocAccessible.h
+++ b/accessible/generic/DocAccessible.h
@@ -14,17 +14,16 @@
 #include "nsAutoPtr.h"
 #include "nsClassHashtable.h"
 #include "nsDataHashtable.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 PresShell;
--- a/accessible/generic/HyperTextAccessible-inl.h
+++ b/accessible/generic/HyperTextAccessible-inl.h
@@ -6,17 +6,16 @@
 #ifndef mozilla_a11y_HyperTextAccessible_inl_h__
 #define mozilla_a11y_HyperTextAccessible_inl_h__
 
 #include "HyperTextAccessible.h"
 
 #include "nsAccUtils.h"
 
 #include "nsIClipboard.h"
-#include "nsIPersistentProperties2.h"
 #include "nsFrameSelection.h"
 
 #include "mozilla/TextEditor.h"
 
 namespace mozilla {
 namespace a11y {
 
 inline bool HyperTextAccessible::IsValidOffset(int32_t aOffset) {
--- a/accessible/generic/HyperTextAccessible.cpp
+++ b/accessible/generic/HyperTextAccessible.cpp
@@ -22,17 +22,16 @@
 #include "nsFocusManager.h"
 #include "nsIEditingSession.h"
 #include "nsContainerFrame.h"
 #include "nsFrameSelection.h"
 #include "nsILineIterator.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsPersistentProperties.h"
 #include "nsIScrollableFrame.h"
-#include "nsIServiceManager.h"
 #include "nsIMathMLFrame.h"
 #include "nsRange.h"
 #include "nsTextFragment.h"
 #include "mozilla/BinarySearch.h"
 #include "mozilla/EventStates.h"
 #include "mozilla/MathAlgorithms.h"
 #include "mozilla/PresShell.h"
 #include "mozilla/TextEditor.h"
--- a/accessible/generic/HyperTextAccessible.h
+++ b/accessible/generic/HyperTextAccessible.h
@@ -8,18 +8,16 @@
 
 #include "AccessibleWrap.h"
 #include "nsIAccessibleText.h"
 #include "nsIAccessibleTypes.h"
 #include "nsDirection.h"
 #include "WordMovementType.h"
 #include "nsIFrame.h"
 
-#include "nsISelectionController.h"
-
 class nsFrameSelection;
 class nsRange;
 class nsIWidget;
 
 namespace mozilla {
 class TextEditor;
 namespace dom {
 class Selection;
--- a/accessible/generic/ImageAccessible.cpp
+++ b/accessible/generic/ImageAccessible.cpp
@@ -11,17 +11,16 @@
 #include "States.h"
 
 #include "imgIContainer.h"
 #include "imgIRequest.h"
 #include "nsGenericHTMLElement.h"
 #include "mozilla/dom/BrowsingContext.h"
 #include "mozilla/dom/Document.h"
 #include "nsIImageLoadingContent.h"
-#include "nsIServiceManager.h"
 #include "nsIPersistentProperties2.h"
 #include "nsPIDOMWindow.h"
 #include "nsIURI.h"
 
 using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
 // ImageAccessible
--- a/accessible/generic/RootAccessible.cpp
+++ b/accessible/generic/RootAccessible.cpp
@@ -24,25 +24,23 @@
 #endif
 
 #include "mozilla/dom/BindingUtils.h"
 #include "mozilla/dom/CustomEvent.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/ScriptSettings.h"
 #include "mozilla/dom/BrowserHost.h"
 
-#include "nsIDocShellTreeItem.h"
 #include "nsIDocShellTreeOwner.h"
 #include "mozilla/dom/Event.h"
 #include "mozilla/dom/EventTarget.h"
 #include "nsIDOMXULMultSelectCntrlEl.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"
 
 #ifdef MOZ_XUL
 #  include "nsIAppWindow.h"
--- a/accessible/html/HTMLElementAccessibles.cpp
+++ b/accessible/html/HTMLElementAccessibles.cpp
@@ -2,17 +2,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "HTMLElementAccessibles.h"
 
 #include "DocAccessible.h"
 #include "nsAccUtils.h"
-#include "nsIPersistentProperties2.h"
 #include "nsTextEquivUtils.h"
 #include "Relation.h"
 #include "Role.h"
 #include "States.h"
 
 #include "mozilla/dom/HTMLLabelElement.h"
 #include "mozilla/dom/HTMLDetailsElement.h"
 #include "mozilla/dom/HTMLSummaryElement.h"
--- a/accessible/html/HTMLFormControlAccessible.cpp
+++ b/accessible/html/HTMLFormControlAccessible.cpp
@@ -11,29 +11,25 @@
 #include "nsTextEquivUtils.h"
 #include "Relation.h"
 #include "Role.h"
 #include "States.h"
 
 #include "nsContentList.h"
 #include "mozilla/dom/HTMLInputElement.h"
 #include "mozilla/dom/HTMLTextAreaElement.h"
-#include "nsIEditor.h"
 #include "nsIFormControl.h"
 #include "nsIPersistentProperties2.h"
-#include "nsISelectionController.h"
-#include "nsIServiceManager.h"
 #include "nsITextControlFrame.h"
 #include "nsNameSpaceManager.h"
 #include "mozilla/dom/ScriptSettings.h"
 
 #include "mozilla/EventStates.h"
 #include "mozilla/FloatingPoint.h"
 #include "mozilla/Preferences.h"
-#include "mozilla/TextControlElement.h"
 #include "mozilla/TextEditor.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLFormAccessible
--- a/accessible/html/HTMLImageMapAccessible.cpp
+++ b/accessible/html/HTMLImageMapAccessible.cpp
@@ -5,17 +5,16 @@
 
 #include "HTMLImageMapAccessible.h"
 
 #include "ARIAMap.h"
 #include "nsAccUtils.h"
 #include "DocAccessible-inl.h"
 #include "Role.h"
 
-#include "nsIServiceManager.h"
 #include "nsIFrame.h"
 #include "nsImageFrame.h"
 #include "nsImageMap.h"
 #include "nsIURI.h"
 #include "mozilla/dom/HTMLAreaElement.h"
 
 using namespace mozilla::a11y;
 
--- a/accessible/html/HTMLTableAccessible.cpp
+++ b/accessible/html/HTMLTableAccessible.cpp
@@ -16,17 +16,16 @@
 #include "Role.h"
 #include "States.h"
 #include "TreeWalker.h"
 
 #include "mozilla/PresShell.h"
 #include "mozilla/dom/HTMLTableElement.h"
 #include "nsIHTMLCollection.h"
 #include "mozilla/dom/Document.h"
-#include "nsIMutableArray.h"
 #include "nsIPersistentProperties2.h"
 #include "nsITableCellLayout.h"
 #include "nsFrameSelection.h"
 #include "nsError.h"
 #include "nsArrayUtils.h"
 #include "nsComponentManagerUtils.h"
 #include "nsNameSpaceManager.h"
 #include "nsTableCellFrame.h"
--- a/accessible/ipc/ProxyAccessibleBase.cpp
+++ b/accessible/ipc/ProxyAccessibleBase.cpp
@@ -10,17 +10,16 @@
 #include "mozilla/a11y/Platform.h"
 #include "mozilla/a11y/ProxyAccessibleBase.h"
 #include "mozilla/a11y/ProxyAccessible.h"
 #include "mozilla/a11y/Role.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/BrowserParent.h"
 #include "mozilla/Unused.h"
 #include "RelationType.h"
-#include "xpcAccessibleDocument.h"
 
 namespace mozilla {
 namespace a11y {
 
 template <class Derived>
 void ProxyAccessibleBase<Derived>::Shutdown() {
   MOZ_DIAGNOSTIC_ASSERT(!IsDoc());
   xpcAccessibleDocument* xpcDoc =
--- a/accessible/ipc/other/DocAccessibleChild.cpp
+++ b/accessible/ipc/other/DocAccessibleChild.cpp
@@ -11,17 +11,16 @@
 #include "ProxyAccessible.h"
 #include "Relation.h"
 #include "HyperTextAccessible-inl.h"
 #include "TextLeafAccessible.h"
 #include "ImageAccessible.h"
 #include "TableAccessible.h"
 #include "TableCellAccessible.h"
 #include "nsIPersistentProperties2.h"
-#include "nsISimpleEnumerator.h"
 #include "nsAccUtils.h"
 #ifdef MOZ_ACCESSIBILITY_ATK
 #  include "AccessibleWrap.h"
 #endif
 #include "mozilla/PresShell.h"
 #include "mozilla/a11y/DocAccessiblePlatformExtChild.h"
 
 namespace mozilla {
--- a/accessible/ipc/other/ProxyAccessible.cpp
+++ b/accessible/ipc/other/ProxyAccessible.cpp
@@ -9,17 +9,16 @@
 #include "DocAccessible.h"
 #include "mozilla/a11y/DocManager.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/BrowserParent.h"
 #include "mozilla/Unused.h"
 #include "mozilla/a11y/Platform.h"
 #include "RelationType.h"
 #include "mozilla/a11y/Role.h"
-#include "xpcAccessibleDocument.h"
 
 namespace mozilla {
 namespace a11y {
 
 uint64_t ProxyAccessible::State() const {
   uint64_t state = 0;
   Unused << mDoc->SendState(mID, &state);
   return state;
--- a/accessible/ipc/win/COMPtrTypes.cpp
+++ b/accessible/ipc/win/COMPtrTypes.cpp
@@ -1,17 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/a11y/COMPtrTypes.h"
 
-#include "Accessible2_3.h"
 #include "MainThreadUtils.h"
 #include "mozilla/a11y/Accessible.h"
 #include "mozilla/a11y/Platform.h"
 #include "mozilla/a11y/HandlerProvider.h"
 #include "mozilla/Assertions.h"
 #include "mozilla/Move.h"
 #include "mozilla/mscom/MainThreadHandoff.h"
 #include "mozilla/mscom/Utils.h"
--- a/accessible/ipc/win/ProxyAccessible.cpp
+++ b/accessible/ipc/win/ProxyAccessible.cpp
@@ -13,17 +13,16 @@
 #include "DocAccessible.h"
 #include "mozilla/a11y/DocManager.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/BrowserParent.h"
 #include "mozilla/Unused.h"
 #include "mozilla/a11y/Platform.h"
 #include "RelationType.h"
 #include "mozilla/a11y/Role.h"
-#include "xpcAccessibleDocument.h"
 
 #include <comutil.h>
 
 static const VARIANT kChildIdSelf = {{{VT_I4}}};
 
 namespace mozilla {
 namespace a11y {
 
--- a/accessible/ipc/win/ProxyAccessible.h
+++ b/accessible/ipc/win/ProxyAccessible.h
@@ -5,18 +5,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_a11y_ProxyAccessible_h
 #define mozilla_a11y_ProxyAccessible_h
 
 #include "Accessible.h"
 #include "mozilla/a11y/ProxyAccessibleBase.h"
 #include "mozilla/a11y/Role.h"
-#include "nsIAccessibleText.h"
-#include "nsIAccessibleTypes.h"
 #include "nsString.h"
 #include "nsTArray.h"
 #include "nsRect.h"
 
 #include <oleacc.h>
 
 namespace mozilla {
 namespace a11y {
--- a/accessible/ipc/win/handler/AccessibleHandler.cpp
+++ b/accessible/ipc/win/handler/AccessibleHandler.cpp
@@ -9,17 +9,16 @@
 #endif  // defined(MOZILLA_INTERNAL_API)
 
 #include "AccessibleHandler.h"
 #include "AccessibleHandlerControl.h"
 #include "HandlerChildEnumerator.h"
 #include "HandlerRelation.h"
 
 #include "Factory.h"
-#include "HandlerData.h"
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/a11y/HandlerDataCleanup.h"
 #include "mozilla/mscom/Registration.h"
 #include "mozilla/UniquePtr.h"
 
 #include <objbase.h>
 #include <uiautomation.h>
 #include <winreg.h>
--- a/accessible/ipc/win/handler/HandlerDataCleanup.h
+++ b/accessible/ipc/win/handler/HandlerDataCleanup.h
@@ -3,17 +3,16 @@
 /* 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_a11y_HandlerDataCleanup_h
 #define mozilla_a11y_HandlerDataCleanup_h
 
 #include <oleauto.h>
-#include "HandlerData.h"
 
 namespace mozilla {
 namespace a11y {
 
 inline void ReleaseStaticIA2DataInterfaces(StaticIA2Data& aData) {
   // Only interfaces of the proxied object wrapped by this handler should be
   // released here, never other objects!
   // For example, if StaticIA2Data were to include accParent in future,
--- a/accessible/mac/mozAccessible.mm
+++ b/accessible/mac/mozAccessible.mm
@@ -5,18 +5,16 @@
 
 #import "mozAccessible.h"
 
 #import "MacUtils.h"
 #import "mozView.h"
 
 #include "Accessible-inl.h"
 #include "nsAccUtils.h"
-#include "nsIAccessibleRelation.h"
-#include "nsIAccessibleEditableText.h"
 #include "nsIPersistentProperties2.h"
 #include "DocAccessibleParent.h"
 #include "Relation.h"
 #include "Role.h"
 #include "RootAccessible.h"
 #include "TableAccessible.h"
 #include "TableCellAccessible.h"
 #include "mozilla/a11y/PDocAccessible.h"
--- a/accessible/windows/ia2/ia2AccessibleHyperlink.cpp
+++ b/accessible/windows/ia2/ia2AccessibleHyperlink.cpp
@@ -1,16 +1,15 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:expandtab:shiftwidth=2:tabstop=2:
  */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "Accessible2.h"
 #include "AccessibleHyperlink.h"
 #include "AccessibleHyperlink_i.c"
 
 #include "AccessibleWrap.h"
 #include "IUnknownImpl.h"
 #include "nsIURI.h"
 
 using namespace mozilla::a11y;
--- a/accessible/windows/ia2/ia2AccessibleImage.cpp
+++ b/accessible/windows/ia2/ia2AccessibleImage.cpp
@@ -9,17 +9,16 @@
 
 #include "AccessibleImage_i.c"
 
 #include "ImageAccessibleWrap.h"
 #include "IUnknownImpl.h"
 #include "nsIAccessibleTypes.h"
 
 #include "nsString.h"
-#include "nsIURI.h"
 
 using namespace mozilla;
 using namespace mozilla::a11y;
 
 // IUnknown
 
 STDMETHODIMP
 ia2AccessibleImage::QueryInterface(REFIID iid, void** ppv) {
--- a/accessible/windows/ia2/ia2AccessibleTableCell.cpp
+++ b/accessible/windows/ia2/ia2AccessibleTableCell.cpp
@@ -2,17 +2,16 @@
 /* vim:expandtab:shiftwidth=2:tabstop=2:
  */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "ia2AccessibleTableCell.h"
 
-#include "Accessible2.h"
 #include "AccessibleTable2_i.c"
 #include "AccessibleTableCell_i.c"
 
 #include "AccessibleWrap.h"
 #include "TableAccessible.h"
 #include "TableCellAccessible.h"
 #include "IUnknownImpl.h"
 
--- a/accessible/windows/ia2/ia2AccessibleText.cpp
+++ b/accessible/windows/ia2/ia2AccessibleText.cpp
@@ -2,17 +2,16 @@
 /* vim:expandtab:shiftwidth=2:tabstop=2:
  */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "ia2AccessibleText.h"
 
-#include "Accessible2.h"
 #include "AccessibleText_i.c"
 
 #include "HyperTextAccessibleWrap.h"
 #include "HyperTextAccessible-inl.h"
 #include "ProxyWrappers.h"
 #include "mozilla/ClearOnShutdown.h"
 
 using namespace mozilla::a11y;
--- a/accessible/windows/ia2/ia2AccessibleText.h
+++ b/accessible/windows/ia2/ia2AccessibleText.h
@@ -3,18 +3,16 @@
  */
 /* 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 _ACCESSIBLE_TEXT_H
 #define _ACCESSIBLE_TEXT_H
 
-#include "nsIAccessibleText.h"
-
 #include "AccessibleText.h"
 
 namespace mozilla {
 namespace a11y {
 class HyperTextAccessibleWrap;
 
 class ia2AccessibleText : public IAccessibleText {
  public:
--- a/accessible/windows/msaa/AccessibleWrap.cpp
+++ b/accessible/windows/msaa/AccessibleWrap.cpp
@@ -25,33 +25,30 @@
 #include "RootAccessible.h"
 #include "sdnAccessible.h"
 #include "States.h"
 
 #ifdef A11Y_LOG
 #  include "Logging.h"
 #endif
 
-#include "nsIMutableArray.h"
 #include "nsIFrame.h"
 #include "nsIScrollableFrame.h"
 #include "mozilla/PresShell.h"
 #include "mozilla/dom/NodeInfo.h"
 #include "mozilla/dom/BrowserBridgeParent.h"
 #include "mozilla/dom/BrowserParent.h"
-#include "nsIServiceManager.h"
 #include "nsNameSpaceManager.h"
 #include "nsTextFormatter.h"
 #include "nsView.h"
 #include "nsViewManager.h"
 #include "nsEventMap.h"
 #include "nsArrayUtils.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/ReverseIterator.h"
-#include "nsIXULRuntime.h"
 #include "mozilla/mscom/AsyncInvoker.h"
 #include "mozilla/mscom/Interceptor.h"
 
 #include "oleacc.h"
 
 using namespace mozilla;
 using namespace mozilla::a11y;
 
--- a/accessible/windows/msaa/AccessibleWrap.h
+++ b/accessible/windows/msaa/AccessibleWrap.h
@@ -4,17 +4,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_a11y_AccessibleWrap_h_
 #define mozilla_a11y_AccessibleWrap_h_
 
 #include "nsCOMPtr.h"
 #include "Accessible.h"
-#include "Accessible2.h"
 #include "ia2Accessible.h"
 #include "ia2AccessibleComponent.h"
 #include "ia2AccessibleHyperlink.h"
 #include "ia2AccessibleValue.h"
 #include "mozilla/a11y/AccessibleHandler.h"
 #include "mozilla/a11y/MsaaIdGenerator.h"
 #include "mozilla/a11y/ProxyAccessible.h"
 #include "mozilla/Attributes.h"
--- a/accessible/windows/msaa/Compatibility.cpp
+++ b/accessible/windows/msaa/Compatibility.cpp
@@ -4,16 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "Compatibility.h"
 
 #include "mozilla/WindowsVersion.h"
 #include "mozilla/WinHeaderOnlyUtils.h"
 #include "nsExceptionHandler.h"
+#include "nsIXULRuntime.h"
 #include "nsPrintfCString.h"
 #include "nsUnicharUtils.h"
 #include "nsWindowsDllInterceptor.h"
 #include "nsWinUtils.h"
 #include "Statistics.h"
 
 #include "mozilla/Preferences.h"
 
--- a/accessible/windows/msaa/ImageAccessibleWrap.cpp
+++ b/accessible/windows/msaa/ImageAccessibleWrap.cpp
@@ -1,17 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:expandtab:shiftwidth=2:tabstop=2:
  */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "ImageAccessibleWrap.h"
-#include "nsIURI.h"
 
 using namespace mozilla;
 using namespace mozilla::a11y;
 
 NS_IMPL_ISUPPORTS_INHERITED0(ImageAccessibleWrap, ImageAccessible)
 
 IMPL_IUNKNOWN_INHERITED1(ImageAccessibleWrap, AccessibleWrap,
                          ia2AccessibleImage)
--- a/accessible/windows/msaa/MsaaIdGenerator.cpp
+++ b/accessible/windows/msaa/MsaaIdGenerator.cpp
@@ -9,17 +9,16 @@
 #include "mozilla/a11y/AccessibleWrap.h"
 #include "mozilla/Assertions.h"
 #include "mozilla/ClearOnShutdown.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/StaticPtr.h"
 #include "mozilla/Unused.h"
 #include "nsDataHashtable.h"
-#include "nsIXULRuntime.h"
 #include "sdnAccessible.h"
 
 // These constants may be adjusted to modify the proportion of the Child ID
 // allocated to the content ID vs proportion allocated to the unique ID. They
 // must always sum to 31, ie. the width of a 32-bit integer less the sign bit.
 
 // NB: kNumContentProcessIDBits must be large enough to successfully hold the
 // maximum permitted number of e10s content processes. If the e10s maximum
--- a/accessible/windows/msaa/Platform.cpp
+++ b/accessible/windows/msaa/Platform.cpp
@@ -4,19 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "Platform.h"
 
 #include "AccEvent.h"
 #include "Compatibility.h"
 #include "HyperTextAccessibleWrap.h"
-#include "ia2AccessibleText.h"
 #include "nsIWindowsRegKey.h"
-#include "nsIXULRuntime.h"
 #include "nsWinUtils.h"
 #include "mozilla/a11y/ProxyAccessible.h"
 #include "mozilla/mscom/ActivationContext.h"
 #include "mozilla/mscom/InterceptorLog.h"
 #include "mozilla/mscom/Registration.h"
 #include "mozilla/mscom/Utils.h"
 #include "mozilla/StaticPtr.h"
 #include "mozilla/WindowsVersion.h"
--- a/accessible/windows/msaa/ServiceProvider.cpp
+++ b/accessible/windows/msaa/ServiceProvider.cpp
@@ -9,17 +9,16 @@
 #include "ApplicationAccessibleWrap.h"
 #include "DocAccessible.h"
 #include "nsAccUtils.h"
 #include "nsCoreUtils.h"
 #include "Relation.h"
 #include "uiaRawElmProvider.h"
 
 #include "mozilla/Preferences.h"
-#include "nsIDocShell.h"
 
 #include "ISimpleDOM.h"
 
 namespace mozilla {
 namespace a11y {
 
 IMPL_IUNKNOWN_QUERY_HEAD(ServiceProvider)
 IMPL_IUNKNOWN_QUERY_IFACE(IServiceProvider)
--- a/accessible/windows/msaa/XULListboxAccessibleWrap.h
+++ b/accessible/windows/msaa/XULListboxAccessibleWrap.h
@@ -4,17 +4,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_a11y_XULListboxAccessibleWrap_h__
 #define mozilla_a11y_XULListboxAccessibleWrap_h__
 
 #include "XULListboxAccessible.h"
 
 #include "ia2AccessibleTable.h"
-#include "ia2AccessibleTableCell.h"
 
 namespace mozilla {
 namespace a11y {
 
 /**
  * IA2 wrapper class for XULListboxAccessible class implementing
  * IAccessibleTable and IAccessibleTable2 interfaces.
  */
--- a/accessible/windows/msaa/nsWinUtils.cpp
+++ b/accessible/windows/msaa/nsWinUtils.cpp
@@ -10,20 +10,18 @@
 #include "Compatibility.h"
 #include "DocAccessible.h"
 #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 "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/xpcAccessibleHyperLink.cpp
+++ b/accessible/xpcom/xpcAccessibleHyperLink.cpp
@@ -1,16 +1,15 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "Accessible-inl.h"
-#include "xpcAccessibleDocument.h"
 #include "nsNetUtil.h"
 
 using namespace mozilla::a11y;
 
 NS_IMETHODIMP
 xpcAccessibleHyperLink::GetStartIndex(int32_t* aStartIndex) {
   NS_ENSURE_ARG_POINTER(aStartIndex);
   *aStartIndex = 0;
--- a/accessible/xpcom/xpcAccessibleHyperText.cpp
+++ b/accessible/xpcom/xpcAccessibleHyperText.cpp
@@ -4,17 +4,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "xpcAccessibleHyperText.h"
 
 #include "Accessible-inl.h"
 #include "HyperTextAccessible-inl.h"
 #include "TextRange.h"
-#include "xpcAccessibleDocument.h"
 #include "xpcAccessibleTextRange.h"
 
 #include "nsIPersistentProperties2.h"
 #include "nsIMutableArray.h"
 
 using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
--- a/accessible/xpcom/xpcAccessibleSelectable.cpp
+++ b/accessible/xpcom/xpcAccessibleSelectable.cpp
@@ -1,16 +1,15 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "Accessible-inl.h"
-#include "xpcAccessibleDocument.h"
 
 #include "nsIMutableArray.h"
 
 using namespace mozilla::a11y;
 
 NS_IMETHODIMP
 xpcAccessibleSelectable::GetSelectedItems(nsIArray** aSelectedItems) {
   NS_ENSURE_ARG_POINTER(aSelectedItems);
--- a/accessible/xpcom/xpcAccessibleTable.cpp
+++ b/accessible/xpcom/xpcAccessibleTable.cpp
@@ -3,17 +3,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "xpcAccessibleTable.h"
 
 #include "Accessible.h"
 #include "TableAccessible.h"
-#include "xpcAccessibleDocument.h"
 
 #include "nsIMutableArray.h"
 #include "nsComponentManagerUtils.h"
 
 using namespace mozilla::a11y;
 
 static const uint32_t XPC_TABLE_DEFAULT_SIZE = 40;
 
--- a/accessible/xpcom/xpcAccessibleTableCell.cpp
+++ b/accessible/xpcom/xpcAccessibleTableCell.cpp
@@ -5,17 +5,16 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "xpcAccessibleTableCell.h"
 
 #include "Accessible.h"
 #include "nsIAccessibleTable.h"
 #include "TableAccessible.h"
 #include "TableCellAccessible.h"
-#include "xpcAccessibleDocument.h"
 
 #include "nsComponentManagerUtils.h"
 #include "nsIMutableArray.h"
 
 using namespace mozilla;
 using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
--- a/accessible/xpcom/xpcAccessibleTextRange.cpp
+++ b/accessible/xpcom/xpcAccessibleTextRange.cpp
@@ -2,17 +2,16 @@
 /* vim: set ts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "xpcAccessibleTextRange.h"
 
 #include "TextRange-inl.h"
-#include "xpcAccessibleDocument.h"
 
 #include "nsIMutableArray.h"
 #include "nsComponentManagerUtils.h"
 #include "nsQueryObject.h"
 
 using namespace mozilla;
 using namespace mozilla::a11y;
 
--- a/accessible/xul/XULComboboxAccessible.cpp
+++ b/accessible/xul/XULComboboxAccessible.cpp
@@ -7,19 +7,17 @@
 
 #include "Accessible-inl.h"
 #include "nsAccessibilityService.h"
 #include "DocAccessible.h"
 #include "nsCoreUtils.h"
 #include "Role.h"
 #include "States.h"
 
-#include "nsIAutoCompleteInput.h"
 #include "nsIDOMXULMenuListElement.h"
-#include "nsIDOMXULSelectCntrlItemEl.h"
 
 using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULComboboxAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 XULComboboxAccessible::XULComboboxAccessible(nsIContent* aContent,
--- a/accessible/xul/XULFormControlAccessible.cpp
+++ b/accessible/xul/XULFormControlAccessible.cpp
@@ -4,28 +4,26 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "XULFormControlAccessible.h"
 
 #include "Accessible-inl.h"
 #include "HTMLFormControlAccessible.h"
 #include "nsAccUtils.h"
 #include "DocAccessible.h"
-#include "nsIAccessibleRelation.h"
 #include "Relation.h"
 #include "Role.h"
 #include "States.h"
 #include "TreeWalker.h"
 #include "XULMenuAccessible.h"
 
 #include "nsIDOMXULButtonElement.h"
 #include "nsIDOMXULMenuListElement.h"
 #include "nsIDOMXULRadioGroupElement.h"
 #include "nsIDOMXULSelectCntrlItemEl.h"
-#include "nsIEditor.h"
 #include "nsIFrame.h"
 #include "nsITextControlFrame.h"
 #include "nsMenuPopupFrame.h"
 #include "nsNameSpaceManager.h"
 #include "mozilla/dom/Element.h"
 
 using namespace mozilla::a11y;
 
--- a/accessible/xul/XULListboxAccessible.cpp
+++ b/accessible/xul/XULListboxAccessible.cpp
@@ -8,24 +8,21 @@
 #include "Accessible-inl.h"
 #include "nsAccessibilityService.h"
 #include "nsAccUtils.h"
 #include "DocAccessible.h"
 #include "Role.h"
 #include "States.h"
 
 #include "nsComponentManagerUtils.h"
-#include "nsIAutoCompleteInput.h"
 #include "nsIAutoCompletePopup.h"
 #include "nsIDOMXULMenuListElement.h"
 #include "nsIDOMXULMultSelectCntrlEl.h"
 #include "nsIDOMXULSelectCntrlItemEl.h"
-#include "nsIMutableArray.h"
 #include "nsINodeList.h"
-#include "nsIPersistentProperties2.h"
 
 using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULColumAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 XULColumAccessible::XULColumAccessible(nsIContent* aContent,
--- a/accessible/xul/XULListboxAccessible.h
+++ b/accessible/xul/XULListboxAccessible.h
@@ -4,18 +4,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_a11y_XULListboxAccessible_h__
 #define mozilla_a11y_XULListboxAccessible_h__
 
 #include "BaseAccessibles.h"
 #include "TableAccessible.h"
 #include "TableCellAccessible.h"
-#include "xpcAccessibleTable.h"
-#include "xpcAccessibleTableCell.h"
 #include "XULMenuAccessible.h"
 #include "XULSelectControlAccessible.h"
 
 namespace mozilla {
 namespace a11y {
 
 /**
  * XULColumAccessible are accessible for list and tree columns elements
--- a/accessible/xul/XULMenuAccessible.cpp
+++ b/accessible/xul/XULMenuAccessible.cpp
@@ -8,21 +8,18 @@
 #include "Accessible-inl.h"
 #include "nsAccessibilityService.h"
 #include "nsAccUtils.h"
 #include "DocAccessible.h"
 #include "Role.h"
 #include "States.h"
 #include "XULFormControlAccessible.h"
 
-#include "nsIMutableArray.h"
 #include "nsIDOMXULContainerElement.h"
 #include "nsIDOMXULSelectCntrlItemEl.h"
-#include "nsIDOMXULMultSelectCntrlEl.h"
-#include "nsIServiceManager.h"
 #include "nsIContent.h"
 #include "nsMenuBarFrame.h"
 #include "nsMenuPopupFrame.h"
 
 #include "mozilla/Preferences.h"
 #include "mozilla/LookAndFeel.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/KeyboardEventBinding.h"
--- a/accessible/xul/XULMenuAccessible.h
+++ b/accessible/xul/XULMenuAccessible.h
@@ -2,17 +2,16 @@
 /* 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_a11y_XULMenuAccessible_h__
 #define mozilla_a11y_XULMenuAccessible_h__
 
 #include "AccessibleWrap.h"
-#include "nsIDOMXULSelectCntrlEl.h"
 #include "XULSelectControlAccessible.h"
 
 namespace mozilla {
 namespace a11y {
 
 /**
  * Used for XUL menu, menuitem elements.
  */
--- a/accessible/xul/XULSelectControlAccessible.cpp
+++ b/accessible/xul/XULSelectControlAccessible.cpp
@@ -6,18 +6,16 @@
 
 #include "XULSelectControlAccessible.h"
 
 #include "nsAccessibilityService.h"
 #include "DocAccessible.h"
 
 #include "nsIDOMXULSelectCntrlItemEl.h"
 #include "nsIDOMXULMultSelectCntrlEl.h"
-#include "nsIMutableArray.h"
-#include "nsIServiceManager.h"
 
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/KeyboardEventBinding.h"
 
 using namespace mozilla;
 using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
--- a/accessible/xul/XULSelectControlAccessible.h
+++ b/accessible/xul/XULSelectControlAccessible.h
@@ -3,17 +3,16 @@
 /* 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_a11y_XULSelectControlAccessible_h__
 #define mozilla_a11y_XULSelectControlAccessible_h__
 
 #include "AccessibleWrap.h"
-#include "nsIDOMXULSelectCntrlEl.h"
 
 namespace mozilla {
 namespace a11y {
 
 /**
  * The basic implementation of accessible selection for XUL select controls.
  */
 class XULSelectControlAccessible : public AccessibleWrap {
--- a/accessible/xul/XULTabAccessible.cpp
+++ b/accessible/xul/XULTabAccessible.cpp
@@ -8,17 +8,16 @@
 #include "ARIAMap.h"
 #include "nsAccUtils.h"
 #include "Relation.h"
 #include "Role.h"
 #include "States.h"
 
 // NOTE: alphabetically ordered
 #include "mozilla/dom/Document.h"
-#include "nsIDOMXULSelectCntrlEl.h"
 #include "nsIDOMXULSelectCntrlItemEl.h"
 #include "nsIDOMXULRelatedElement.h"
 #include "nsXULElement.h"
 
 #include "mozilla/dom/BindingDeclarations.h"
 
 using namespace mozilla::a11y;
 
--- a/accessible/xul/XULTreeAccessible.cpp
+++ b/accessible/xul/XULTreeAccessible.cpp
@@ -15,23 +15,19 @@
 #include "DocAccessible.h"
 #include "Relation.h"
 #include "Role.h"
 #include "States.h"
 #include "XULTreeGridAccessible.h"
 #include "nsQueryObject.h"
 
 #include "nsComponentManagerUtils.h"
-#include "nsIAccessibleRelation.h"
-#include "nsIAutoCompleteInput.h"
 #include "nsIAutoCompletePopup.h"
 #include "nsIDOMXULMenuListElement.h"
-#include "nsIDOMXULMultSelectCntrlEl.h"
 #include "nsITreeSelection.h"
-#include "nsIMutableArray.h"
 #include "nsTreeBodyFrame.h"
 #include "nsTreeColumns.h"
 #include "nsTreeUtils.h"
 #include "mozilla/PresShell.h"
 #include "mozilla/dom/XULTreeElementBinding.h"
 
 using namespace mozilla::a11y;
 
--- a/accessible/xul/XULTreeGridAccessible.cpp
+++ b/accessible/xul/XULTreeGridAccessible.cpp
@@ -11,17 +11,16 @@
 #include "DocAccessible.h"
 #include "nsEventShell.h"
 #include "Relation.h"
 #include "Role.h"
 #include "States.h"
 #include "nsQueryObject.h"
 #include "nsTreeColumns.h"
 
-#include "nsIMutableArray.h"
 #include "nsPersistentProperties.h"
 #include "nsITreeSelection.h"
 #include "nsComponentManagerUtils.h"
 #include "mozilla/PresShell.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/TreeColumnBinding.h"
 #include "mozilla/dom/XULTreeElementBinding.h"
 
--- a/accessible/xul/XULTreeGridAccessible.h
+++ b/accessible/xul/XULTreeGridAccessible.h
@@ -4,18 +4,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_a11y_XULTreeGridAccessible_h__
 #define mozilla_a11y_XULTreeGridAccessible_h__
 
 #include "XULTreeAccessible.h"
 #include "TableAccessible.h"
 #include "TableCellAccessible.h"
-#include "xpcAccessibleTable.h"
-#include "xpcAccessibleTableCell.h"
 
 namespace mozilla {
 namespace a11y {
 
 class XULTreeGridCellAccessible;
 
 /**
  * Represents accessible for XUL tree in the case when it has multiple columns.
--- a/browser/app/nsBrowserApp.cpp
+++ b/browser/app/nsBrowserApp.cpp
@@ -16,17 +16,16 @@
 #  include <unistd.h>
 #endif
 
 #include <stdio.h>
 #include <stdarg.h>
 #include <time.h>
 
 #include "nsCOMPtr.h"
-#include "nsIFile.h"
 
 #ifdef XP_WIN
 #  include "LauncherProcessWin.h"
 #  include "mozilla/WindowsDllBlocklist.h"
 
 #  define XRE_WANT_ENVIRON
 #  define strcasecmp _stricmp
 #  ifdef MOZ_SANDBOX
--- a/browser/components/about/AboutRedirector.cpp
+++ b/browser/components/about/AboutRedirector.cpp
@@ -5,17 +5,16 @@
 
 // See also: docshell/base/nsAboutRedirector.cpp
 
 #include "AboutRedirector.h"
 #include "nsNetUtil.h"
 #include "nsIAboutNewTabService.h"
 #include "nsIChannel.h"
 #include "nsIURI.h"
-#include "nsIScriptSecurityManager.h"
 #include "nsIProtocolHandler.h"
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/Preferences.h"
 #include "nsServiceManagerUtils.h"
 
 namespace mozilla {
 namespace browser {
 
--- a/browser/components/dirprovider/DirectoryProvider.cpp
+++ b/browser/components/dirprovider/DirectoryProvider.cpp
@@ -1,13 +1,12 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "nsIDirectoryService.h"
 #include "DirectoryProvider.h"
 
 #include "nsIFile.h"
 #include "nsISimpleEnumerator.h"
 #include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 
 #include "nsArrayEnumerator.h"
@@ -18,17 +17,16 @@
 #include "nsComponentManagerUtils.h"
 #include "nsCOMArray.h"
 #include "nsDirectoryServiceUtils.h"
 #include "mozilla/ModuleUtils.h"
 #include "mozilla/intl/LocaleService.h"
 #include "nsServiceManagerUtils.h"
 #include "nsString.h"
 #include "nsXULAppAPI.h"
-#include "nsIPrefLocalizedString.h"
 
 using mozilla::intl::LocaleService;
 
 namespace mozilla {
 namespace browser {
 
 NS_IMPL_ISUPPORTS(DirectoryProvider, nsIDirectoryServiceProvider,
                   nsIDirectoryServiceProvider2)
--- a/browser/components/dirprovider/DirectoryProvider.h
+++ b/browser/components/dirprovider/DirectoryProvider.h
@@ -2,17 +2,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef DirectoryProvider_h__
 #define DirectoryProvider_h__
 
 #include "nsIDirectoryService.h"
 #include "nsComponentManagerUtils.h"
-#include "nsIFile.h"
 #include "nsSimpleEnumerator.h"
 #include "mozilla/Attributes.h"
 
 #define NS_BROWSERDIRECTORYPROVIDER_CONTRACTID \
   "@mozilla.org/browser/directory-provider;1"
 
 namespace mozilla {
 namespace browser {
--- a/browser/components/migration/nsIEHistoryEnumerator.cpp
+++ b/browser/components/migration/nsIEHistoryEnumerator.cpp
@@ -3,19 +3,19 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsIEHistoryEnumerator.h"
 
 #include <urlhist.h>
 #include <shlguid.h>
 
 #include "nsArrayEnumerator.h"
+#include "nsComponentManagerUtils.h"
 #include "nsCOMArray.h"
 #include "nsIURI.h"
-#include "nsIVariant.h"
 #include "nsNetUtil.h"
 #include "nsString.h"
 #include "nsWindowsMigrationUtils.h"
 #include "prtime.h"
 
 ////////////////////////////////////////////////////////////////////////////////
 //// nsIEHistoryEnumerator
 
--- a/browser/components/shell/nsGNOMEShellService.cpp
+++ b/browser/components/shell/nsGNOMEShellService.cpp
@@ -3,27 +3,24 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/ArrayUtils.h"
 
 #include "nsCOMPtr.h"
 #include "nsGNOMEShellService.h"
 #include "nsShellService.h"
-#include "nsIServiceManager.h"
 #include "nsIFile.h"
 #include "nsIProperties.h"
 #include "nsDirectoryServiceDefs.h"
-#include "nsIPrefService.h"
 #include "prenv.h"
 #include "nsString.h"
 #include "nsIGIOService.h"
 #include "nsIGSettingsService.h"
 #include "nsIStringBundle.h"
-#include "nsIOutputStream.h"
 #include "nsServiceManagerUtils.h"
 #include "nsComponentManagerUtils.h"
 #include "nsIImageLoadingContent.h"
 #include "imgIRequest.h"
 #include "imgIContainer.h"
 #include "mozilla/Sprintf.h"
 #include "mozilla/dom/Element.h"
 #if defined(MOZ_WIDGET_GTK)
--- a/browser/components/shell/nsMacShellService.cpp
+++ b/browser/components/shell/nsMacShellService.cpp
@@ -3,20 +3,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsDirectoryServiceDefs.h"
 #include "nsIImageLoadingContent.h"
 #include "mozilla/dom/Document.h"
 #include "nsIContent.h"
 #include "nsIObserverService.h"
-#include "nsIPrefService.h"
-#include "nsIServiceManager.h"
-#include "nsIStringBundle.h"
-#include "nsIURL.h"
 #include "nsIWebBrowserPersist.h"
 #include "nsMacShellService.h"
 #include "nsIProperties.h"
 #include "nsServiceManagerUtils.h"
 #include "nsShellService.h"
 #include "nsString.h"
 #include "nsIDocShell.h"
 #include "nsILoadContext.h"
--- a/browser/components/shell/nsWindowsShellService.cpp
+++ b/browser/components/shell/nsWindowsShellService.cpp
@@ -8,24 +8,20 @@
 #include "BinaryPath.h"
 #include "city.h"
 #include "imgIContainer.h"
 #include "imgIRequest.h"
 #include "mozilla/RefPtr.h"
 #include "nsIContent.h"
 #include "nsIImageLoadingContent.h"
 #include "nsIOutputStream.h"
-#include "nsIPrefService.h"
-#include "nsIPrefLocalizedString.h"
-#include "nsIServiceManager.h"
 #include "nsIStringBundle.h"
 #include "nsNetUtil.h"
 #include "nsServiceManagerUtils.h"
 #include "nsShellService.h"
-#include "nsICategoryManager.h"
 #include "nsDirectoryServiceUtils.h"
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsIWindowsRegKey.h"
 #include "nsUnicharUtils.h"
 #include "nsIURLFormatter.h"
 #include "nsXULAppAPI.h"
 #include "mozilla/WindowsVersion.h"
--- a/caps/BasePrincipal.cpp
+++ b/caps/BasePrincipal.cpp
@@ -2,19 +2,16 @@
 /* vim: set ts=2 sw=2 et tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/BasePrincipal.h"
 
 #include "nsDocShell.h"
-#include "nsIObjectInputStream.h"
-#include "nsIObjectOutputStream.h"
-#include "nsIStandardURL.h"
 
 #include "ExpandedPrincipal.h"
 #include "nsNetUtil.h"
 #include "nsContentUtils.h"
 #include "nsIURIWithSpecialOrigin.h"
 #include "nsScriptSecurityManager.h"
 #include "nsServiceManagerUtils.h"
 #include "nsAboutProtocolUtils.h"
--- a/caps/ContentPrincipal.h
+++ b/caps/ContentPrincipal.h
@@ -4,18 +4,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_ContentPrincipal_h
 #define mozilla_ContentPrincipal_h
 
 #include "nsCOMPtr.h"
 #include "nsJSPrincipals.h"
 #include "nsTArray.h"
-#include "nsIContentSecurityPolicy.h"
-#include "nsIProtocolHandler.h"
 #include "nsNetUtil.h"
 #include "nsScriptSecurityManager.h"
 #include "mozilla/BasePrincipal.h"
 #include "mozilla/extensions/WebExtensionPolicy.h"
 
 namespace Json {
 class Value;
 }
--- a/caps/DomainPolicy.cpp
+++ b/caps/DomainPolicy.cpp
@@ -3,18 +3,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "DomainPolicy.h"
 #include "mozilla/dom/ContentParent.h"
 #include "mozilla/ipc/URIUtils.h"
 #include "mozilla/Unused.h"
-#include "nsIMessageManager.h"
-#include "nsIURIMutator.h"
 #include "nsScriptSecurityManager.h"
 
 namespace mozilla {
 
 using namespace ipc;
 using namespace dom;
 
 NS_IMPL_ISUPPORTS(DomainPolicy, nsIDomainPolicy)
--- a/caps/NullPrincipal.cpp
+++ b/caps/NullPrincipal.cpp
@@ -14,17 +14,16 @@
 
 #include "nsDocShell.h"
 #include "NullPrincipal.h"
 #include "NullPrincipalURI.h"
 #include "nsMemory.h"
 #include "nsIClassInfoImpl.h"
 #include "nsNetCID.h"
 #include "nsError.h"
-#include "nsIScriptSecurityManager.h"
 #include "ContentPrincipal.h"
 #include "nsScriptSecurityManager.h"
 #include "pratom.h"
 
 #include "json/json.h"
 
 using namespace mozilla;
 
--- a/caps/NullPrincipal.h
+++ b/caps/NullPrincipal.h
@@ -9,17 +9,16 @@
  * same-origin with anything but themselves.
  */
 
 #ifndef mozilla_NullPrincipal_h
 #define mozilla_NullPrincipal_h
 
 #include "nsIPrincipal.h"
 #include "nsJSPrincipals.h"
-#include "nsIScriptSecurityManager.h"
 #include "nsCOMPtr.h"
 
 #include "mozilla/BasePrincipal.h"
 
 class nsIDocShell;
 class nsIURI;
 namespace Json {
 class Value;
--- a/caps/SystemPrincipal.cpp
+++ b/caps/SystemPrincipal.cpp
@@ -2,25 +2,21 @@
 /* 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/. */
 
 /* The privileged system principal. */
 
 #include "nscore.h"
 #include "SystemPrincipal.h"
-#include "nsIComponentManager.h"
-#include "nsIServiceManager.h"
-#include "nsIURL.h"
 #include "nsCOMPtr.h"
 #include "nsReadableUtils.h"
 #include "nsCRT.h"
 #include "nsString.h"
 #include "nsIClassInfoImpl.h"
-#include "nsIScriptSecurityManager.h"
 #include "pratom.h"
 
 using namespace mozilla;
 
 NS_IMPL_CLASSINFO(SystemPrincipal, nullptr,
                   nsIClassInfo::SINGLETON | nsIClassInfo::MAIN_THREAD_ONLY,
                   NS_SYSTEMPRINCIPAL_CID)
 NS_IMPL_QUERY_INTERFACE_CI(SystemPrincipal, nsIPrincipal, nsISerializable)
--- a/caps/nsJSPrincipals.cpp
+++ b/caps/nsJSPrincipals.cpp
@@ -1,21 +1,18 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "xpcpublic.h"
 #include "nsString.h"
-#include "nsIObjectOutputStream.h"
-#include "nsIObjectInputStream.h"
 #include "nsJSPrincipals.h"
 #include "plstr.h"
 #include "nsCOMPtr.h"
-#include "nsIServiceManager.h"
 #include "nsMemory.h"
 #include "nsStringBuffer.h"
 #include "mozilla/BasePrincipal.h"
 #include "mozilla/dom/StructuredCloneTags.h"
 // for mozilla::dom::workerinternals::kJSPrincipalsDebugToken
 #include "mozilla/dom/workerinternals/JSSettings.h"
 // for mozilla::dom::worklet::kJSPrincipalsDebugToken
 #include "mozilla/dom/WorkletPrincipals.h"
--- a/caps/nsScriptSecurityManager.cpp
+++ b/caps/nsScriptSecurityManager.cpp
@@ -8,24 +8,20 @@
 
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/StaticPrefs_extensions.h"
 #include "mozilla/StaticPrefs_security.h"
 #include "mozilla/StoragePrincipalHelper.h"
 
 #include "xpcpublic.h"
 #include "XPCWrapper.h"
-#include "nsIInputStreamChannel.h"
 #include "nsILoadContext.h"
-#include "nsIServiceManager.h"
 #include "nsIScriptObjectPrincipal.h"
 #include "nsIScriptContext.h"
 #include "nsIScriptError.h"
-#include "nsIURL.h"
-#include "nsIURIMutator.h"
 #include "nsINestedURI.h"
 #include "nspr.h"
 #include "nsJSPrincipals.h"
 #include "mozilla/BasePrincipal.h"
 #include "ExpandedPrincipal.h"
 #include "SystemPrincipal.h"
 #include "DomainPolicy.h"
 #include "nsString.h"
@@ -35,53 +31,44 @@
 #include "nsDocShell.h"
 #include "nsError.h"
 #include "nsGlobalWindowInner.h"
 #include "nsDOMCID.h"
 #include "nsTextFormatter.h"
 #include "nsIStringBundle.h"
 #include "nsNetUtil.h"
 #include "nsIEffectiveTLDService.h"
-#include "nsIProperties.h"
 #include "nsDirectoryServiceDefs.h"
-#include "nsIFile.h"
-#include "nsIFileURL.h"
-#include "nsIZipReader.h"
 #include "nsIScriptGlobalObject.h"
 #include "nsPIDOMWindow.h"
 #include "nsIDocShell.h"
-#include "nsIPrompt.h"
-#include "nsIWindowWatcher.h"
 #include "nsIConsoleService.h"
 #include "nsIOService.h"
 #include "nsIContent.h"
 #include "nsDOMJSUtils.h"
 #include "nsAboutProtocolUtils.h"
 #include "nsIClassInfo.h"
 #include "nsIURIFixup.h"
 #include "nsIChromeRegistry.h"
 #include "nsIResProtocolHandler.h"
 #include "nsIContentSecurityPolicy.h"
-#include "nsIAsyncVerifyRedirectCallback.h"
 #include "mozilla/Components.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/dom/BindingUtils.h"
 #include "mozilla/NullPrincipal.h"
 #include <stdint.h>
 #include "mozilla/dom/nsCSPContext.h"
 #include "mozilla/dom/ScriptSettings.h"
 #include "mozilla/ClearOnShutdown.h"
 #include "mozilla/StaticPtr.h"
 #include "mozilla/dom/WorkerCommon.h"
 #include "mozilla/dom/WorkerPrivate.h"
 #include "nsContentUtils.h"
 #include "nsJSUtils.h"
 #include "nsILoadInfo.h"
-#include "nsIDOMXULCommandDispatcher.h"
-#include "nsITreeSelection.h"
 
 // This should be probably defined on some other place... but I couldn't find it
 #define WEBAPPS_PERM_NAME "webapps-manage"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 nsIIOService* nsScriptSecurityManager::sIOService = nullptr;
--- a/chrome/nsChromeProtocolHandler.cpp
+++ b/chrome/nsChromeProtocolHandler.cpp
@@ -14,19 +14,16 @@
 #include "nsChromeRegistry.h"
 #include "nsCOMPtr.h"
 #include "nsContentUtils.h"
 #include "nsThreadUtils.h"
 #include "nsIChannel.h"
 #include "nsIChromeRegistry.h"
 #include "nsIFile.h"
 #include "nsIFileChannel.h"
-#include "nsIIOService.h"
-#include "nsILoadGroup.h"
-#include "nsIScriptSecurityManager.h"
 #include "nsIStandardURL.h"
 #include "nsNetUtil.h"
 #include "nsNetCID.h"
 #include "nsIURL.h"
 #include "nsString.h"
 #include "nsStandardURL.h"
 
 ////////////////////////////////////////////////////////////////////////////////
--- a/chrome/nsChromeRegistry.cpp
+++ b/chrome/nsChromeRegistry.cpp
@@ -15,25 +15,22 @@
 #include "nsString.h"
 #include "nsQueryObject.h"
 
 #include "mozilla/dom/URL.h"
 #include "nsIConsoleService.h"
 #include "mozilla/dom/Document.h"
 #include "nsIObserverService.h"
 #include "nsIScriptError.h"
-#include "nsIWindowMediator.h"
-#include "nsIPrefService.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/PresShell.h"
 #include "mozilla/Printf.h"
 #include "mozilla/StyleSheet.h"
 #include "mozilla/StyleSheetInlines.h"
 #include "mozilla/dom/Location.h"
-#include "nsIURIMutator.h"
 
 #include "unicode/uloc.h"
 
 nsChromeRegistry* nsChromeRegistry::gChromeRegistry;
 
 // DO NOT use namespace mozilla; it'll break due to a naming conflict between
 // mozilla::TextRange and a TextRange in OSX headers.
 using mozilla::PresShell;
--- a/chrome/nsChromeRegistryChrome.cpp
+++ b/chrome/nsChromeRegistryChrome.cpp
@@ -24,18 +24,16 @@
 #include "nsTextFormatter.h"
 #include "nsXPCOMCIDInternal.h"
 
 #include "mozilla/LookAndFeel.h"
 #include "mozilla/Unused.h"
 
 #include "nsIAppStartup.h"
 #include "nsIObserverService.h"
-#include "nsIPrefBranch.h"
-#include "nsIPrefService.h"
 #include "mozilla/Preferences.h"
 #include "nsIResProtocolHandler.h"
 #include "nsIScriptError.h"
 #include "nsIXULRuntime.h"
 
 #define PACKAGE_OVERRIDE_BRANCH "chrome.override_package."
 #define SKIN NS_LITERAL_CSTRING("classic/1.0")
 
--- a/chrome/nsChromeRegistryContent.cpp
+++ b/chrome/nsChromeRegistryContent.cpp
@@ -3,17 +3,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "RegistryMessageUtils.h"
 #include "nsChromeRegistryContent.h"
 #include "nsString.h"
 #include "nsNetUtil.h"
-#include "nsIResProtocolHandler.h"
 
 nsChromeRegistryContent::nsChromeRegistryContent() {}
 
 void nsChromeRegistryContent::RegisterRemoteChrome(
     const nsTArray<ChromePackage>& aPackages,
     const nsTArray<SubstitutionMapping>& aSubstitutions,
     const nsTArray<OverrideMapping>& aOverrides, const nsACString& aLocale,
     bool aReset) {
--- a/devtools/platform/nsJSInspector.cpp
+++ b/devtools/platform/nsJSInspector.cpp
@@ -1,15 +1,14 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsJSInspector.h"
-#include "nsIXPConnect.h"
 #include "nsThreadUtils.h"
 #include "jsfriendapi.h"
 #include "mozilla/HoldDropJSObjects.h"
 #include "mozilla/dom/ScriptSettings.h"
 #include "nsServiceManagerUtils.h"
 #include "nsMemory.h"
 #include "nsArray.h"
 #include "nsTArray.h"
--- a/docshell/base/CanonicalBrowsingContext.h
+++ b/docshell/base/CanonicalBrowsingContext.h
@@ -12,18 +12,16 @@
 #include "mozilla/RefPtr.h"
 #include "mozilla/MozPromise.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsWrapperCache.h"
 #include "nsTHashtable.h"
 #include "nsHashKeys.h"
 #include "nsISHistory.h"
 
-class nsIDocShell;
-
 namespace mozilla {
 namespace dom {
 
 class WindowGlobalParent;
 class BrowserParent;
 
 // CanonicalBrowsingContext is a BrowsingContext living in the parent
 // process, with whatever extra data that a BrowsingContext in the
--- a/docshell/base/nsCTooltipTextProvider.h
+++ b/docshell/base/nsCTooltipTextProvider.h
@@ -2,16 +2,14 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef NSCTOOLTIPTEXTPROVIDER_H
 #define NSCTOOLTIPTEXTPROVIDER_H
 
-#include "nsITooltipTextProvider.h"
-
 #define NS_TOOLTIPTEXTPROVIDER_CONTRACTID \
   "@mozilla.org/embedcomp/tooltiptextprovider;1"
 #define NS_DEFAULTTOOLTIPTEXTPROVIDER_CONTRACTID \
   "@mozilla.org/embedcomp/default-tooltiptextprovider;1"
 
 #endif
--- a/docshell/base/nsDSURIContentListener.cpp
+++ b/docshell/base/nsDSURIContentListener.cpp
@@ -6,17 +6,16 @@
 
 #include "nsDocShell.h"
 #include "nsDSURIContentListener.h"
 #include "nsIChannel.h"
 #include "nsServiceManagerUtils.h"
 #include "nsDocShellCID.h"
 #include "nsIWebNavigationInfo.h"
 #include "mozilla/dom/Document.h"
-#include "nsIHttpChannel.h"
 #include "nsError.h"
 #include "nsContentSecurityManager.h"
 #include "nsDocShellLoadTypes.h"
 #include "nsGlobalWindowOuter.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsIMultiPartChannel.h"
 
 using namespace mozilla;
--- a/docshell/base/nsDefaultURIFixup.cpp
+++ b/docshell/base/nsDefaultURIFixup.cpp
@@ -18,17 +18,16 @@
 #include "nsDefaultURIFixup.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/ipc/IPCStreamUtils.h"
 #include "mozilla/ipc/URIUtils.h"
 #include "mozilla/TextUtils.h"
 #include "mozilla/Tokenizer.h"
 #include "mozilla/Unused.h"
-#include "nsIObserverService.h"
 #include "nsXULAppAPI.h"
 #include "mozilla/StaticPrefs_browser.h"
 #include "mozilla/StaticPrefs_keyword.h"
 
 // Used to check if external protocol schemes are usable
 #include "nsCExternalHandlerService.h"
 #include "nsIExternalProtocolService.h"
 
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -74,47 +74,44 @@
 
 #include "mozilla/net/DocumentChannelChild.h"
 #include "mozilla/net/UrlClassifierFeatureFactory.h"
 #include "ReferrerInfo.h"
 
 #include "nsIApplicationCacheChannel.h"
 #include "nsIApplicationCacheContainer.h"
 #include "nsIAppShell.h"
-#include "nsIAsyncVerifyRedirectCallback.h"
 #include "nsIAuthPrompt.h"
 #include "nsIAuthPrompt2.h"
 #include "nsICachingChannel.h"
 #include "nsICaptivePortalService.h"
 #include "nsIChannel.h"
 #include "nsIChannelEventSink.h"
 #include "nsIClassOfService.h"
 #include "nsIConsoleReportCollector.h"
 #include "nsIContent.h"
 #include "nsIContentInlines.h"
 #include "nsIContentSecurityPolicy.h"
 #include "nsIContentViewer.h"
 #include "nsIController.h"
-#include "nsICookieService.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsIDocShellTreeOwner.h"
 #include "mozilla/dom/Document.h"
 #include "nsIDocumentLoaderFactory.h"
 #include "nsIDOMWindow.h"
 #include "nsIEditingSession.h"
 #include "nsIExternalProtocolService.h"
 #include "nsIFormPOSTActionChannel.h"
 #include "nsIFrame.h"
 #include "nsIGlobalObject.h"
 #include "nsIHttpChannel.h"
 #include "nsIHttpChannelInternal.h"
 #include "nsIIDNService.h"
 #include "nsIInputStreamChannel.h"
 #include "nsIInterfaceRequestorUtils.h"
-#include "nsIJARChannel.h"
 #include "nsILayoutHistoryState.h"
 #include "nsILoadInfo.h"
 #include "nsIMultiPartChannel.h"
 #include "nsINestedURI.h"
 #include "nsINetworkPredictor.h"
 #include "nsINode.h"
 #include "nsINSSErrorsService.h"
 #include "nsIObserverService.h"
@@ -125,36 +122,31 @@
 #include "nsIPromptFactory.h"
 #include "nsIReflowObserver.h"
 #include "nsIScriptChannel.h"
 #include "nsIScriptObjectPrincipal.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsIScrollableFrame.h"
 #include "nsIScrollObserver.h"
 #include "nsISecureBrowserUI.h"
-#include "nsISecurityUITelemetry.h"
 #include "nsISeekableStream.h"
 #include "nsISelectionDisplay.h"
 #include "nsISHEntry.h"
-#include "nsISHistory.h"
 #include "nsISiteSecurityService.h"
 #include "nsISocketProvider.h"
 #include "nsIStringBundle.h"
 #include "nsIStructuredCloneContainer.h"
-#include "nsISupportsPrimitives.h"
 #include "nsIBrowserChild.h"
 #include "nsITextToSubURI.h"
 #include "nsITimedChannel.h"
 #include "nsITimer.h"
 #include "nsITransportSecurityInfo.h"
 #include "nsIUploadChannel.h"
 #include "nsIURIFixup.h"
 #include "nsIURILoader.h"
-#include "nsIURIMutator.h"
-#include "nsIURL.h"
 #include "nsIViewSourceChannel.h"
 #include "nsIWebBrowserChrome.h"
 #include "nsIWebBrowserChrome3.h"
 #include "nsIWebBrowserChromeFocus.h"
 #include "nsIWebBrowserFind.h"
 #include "nsIWebProgress.h"
 #include "nsIWidget.h"
 #include "nsIWindowWatcher.h"
@@ -162,18 +154,16 @@
 
 #include "nsCommandManager.h"
 #include "nsPIDOMWindow.h"
 #include "nsPIWindowRoot.h"
 
 #include "IHistory.h"
 #include "IUrlClassifierUITelemetry.h"
 
-#include "mozIThirdPartyUtil.h"
-
 #include "nsArray.h"
 #include "nsArrayUtils.h"
 #include "nsAutoPtr.h"
 #include "nsCExternalHandlerService.h"
 #include "nsContentDLF.h"
 #include "nsContentPolicyUtils.h"  // NS_CheckContentLoadPolicy(...)
 #include "nsContentSecurityManager.h"
 #include "nsContentUtils.h"
--- a/docshell/base/nsDocShell.h
+++ b/docshell/base/nsDocShell.h
@@ -30,17 +30,16 @@
 #include "nsIDocShellTreeItem.h"
 #include "nsIDOMStorageManager.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsILoadContext.h"
 #include "nsILoadURIDelegate.h"
 #include "nsINetworkInterceptController.h"
 #include "nsIRefreshURI.h"
 #include "nsIScrollable.h"
-#include "nsIRemoteTab.h"
 #include "nsIWebNavigation.h"
 #include "nsIWebPageDescriptor.h"
 #include "nsIWebProgressListener.h"
 
 #include "nsAutoPtr.h"
 #include "nsCharsetSource.h"
 #include "nsCOMPtr.h"
 #include "nsContentPolicyUtils.h"
--- a/docshell/base/nsDocShellEditorData.cpp
+++ b/docshell/base/nsDocShellEditorData.cpp
@@ -3,17 +3,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsDocShellEditorData.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsComponentManagerUtils.h"
 #include "nsPIDOMWindow.h"
-#include "nsIEditor.h"
 #include "nsEditingSession.h"
 #include "nsIDocShell.h"
 
 using namespace mozilla;
 
 nsDocShellEditorData::nsDocShellEditorData(nsIDocShell* aOwningDocShell)
     : mDocShell(aOwningDocShell),
       mDetachedEditingState(Document::EditingState::eOff),
--- a/docshell/base/nsDocShellLoadState.cpp
+++ b/docshell/base/nsDocShellLoadState.cpp
@@ -5,17 +5,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsDocShellLoadState.h"
 #include "nsIDocShell.h"
 #include "SHEntryParent.h"
 #include "SHEntryChild.h"
 #include "nsISHEntry.h"
 #include "nsIDocShellTreeItem.h"
-#include "nsIScriptSecurityManager.h"
 #include "nsIWebNavigation.h"
 #include "nsIChildChannel.h"
 #include "ReferrerInfo.h"
 #include "mozilla/BasePrincipal.h"
 #include "mozilla/dom/LoadURIOptionsBinding.h"
 #include "mozilla/StaticPrefs_fission.h"
 
 #include "mozilla/OriginAttributes.h"
--- a/docshell/base/nsDocShellTreeOwner.cpp
+++ b/docshell/base/nsDocShellTreeOwner.cpp
@@ -7,48 +7,43 @@
 // Local Includes
 #include "nsDocShellTreeOwner.h"
 #include "nsWebBrowser.h"
 
 // Helper Classes
 #include "nsContentUtils.h"
 #include "nsSize.h"
 #include "mozilla/ReflowInput.h"
-#include "nsIServiceManager.h"
 #include "nsComponentManagerUtils.h"
 #include "nsString.h"
 #include "nsAtom.h"
 #include "nsReadableUtils.h"
 #include "nsUnicharUtils.h"
-#include "nsISimpleEnumerator.h"
 #include "mozilla/LookAndFeel.h"
 
 // Interfaces needed to be included
 #include "nsPresContext.h"
 #include "nsITooltipListener.h"
 #include "nsINode.h"
 #include "Link.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/MouseEvent.h"
 #include "mozilla/dom/SVGTitleElement.h"
 #include "nsIFormControl.h"
-#include "nsIImageLoadingContent.h"
 #include "nsIWebNavigation.h"
-#include "nsIStringBundle.h"
 #include "nsPIDOMWindow.h"
 #include "nsPIWindowRoot.h"
 #include "nsIWindowWatcher.h"
 #include "nsPIWindowWatcher.h"
 #include "nsIPrompt.h"
 #include "nsIRemoteTab.h"
 #include "nsIBrowserChild.h"
 #include "nsRect.h"
 #include "nsIWebBrowserChromeFocus.h"
 #include "nsIContent.h"
-#include "imgIContainer.h"
 #include "nsViewManager.h"
 #include "nsView.h"
 #include "nsIConstraintValidation.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/EventListenerManager.h"
 #include "mozilla/dom/DragEvent.h"
 #include "mozilla/dom/Event.h"     // for Event
 #include "mozilla/dom/File.h"      // for input type=file
--- a/docshell/base/nsDocShellTreeOwner.h
+++ b/docshell/base/nsDocShellTreeOwner.h
@@ -19,28 +19,27 @@
 #include "nsIWebBrowserChrome.h"
 #include "nsIDOMEventListener.h"
 #include "nsIEmbeddingSiteWindow.h"
 #include "nsIWebProgressListener.h"
 #include "nsWeakReference.h"
 #include "nsITimer.h"
 #include "nsIPrompt.h"
 #include "nsIAuthPrompt.h"
-#include "nsITooltipListener.h"
 #include "nsITooltipTextProvider.h"
 #include "nsCTooltipTextProvider.h"
-#include "nsIDroppedLinkHandler.h"
 
 namespace mozilla {
 namespace dom {
 class Event;
 class EventTarget;
 }  // namespace dom
 }  // namespace mozilla
 
+class nsIDocShellTreeItem;
 class nsWebBrowser;
 class ChromeTooltipListener;
 
 class nsDocShellTreeOwner final : public nsIDocShellTreeOwner,
                                   public nsIBaseWindow,
                                   public nsIInterfaceRequestor,
                                   public nsIWebProgressListener,
                                   public nsIDOMEventListener,
--- a/docshell/shistory/ChildSHistory.cpp
+++ b/docshell/shistory/ChildSHistory.cpp
@@ -6,22 +6,20 @@
 
 #include "mozilla/dom/ChildSHistory.h"
 #include "mozilla/dom/ChildSHistoryBinding.h"
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/dom/ContentFrameMessageManager.h"
 #include "mozilla/dom/SHEntryChild.h"
 #include "mozilla/dom/SHistoryChild.h"
 #include "mozilla/StaticPrefs_fission.h"
-#include "nsIMessageManager.h"
 #include "nsComponentManagerUtils.h"
 #include "nsSHEntry.h"
 #include "nsSHistory.h"
 #include "nsDocShell.h"
-#include "nsISHEntry.h"
 #include "nsXULAppAPI.h"
 
 namespace mozilla {
 namespace dom {
 
 static already_AddRefed<nsISHistory> CreateSHistory(nsDocShell* aDocShell) {
   if (XRE_IsContentProcess() && StaticPrefs::fission_sessionHistoryInParent()) {
     return do_AddRef(static_cast<SHistoryChild*>(
--- a/docshell/shistory/nsSHEntryShared.cpp
+++ b/docshell/shistory/nsSHEntryShared.cpp
@@ -4,18 +4,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsSHEntryShared.h"
 
 #include "nsArray.h"
 #include "nsDocShellEditorData.h"
 #include "nsIContentViewer.h"
-#include "nsIDocShell.h"
-#include "nsIDocShellTreeItem.h"
 #include "mozilla/dom/Document.h"
 #include "nsILayoutHistoryState.h"
 #include "nsIWebNavigation.h"
 #include "nsSHistory.h"
 #include "nsThreadUtils.h"
 
 #include "mozilla/Attributes.h"
 #include "mozilla/Preferences.h"
--- a/editor/composer/ComposerCommandsUpdater.cpp
+++ b/editor/composer/ComposerCommandsUpdater.cpp
@@ -10,17 +10,16 @@
 #include "mozilla/TransactionManager.h"  // for TransactionManager
 #include "mozilla/dom/Selection.h"
 #include "nsAString.h"
 #include "nsCommandManager.h"            // for nsCommandManager
 #include "nsComponentManagerUtils.h"     // for do_CreateInstance
 #include "nsDebug.h"                     // for NS_ENSURE_TRUE, etc
 #include "nsError.h"                     // for NS_OK, NS_ERROR_FAILURE, etc
 #include "nsID.h"                        // for NS_GET_IID, etc
-#include "nsIDocShell.h"                 // for nsIDocShell
 #include "nsIInterfaceRequestorUtils.h"  // for do_GetInterface
 #include "nsITransactionManager.h"       // for nsITransactionManager
 #include "nsLiteralString.h"             // for NS_LITERAL_STRING
 #include "nsPIDOMWindow.h"               // for nsPIDOMWindow
 
 class nsITransaction;
 
 namespace mozilla {
--- a/editor/composer/nsEditingSession.cpp
+++ b/editor/composer/nsEditingSession.cpp
@@ -14,32 +14,30 @@
 #include "mozilla/PresShell.h"                // for PresShell
 #include "nsAString.h"
 #include "nsBaseCommandController.h"  // for nsBaseCommandController
 #include "nsCommandManager.h"         // for nsCommandManager
 #include "nsComponentManagerUtils.h"  // for do_CreateInstance
 #include "nsContentUtils.h"
 #include "nsDebug.h"  // for NS_ENSURE_SUCCESS, etc
 #include "nsEditingSession.h"
-#include "nsError.h"               // for NS_ERROR_FAILURE, NS_OK, etc
-#include "nsIChannel.h"            // for nsIChannel
-#include "nsIContentViewer.h"      // for nsIContentViewer
-#include "nsIControllers.h"        // for nsIControllers
-#include "nsID.h"                  // for NS_GET_IID, etc
-#include "nsHTMLDocument.h"        // for nsHTMLDocument
-#include "nsIDocShell.h"           // for nsIDocShell
-#include "mozilla/dom/Document.h"  // for Document
-#include "nsIDocumentStateListener.h"
+#include "nsError.h"                     // for NS_ERROR_FAILURE, NS_OK, etc
+#include "nsIChannel.h"                  // for nsIChannel
+#include "nsIContentViewer.h"            // for nsIContentViewer
+#include "nsIControllers.h"              // for nsIControllers
+#include "nsID.h"                        // for NS_GET_IID, etc
+#include "nsHTMLDocument.h"              // for nsHTMLDocument
+#include "nsIDocShell.h"                 // for nsIDocShell
+#include "mozilla/dom/Document.h"        // for Document
 #include "nsIEditor.h"                   // for nsIEditor
 #include "nsIInterfaceRequestorUtils.h"  // for do_GetInterface
 #include "nsIPlaintextEditor.h"          // for nsIPlaintextEditor, etc
 #include "nsIRefreshURI.h"               // for nsIRefreshURI
 #include "nsIRequest.h"                  // for nsIRequest
 #include "nsITimer.h"                    // for nsITimer, etc
-#include "nsITransactionManager.h"       // for nsITransactionManager
 #include "nsIWeakReference.h"            // for nsISupportsWeakReference, etc
 #include "nsIWebNavigation.h"            // for nsIWebNavigation
 #include "nsIWebProgress.h"              // for nsIWebProgress, etc
 #include "nsLiteralString.h"             // for NS_LITERAL_STRING
 #include "nsPIDOMWindow.h"               // for nsPIDOMWindow
 #include "nsPresContext.h"               // for nsPresContext
 #include "nsReadableUtils.h"             // for AppendUTF16toUTF8
 #include "nsStringFwd.h"                 // for nsString
--- a/editor/libeditor/CSSEditUtils.cpp
+++ b/editor/libeditor/CSSEditUtils.cpp
@@ -20,17 +20,16 @@
 #include "nsDebug.h"
 #include "nsDependentSubstring.h"
 #include "nsError.h"
 #include "nsGkAtoms.h"
 #include "nsAtom.h"
 #include "nsIContent.h"
 #include "nsICSSDeclaration.h"
 #include "mozilla/dom/Document.h"
-#include "nsIEditor.h"
 #include "nsINode.h"
 #include "nsISupportsImpl.h"
 #include "nsISupportsUtils.h"
 #include "nsLiteralString.h"
 #include "nsPIDOMWindow.h"
 #include "nsReadableUtils.h"
 #include "nsString.h"
 #include "nsStringFwd.h"
--- a/editor/libeditor/CreateElementTransaction.cpp
+++ b/editor/libeditor/CreateElementTransaction.cpp
@@ -15,17 +15,16 @@
 #include "mozilla/EditorBase.h"
 #include "mozilla/EditorDOMPoint.h"
 
 #include "nsAlgorithm.h"
 #include "nsAString.h"
 #include "nsDebug.h"
 #include "nsError.h"
 #include "nsIContent.h"
-#include "nsIEditor.h"
 #include "nsINode.h"
 #include "nsISupportsUtils.h"
 #include "nsMemory.h"
 #include "nsReadableUtils.h"
 #include "nsStringFwd.h"
 #include "nsString.h"
 
 namespace mozilla {
--- a/editor/libeditor/DeleteTextTransaction.cpp
+++ b/editor/libeditor/DeleteTextTransaction.cpp
@@ -7,17 +7,16 @@
 
 #include "mozilla/Assertions.h"
 #include "mozilla/EditorBase.h"
 #include "mozilla/EditorDOMPoint.h"
 #include "mozilla/SelectionState.h"
 #include "mozilla/dom/Selection.h"
 #include "nsDebug.h"
 #include "nsError.h"
-#include "nsIEditor.h"
 #include "nsISupportsImpl.h"
 #include "nsAString.h"
 
 namespace mozilla {
 
 using namespace dom;
 
 // static
--- a/editor/libeditor/EditorBase.cpp
+++ b/editor/libeditor/EditorBase.cpp
@@ -74,21 +74,19 @@
 #include "nsFocusManager.h"            // for nsFocusManager
 #include "nsFrameSelection.h"          // for nsFrameSelection
 #include "nsGenericHTMLElement.h"      // for nsGenericHTMLElement
 #include "nsGkAtoms.h"                 // for nsGkAtoms, nsGkAtoms::dir
 #include "nsIAbsorbingTransaction.h"   // for nsIAbsorbingTransaction
 #include "nsAtom.h"                    // for nsAtom
 #include "nsIContent.h"                // for nsIContent
 #include "mozilla/dom/Document.h"      // for Document
-#include "nsIDOMEventListener.h"       // for nsIDOMEventListener
 #include "nsIDocumentStateListener.h"  // for nsIDocumentStateListener
 #include "nsIEditActionListener.h"     // for nsIEditActionListener
 #include "nsIEditorObserver.h"         // for nsIEditorObserver
-#include "nsIEditorSpellCheck.h"       // for nsIEditorSpellCheck
 #include "nsIFrame.h"                  // for nsIFrame
 #include "nsIInlineSpellChecker.h"     // for nsIInlineSpellChecker, etc.
 #include "nsNameSpaceManager.h"        // for kNameSpaceID_None, etc.
 #include "nsINode.h"                   // for nsINode, etc.
 #include "nsIPlaintextEditor.h"        // for nsIPlaintextEditor, etc.
 #include "nsISelectionController.h"    // for nsISelectionController, etc.
 #include "nsISelectionDisplay.h"       // for nsISelectionDisplay, etc.
 #include "nsISupportsBase.h"           // for nsISupports
--- a/editor/libeditor/EditorBase.h
+++ b/editor/libeditor/EditorBase.h
@@ -23,17 +23,16 @@
 #include "mozilla/dom/Selection.h"
 #include "mozilla/dom/Text.h"
 #include "nsCOMPtr.h"  // for already_AddRefed, nsCOMPtr
 #include "nsCycleCollectionParticipant.h"
 #include "nsGkAtoms.h"
 #include "mozilla/dom/Document.h"
 #include "nsIContentInlines.h"       // for nsINode::IsEditable()
 #include "nsIEditor.h"               // for nsIEditor, etc.
-#include "nsIObserver.h"             // for NS_DECL_NSIOBSERVER, etc.
 #include "nsIPlaintextEditor.h"      // for nsIPlaintextEditor, etc.
 #include "nsISelectionController.h"  // for nsISelectionController constants
 #include "nsISelectionListener.h"    // for nsISelectionListener
 #include "nsISupportsImpl.h"         // for EditorBase::Release, etc.
 #include "nsIWeakReferenceUtils.h"   // for nsWeakPtr
 #include "nsLiteralString.h"         // for NS_LITERAL_STRING
 #include "nsPIDOMWindow.h"           // for nsPIDOMWindowInner, etc.
 #include "nsString.h"                // for nsCString
--- a/editor/libeditor/EditorEventListener.cpp
+++ b/editor/libeditor/EditorEventListener.cpp
@@ -22,34 +22,30 @@
 #include "mozilla/dom/EventTarget.h"       // for EventTarget
 #include "mozilla/dom/MouseEvent.h"        // for MouseEvent
 #include "mozilla/dom/Selection.h"
 #include "nsAString.h"
 #include "nsCaret.h"         // for nsCaret
 #include "nsDebug.h"         // for NS_ENSURE_TRUE, etc.
 #include "nsFocusManager.h"  // for nsFocusManager
 #include "nsGkAtoms.h"       // for nsGkAtoms, nsGkAtoms::input
-#include "nsIClipboard.h"    // for nsIClipboard, etc.
 #include "nsIContent.h"      // for nsIContent
 #include "nsIController.h"   // for nsIController
 #include "nsID.h"
 #include "mozilla/dom/DOMStringList.h"
 #include "mozilla/dom/DataTransfer.h"
 #include "mozilla/dom/DragEvent.h"
-#include "mozilla/dom/Document.h"    // for Document
-#include "nsIFocusManager.h"         // for nsIFocusManager
-#include "nsIFormControl.h"          // for nsIFormControl, etc.
-#include "nsINode.h"                 // for nsINode, ::NODE_IS_EDITABLE, etc.
-#include "nsIPlaintextEditor.h"      // for nsIPlaintextEditor, etc.
-#include "nsISelectionController.h"  // for nsISelectionController, etc.
-#include "nsITransferable.h"         // for kFileMime, kHTMLMime, etc.
-#include "nsIWidget.h"               // for nsIWidget
-#include "nsLiteralString.h"         // for NS_LITERAL_STRING
-#include "nsPIWindowRoot.h"          // for nsPIWindowRoot
-#include "nsPrintfCString.h"         // for nsPrintfCString
+#include "mozilla/dom/Document.h"  // for Document
+#include "nsIFormControl.h"        // for nsIFormControl, etc.
+#include "nsINode.h"               // for nsINode, ::NODE_IS_EDITABLE, etc.
+#include "nsIPlaintextEditor.h"    // for nsIPlaintextEditor, etc.
+#include "nsIWidget.h"             // for nsIWidget
+#include "nsLiteralString.h"       // for NS_LITERAL_STRING
+#include "nsPIWindowRoot.h"        // for nsPIWindowRoot
+#include "nsPrintfCString.h"       // for nsPrintfCString
 #include "nsRange.h"
 #include "nsServiceManagerUtils.h"  // for do_GetService
 #include "nsString.h"               // for nsAutoString
 #include "nsQueryObject.h"          // for do_QueryObject
 #ifdef HANDLE_NATIVE_TEXT_DIRECTION_SWITCH
 #  include "nsContentUtils.h"   // for nsContentUtils, etc.
 #  include "nsIBidiKeyboard.h"  // for nsIBidiKeyboard
 #endif
--- a/editor/libeditor/EditorUtils.cpp
+++ b/editor/libeditor/EditorUtils.cpp
@@ -10,17 +10,16 @@
 #include "mozilla/OwningNonNull.h"
 #include "mozilla/TextEditor.h"
 #include "mozilla/dom/Selection.h"
 #include "mozilla/dom/Text.h"
 #include "nsContentUtils.h"
 #include "nsComponentManagerUtils.h"
 #include "nsError.h"
 #include "nsIContent.h"
-#include "nsIDocShell.h"
 #include "mozilla/dom/Document.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsINode.h"
 
 class nsISupports;
 class nsRange;
 
 namespace mozilla {
--- a/editor/libeditor/EditorUtils.h
+++ b/editor/libeditor/EditorUtils.h
@@ -11,17 +11,16 @@
 #include "mozilla/EditorBase.h"
 #include "mozilla/EditorDOMPoint.h"
 #include "mozilla/GuardObjects.h"
 #include "mozilla/RangeBoundary.h"
 #include "mozilla/dom/Selection.h"
 #include "mozilla/dom/StaticRange.h"
 #include "nsCOMPtr.h"
 #include "nsDebug.h"
-#include "nsIEditor.h"
 #include "nsRange.h"
 #include "nscore.h"
 
 class nsAtom;
 class nsISimpleEnumerator;
 class nsITransferable;
 
 namespace mozilla {
--- a/editor/libeditor/HTMLAbsPositionEditor.cpp
+++ b/editor/libeditor/HTMLAbsPositionEditor.cpp
@@ -19,18 +19,16 @@
 #include "nsAlgorithm.h"
 #include "nsCOMPtr.h"
 #include "nsComputedDOMStyle.h"
 #include "nsDebug.h"
 #include "nsError.h"
 #include "nsGkAtoms.h"
 #include "nsIContent.h"
 #include "nsROCSSPrimitiveValue.h"
-#include "nsIDOMEventListener.h"
-#include "nsIHTMLObjectResizer.h"
 #include "nsINode.h"
 #include "nsIPrincipal.h"
 #include "nsISupportsImpl.h"
 #include "nsISupportsUtils.h"
 #include "nsLiteralString.h"
 #include "nsReadableUtils.h"
 #include "nsString.h"
 #include "nsStringFwd.h"
--- a/editor/libeditor/HTMLAnonymousNodeEditor.cpp
+++ b/editor/libeditor/HTMLAnonymousNodeEditor.cpp
@@ -18,19 +18,16 @@
 #include "nsError.h"
 #include "nsGenericHTMLElement.h"
 #include "nsGkAtoms.h"
 #include "nsAtom.h"
 #include "nsIContent.h"
 #include "nsID.h"
 #include "mozilla/dom/Document.h"
 #include "nsIDocumentObserver.h"
-#include "nsIHTMLAbsPosEditor.h"
-#include "nsIHTMLInlineTableEditor.h"
-#include "nsIHTMLObjectResizer.h"
 #include "nsStubMutationObserver.h"
 #include "nsINode.h"
 #include "nsISupportsImpl.h"
 #include "nsISupportsUtils.h"
 #include "nsLiteralString.h"
 #include "nsPresContext.h"
 #include "nsReadableUtils.h"
 #include "nsString.h"
--- a/editor/libeditor/HTMLEditSubActionHandler.cpp
+++ b/editor/libeditor/HTMLEditSubActionHandler.cpp
@@ -38,17 +38,16 @@
 #include "nsDebug.h"
 #include "nsError.h"
 #include "nsGkAtoms.h"
 #include "nsAtom.h"
 #include "nsHTMLDocument.h"
 #include "nsIContent.h"
 #include "nsID.h"
 #include "nsIFrame.h"
-#include "nsIHTMLAbsPosEditor.h"
 #include "nsINode.h"
 #include "nsLiteralString.h"
 #include "nsRange.h"
 #include "nsReadableUtils.h"
 #include "nsString.h"
 #include "nsStringFwd.h"
 #include "nsTArray.h"
 #include "nsTextNode.h"
--- a/editor/libeditor/HTMLEditor.cpp
+++ b/editor/libeditor/HTMLEditor.cpp
@@ -24,24 +24,22 @@
 
 #include "HTMLEditorEventListener.h"
 #include "HTMLEditUtils.h"
 #include "TypeInState.h"
 
 #include "nsHTMLDocument.h"
 #include "mozilla/dom/DocumentInlines.h"
 #include "nsISelectionController.h"
-#include "nsIInlineSpellChecker.h"
 #include "nsIPrincipal.h"
 
 #include "mozilla/css/Loader.h"
 
 #include "nsIContent.h"
 #include "nsContentUtils.h"
-#include "nsIDocumentEncoder.h"
 #include "nsGenericHTMLElement.h"
 #include "nsPresContext.h"
 #include "nsFocusManager.h"
 #include "nsPIDOMWindow.h"
 
 // netwerk
 #include "nsIURI.h"
 #include "nsNetUtil.h"
--- a/editor/libeditor/HTMLEditorDataTransfer.cpp
+++ b/editor/libeditor/HTMLEditorDataTransfer.cpp
@@ -36,28 +36,27 @@
 #include "nsContentUtils.h"
 #include "nsDebug.h"
 #include "nsDependentSubstring.h"
 #include "nsError.h"
 #include "nsGkAtoms.h"
 #include "nsIClipboard.h"
 #include "nsIContent.h"
 #include "mozilla/dom/Document.h"
+#include "nsIDocumentEncoder.h"
 #include "nsIFile.h"
 #include "nsIInputStream.h"
-#include "nsIMIMEService.h"
 #include "nsNameSpaceManager.h"
 #include "nsINode.h"
 #include "nsIParserUtils.h"
 #include "nsIPrincipal.h"
 #include "nsISupportsImpl.h"
 #include "nsISupportsPrimitives.h"
 #include "nsISupportsUtils.h"
 #include "nsITransferable.h"
-#include "nsIURI.h"
 #include "nsIVariant.h"
 #include "nsLinebreakConverter.h"
 #include "nsLiteralString.h"
 #include "nsNetUtil.h"
 #include "nsRange.h"
 #include "nsReadableUtils.h"
 #include "nsServiceManagerUtils.h"
 #include "nsStreamUtils.h"
--- a/editor/libeditor/HTMLEditorDocumentCommands.cpp
+++ b/editor/libeditor/HTMLEditorDocumentCommands.cpp
@@ -1,27 +1,25 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/EditorCommands.h"
 
-#include "mozilla/HTMLEditor.h"      // for HTMLEditor
-#include "mozilla/TextEditor.h"      // for TextEditor
-#include "mozilla/dom/Document.h"    // for Document
-#include "nsCommandParams.h"         // for nsCommandParams
-#include "nsIDocShell.h"             // for nsIDocShell
-#include "nsIEditingSession.h"       // for nsIEditingSession, etc
-#include "nsIPrincipal.h"            // for nsIPrincipal
-#include "nsISelectionController.h"  // for nsISelectionController
-#include "nsISupportsImpl.h"         // for nsPresContext::Release
-#include "nsISupportsUtils.h"        // for NS_IF_ADDREF
-#include "nsIURI.h"                  // for nsIURI
-#include "nsPresContext.h"           // for nsPresContext
+#include "mozilla/HTMLEditor.h"    // for HTMLEditor
+#include "mozilla/TextEditor.h"    // for TextEditor
+#include "mozilla/dom/Document.h"  // for Document
+#include "nsCommandParams.h"       // for nsCommandParams
+#include "nsIEditingSession.h"     // for nsIEditingSession, etc
+#include "nsIPrincipal.h"          // for nsIPrincipal
+#include "nsISupportsImpl.h"       // for nsPresContext::Release
+#include "nsISupportsUtils.h"      // for NS_IF_ADDREF
+#include "nsIURI.h"                // for nsIURI
+#include "nsPresContext.h"         // for nsPresContext
 
 // defines
 #define STATE_ENABLED "state_enabled"
 #define STATE_ALL "state_all"
 #define STATE_ATTRIBUTE "state_attribute"
 #define STATE_DATA "state_data"
 
 namespace mozilla {
--- a/editor/libeditor/HTMLInlineTableEditor.cpp
+++ b/editor/libeditor/HTMLInlineTableEditor.cpp
@@ -8,17 +8,16 @@
 #include "mozilla/PresShell.h"
 #include "mozilla/dom/Element.h"
 #include "nsAString.h"
 #include "nsCOMPtr.h"
 #include "nsDebug.h"
 #include "nsError.h"
 #include "nsGenericHTMLElement.h"
 #include "nsIContent.h"
-#include "nsIHTMLObjectResizer.h"
 #include "nsLiteralString.h"
 #include "nsReadableUtils.h"
 #include "nsString.h"
 #include "nscore.h"
 
 namespace mozilla {
 
 NS_IMETHODIMP
--- a/editor/libeditor/TextEditSubActionHandler.cpp
+++ b/editor/libeditor/TextEditSubActionHandler.cpp
@@ -22,17 +22,16 @@
 #include "nsCRT.h"
 #include "nsCRTGlue.h"
 #include "nsComponentManagerUtils.h"
 #include "nsContentUtils.h"
 #include "nsDebug.h"
 #include "nsError.h"
 #include "nsGkAtoms.h"
 #include "nsIContent.h"
-#include "nsIDocumentEncoder.h"
 #include "nsNameSpaceManager.h"
 #include "nsINode.h"
 #include "nsIPlaintextEditor.h"
 #include "nsISupportsBase.h"
 #include "nsLiteralString.h"
 #include "nsTextNode.h"
 #include "nsUnicharUtils.h"
 #include "nsIHTMLCollection.h"
--- a/editor/libeditor/TextEditorDataTransfer.cpp
+++ b/editor/libeditor/TextEditorDataTransfer.cpp
@@ -17,22 +17,20 @@
 #include "nsContentUtils.h"
 #include "nsDebug.h"
 #include "nsError.h"
 #include "nsIClipboard.h"
 #include "nsIContent.h"
 #include "mozilla/dom/Document.h"
 #include "nsIDragService.h"
 #include "nsIDragSession.h"
-#include "nsIEditor.h"
 #include "nsIDocShell.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsIPrincipal.h"
 #include "nsIFormControl.h"
-#include "nsIPlaintextEditor.h"
 #include "nsISupportsPrimitives.h"
 #include "nsITransferable.h"
 #include "nsIVariant.h"
 #include "nsLiteralString.h"
 #include "nsRange.h"
 #include "nsServiceManagerUtils.h"
 #include "nsString.h"
 #include "nsXPCOM.h"
--- a/editor/txmgr/nsTransactionManagerCID.h
+++ b/editor/txmgr/nsTransactionManagerCID.h
@@ -1,8 +1,7 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // XXX Needs to modify mailnews/base/src/nsMsgWindow.cpp before removing this
 //     header file.
-#include "nsITransactionManager.h"
--- a/extensions/auth/nsAuthGSSAPI.cpp
+++ b/extensions/auth/nsAuthGSSAPI.cpp
@@ -13,18 +13,16 @@
 // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsecure/html/http-sso-1.asp
 //
 //
 
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/IntegerPrintfMacros.h"
 
 #include "nsCOMPtr.h"
-#include "nsIPrefService.h"
-#include "nsIServiceManager.h"
 #include "nsMemory.h"
 #include "nsNativeCharsetUtils.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/SharedLibrary.h"
 #include "mozilla/Telemetry.h"
 
 #include "nsAuthGSSAPI.h"
 
--- a/extensions/auth/nsAuthSASL.cpp
+++ b/extensions/auth/nsAuthSASL.cpp
@@ -1,17 +1,17 @@
 /* vim:set ts=4 sw=2 et cindent: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsComponentManagerUtils.h"
 #include "nsNativeCharsetUtils.h"
-#include "nsIServiceManager.h"
 #include "nsIPrefService.h"
+#include "nsServiceManagerUtils.h"
 
 #include "nsAuthSASL.h"
 
 static const char kNegotiateAuthSSPI[] = "network.auth.use-sspi";
 
 nsAuthSASL::nsAuthSASL() { mSASLReady = false; }
 
 void nsAuthSASL::Reset() { mSASLReady = false; }
--- a/extensions/auth/nsAuthSSPI.cpp
+++ b/extensions/auth/nsAuthSSPI.cpp
@@ -9,18 +9,18 @@
 // Described by IETF Internet draft: draft-brezak-kerberos-http-00.txt
 // (formerly draft-brezak-spnego-http-04.txt)
 //
 // Also described here:
 // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsecure/html/http-sso-1.asp
 //
 
 #include "nsAuthSSPI.h"
+#include "nsComponentManagerUtils.h"
 #include "nsDNSService2.h"
-#include "nsIServiceManager.h"
 #include "nsIDNSService.h"
 #include "nsIDNSRecord.h"
 #include "nsMemory.h"
 #include "nsNetCID.h"
 #include "nsCOMPtr.h"
 #include "nsICryptoHash.h"
 #include "mozilla/Telemetry.h"
 
--- a/extensions/auth/nsHttpNegotiateAuth.cpp
+++ b/extensions/auth/nsHttpNegotiateAuth.cpp
@@ -15,20 +15,17 @@
 
 #include <string.h>
 #include <stdlib.h>
 
 #include "nsAuth.h"
 #include "nsHttpNegotiateAuth.h"
 
 #include "nsIHttpAuthenticableChannel.h"
-#include "nsIProxiedChannel.h"
 #include "nsIAuthModule.h"
-#include "nsIServiceManager.h"
-#include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 #include "nsIProxyInfo.h"
 #include "nsIURI.h"
 #include "nsCOMPtr.h"
 #include "nsString.h"
 #include "nsNetCID.h"
 #include "plbase64.h"
 #include "plstr.h"
@@ -487,18 +484,17 @@ nsHttpNegotiateAuth::GenerateCredentials
   void *inToken = nullptr, *outToken;
   uint32_t inTokenLen, outTokenLen;
 
   if (len > kNegotiateLen) {
     challenge += kNegotiateLen;
     while (*challenge == ' ') challenge++;
     len = strlen(challenge);
 
-    if (!len)
-      return NS_ERROR_UNEXPECTED;
+    if (!len) return NS_ERROR_UNEXPECTED;
 
     // strip off any padding (see bug 230351)
     while (len && challenge[len - 1] == '=') len--;
 
     //
     // Decode the response that followed the "Negotiate" token
     //
     nsresult rv = Base64Decode(challenge, len, (char**)&inToken, &inTokenLen);
--- a/extensions/permissions/nsContentBlocker.cpp
+++ b/extensions/permissions/nsContentBlocker.cpp
@@ -1,23 +1,21 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsContentBlocker.h"
 #include "nsIContent.h"
 #include "nsIURI.h"
-#include "nsIServiceManager.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 #include "nsIDocShell.h"
 #include "nsString.h"
 #include "nsContentPolicyUtils.h"
-#include "nsIObjectLoadingContent.h"
 #include "mozilla/ArrayUtils.h"
 #include "nsContentUtils.h"
 #include "nsNetUtil.h"
 #include "mozilla/StaticPrefs_extensions.h"
 
 // Possible behavior pref values
 // Those map to the nsIPermissionManager values where possible
 #define BEHAVIOR_ACCEPT nsIPermissionManager::ALLOW_ACTION
--- a/extensions/permissions/nsPermissionManager.cpp
+++ b/extensions/permissions/nsPermissionManager.cpp
@@ -14,27 +14,27 @@
 #include "mozilla/Services.h"
 #include "mozilla/SystemGroup.h"
 #include "nsPermissionManager.h"
 #include "nsPermission.h"
 #include "nsCRT.h"
 #include "nsNetUtil.h"
 #include "nsTArray.h"
 #include "nsReadableUtils.h"
-#include "nsILineInputStream.h"
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsDirectoryServiceDefs.h"
+#include "mozIStorageCompletionCallback.h"
+#include "mozIStorageService.h"
+#include "mozIStorageStatementCallback.h"
 #include "mozilla/storage.h"
 #include "mozilla/Attributes.h"
 #include "nsXULAppAPI.h"
 #include "nsIPrincipal.h"
 #include "nsIURIMutator.h"
 #include "nsContentUtils.h"
-#include "nsIScriptSecurityManager.h"
-#include "nsIEffectiveTLDService.h"
 #include "nsPIDOMWindow.h"
 #include "mozilla/dom/Document.h"
 #include "mozilla/net/NeckoMessageUtils.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/StaticPrefs_permissions.h"
 #include "nsReadLine.h"
 #include "mozilla/Telemetry.h"
 #include "nsIConsoleService.h"
--- a/extensions/permissions/nsPermissionManager.h
+++ b/extensions/permissions/nsPermissionManager.h
@@ -15,17 +15,16 @@
 #include "nsTHashtable.h"
 #include "nsTArray.h"
 #include "nsString.h"
 #include "nsPermission.h"
 #include "nsIPrefBranch.h"
 #include "nsHashKeys.h"
 #include "nsCOMArray.h"
 #include "nsDataHashtable.h"
-#include "nsIRunnable.h"
 #include "nsRefPtrHashtable.h"
 #include "mozilla/BasePrincipal.h"
 #include "mozilla/ExpandedPrincipal.h"
 #include "mozilla/MozPromise.h"
 #include "mozilla/Unused.h"
 #include "mozilla/Variant.h"
 #include "mozilla/Vector.h"
 
--- a/extensions/pref/autoconfig/src/nsAutoConfig.cpp
+++ b/extensions/pref/autoconfig/src/nsAutoConfig.cpp
@@ -4,23 +4,23 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/ResultExtensions.h"
 #include "nsAutoConfig.h"
 #include "nsJSConfigTriggers.h"
 
 #include "nsIURI.h"
 #include "nsIHttpChannel.h"
-#include "nsIFileStreams.h"
 #include "nsThreadUtils.h"
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsIObserverService.h"
 #include "nsLiteralString.h"
 #include "nsIPromptService.h"
-#include "nsIServiceManager.h"
+#include "nsIInputStream.h"
+#include "nsIOutputStream.h"
 #include "nsIStringBundle.h"
 #include "nsContentUtils.h"
 #include "nsCRT.h"
 #include "nsNetCID.h"
 #include "nsNetUtil.h"
 #include "nspr.h"
 #include <algorithm>
 
--- a/extensions/pref/autoconfig/src/nsAutoConfig.h
+++ b/extensions/pref/autoconfig/src/nsAutoConfig.h
@@ -6,21 +6,21 @@
 #ifndef nsAutoConfig_h
 #define nsAutoConfig_h
 
 #include "nsITimer.h"
 #include "nsIFile.h"
 #include "nsINamed.h"
 #include "nsIObserver.h"
 #include "nsIStreamListener.h"
-#include "nsIPrefService.h"
-#include "nsIPrefBranch.h"
 #include "nsWeakReference.h"
 #include "nsString.h"
 
+class nsIPrefBranch;
+
 class nsAutoConfig final : public nsITimerCallback,
                            public nsIStreamListener,
                            public nsIObserver,
                            public nsSupportsWeakReference,
                            public nsINamed
 
 {
  public:
--- a/extensions/pref/autoconfig/src/nsJSConfigTriggers.cpp
+++ b/extensions/pref/autoconfig/src/nsJSConfigTriggers.cpp
@@ -3,27 +3,22 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsJSConfigTriggers.h"
 
 #include "jsapi.h"
 #include "nsIXPConnect.h"
 #include "nsCOMPtr.h"
-#include "nsIServiceManager.h"
-#include "nsIComponentManager.h"
 #include "nsString.h"
-#include "nsIPrefBranch.h"
-#include "nsIPrefService.h"
 #include "nspr.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/Maybe.h"
 #include "mozilla/NullPrincipal.h"
 #include "nsContentUtils.h"
-#include "nsIScriptSecurityManager.h"
 #include "nsJSPrincipals.h"
 #include "nsIScriptError.h"
 #include "js/Wrapper.h"
 #include "mozilla/Utf8.h"
 
 extern mozilla::LazyLogModule MCD;
 using mozilla::AutoSafeJSContext;
 using mozilla::IsUtf8;
--- a/extensions/pref/autoconfig/src/nsReadConfig.cpp
+++ b/extensions/pref/autoconfig/src/nsReadConfig.cpp
@@ -6,23 +6,21 @@
 #include "nsReadConfig.h"
 #include "nsJSConfigTriggers.h"
 
 #include "mozilla/Components.h"
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsIAppStartup.h"
 #include "nsContentUtils.h"
 #include "nsDirectoryServiceDefs.h"
-#include "nsIComponentManager.h"
 #include "nsIFile.h"
 #include "nsIObserverService.h"
 #include "nsIPrefBranch.h"
 #include "nsIPrefService.h"
 #include "nsIPromptService.h"
-#include "nsIServiceManager.h"
 #include "nsIStringBundle.h"
 #include "nsNetUtil.h"
 #include "nsString.h"
 #include "nsCRT.h"
 #include "nspr.h"
 #include "nsXULAppAPI.h"
 
 using namespace mozilla;
--- a/extensions/spellcheck/hunspell/glue/mozHunspell.cpp
+++ b/extensions/spellcheck/hunspell/glue/mozHunspell.cpp
@@ -56,24 +56,22 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  ******* END LICENSE BLOCK *******/
 
 #include "mozHunspell.h"
 #include "nsReadableUtils.h"
 #include "nsString.h"
 #include "nsIObserverService.h"
-#include "nsISimpleEnumerator.h"
 #include "nsIDirectoryEnumerator.h"
 #include "nsIFile.h"
 #include "nsUnicharUtils.h"
 #include "nsCRT.h"
 #include "mozInlineSpellChecker.h"
 #include <stdlib.h>
-#include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 #include "nsNetUtil.h"
 #include "mozilla/dom/ContentParent.h"
 #include "mozilla/Components.h"
 
 using mozilla::dom::ContentParent;
 using namespace mozilla;
 
--- a/extensions/spellcheck/src/mozEnglishWordUtils.cpp
+++ b/extensions/spellcheck/src/mozEnglishWordUtils.cpp
@@ -1,16 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozEnglishWordUtils.h"
+#include "nsComponentManagerUtils.h"
 #include "nsReadableUtils.h"
-#include "nsIServiceManager.h"
 #include "nsUnicharUtils.h"
 #include "nsUnicodeProperties.h"
 #include "nsCRT.h"
 #include "mozilla/Likely.h"
 #include "nsMemory.h"
 
 NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(mozEnglishWordUtils, AddRef)
 NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(mozEnglishWordUtils, Release)
--- a/extensions/spellcheck/src/mozInlineSpellChecker.cpp
+++ b/extensions/spellcheck/src/mozInlineSpellChecker.cpp
@@ -45,22 +45,18 @@
 #include "mozilla/dom/KeyboardEventBinding.h"
 #include "mozilla/dom/MouseEvent.h"
 #include "mozilla/dom/Selection.h"
 #include "mozInlineSpellWordUtil.h"
 #include "nsCOMPtr.h"
 #include "nsCRT.h"
 #include "nsGenericHTMLElement.h"
 #include "nsRange.h"
-#include "nsIPlaintextEditor.h"
 #include "nsIPrefBranch.h"
-#include "nsIPrefService.h"
 #include "nsIRunnable.h"
-#include "nsISelectionController.h"
-#include "nsIServiceManager.h"
 #include "nsString.h"
 #include "nsThreadUtils.h"
 #include "nsUnicharUtils.h"
 #include "nsIContent.h"
 #include "nsIContentInlines.h"
 #include "nsRange.h"
 #include "nsContentUtils.h"
 #include "nsIObserverService.h"
--- a/extensions/spellcheck/src/mozInlineSpellWordUtil.cpp
+++ b/extensions/spellcheck/src/mozInlineSpellWordUtil.cpp
@@ -8,17 +8,16 @@
 #include "mozilla/BinarySearch.h"
 #include "mozilla/HTMLEditor.h"
 #include "mozilla/TextEditor.h"
 #include "mozilla/dom/Element.h"
 
 #include "nsDebug.h"
 #include "nsAtom.h"
 #include "nsComponentManagerUtils.h"
-#include "nsIEditor.h"
 #include "nsUnicodeProperties.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIContent.h"
 #include "nsTextFragment.h"
 #include "nsRange.h"
 #include "nsContentUtils.h"
 #include "nsIFrame.h"
 #include <algorithm>
--- a/extensions/spellcheck/src/mozPersonalDictionary.cpp
+++ b/extensions/spellcheck/src/mozPersonalDictionary.cpp
@@ -4,18 +4,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozPersonalDictionary.h"
 #include "nsIUnicharInputStream.h"
 #include "nsReadableUtils.h"
 #include "nsIFile.h"
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsIObserverService.h"
-#include "nsIPrefService.h"
-#include "nsIPrefBranch.h"
 #include "nsIWeakReference.h"
 #include "nsCRT.h"
 #include "nsNetUtil.h"
 #include "nsNetCID.h"
 #include "nsIInputStream.h"
 #include "nsIOutputStream.h"
 #include "nsISafeOutputStream.h"
 #include "nsTArray.h"
--- a/extensions/spellcheck/src/mozSpellChecker.cpp
+++ b/extensions/spellcheck/src/mozSpellChecker.cpp
@@ -1,15 +1,14 @@
 /* vim: set ts=2 sts=2 sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozSpellChecker.h"
-#include "nsIServiceManager.h"
 #include "nsIStringEnumerator.h"
 #include "nsICategoryManager.h"
 #include "nsISupportsPrimitives.h"
 #include "nsISimpleEnumerator.h"
 #include "mozEnglishWordUtils.h"
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/PRemoteSpellcheckEngineChild.h"
 #include "mozilla/TextServicesDocument.h"
--- a/gfx/gl/GLLibraryEGL.h
+++ b/gfx/gl/GLLibraryEGL.h
@@ -7,17 +7,16 @@
 
 #if defined(MOZ_X11)
 #  include "mozilla/X11Util.h"
 #endif
 
 #include "GLLibraryLoader.h"
 #include "mozilla/StaticMutex.h"
 #include "mozilla/ThreadLocal.h"
-#include "nsIFile.h"
 #include "GeckoProfiler.h"
 
 #include <bitset>
 #include <vector>
 
 #if defined(MOZ_X11)
 #  define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)mozilla::DefaultXDisplay())
 #else
--- a/gfx/ipc/GPUProcessHost.cpp
+++ b/gfx/ipc/GPUProcessHost.cpp
@@ -2,17 +2,16 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "GPUProcessHost.h"
 #include "chrome/common/process_watcher.h"
 #include "mozilla/gfx/Logging.h"
-#include "nsITimer.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/StaticPrefs_layers.h"
 #include "VRGPUChild.h"
 #include "ProcessUtils.h"
 
 namespace mozilla {
 namespace gfx {
 
--- a/gfx/ipc/GPUProcessManager.h
+++ b/gfx/ipc/GPUProcessManager.h
@@ -13,17 +13,16 @@
 #include "mozilla/dom/ipc/IdType.h"
 #include "mozilla/gfx/GPUProcessHost.h"
 #include "mozilla/gfx/Point.h"
 #include "mozilla/ipc/ProtocolUtils.h"
 #include "mozilla/ipc/TaskFactory.h"
 #include "mozilla/ipc/Transport.h"
 #include "mozilla/layers/LayersTypes.h"
 #include "mozilla/webrender/WebRenderTypes.h"
-#include "nsIObserverService.h"
 #include "nsThreadUtils.h"
 class nsBaseWidget;
 
 namespace mozilla {
 class MemoryReportingProcess;
 class PRemoteDecoderManagerChild;
 namespace layers {
 class IAPZCTreeManager;
--- a/gfx/layers/LayerScope.cpp
+++ b/gfx/layers/LayerScope.cpp
@@ -24,32 +24,28 @@
 #include "gfxUtils.h"
 
 #include "nsIWidget.h"
 
 #include "GLContext.h"
 #include "GLContextProvider.h"
 #include "GLReadTexImageHelper.h"
 
-#include "nsIServiceManager.h"
-#include "nsIConsoleService.h"
-
 #include <memory>
 #include "mozilla/LinkedList.h"
 #include "mozilla/Base64.h"
 #include "mozilla/SHA1.h"
 #include "mozilla/StaticPtr.h"
 #include "nsThreadUtils.h"
 #include "nsISocketTransport.h"
 #include "nsIServerSocket.h"
 #include "nsReadLine.h"
 #include "nsNetCID.h"
 #include "nsIOutputStream.h"
 #include "nsIAsyncInputStream.h"
-#include "nsIEventTarget.h"
 #include "nsProxyRelease.h"
 #include <list>
 
 // Undo the damage done by mozzconf.h
 #undef compress
 #include "mozilla/Compression.h"
 
 // Undo the damage done by X11
--- a/gfx/layers/PaintThread.cpp
+++ b/gfx/layers/PaintThread.cpp
@@ -17,17 +17,16 @@
 #include "mozilla/gfx/2D.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/StaticPrefs_layers.h"
 #include "mozilla/SharedThreadPool.h"
 #include "mozilla/SyncRunnable.h"
 #ifdef XP_MACOSX
 #  include "nsCocoaFeatures.h"
 #endif
-#include "nsIPropertyBag2.h"
 #include "nsIThreadManager.h"
 #include "nsServiceManagerUtils.h"
 #include "prsystem.h"
 
 // Uncomment the following line to dispatch sync runnables when
 // painting so that rasterization happens synchronously from
 // the perspective of the main thread
 // #define OMTP_FORCE_SYNC
--- a/gfx/layers/client/ClientLayerManager.h
+++ b/gfx/layers/client/ClientLayerManager.h
@@ -18,17 +18,16 @@
 #include "mozilla/layers/CompositorTypes.h"
 #include "mozilla/layers/FocusTarget.h"   // for FocusTarget
 #include "mozilla/layers/LayersTypes.h"   // for BufferMode, LayersBackend, etc
 #include "mozilla/layers/PaintThread.h"   // For PaintThread
 #include "mozilla/layers/ShadowLayers.h"  // for ShadowLayerForwarder, etc
 #include "mozilla/layers/APZTestData.h"   // for APZTestData
 #include "mozilla/layers/MemoryPressureObserver.h"
 #include "nsCOMPtr.h"         // for already_AddRefed
-#include "nsIObserver.h"      // for nsIObserver
 #include "nsISupportsImpl.h"  // for Layer::Release, etc
 #include "nsRect.h"           // for mozilla::gfx::IntRect
 #include "nsTArray.h"         // for nsTArray
 #include "nscore.h"           // for nsAString
 #include "mozilla/layers/TransactionIdAllocator.h"
 #include "nsIWidget.h"  // For plugin window configuration information structs
 
 class nsDisplayListBuilder;
--- a/gfx/layers/ipc/CompositorBridgeChild.cpp
+++ b/gfx/layers/ipc/CompositorBridgeChild.cpp
@@ -31,17 +31,16 @@
 #include "mozilla/gfx/GPUProcessManager.h"
 #include "mozilla/gfx/Logging.h"
 #include "mozilla/webgpu/WebGPUChild.h"
 #include "mozilla/mozalloc.h"  // for operator new, etc
 #include "mozilla/Telemetry.h"
 #include "gfxConfig.h"
 #include "nsAutoPtr.h"
 #include "nsDebug.h"          // for NS_WARNING
-#include "nsIObserver.h"      // for nsIObserver
 #include "nsISupportsImpl.h"  // for MOZ_COUNT_CTOR, etc
 #include "nsTArray.h"         // for nsTArray, nsTArray_Impl
 #include "nsXULAppAPI.h"      // for XRE_GetIOMessageLoop, etc
 #include "FrameLayerBuilder.h"
 #include "mozilla/dom/BrowserChild.h"
 #include "mozilla/dom/BrowserParent.h"
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/Unused.h"
--- a/gfx/layers/ipc/ImageBridgeChild.h
+++ b/gfx/layers/ipc/ImageBridgeChild.h
@@ -16,17 +16,16 @@
 #include "mozilla/RefPtr.h"            // for already_AddRefed
 #include "mozilla/ipc/SharedMemory.h"  // for SharedMemory, etc
 #include "mozilla/layers/CanvasClient.h"
 #include "mozilla/layers/CompositableForwarder.h"
 #include "mozilla/layers/CompositorTypes.h"
 #include "mozilla/layers/PImageBridgeChild.h"
 #include "mozilla/Mutex.h"
 #include "mozilla/webrender/WebRenderTypes.h"
-#include "nsIObserver.h"
 #include "nsRegion.h"  // for nsIntRegion
 #include "mozilla/gfx/Rect.h"
 #include "mozilla/ReentrantMonitor.h"  // for ReentrantMonitor, etc
 
 class MessageLoop;
 
 namespace base {
 class Thread;
--- a/gfx/src/gfxCrashReporterUtils.cpp
+++ b/gfx/src/gfxCrashReporterUtils.cpp
@@ -12,17 +12,16 @@
 #include "mozilla/SystemGroup.h"  // for SystemGroup
 #include "mozilla/mozalloc.h"     // for operator new, etc
 #include "mozilla/RefPtr.h"       // for RefPtr
 #include "MainThreadUtils.h"      // for NS_IsMainThread
 #include "nsCOMPtr.h"             // for nsCOMPtr
 #include "nsError.h"              // for NS_OK, NS_FAILED, nsresult
 #include "nsExceptionHandler.h"   // for AppendAppNotesToCrashReport
 #include "nsID.h"
-#include "nsIEventTarget.h"      // for NS_DISPATCH_NORMAL
 #include "nsIObserver.h"         // for nsIObserver, etc
 #include "nsIObserverService.h"  // for nsIObserverService
 #include "nsIRunnable.h"         // for nsIRunnable
 #include "nsISupports.h"
 #include "nsTArray.h"  // for nsTArray
 #include "nscore.h"    // for NS_IMETHOD, NS_IMETHODIMP, etc
 
 namespace mozilla {
--- a/gfx/thebes/DeviceManagerDx.cpp
+++ b/gfx/thebes/DeviceManagerDx.cpp
@@ -18,17 +18,16 @@
 #include "mozilla/gfx/Logging.h"
 #include "mozilla/gfx/gfxVars.h"
 #include "mozilla/layers/CompositorBridgeChild.h"
 #include "mozilla/layers/CompositorThread.h"
 #include "mozilla/layers/DeviceAttachmentsD3D11.h"
 #include "mozilla/layers/MLGDeviceD3D11.h"
 #include "mozilla/layers/PaintThread.h"
 #include "nsExceptionHandler.h"
-#include "nsIGfxInfo.h"
 #include "nsPrintfCString.h"
 #include "nsString.h"
 
 #undef _WIN32_WINNT
 #define _WIN32_WINNT _WIN32_WINNT_WINBLUE
 #undef NTDDI_VERSION
 #define NTDDI_VERSION NTDDI_WINBLUE
 
--- a/gfx/thebes/gfxASurface.cpp
+++ b/gfx/thebes/gfxASurface.cpp
@@ -35,23 +35,21 @@
 
 #ifdef CAIRO_HAS_QUARTZ_SURFACE
 #  include "gfxQuartzSurface.h"
 #endif
 
 #include <stdio.h>
 #include <limits.h>
 
-#include "imgIEncoder.h"
 #include "nsComponentManagerUtils.h"
 #include "nsISupportsUtils.h"
 #include "nsCOMPtr.h"
 #include "nsServiceManagerUtils.h"
 #include "nsString.h"
-#include "nsIClipboardHelper.h"
 
 using namespace mozilla;
 using namespace mozilla::gfx;
 
 static cairo_user_data_key_t gfxasurface_pointer_key;
 
 gfxASurface::gfxASurface()
     : mSurface(nullptr),
--- a/gfx/thebes/gfxAndroidPlatform.cpp
+++ b/gfx/thebes/gfxAndroidPlatform.cpp
@@ -15,17 +15,16 @@
 #include "mozilla/StaticPrefs_gfx.h"
 
 #include "gfx2DGlue.h"
 #include "gfxFT2FontList.h"
 #include "gfxImageSurface.h"
 #include "gfxTextRun.h"
 #include "nsXULAppAPI.h"
 #include "nsIScreen.h"
-#include "nsIScreenManager.h"
 #include "nsServiceManagerUtils.h"
 #include "nsUnicodeProperties.h"
 #include "cairo.h"
 #include "VsyncSource.h"
 
 #include "ft2build.h"
 #include FT_FREETYPE_H
 #include FT_MODULE_H
--- a/gfx/thebes/gfxDWriteCommon.h
+++ b/gfx/thebes/gfxDWriteCommon.h
@@ -5,23 +5,21 @@
 
 #ifndef GFX_DWRITECOMMON_H
 #define GFX_DWRITECOMMON_H
 
 // Mozilla includes
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/FontPropertyTypes.h"
 #include "nscore.h"
-#include "nsIServiceManager.h"
 #include "nsCOMPtr.h"
 #include "cairo-features.h"
 #include "gfxFontConstants.h"
 #include "nsTArray.h"
 #include "gfxWindowsPlatform.h"
-#include "nsIUUIDGenerator.h"
 
 #include <windows.h>
 #include <dwrite.h>
 
 static inline DWRITE_FONT_STRETCH DWriteFontStretchFromStretch(
     mozilla::FontStretch aStretch) {
   if (aStretch == mozilla::FontStretch::UltraCondensed()) {
     return DWRITE_FONT_STRETCH_ULTRA_CONDENSED;
--- a/gfx/thebes/gfxDWriteFontList.cpp
+++ b/gfx/thebes/gfxDWriteFontList.cpp
@@ -14,22 +14,19 @@
 #include "nsServiceManagerUtils.h"
 #include "nsCharSeparatedTokenizer.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Sprintf.h"
 #include "mozilla/Telemetry.h"
 #include "nsDirectoryServiceUtils.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsAppDirectoryServiceDefs.h"
-#include "nsISimpleEnumerator.h"
 
 #include "gfxGDIFontList.h"
 
-#include "nsIWindowsRegKey.h"
-
 #include "harfbuzz/hb.h"
 
 using namespace mozilla;
 using namespace mozilla::gfx;
 using mozilla::intl::OSPreferences;
 
 #define LOG_FONTLIST(args) \
   MOZ_LOG(gfxPlatform::GetLog(eGfxLog_fontlist), LogLevel::Debug, args)
--- a/gfx/thebes/gfxFT2FontList.cpp
+++ b/gfx/thebes/gfxFT2FontList.cpp
@@ -8,17 +8,16 @@
 #include "mozilla/FontPropertyTypes.h"
 #include "mozilla/MemoryReporting.h"
 
 #include "mozilla/dom/ContentChild.h"
 #include "gfxAndroidPlatform.h"
 #include "mozilla/Omnijar.h"
 #include "mozilla/UniquePtr.h"
 #include "mozilla/UniquePtrExtensions.h"
-#include "nsIInputStream.h"
 #include "nsReadableUtils.h"
 
 #include "nsXULAppAPI.h"
 #include <dirent.h>
 #include <android/log.h>
 #define ALOG(args...) __android_log_print(ANDROID_LOG_INFO, "Gecko", ##args)
 
 #include "ft2build.h"
@@ -39,17 +38,16 @@
 #include "nsIObserverService.h"
 #include "nsTArray.h"
 #include "nsUnicharUtils.h"
 #include "nsCRT.h"
 
 #include "nsDirectoryServiceUtils.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsAppDirectoryServiceDefs.h"
-#include "nsISimpleEnumerator.h"
 #include "nsIMemory.h"
 #include "gfxFontConstants.h"
 
 #include "mozilla/EndianUtils.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/scache/StartupCache.h"
 #include <fcntl.h>
 #include <sys/mman.h>
--- a/gfx/thebes/gfxFontInfoLoader.h
+++ b/gfx/thebes/gfxFontInfoLoader.h
@@ -8,17 +8,16 @@
 
 #include "nsCOMPtr.h"
 #include "nsIObserver.h"
 #include "nsITimer.h"
 #include "nsIThread.h"
 #include "nsRefPtrHashtable.h"
 #include "nsString.h"
 #include "gfxFont.h"
-#include "nsIRunnable.h"
 #include "mozilla/Atomics.h"
 #include "mozilla/TimeStamp.h"
 #include "nsISupportsImpl.h"
 
 // data retrieved for a given face
 
 struct FontFaceData {
   FontFaceData() : mUVSOffset(0) {}
--- a/gfx/thebes/gfxGDIFontList.cpp
+++ b/gfx/thebes/gfxGDIFontList.cpp
@@ -18,18 +18,16 @@
 
 #include "nsServiceManagerUtils.h"
 #include "nsTArray.h"
 #include "nsUnicharUtils.h"
 
 #include "nsDirectoryServiceUtils.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsAppDirectoryServiceDefs.h"
-#include "nsISimpleEnumerator.h"
-#include "nsIWindowsRegKey.h"
 #include "gfxFontConstants.h"
 #include "GeckoProfiler.h"
 
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/Telemetry.h"
 
 #include <usp10.h>
 
--- a/gfx/thebes/gfxUserFontSet.cpp
+++ b/gfx/thebes/gfxUserFontSet.cpp
@@ -2,17 +2,16 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/Logging.h"
 
 #include "gfxUserFontSet.h"
 #include "gfxPlatform.h"
-#include "nsIProtocolHandler.h"
 #include "gfxFontConstants.h"
 #include "mozilla/FontPropertyTypes.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Services.h"
 #include "mozilla/StaticPrefs_gfx.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/gfx/2D.h"
 #include "gfxPlatformFontList.h"
--- a/gfx/thebes/gfxUserFontSet.h
+++ b/gfx/thebes/gfxUserFontSet.h
@@ -10,20 +10,18 @@
 #include "gfxFontFamilyList.h"
 #include "gfxFontSrcPrincipal.h"
 #include "gfxFontSrcURI.h"
 #include "nsProxyRelease.h"
 #include "nsRefPtrHashtable.h"
 #include "nsCOMPtr.h"
 #include "nsIFontLoadCompleteCallback.h"
 #include "nsIMemoryReporter.h"
-#include "nsIPrincipal.h"
 #include "nsIRunnable.h"
 #include "nsIScriptError.h"
-#include "nsIURI.h"
 #include "nsIReferrerInfo.h"
 #include "nsURIHashKey.h"
 #include "mozilla/FontPropertyTypes.h"
 #include "mozilla/ServoStyleConsts.h"
 #include "gfxFontConstants.h"
 #include "mozilla/LazyIdleThread.h"
 #include "mozilla/StaticPtr.h"
 
--- a/gfx/thebes/gfxWindowsPlatform.cpp
+++ b/gfx/thebes/gfxWindowsPlatform.cpp
@@ -24,18 +24,16 @@
 #include "mozilla/WindowsVersion.h"
 #include "nsIGfxInfo.h"
 #include "nsServiceManagerUtils.h"
 #include "nsTArray.h"
 #include "nsThreadUtils.h"
 #include "mozilla/Telemetry.h"
 #include "GeckoProfiler.h"
 
-#include "nsIWindowsRegKey.h"
-#include "nsIFile.h"
 #include "plbase64.h"
 #include "nsIXULRuntime.h"
 #include "imgLoader.h"
 
 #include "nsIGfxInfo.h"
 
 #include "gfxCrashReporterUtils.h"
 
--- a/gfx/vr/VRDisplayClient.cpp
+++ b/gfx/vr/VRDisplayClient.cpp
@@ -12,17 +12,16 @@
 #include "nsIGlobalObject.h"
 #include "nsRefPtrHashtable.h"
 #include "nsString.h"
 #include "mozilla/dom/GamepadManager.h"
 #include "mozilla/dom/Gamepad.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Unused.h"
 #include "nsServiceManagerUtils.h"
-#include "nsIScreenManager.h"
 
 #ifdef XP_WIN
 #  include "../layers/d3d11/CompositorD3D11.h"
 #endif
 
 #include "VRDisplayClient.h"
 #include "VRDisplayPresentation.h"
 #include "VRManagerChild.h"
--- a/gfx/vr/VRDisplayClient.h
+++ b/gfx/vr/VRDisplayClient.h
@@ -2,17 +2,16 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef GFX_VR_DISPLAY_CLIENT_H
 #define GFX_VR_DISPLAY_CLIENT_H
 
-#include "nsIScreen.h"
 #include "nsCOMPtr.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/RefPtr.h"
 #include "mozilla/dom/VRDisplayBinding.h"
 
 #include "gfxVR.h"
 
 namespace mozilla {
--- a/hal/Hal.cpp
+++ b/hal/Hal.cpp
@@ -6,19 +6,16 @@
 
 #include "Hal.h"
 
 #include "HalImpl.h"
 #include "HalLog.h"
 #include "HalSandbox.h"
 #include "HalWakeLockInternal.h"
 #include "mozilla/dom/Document.h"
-#include "nsIDocShell.h"
-#include "nsIBrowserChild.h"
-#include "nsIWebNavigation.h"
 #include "nsThreadUtils.h"
 #include "nsXULAppAPI.h"
 #include "nsPIDOMWindow.h"
 #include "nsJSUtils.h"
 #include "mozilla/ClearOnShutdown.h"
 #include "mozilla/Observer.h"
 #include "mozilla/dom/ContentChild.h"
 #include "WindowIdentifier.h"
--- a/image/DecodePool.cpp
+++ b/image/DecodePool.cpp
@@ -9,22 +9,20 @@
 
 #include "mozilla/ClearOnShutdown.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/Monitor.h"
 #include "mozilla/StaticPrefs_image.h"
 #include "mozilla/TimeStamp.h"
 #include "nsCOMPtr.h"
 #include "nsIObserverService.h"
-#include "nsIThreadPool.h"
 #include "nsThreadManager.h"
 #include "nsThreadUtils.h"
 #include "nsXPCOMCIDInternal.h"
 #include "prsystem.h"
-#include "nsIXULRuntime.h"
 
 #include "Decoder.h"
 #include "IDecodingTask.h"
 #include "RasterImage.h"
 
 #if defined(XP_WIN)
 #  include <objbase.h>
 #endif
--- a/image/ImageCacheKey.cpp
+++ b/image/ImageCacheKey.cpp
@@ -4,17 +4,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "ImageCacheKey.h"
 
 #include "mozilla/HashFunctions.h"
 #include "mozilla/Move.h"
 #include "mozilla/Unused.h"
 #include "nsContentUtils.h"
-#include "nsICookieService.h"
 #include "nsLayoutUtils.h"
 #include "nsString.h"
 #include "mozilla/AntiTrackingCommon.h"
 #include "mozilla/HashFunctions.h"
 #include "mozilla/StorageAccess.h"
 #include "mozilla/dom/BlobURLProtocolHandler.h"
 #include "mozilla/dom/File.h"
 #include "mozilla/dom/ServiceWorkerManager.h"
--- a/image/ImageFactory.cpp
+++ b/image/ImageFactory.cpp
@@ -5,29 +5,27 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "ImageFactory.h"
 
 #include <algorithm>
 
 #include "mozilla/Likely.h"
 
-#include "nsIHttpChannel.h"
 #include "nsIFileChannel.h"
 #include "nsIFile.h"
 #include "nsMimeTypes.h"
 #include "nsIRequest.h"
 
 #include "MultipartImage.h"
 #include "RasterImage.h"
 #include "VectorImage.h"
 #include "Image.h"
 #include "nsMediaFragmentURIParser.h"
 #include "nsContentUtils.h"
-#include "nsIScriptSecurityManager.h"
 
 #include "mozilla/StaticPrefs_image.h"
 
 namespace mozilla {
 namespace image {
 
 /*static*/
 void ImageFactory::Initialize() {}
--- a/image/ProgressTracker.cpp
+++ b/image/ProgressTracker.cpp
@@ -2,17 +2,16 @@
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "ImageLogging.h"
 #include "ProgressTracker.h"
 
-#include "imgIContainer.h"
 #include "imgINotificationObserver.h"
 #include "imgIRequest.h"
 #include "Image.h"
 #include "nsNetUtil.h"
 #include "nsIObserverService.h"
 
 #include "mozilla/Assertions.h"
 #include "mozilla/Services.h"
--- a/image/RasterImage.h
+++ b/image/RasterImage.h
@@ -24,17 +24,16 @@
 #include "nsTArray.h"
 #include "LookupResult.h"
 #include "nsThreadUtils.h"
 #include "DecoderFactory.h"
 #include "FrameAnimator.h"
 #include "ImageMetadata.h"
 #include "ISurfaceProvider.h"
 #include "Orientation.h"
-#include "nsIObserver.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/Maybe.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/NotNull.h"
 #include "mozilla/TimeStamp.h"
 #include "mozilla/WeakPtr.h"
 #include "mozilla/UniquePtr.h"
 #include "ImageContainer.h"
--- a/image/decoders/icon/android/nsIconChannel.cpp
+++ b/image/decoders/icon/android/nsIconChannel.cpp
@@ -3,20 +3,20 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include <stdlib.h>
 #include "mozilla/gfx/Swizzle.h"
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/NullPrincipal.h"
 #include "nsMimeTypes.h"
-#include "nsIURL.h"
 #include "nsXULAppAPI.h"
 #include "AndroidBridge.h"
 #include "nsIconChannel.h"
+#include "nsIIconURI.h"
 #include "nsIStringStream.h"
 #include "nsNetUtil.h"
 #include "nsComponentManagerUtils.h"
 
 NS_IMPL_ISUPPORTS(nsIconChannel, nsIRequest, nsIChannel)
 
 using namespace mozilla;
 using mozilla::dom::ContentChild;
--- a/image/decoders/icon/android/nsIconChannel.h
+++ b/image/decoders/icon/android/nsIconChannel.h
@@ -5,17 +5,16 @@
 
 #ifndef mozilla_image_decoders_icon_android_nsIconChannel_h
 #define mozilla_image_decoders_icon_android_nsIconChannel_h
 
 #include "mozilla/Attributes.h"
 
 #include "nsIChannel.h"
 #include "nsIURI.h"
-#include "nsIIconURI.h"
 #include "nsCOMPtr.h"
 
 /**
  * This class is the Android implementation of nsIconChannel.
  * It asks Android for an icon, and creates a new channel for
  * that file to which all calls will be proxied.
  */
 class nsIconChannel final : public nsIChannel {
--- a/image/decoders/icon/gtk/nsIconChannel.h
+++ b/image/decoders/icon/gtk/nsIconChannel.h
@@ -3,17 +3,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_image_decoders_icon_gtk_nsIconChannel_h
 #define mozilla_image_decoders_icon_gtk_nsIconChannel_h
 
 #include "mozilla/Attributes.h"
 
 #include "nsIChannel.h"
-#include "nsIStreamListener.h"
 #include "nsIURI.h"
 #include "nsIIconURI.h"
 #include "nsCOMPtr.h"
 
 /// This class is the gnome implementation of nsIconChannel. It basically asks
 /// gtk/gnome for an icon, saves it as a tmp icon, and creates a new channel for
 /// that file to which all calls will be proxied.
 class nsIconChannel final : public nsIChannel {
--- a/image/decoders/icon/mac/nsIconChannelCocoa.mm
+++ b/image/decoders/icon/mac/nsIconChannelCocoa.mm
@@ -4,28 +4,25 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsContentUtils.h"
 #include "nsIconChannel.h"
 #include "mozilla/BasePrincipal.h"
 #include "mozilla/EndianUtils.h"
 #include "nsIIconURI.h"
-#include "nsIServiceManager.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsString.h"
 #include "nsMimeTypes.h"
 #include "nsMemory.h"
-#include "nsIStringStream.h"
 #include "nsIURL.h"
 #include "nsNetCID.h"
 #include "nsIPipe.h"
 #include "nsIOutputStream.h"
-#include "nsIMIMEService.h"
 #include "nsCExternalHandlerService.h"
 #include "nsILocalFileMac.h"
 #include "nsIFileURL.h"
 #include "nsTArray.h"
 #include "nsObjCExceptions.h"
 #include "nsProxyRelease.h"
 #include "nsContentSecurityManager.h"
 #include "nsNetUtil.h"
--- a/image/decoders/icon/nsIconProtocolHandler.cpp
+++ b/image/decoders/icon/nsIconProtocolHandler.cpp
@@ -3,21 +3,18 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsIconProtocolHandler.h"
 
 #include "nsIconChannel.h"
 #include "nsIconURI.h"
-#include "nsIURL.h"
 #include "nsCRT.h"
 #include "nsCOMPtr.h"
-#include "nsIComponentManager.h"
-#include "nsIServiceManager.h"
 #include "nsNetCID.h"
 
 ///////////////////////////////////////////////////////////////////////////////
 
 nsIconProtocolHandler::nsIconProtocolHandler() {}
 
 nsIconProtocolHandler::~nsIconProtocolHandler() {}
 
--- a/image/decoders/icon/win/nsIconChannel.cpp
+++ b/image/decoders/icon/win/nsIconChannel.cpp
@@ -5,24 +5,22 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/BasePrincipal.h"
 #include "mozilla/Monitor.h"
 
 #include "nsIconChannel.h"
 #include "nsIIconURI.h"
-#include "nsIServiceManager.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsString.h"
 #include "nsReadableUtils.h"
 #include "nsMimeTypes.h"
 #include "nsMemory.h"
-#include "nsIStringStream.h"
 #include "nsIURL.h"
 #include "nsIPipe.h"
 #include "nsNetCID.h"
 #include "nsIFile.h"
 #include "nsIFileURL.h"
 #include "nsIMIMEService.h"
 #include "nsCExternalHandlerService.h"
 #include "nsDirectoryServiceDefs.h"
--- a/image/decoders/nsBMPDecoder.cpp
+++ b/image/decoders/nsBMPDecoder.cpp
@@ -96,17 +96,16 @@
 #include "nsBMPDecoder.h"
 
 #include <stdlib.h>
 
 #include "mozilla/Attributes.h"
 #include "mozilla/EndianUtils.h"
 #include "mozilla/Likely.h"
 
-#include "nsIInputStream.h"
 #include "RasterImage.h"
 #include <algorithm>
 
 using namespace mozilla::gfx;
 
 namespace mozilla {
 namespace image {
 namespace bmp {
--- a/image/decoders/nsGIFDecoder2.cpp
+++ b/image/decoders/nsGIFDecoder2.cpp
@@ -39,17 +39,16 @@ mailing address.
 */
 
 #include "nsGIFDecoder2.h"
 
 #include <stddef.h>
 
 #include "imgFrame.h"
 #include "mozilla/EndianUtils.h"
-#include "nsIInputStream.h"
 #include "RasterImage.h"
 #include "SurfacePipeFactory.h"
 
 #include "gfxColor.h"
 #include "gfxPlatform.h"
 #include "qcms.h"
 #include <algorithm>
 #include "mozilla/Telemetry.h"
--- a/image/decoders/nsPNGDecoder.cpp
+++ b/image/decoders/nsPNGDecoder.cpp
@@ -9,17 +9,16 @@
 
 #include <algorithm>
 #include <cstdint>
 
 #include "gfxColor.h"
 #include "gfxPlatform.h"
 #include "imgFrame.h"
 #include "nsColor.h"
-#include "nsIInputStream.h"
 #include "nsMemory.h"
 #include "nsRect.h"
 #include "nspr.h"
 #include "png.h"
 
 #include "RasterImage.h"
 #include "SurfaceCache.h"
 #include "SurfacePipeFactory.h"
--- a/image/imgFrame.h
+++ b/image/imgFrame.h
@@ -8,17 +8,16 @@
 #define mozilla_image_imgFrame_h
 
 #include "mozilla/Maybe.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/Monitor.h"
 #include "mozilla/Move.h"
 #include "AnimationParams.h"
 #include "gfxDrawable.h"
-#include "imgIContainer.h"
 #include "MainThreadUtils.h"
 
 namespace mozilla {
 namespace image {
 
 class ImageRegion;
 class DrawableFrameRef;
 class RawAccessFrameRef;
--- a/image/imgLoader.cpp
+++ b/image/imgLoader.cpp
@@ -61,17 +61,16 @@
 #include "Image.h"
 #include "prtime.h"
 #include "ReferrerInfo.h"
 
 // we want to explore making the document own the load group
 // so we can associate the document URI with the load group.
 // until this point, we have an evil hack:
 #include "nsIHttpChannelInternal.h"
-#include "nsILoadContext.h"
 #include "nsILoadGroupChild.h"
 #include "nsIDocShell.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 using namespace mozilla::image;
 using namespace mozilla::net;
 
--- a/image/test/fuzzing/TestDecoders.cpp
+++ b/image/test/fuzzing/TestDecoders.cpp
@@ -9,17 +9,16 @@
 #include "imgIContainer.h"
 #include "imgITools.h"
 #include "ImageOps.h"
 #include "mozilla/gfx/2D.h"
 #include "nsComponentManagerUtils.h"
 #include "nsCOMPtr.h"
 #include "nsIInputStream.h"
 #include "nsIRunnable.h"
-#include "nsIStringStream.h"
 #include "nsIThread.h"
 #include "mozilla/RefPtr.h"
 #include "nsString.h"
 #include "nsThreadUtils.h"
 
 #include "FuzzingInterfaceStream.h"
 
 using namespace mozilla;
--- a/image/test/gtest/Common.cpp
+++ b/image/test/gtest/Common.cpp
@@ -4,18 +4,18 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "Common.h"
 
 #include <cstdlib>
 
 #include "gfxPlatform.h"
 
+#include "imgITools.h"
 #include "nsDirectoryServiceDefs.h"
-#include "nsIDirectoryService.h"
 #include "nsIFile.h"
 #include "nsIInputStream.h"
 #include "nsIProperties.h"
 #include "nsNetUtil.h"
 #include "mozilla/RefPtr.h"
 #include "nsStreamUtils.h"
 #include "nsString.h"
 
--- a/image/test/gtest/Common.h
+++ b/image/test/gtest/Common.h
@@ -11,17 +11,16 @@
 #include "gtest/gtest.h"
 
 #include "mozilla/Attributes.h"
 #include "mozilla/Maybe.h"
 #include "mozilla/UniquePtr.h"
 #include "mozilla/gfx/2D.h"
 #include "Decoder.h"
 #include "gfxColor.h"
-#include "imgITools.h"
 #include "nsCOMPtr.h"
 #include "SurfaceFlags.h"
 #include "SurfacePipe.h"
 #include "SurfacePipeFactory.h"
 
 class nsIInputStream;
 
 namespace mozilla {
--- a/image/test/gtest/TestContainers.cpp
+++ b/image/test/gtest/TestContainers.cpp
@@ -2,17 +2,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "gtest/gtest.h"
 
 #include "BasicLayers.h"
 #include "Common.h"
 #include "imgIContainer.h"
-#include "imgITools.h"
 #include "ImageFactory.h"
 #include "ImageContainer.h"
 #include "mozilla/gfx/2D.h"
 #include "mozilla/RefPtr.h"
 #include "nsIInputStream.h"
 #include "nsString.h"
 #include "ProgressTracker.h"
 
--- a/image/test/gtest/TestDecodeToSurface.cpp
+++ b/image/test/gtest/TestDecodeToSurface.cpp
@@ -1,17 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "gtest/gtest.h"
 
 #include "Common.h"
 #include "imgIContainer.h"
-#include "imgITools.h"
 #include "ImageOps.h"
 #include "mozilla/gfx/2D.h"
 #include "nsComponentManagerUtils.h"
 #include "nsCOMPtr.h"
 #include "nsIInputStream.h"
 #include "nsIRunnable.h"
 #include "nsIThread.h"
 #include "mozilla/RefPtr.h"
--- a/image/test/gtest/TestDecoders.cpp
+++ b/image/test/gtest/TestDecoders.cpp
@@ -7,24 +7,21 @@
 #include "Common.h"
 #include "AnimationSurfaceProvider.h"
 #include "Decoder.h"
 #include "DecoderFactory.h"
 #include "decoders/nsBMPDecoder.h"
 #include "IDecodingTask.h"
 #include "ImageOps.h"
 #include "imgIContainer.h"
-#include "imgITools.h"
 #include "ImageFactory.h"
 #include "mozilla/gfx/2D.h"
 #include "nsComponentManagerUtils.h"
 #include "nsCOMPtr.h"
 #include "nsIInputStream.h"
-#include "nsIRunnable.h"
-#include "nsIThread.h"
 #include "mozilla/RefPtr.h"
 #include "nsStreamUtils.h"
 #include "nsString.h"
 #include "nsThreadUtils.h"
 #include "ProgressTracker.h"
 #include "SourceBuffer.h"
 
 using namespace mozilla;
--- a/image/test/gtest/TestMetadata.cpp
+++ b/image/test/gtest/TestMetadata.cpp
@@ -5,24 +5,21 @@
 #include "gtest/gtest.h"
 
 #include "Common.h"
 #include "Decoder.h"
 #include "DecoderFactory.h"
 #include "decoders/nsBMPDecoder.h"
 #include "IDecodingTask.h"
 #include "imgIContainer.h"
-#include "imgITools.h"
 #include "ImageFactory.h"
 #include "mozilla/gfx/2D.h"
 #include "nsComponentManagerUtils.h"
 #include "nsCOMPtr.h"
 #include "nsIInputStream.h"
-#include "nsIRunnable.h"
-#include "nsIThread.h"
 #include "mozilla/RefPtr.h"
 #include "nsStreamUtils.h"
 #include "nsString.h"
 #include "nsThreadUtils.h"
 #include "ProgressTracker.h"
 #include "SourceBuffer.h"
 
 using namespace mozilla;
--- a/image/test/gtest/TestSurfaceCache.cpp
+++ b/image/test/gtest/TestSurfaceCache.cpp
@@ -2,17 +2,16 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "gtest/gtest.h"
 
 #include "Common.h"
 #include "imgIContainer.h"
-#include "imgITools.h"
 #include "ImageFactory.h"
 #include "mozilla/gfx/2D.h"
 #include "mozilla/RefPtr.h"
 #include "mozilla/StaticPrefs_image.h"
 #include "nsIInputStream.h"
 #include "nsString.h"
 #include "ProgressTracker.h"
 
--- a/intl/chardet/tools/GenCyrillicClass.cpp
+++ b/intl/chardet/tools/GenCyrillicClass.cpp
@@ -1,17 +1,15 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #include "nsICharsetConverterManager.h"
 #include <iostream.h>
 #include "nsISupports.h"
-#include "nsIComponentManager.h"
-#include "nsIServiceManager.h"
 #include "nsIUnicodeDecoder.h"
 #include "nsIUnicodeEncoder.h"
 #include "nsCRT.h"
 #include <stdio.h>
 #include <stdlib.h>
 #if defined(XP_WIN)
 #  include <io.h>
 #endif
--- a/intl/hyphenation/glue/nsHyphenationManager.cpp
+++ b/intl/hyphenation/glue/nsHyphenationManager.cpp
@@ -5,17 +5,16 @@
 
 #include "nsHyphenationManager.h"
 #include "nsHyphenator.h"
 #include "nsAtom.h"
 #include "nsIFile.h"
 #include "nsIURI.h"
 #include "nsIJARURI.h"
 #include "nsIProperties.h"
-#include "nsISimpleEnumerator.h"
 #include "nsIDirectoryEnumerator.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsNetUtil.h"
 #include "nsUnicharUtils.h"
 #include "mozilla/CountingAllocatorBase.h"
 #include "mozilla/Preferences.h"
 #include "nsZipArchive.h"
 #include "mozilla/Services.h"
--- a/intl/locale/DateTimeFormat.cpp
+++ b/intl/locale/DateTimeFormat.cpp
@@ -1,17 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "DateTimeFormat.h"
 #include "nsCOMPtr.h"
-#include "nsIServiceManager.h"
 #include "mozilla/intl/LocaleService.h"
 #include "OSPreferences.h"
 #include "mozIOSPreferences.h"
 #include "unicode/udatpg.h"
 
 namespace mozilla {
 using namespace mozilla::intl;
 
--- a/intl/locale/LocaleService.cpp
+++ b/intl/locale/LocaleService.cpp
@@ -11,17 +11,16 @@
 #include "mozilla/Preferences.h"
 #include "mozilla/Services.h"
 #include "mozilla/StaticPrefs_privacy.h"
 #include "mozilla/intl/MozLocale.h"
 #include "mozilla/intl/OSPreferences.h"
 #include "nsDirectoryService.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsIObserverService.h"
-#include "nsIToolkitChromeRegistry.h"
 #include "nsStringEnumerator.h"
 #include "nsXULAppAPI.h"
 #include "nsZipArchive.h"
 
 #include "unicode/uloc.h"
 
 #define INTL_SYSTEM_LOCALES_CHANGED "intl:system-locales-changed"
 
--- a/intl/locale/nsCollation.cpp
+++ b/intl/locale/nsCollation.cpp
@@ -1,16 +1,15 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsCollation.h"
 #include "mozilla/intl/LocaleService.h"
-#include "nsIServiceManager.h"
 #include "nsString.h"
 
 NS_IMPL_ISUPPORTS(nsCollation, nsICollation)
 
 nsCollation::nsCollation()
     : mInit(false),
       mHasCollator(false),
       mLastStrength(-1),
--- a/intl/locale/nsLocaleConstructors.h
+++ b/intl/locale/nsLocaleConstructors.h
@@ -4,17 +4,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsLocaleConstructors_h__
 #define nsLocaleConstructors_h__
 
 #include "nsCollation.h"
 #include "nsCollationCID.h"
 #include "mozilla/ModuleUtils.h"
-#include "nsIServiceManager.h"
 #include "LocaleService.h"
 #include "OSPreferences.h"
 
 #define NSLOCALE_MAKE_CTOR(ctor_, iface_, func_)                              \
   static nsresult ctor_(nsISupports* aOuter, REFNSIID aIID, void** aResult) { \
     *aResult = nullptr;                                                       \
     if (aOuter) return NS_ERROR_NO_AGGREGATION;                               \
     iface_* inst;                                                             \
--- a/intl/locale/tests/gtest/TestLocaleService.cpp
+++ b/intl/locale/tests/gtest/TestLocaleService.cpp
@@ -2,17 +2,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "gtest/gtest.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/intl/LocaleService.h"
 #include "mozilla/intl/MozLocale.h"
-#include "nsIToolkitChromeRegistry.h"
 
 using namespace mozilla::intl;
 
 TEST(Intl_Locale_LocaleService, GetAppLocalesAsBCP47)
 {
   nsTArray<nsCString> appLocales;
   LocaleService::GetInstance()->GetAppLocalesAsBCP47(appLocales);
 
--- a/intl/locale/tests/gtest/TestLocaleServiceNegotiate.cpp
+++ b/intl/locale/tests/gtest/TestLocaleServiceNegotiate.cpp
@@ -1,16 +1,15 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "gtest/gtest.h"
 #include "mozilla/intl/LocaleService.h"
-#include "nsIToolkitChromeRegistry.h"
 
 using namespace mozilla::intl;
 
 TEST(Intl_Locale_LocaleService, Negotiate)
 {
   nsTArray<nsCString> requestedLocales;
   nsTArray<nsCString> availableLocales;
   nsTArray<nsCString> supportedLocales;
--- a/intl/lwbrk/gtest/TestLineBreak.cpp
+++ b/intl/lwbrk/gtest/TestLineBreak.cpp
@@ -1,17 +1,16 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include <stdio.h>
 #include "nsXPCOM.h"
-#include "nsIComponentManager.h"
 #include "nsISupports.h"
 #include "nsServiceManagerUtils.h"
 #include "nsString.h"
 #include "gtest/gtest.h"
 
 #include "mozilla/intl/LineBreaker.h"
 #include "mozilla/intl/WordBreaker.h"
 
--- a/intl/strres/nsStringBundle.cpp
+++ b/intl/strres/nsStringBundle.cpp
@@ -3,31 +3,28 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsStringBundle.h"
 #include "nsID.h"
 #include "nsString.h"
 #include "nsIStringBundle.h"
 #include "nsStringBundleService.h"
-#include "nsISupportsPrimitives.h"
-#include "nsIMutableArray.h"
 #include "nsArrayEnumerator.h"
 #include "nscore.h"
 #include "nsMemory.h"
 #include "nsNetUtil.h"
 #include "nsComponentManagerUtils.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIInputStream.h"
 #include "nsIURI.h"
 #include "nsIObserverService.h"
 #include "nsCOMArray.h"
 #include "nsTextFormatter.h"
 #include "nsErrorService.h"
-#include "nsICategoryManager.h"
 #include "nsContentUtils.h"
 #include "nsPersistentProperties.h"
 #include "nsQueryObject.h"
 #include "nsSimpleEnumerator.h"
 #include "nsStringStream.h"
 #include "mozilla/BinarySearch.h"
 #include "mozilla/ResultExtensions.h"
 #include "mozilla/URLPreloader.h"
--- a/intl/strres/nsStringBundleService.h
+++ b/intl/strres/nsStringBundleService.h
@@ -4,17 +4,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsStringBundleService_h__
 #define nsStringBundleService_h__
 
 #include "nsCOMPtr.h"
 #include "nsDataHashtable.h"
 #include "nsHashKeys.h"
-#include "nsIPersistentProperties2.h"
 #include "nsIStringBundle.h"
 #include "nsIObserver.h"
 #include "nsWeakReference.h"
 #include "nsIErrorService.h"
 #include "nsIMemoryReporter.h"
 
 #include "mozilla/LinkedList.h"
 #include "mozilla/UniquePtr.h"
--- a/intl/uconv/nsTextToSubURI.cpp
+++ b/intl/uconv/nsTextToSubURI.cpp
@@ -7,17 +7,16 @@
 #include "nsEscape.h"
 #include "nsTextToSubURI.h"
 #include "nsCRT.h"
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/Encoding.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/TextUtils.h"
 #include "mozilla/Utf8.h"
-#include "nsISupportsPrimitives.h"
 
 using namespace mozilla;
 
 nsTextToSubURI::~nsTextToSubURI() {}
 
 NS_IMPL_ISUPPORTS(nsTextToSubURI, nsITextToSubURI)
 
 NS_IMETHODIMP
--- a/ipc/glue/BackgroundImpl.cpp
+++ b/ipc/glue/BackgroundImpl.cpp
@@ -26,17 +26,16 @@
 #include "mozilla/dom/File.h"
 #include "mozilla/dom/WorkerPrivate.h"
 #include "mozilla/dom/WorkerRef.h"
 #include "mozilla/ipc/ProtocolTypes.h"
 #include "mozilla/net/SocketProcessBridgeChild.h"
 #include "nsAutoPtr.h"
 #include "nsCOMPtr.h"
 #include "nsIEventTarget.h"
-#include "nsIMutable.h"
 #include "nsIObserver.h"
 #include "nsIObserverService.h"
 #include "nsIRunnable.h"
 #include "nsISupportsImpl.h"
 #include "nsIThread.h"
 #include "nsITimer.h"
 #include "nsTArray.h"
 #include "nsThreadUtils.h"
--- a/ipc/glue/BackgroundParentImpl.cpp
+++ b/ipc/glue/BackgroundParentImpl.cpp
@@ -58,17 +58,16 @@
 #include "mozilla/ipc/PParentToChildStreamParent.h"
 #include "mozilla/layout/VsyncParent.h"
 #include "mozilla/net/HttpBackgroundChannelParent.h"
 #include "mozilla/dom/network/UDPSocketParent.h"
 #include "mozilla/dom/WebAuthnTransactionParent.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/StaticPrefs_dom.h"
 #include "nsNetUtil.h"
-#include "nsIScriptSecurityManager.h"
 #include "nsProxyRelease.h"
 #include "mozilla/RefPtr.h"
 #include "nsThreadUtils.h"
 #include "nsTraceRefcnt.h"
 #include "nsXULAppAPI.h"
 
 #ifdef DISABLE_ASSERTS_FOR_FUZZING
 #  define ASSERT_UNLESS_FUZZING(...) \
--- a/ipc/glue/CrashReporterHost.cpp
+++ b/ipc/glue/CrashReporterHost.cpp
@@ -6,17 +6,16 @@
 
 #include "CrashReporterHost.h"
 #include "CrashReporterMetadataShmem.h"
 #include "mozilla/dom/Promise.h"
 #include "mozilla/recordreplay/ParentIPC.h"
 #include "mozilla/Sprintf.h"
 #include "mozilla/SyncRunnable.h"
 #include "mozilla/Telemetry.h"
-#include "nsIAsyncShutdown.h"
 #include "nsICrashService.h"
 #include "nsXULAppAPI.h"
 
 // Consistency checking for nsICrashService constants.  We depend on the
 // equivalence between nsICrashService values and GeckoProcessType values
 // in the code below.  Making them equal also ensures that if new process
 // types are added, people will know they may need to add crash reporting
 // support in various places because compilation errors will be triggered here.
--- a/ipc/glue/InputStreamUtils.cpp
+++ b/ipc/glue/InputStreamUtils.cpp
@@ -19,18 +19,19 @@
 #include "mozilla/InputStreamLengthWrapper.h"
 #include "nsBufferedStreams.h"
 #include "nsComponentManagerUtils.h"
 #include "nsDebug.h"
 #include "nsFileStreams.h"
 #include "nsIAsyncInputStream.h"
 #include "nsIAsyncOutputStream.h"
 #include "nsID.h"
+#include "nsIMIMEInputStream.h"
+#include "nsIMultiplexInputStream.h"
 #include "nsIPipe.h"
-#include "nsIXULRuntime.h"
 #include "nsMIMEInputStream.h"
 #include "nsMultiplexInputStream.h"
 #include "nsNetCID.h"
 #include "nsStreamUtils.h"
 #include "nsStringStream.h"
 #include "nsXULAppAPI.h"
 
 using namespace mozilla;
--- a/ipc/glue/MessageChannel.cpp
+++ b/ipc/glue/MessageChannel.cpp
@@ -21,16 +21,17 @@
 #include "mozilla/Telemetry.h"
 #include "mozilla/TimeStamp.h"
 #include "mozilla/UniquePtr.h"
 #include "nsAppRunner.h"
 #include "nsAutoPtr.h"
 #include "nsContentUtils.h"
 #include "nsDataHashtable.h"
 #include "nsDebug.h"
+#include "nsIMemoryReporter.h"
 #include "nsISupportsImpl.h"
 #include "nsPrintfCString.h"
 #include <math.h>
 
 #ifdef MOZ_TASK_TRACER
 #  include "GeckoTaskTracer.h"
 using namespace mozilla::tasktracer;
 #endif
--- a/ipc/glue/MessageChannel.h
+++ b/ipc/glue/MessageChannel.h
@@ -6,17 +6,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef ipc_glue_MessageChannel_h
 #define ipc_glue_MessageChannel_h 1
 
 #include "base/basictypes.h"
 #include "base/message_loop.h"
 
-#include "nsIMemoryReporter.h"
 #include "mozilla/Atomics.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/Monitor.h"
 #include "mozilla/MozPromise.h"
 #include "mozilla/Vector.h"
 #if defined(OS_WIN)
 #  include "mozilla/ipc/Neutering.h"
 #endif  // defined(OS_WIN)
--- a/ipc/glue/MessagePump.cpp
+++ b/ipc/glue/MessagePump.cpp
@@ -1,17 +1,16 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "MessagePump.h"
 
-#include "nsIRunnable.h"
 #include "nsIThread.h"
 #include "nsITimer.h"
 #include "nsICancelableRunnable.h"
 
 #include "base/basictypes.h"
 #include "base/logging.h"
 #include "base/scoped_nsautorelease_pool.h"
 #include "mozilla/Assertions.h"
--- a/ipc/glue/ProtocolUtils.h
+++ b/ipc/glue/ProtocolUtils.h
@@ -28,17 +28,16 @@
 #include "mozilla/LinkedList.h"
 #include "mozilla/Maybe.h"
 #include "mozilla/MozPromise.h"
 #include "mozilla/Mutex.h"
 #include "mozilla/NotNull.h"
 #include "mozilla/Scoped.h"
 #include "mozilla/UniquePtr.h"
 #include "MainThreadUtils.h"
-#include "nsICrashReporter.h"
 
 #if defined(ANDROID) && defined(DEBUG)
 #  include <android/log.h>
 #endif
 
 template <typename T>
 class nsTHashtable;
 template <typename T>
--- a/ipc/glue/WindowsMessageLoop.cpp
+++ b/ipc/glue/WindowsMessageLoop.cpp
@@ -8,17 +8,16 @@
 
 #include "WindowsMessageLoop.h"
 #include "Neutering.h"
 #include "MessageChannel.h"
 
 #include "nsAutoPtr.h"
 #include "nsServiceManagerUtils.h"
 #include "nsString.h"
-#include "nsIXULAppInfo.h"
 #include "WinUtils.h"
 
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/ipc/ProtocolUtils.h"
 #include "mozilla/PaintTracker.h"
 
 using namespace mozilla;
 using namespace mozilla::ipc;
--- a/ipc/ipdl/test/cxx/IPDLUnitTests.h
+++ b/ipc/ipdl/test/cxx/IPDLUnitTests.h
@@ -5,18 +5,16 @@
 
 #ifndef mozilla__ipdltest_IPDLUnitTests_h
 #define mozilla__ipdltest_IPDLUnitTests_h 1
 
 #include "base/message_loop.h"
 #include "base/process.h"
 #include "chrome/common/ipc_channel.h"
 
-#include "nsIAppShell.h"
-
 #include "nsCOMPtr.h"
 #include "nsDebug.h"
 #include "nsServiceManagerUtils.h"  // do_GetService()
 #include "nsWidgetsCID.h"           // NS_APPSHELL_CID
 #include "nsXULAppAPI.h"
 
 #define MOZ_IPDL_TESTFAIL_LABEL "TEST-UNEXPECTED-FAIL"
 #define MOZ_IPDL_TESTPASS_LABEL "TEST-PASS"
--- a/ipc/mscom/InterceptorLog.cpp
+++ b/ipc/mscom/InterceptorLog.cpp
@@ -15,19 +15,19 @@
 #include "mozilla/Mutex.h"
 #include "mozilla/Services.h"
 #include "mozilla/StaticPtr.h"
 #include "mozilla/TimeStamp.h"
 #include "mozilla/Unused.h"
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsDirectoryServiceUtils.h"
-#include "nsIFileStreams.h"
 #include "nsIObserver.h"
 #include "nsIObserverService.h"
+#include "nsIOutputStream.h"
 #include "nsNetUtil.h"
 #include "nsPrintfCString.h"
 #include "nsTArray.h"
 #include "nsThreadUtils.h"
 #include "nsXPCOMPrivate.h"
 #include "nsXULAppAPI.h"
 #include "prenv.h"
 
--- a/ipc/testshell/XPCShellEnvironment.cpp
+++ b/ipc/testshell/XPCShellEnvironment.cpp
@@ -23,24 +23,19 @@
 
 #include "xpcpublic.h"
 
 #include "XPCShellEnvironment.h"
 
 #include "mozilla/Utf8.h"  // mozilla::Utf8Unit
 #include "mozilla/XPCOM.h"
 
-#include "nsIChannel.h"
-#include "nsIClassInfo.h"
-#include "nsIDirectoryService.h"
 #include "nsIPrincipal.h"
 #include "nsIScriptSecurityManager.h"
-#include "nsIURI.h"
 #include "nsIXPConnect.h"
-#include "nsIXPCScriptable.h"
 
 #include "nsJSUtils.h"
 #include "nsJSPrincipals.h"
 #include "nsThreadUtils.h"
 #include "nsXULAppAPI.h"
 
 #include "BackstagePass.h"
 
--- a/js/ductwork/debugger/JSDebugger.cpp
+++ b/js/ductwork/debugger/JSDebugger.cpp
@@ -1,16 +1,15 @@
 /* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*-
  */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "JSDebugger.h"
-#include "nsIXPConnect.h"
 #include "nsThreadUtils.h"
 #include "jsapi.h"
 #include "jsfriendapi.h"
 #include "js/Wrapper.h"
 #include "nsServiceManagerUtils.h"
 #include "nsMemory.h"
 
 #define JSDEBUGGER_CONTRACTID "@mozilla.org/jsdebugger;1"
--- a/js/ipc/JavaScriptParent.cpp
+++ b/js/ipc/JavaScriptParent.cpp
@@ -4,16 +4,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/. */
 
 #include "JavaScriptParent.h"
 #include "mozilla/dom/ContentParent.h"
 #include "mozilla/dom/ScriptSettings.h"
 #include "nsJSUtils.h"
+#include "nsIConsoleService.h"
 #include "nsIScriptError.h"
 #include "jsfriendapi.h"
 #include "js/Proxy.h"
 #include "js/HeapAPI.h"
 #include "js/Wrapper.h"
 #include "xpcprivate.h"
 #include "mozilla/Casting.h"
 #include "mozilla/StaticPrefs_dom.h"
--- a/js/xpconnect/loader/AutoMemMap.h
+++ b/js/xpconnect/loader/AutoMemMap.h
@@ -5,17 +5,16 @@
 
 #ifndef loader_AutoMemMap_h
 #define loader_AutoMemMap_h
 
 #include "mozilla/FileUtils.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/RangedPtr.h"
 #include "mozilla/Result.h"
-#include "nsIMemoryReporter.h"
 
 #include <prio.h>
 
 class nsIFile;
 
 namespace mozilla {
 namespace ipc {
 class FileDescriptor;
--- a/js/xpconnect/loader/mozJSComponentLoader.cpp
+++ b/js/xpconnect/loader/mozJSComponentLoader.cpp
@@ -26,18 +26,16 @@
 #include "nsCOMPtr.h"
 #include "nsAutoPtr.h"
 #include "nsExceptionHandler.h"
 #include "nsIComponentManager.h"
 #include "mozilla/Module.h"
 #include "nsIFile.h"
 #include "mozJSComponentLoader.h"
 #include "mozJSLoaderUtils.h"
-#include "nsIXPConnect.h"
-#include "nsIScriptSecurityManager.h"
 #include "nsIFileURL.h"
 #include "nsIJARURI.h"
 #include "nsNetUtil.h"
 #include "nsJSPrincipals.h"
 #include "nsJSUtils.h"
 #include "xpcprivate.h"
 #include "xpcpublic.h"
 #include "nsContentUtils.h"
--- a/js/xpconnect/src/XPCJSContext.cpp
+++ b/js/xpconnect/src/XPCJSContext.cpp
@@ -14,23 +14,18 @@
 #include "XPCWrapper.h"
 #include "XPCJSMemoryReporter.h"
 #include "WrapperFactory.h"
 #include "mozJSComponentLoader.h"
 #include "nsAutoPtr.h"
 #include "nsNetUtil.h"
 #include "nsThreadUtils.h"
 
-#include "nsIMemoryInfoDumper.h"
-#include "nsIMemoryReporter.h"
 #include "nsIObserverService.h"
-#include "nsIBrowserChild.h"
 #include "nsIDebug2.h"
-#include "nsIDocShell.h"
-#include "nsIRunnable.h"
 #include "nsPIDOMWindow.h"
 #include "nsPrintfCString.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/Services.h"
 #ifdef FUZZING
 #  include "mozilla/StaticPrefs_fuzzing.h"
 #endif
@@ -58,17 +53,16 @@
 #include "mozilla/ThreadLocal.h"
 #include "mozilla/UniquePtrExtensions.h"
 #include "mozilla/Unused.h"
 #include "AccessCheck.h"
 #include "nsGlobalWindow.h"
 #include "nsAboutProtocolUtils.h"
 
 #include "GeckoProfiler.h"
-#include "nsIInputStream.h"
 #include "nsIXULRuntime.h"
 #include "nsJSPrincipals.h"
 #include "ExpandedPrincipal.h"
 
 #if defined(XP_LINUX) && !defined(ANDROID)
 // For getrlimit and min/max.
 #  include <algorithm>
 #  include <sys/resource.h>
--- a/js/xpconnect/src/XPCJSRuntime.cpp
+++ b/js/xpconnect/src/XPCJSRuntime.cpp
@@ -21,18 +21,16 @@
 #include "nsAutoPtr.h"
 #include "nsNetUtil.h"
 #include "nsContentSecurityUtils.h"
 
 #include "nsExceptionHandler.h"
 #include "nsIMemoryInfoDumper.h"
 #include "nsIMemoryReporter.h"
 #include "nsIObserverService.h"
-#include "nsIDebug2.h"
-#include "nsIDocShell.h"
 #include "mozilla/dom/Document.h"
 #include "nsIRunnable.h"
 #include "nsIPlatformInfo.h"
 #include "nsPIDOMWindow.h"
 #include "nsPrintfCString.h"
 #include "nsScriptSecurityManager.h"
 #include "nsThreadPool.h"
 #include "nsWindowSizes.h"
@@ -68,17 +66,16 @@
 #include "mozilla/Unused.h"
 #include "AccessCheck.h"
 #include "nsGlobalWindow.h"
 #include "nsAboutProtocolUtils.h"
 
 #include "GeckoProfiler.h"
 #include "NodeUbiReporting.h"
 #include "nsIInputStream.h"
-#include "nsIXULRuntime.h"
 #include "nsJSPrincipals.h"
 
 #ifdef XP_WIN
 #  include <windows.h>
 #endif
 
 using namespace mozilla;
 using namespace xpc;
--- a/js/xpconnect/src/XPCRuntimeService.cpp
+++ b/js/xpconnect/src/XPCRuntimeService.cpp
@@ -3,17 +3,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "xpcprivate.h"
 
 #include "nsContentUtils.h"
 #include "BackstagePass.h"
-#include "nsIPrincipal.h"
 #include "mozilla/dom/BindingUtils.h"
 #include "mozilla/dom/WebIDLGlobalNameHash.h"
 
 using namespace mozilla::dom;
 
 NS_IMPL_ISUPPORTS(BackstagePass, nsIXPCScriptable, nsIGlobalObject,
                   nsIClassInfo, nsIScriptObjectPrincipal,
                   nsISupportsWeakReference)
--- a/js/xpconnect/src/XPCWrappedNativeScope.cpp
+++ b/js/xpconnect/src/XPCWrappedNativeScope.cpp
@@ -10,17 +10,16 @@
 #include "XPCWrapper.h"
 #include "nsContentUtils.h"
 #include "nsCycleCollectionNoteRootCallback.h"
 #include "ExpandedPrincipal.h"
 #include "mozilla/BasePrincipal.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Unused.h"
-#include "nsIXULRuntime.h"
 #include "mozJSComponentLoader.h"
 
 #include "mozilla/dom/BindingUtils.h"
 
 using namespace mozilla;
 using namespace xpc;
 using namespace JS;
 
--- a/js/xpconnect/src/nsXPConnect.cpp
+++ b/js/xpconnect/src/nsXPConnect.cpp
@@ -30,18 +30,16 @@
 #include "mozilla/ScriptPreloader.h"
 
 #include "nsDOMMutationObserver.h"
 #include "nsICycleCollectorListener.h"
 #include "nsCycleCollector.h"
 #include "nsIObjectInputStream.h"
 #include "nsIObjectOutputStream.h"
 #include "nsScriptSecurityManager.h"
-#include "nsIPermissionManager.h"
-#include "nsIScriptError.h"
 #include "nsContentUtils.h"
 #include "nsScriptError.h"
 #include "nsJSUtils.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 using namespace xpc;
 using namespace JS;
--- a/js/xpconnect/src/xpcprivate.h
+++ b/js/xpconnect/src/xpcprivate.h
@@ -126,17 +126,16 @@
 #include "nsString.h"
 #include "nsReadableUtils.h"
 
 #include "MainThreadUtils.h"
 
 #include "nsIConsoleService.h"
 
 #include "nsVariant.h"
-#include "nsIProperty.h"
 #include "nsCOMArray.h"
 #include "nsTArray.h"
 #include "nsBaseHashtable.h"
 #include "nsHashKeys.h"
 #include "nsWrapperCache.h"
 #include "nsStringBuffer.h"
 #include "nsDataHashtable.h"
 #include "nsDeque.h"
--- a/js/xpconnect/tests/components/native/xpctest_returncode.cpp
+++ b/js/xpconnect/tests/components/native/xpctest_returncode.cpp
@@ -1,14 +1,13 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "xpctest_private.h"
-#include "xpctest_interfaces.h"
 #include "nsComponentManagerUtils.h"
 
 NS_IMPL_ISUPPORTS(nsXPCTestReturnCodeParent, nsIXPCTestReturnCodeParent)
 
 nsXPCTestReturnCodeParent::nsXPCTestReturnCodeParent() {}
 
 nsXPCTestReturnCodeParent::~nsXPCTestReturnCodeParent() {}
 
--- a/js/xpconnect/wrappers/XrayWrapper.cpp
+++ b/js/xpconnect/wrappers/XrayWrapper.cpp
@@ -4,17 +4,19 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "XrayWrapper.h"
 #include "AccessCheck.h"
 #include "WrapperFactory.h"
 
 #include "nsDependentString.h"
+#include "nsIConsoleService.h"
 #include "nsIScriptError.h"
+#include "nsIXPConnect.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/ScriptSettings.h"
 
 #include "XPCWrapper.h"
 #include "xpcprivate.h"
 
 #include "jsapi.h"
 #include "js/PropertySpec.h"
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -69,18 +69,16 @@
 #include "nsContainerFrame.h"
 #include "mozilla/dom/Selection.h"
 #include "nsGkAtoms.h"
 #include "nsRange.h"
 #include "nsWindowSizes.h"
 #include "nsCOMPtr.h"
 #include "nsReadableUtils.h"
 #include "nsPageSequenceFrame.h"
-#include "nsIPermissionManager.h"
-#include "nsIMozBrowserFrame.h"
 #include "nsCaret.h"
 #include "mozilla/AccessibleCaretEventHub.h"
 #include "nsFrameManager.h"
 #include "nsXPCOM.h"
 #include "nsILayoutHistoryState.h"
 #include "nsILineIterator.h"  // for ScrollContentIntoView
 #include "PLDHashTable.h"
 #include "mozilla/dom/Touch.h"
@@ -165,17 +163,16 @@
 #include "LayerTreeInvalidation.h"
 #include "mozilla/css/ImageLoader.h"
 #include "mozilla/dom/DocumentTimeline.h"
 #include "mozilla/dom/ScriptSettings.h"
 #include "mozilla/ErrorResult.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Telemetry.h"
 #include "nsCanvasFrame.h"
-#include "nsIImageLoadingContent.h"
 #include "nsImageFrame.h"
 #include "nsIScreen.h"
 #include "nsIScreenManager.h"
 #include "nsPlaceholderFrame.h"
 #include "nsTransitionManager.h"
 #include "ChildIterator.h"
 #include "mozilla/RestyleManager.h"
 #include "nsIDragSession.h"
--- a/layout/base/PresShell.h
+++ b/layout/base/PresShell.h
@@ -11,16 +11,17 @@
 
 #include "mozilla/PresShellForwards.h"
 
 #include <stdio.h>  // for FILE definition
 #include "FrameMetrics.h"
 #include "GeckoProfiler.h"
 #include "TouchManager.h"
 #include "Units.h"
+#include "Visibility.h"
 #include "ZoomConstraintsClient.h"
 #include "gfxPoint.h"
 #include "mozilla/ArenaObjectID.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/EventForwards.h"
 #include "mozilla/FlushType.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/ScrollTypes.h"
@@ -38,17 +39,16 @@
 #include "nsColor.h"
 #include "nsCOMArray.h"
 #include "nsCoord.h"
 #include "nsDOMNavigationTiming.h"
 #include "nsFrameManager.h"
 #include "nsFrameState.h"
 #include "nsHashKeys.h"
 #include "nsIContent.h"
-#include "nsIImageLoadingContent.h"
 #include "nsIObserver.h"
 #include "nsISelectionController.h"
 #include "nsIWidget.h"
 #include "nsQueryFrame.h"
 #include "nsMargin.h"
 #include "nsPresArena.h"
 #include "nsPresContext.h"
 #include "nsRect.h"
--- a/layout/base/nsPresContext.cpp
+++ b/layout/base/nsPresContext.cpp
@@ -65,17 +65,16 @@
 #include "mozilla/dom/BrowserChild.h"
 #include "mozilla/dom/BrowserParent.h"
 #include "nsRefreshDriver.h"
 #include "Layers.h"
 #include "LayerUserData.h"
 #include "ClientLayerManager.h"
 #include "mozilla/dom/NotifyPaintEvent.h"
 
-#include "nsIDOMChromeWindow.h"
 #include "nsFrameLoader.h"
 #include "nsContentUtils.h"
 #include "nsPIWindowRoot.h"
 #include "mozilla/Preferences.h"
 #include "gfxTextRun.h"
 #include "nsFontFaceUtils.h"
 #include "mozilla/GlobalStyleSheetCache.h"
 #include "mozilla/ServoBindings.h"
--- a/layout/base/nsPresContext.h
+++ b/layout/base/nsPresContext.h
@@ -36,17 +36,16 @@
 #include "nsTArray.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/TimeStamp.h"
 #include "mozilla/AppUnits.h"
 #include "mozilla/MediaEmulationData.h"
 #include "mozilla/PresShellForwards.h"
 #include "prclist.h"
 #include "nsThreadUtils.h"
-#include "nsIMessageManager.h"
 #include "Units.h"
 #include "prenv.h"
 #include "mozilla/StaticPresData.h"
 
 class nsBidi;
 class nsIPrintSettings;
 class nsDocShell;
 class nsIDocShell;
--- a/layout/base/nsStyleSheetService.cpp
+++ b/layout/base/nsStyleSheetService.cpp
@@ -20,17 +20,16 @@
 #include "mozilla/ipc/URIUtils.h"
 #include "nsIURI.h"
 #include "nsCOMPtr.h"
 #include "nsICategoryManager.h"
 #include "nsISupportsPrimitives.h"
 #include "nsISimpleEnumerator.h"
 #include "nsNetUtil.h"
 #include "nsIConsoleService.h"
-#include "nsIObserverService.h"
 #include "nsLayoutStatics.h"
 #include "nsLayoutUtils.h"
 
 using namespace mozilla;
 
 nsStyleSheetService* nsStyleSheetService::gInstance = nullptr;
 
 nsStyleSheetService::nsStyleSheetService() {
--- a/layout/build/nsContentDLF.cpp
+++ b/layout/build/nsContentDLF.cpp
@@ -6,38 +6,32 @@
 #include "nsContentDLF.h"
 
 #include "mozilla/Encoding.h"
 
 #include "nsCOMPtr.h"
 #include "nsDocShell.h"
 #include "nsGenericHTMLElement.h"
 #include "nsGkAtoms.h"
-#include "nsIComponentManager.h"
-#include "nsIComponentRegistrar.h"
 #include "nsIContentViewer.h"
-#include "nsICategoryManager.h"
 #include "nsIDocumentLoaderFactory.h"
 #include "mozilla/dom/Document.h"
-#include "nsIURL.h"
 #include "nsNodeInfoManager.h"
-#include "nsIScriptSecurityManager.h"
 #include "nsString.h"
 #include "nsContentCID.h"
 #include "nsNetUtil.h"
 #include "nsCRT.h"
 #include "nsIViewSourceChannel.h"
 #include "nsContentUtils.h"
 #include "imgLoader.h"
 #include "nsCharsetSource.h"
 #include "nsMimeTypes.h"
 #include "DecoderTraits.h"
 
 // plugins
-#include "nsIPluginHost.h"
 #include "nsPluginHost.h"
 
 // Factory code for creating variations on html documents
 
 #undef NOISY_REGISTRY
 
 using mozilla::dom::Document;
 
--- a/layout/build/nsLayoutModule.cpp
+++ b/layout/build/nsLayoutModule.cpp
@@ -31,17 +31,16 @@
 #include "nsLayoutCID.h"
 #include "nsFocusManager.h"
 #include "ThirdPartyUtil.h"
 #include "gfxPlatform.h"
 #include "mozilla/gfx/gfxVars.h"
 #include "mozilla/dom/quota/QuotaManagerService.h"
 
 #include "nsIEventListenerService.h"
-#include "nsIMessageManager.h"
 
 // view stuff
 #include "nsContentCreatorFunctions.h"
 
 #include "mozilla/dom/LocalStorageCommon.h"
 #include "mozilla/dom/LocalStorageManager.h"
 #include "mozilla/dom/LocalStorageManager2.h"
 #include "mozilla/dom/SessionStorageManager.h"
--- a/layout/forms/nsButtonFrameRenderer.h
+++ b/layout/forms/nsButtonFrameRenderer.h
@@ -2,17 +2,16 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsButtonFrameRenderer_h___
 #define nsButtonFrameRenderer_h___
 
-#include "imgIContainer.h"
 #include "nsMargin.h"
 #include "nsCSSRenderingBorders.h"
 
 class gfxContext;
 class nsIFrame;
 class nsFrame;
 class nsDisplayList;
 class nsDisplayListBuilder;
--- a/layout/forms/nsComboboxControlFrame.cpp
+++ b/layout/forms/nsComboboxControlFrame.cpp
@@ -45,17 +45,16 @@
 #include "mozilla/EventStates.h"
 #include "mozilla/LookAndFeel.h"
 #include "mozilla/MouseEvents.h"
 #include "mozilla/PresShell.h"
 #include "mozilla/PresShellInlines.h"
 #include "mozilla/Unused.h"
 #include "gfx2DGlue.h"
 #include "mozilla/widget/nsAutoRollup.h"
-#include "nsILayoutHistoryState.h"
 
 #ifdef XP_WIN
 #  define COMBOBOX_ROLLUP_CONSUME_EVENT 0
 #else
 #  define COMBOBOX_ROLLUP_CONSUME_EVENT 1
 #endif
 
 using namespace mozilla;
--- a/layout/forms/nsDateTimeControlFrame.cpp
+++ b/layout/forms/nsDateTimeControlFrame.cpp
@@ -15,17 +15,16 @@
 #include "nsCheckboxRadioFrame.h"
 #include "nsGkAtoms.h"
 #include "nsContentCreatorFunctions.h"
 #include "mozilla/AsyncEventDispatcher.h"
 #include "mozilla/PresShell.h"
 #include "mozilla/dom/HTMLInputElement.h"
 #include "mozilla/dom/MutationEventBinding.h"
 #include "nsNodeInfoManager.h"
-#include "nsIObserverService.h"
 #include "jsapi.h"
 #include "nsJSUtils.h"
 #include "nsThreadUtils.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 nsIFrame* NS_NewDateTimeControlFrame(PresShell* aPresShell,
--- a/layout/forms/nsListControlFrame.cpp
+++ b/layout/forms/nsListControlFrame.cpp
@@ -6,17 +6,16 @@
 
 #include "nscore.h"
 #include "nsCOMPtr.h"
 #include "nsUnicharUtils.h"
 #include "nsListControlFrame.h"
 #include "nsCheckboxRadioFrame.h"  // for COMPARE macro
 #include "nsGkAtoms.h"
 #include "nsComboboxControlFrame.h"
-#include "nsIXULRuntime.h"
 #include "nsFontMetrics.h"
 #include "nsIScrollableFrame.h"
 #include "nsCSSRendering.h"
 #include "nsIDOMEventListener.h"
 #include "nsLayoutUtils.h"
 #include "nsDisplayList.h"
 #include "nsContentUtils.h"
 #include "mozilla/Attributes.h"
--- a/layout/forms/nsNumberControlFrame.cpp
+++ b/layout/forms/nsNumberControlFrame.cpp
@@ -8,17 +8,16 @@
 
 #include "mozilla/BasicEvents.h"
 #include "mozilla/EventStates.h"
 #include "mozilla/FloatingPoint.h"
 #include "mozilla/PresShell.h"
 #include "mozilla/dom/MutationEventBinding.h"
 #include "HTMLInputElement.h"
 #include "ICUUtils.h"
-#include "nsIFocusManager.h"
 #include "nsFocusManager.h"
 #include "nsFontMetrics.h"
 #include "nsCheckboxRadioFrame.h"
 #include "nsGkAtoms.h"
 #include "nsNameSpaceManager.h"
 #include "nsStyleConsts.h"
 #include "nsContentUtils.h"
 #include "nsContentCreatorFunctions.h"
--- a/layout/forms/nsTextControlFrame.cpp
+++ b/layout/forms/nsTextControlFrame.cpp
@@ -9,17 +9,16 @@
 #include "gfxContext.h"
 #include "nsCOMPtr.h"
 #include "nsFontMetrics.h"
 #include "nsTextControlFrame.h"
 #include "nsIPlaintextEditor.h"
 #include "nsCaret.h"
 #include "nsCSSPseudoElements.h"
 #include "nsGenericHTMLElement.h"
-#include "nsIEditor.h"
 #include "nsTextFragment.h"
 #include "nsNameSpaceManager.h"
 #include "nsCheckboxRadioFrame.h"  //for registering accesskeys
 
 #include "nsIContent.h"
 #include "nsPresContext.h"
 #include "nsGkAtoms.h"
 #include "nsLayoutUtils.h"
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -71,17 +71,16 @@
 #include "FrameLayerBuilder.h"
 #include "ImageLayers.h"
 
 #include "nsBidiPresUtils.h"
 #include "RubyUtils.h"
 #include "nsAnimationManager.h"
 
 // For triple-click pref
-#include "imgIContainer.h"
 #include "imgIRequest.h"
 #include "nsError.h"
 #include "nsContainerFrame.h"
 #include "nsBoxLayoutState.h"
 #include "nsBlockFrame.h"
 #include "nsDisplayList.h"
 #include "nsSVGIntegrationUtils.h"
 #include "SVGObserverUtils.h"
--- a/layout/generic/nsFrameSelection.cpp
+++ b/layout/generic/nsFrameSelection.cpp
@@ -26,17 +26,16 @@
 #include "nsIContent.h"
 #include "nsRange.h"
 #include "nsITableCellLayout.h"
 #include "nsTArray.h"
 #include "nsTableWrapperFrame.h"
 #include "nsTableCellFrame.h"
 #include "nsIScrollableFrame.h"
 #include "nsCCUncollectableMarker.h"
-#include "nsIDocumentEncoder.h"
 #include "nsTextFragment.h"
 #include <algorithm>
 #include "nsContentUtils.h"
 #include "nsCSSFrameConstructor.h"
 
 #include "nsGkAtoms.h"
 #include "nsIFrameTraversal.h"
 #include "nsLayoutUtils.h"
@@ -50,27 +49,24 @@ static NS_DEFINE_CID(kFrameTraversalCID,
 
 #include "mozilla/PresShell.h"
 #include "nsPresContext.h"
 #include "nsCaret.h"
 
 #include "mozilla/MouseEvents.h"
 #include "mozilla/TextEvents.h"
 
-#include "nsITimer.h"
 // notifications
 #include "mozilla/dom/Document.h"
 
 #include "nsISelectionController.h"  //for the enums
 #include "nsCopySupport.h"
 #include "nsIClipboard.h"
 #include "nsIFrameInlines.h"
 
-#include "nsIBidiKeyboard.h"
-
 #include "nsError.h"
 #include "mozilla/AutoCopyListener.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/Selection.h"
 #include "mozilla/dom/ShadowRoot.h"
 #include "mozilla/dom/Text.h"
 #include "mozilla/ErrorResult.h"
 #include "mozilla/dom/SelectionBinding.h"
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -46,26 +46,24 @@
 #include "mozilla/dom/Event.h"
 #include "mozilla/dom/HTMLTextAreaElement.h"
 #include <stdint.h>
 #include "mozilla/MathAlgorithms.h"
 #include "mozilla/Telemetry.h"
 #include "FrameLayerBuilder.h"
 #include "nsSubDocumentFrame.h"
 #include "nsSVGOuterSVGFrame.h"
-#include "nsIObjectLoadingContent.h"
 #include "mozilla/Attributes.h"
 #include "ScrollbarActivity.h"
 #include "nsRefreshDriver.h"
 #include "nsStyleConsts.h"
 #include "nsSVGIntegrationUtils.h"
 #include "nsIScrollPositionListener.h"
 #include "StickyScrollContainer.h"
 #include "nsIFrameInlines.h"
-#include "nsILayoutHistoryState.h"
 #include "gfxPlatform.h"
 #include "mozilla/StaticPrefs_apz.h"
 #include "mozilla/StaticPrefs_general.h"
 #include "mozilla/StaticPrefs_layers.h"
 #include "mozilla/StaticPrefs_layout.h"
 #include "ScrollAnimationPhysics.h"
 #include "ScrollAnimationBezierPhysics.h"
 #include "ScrollAnimationMSDPhysics.h"
--- a/layout/generic/nsImageFrame.cpp
+++ b/layout/generic/nsImageFrame.cpp
@@ -43,17 +43,16 @@
 #include "mozilla/dom/Document.h"
 #include "nsContentUtils.h"
 #include "nsCSSAnonBoxes.h"
 #include "nsStyleConsts.h"
 #include "nsStyleUtil.h"
 #include "nsTransform2D.h"
 #include "nsImageMap.h"
 #include "nsILoadGroup.h"
-#include "nsISupportsPriority.h"
 #include "nsNetUtil.h"
 #include "nsNetCID.h"
 #include "nsCSSRendering.h"
 #include "nsNameSpaceManager.h"
 #include <algorithm>
 #ifdef ACCESSIBILITY
 #  include "nsAccessibilityService.h"
 #endif
--- a/layout/generic/nsImageMap.cpp
+++ b/layout/generic/nsImageMap.cpp
@@ -17,17 +17,16 @@
 #include "nsReadableUtils.h"
 #include "nsPresContext.h"
 #include "nsNameSpaceManager.h"
 #include "nsGkAtoms.h"
 #include "nsImageFrame.h"
 #include "nsCoord.h"
 #include "nsIContentInlines.h"
 #include "nsIScriptError.h"
-#include "nsIStringBundle.h"
 #include "nsContentUtils.h"
 #include "ImageLayers.h"
 
 #ifdef ACCESSIBILITY
 #  include "nsAccessibilityService.h"
 #endif
 
 using namespace mozilla;
--- a/layout/generic/nsPluginFrame.cpp
+++ b/layout/generic/nsPluginFrame.cpp
@@ -23,17 +23,16 @@
 #include "nscore.h"
 #include "nsCOMPtr.h"
 #include "nsPresContext.h"
 #include "nsWidgetsCID.h"
 #include "nsView.h"
 #include "nsViewManager.h"
 #include "nsString.h"
 #include "nsGkAtoms.h"
-#include "nsIPluginInstanceOwner.h"
 #include "nsNPAPIPluginInstance.h"
 #include "npapi.h"
 #include "nsIObjectLoadingContent.h"
 #include "nsContentUtils.h"
 #include "nsDisplayList.h"
 #include "nsFocusManager.h"
 #include "nsLayoutUtils.h"
 #include "nsFrameManager.h"
--- a/layout/generic/nsSubDocumentFrame.cpp
+++ b/layout/generic/nsSubDocumentFrame.cpp
@@ -38,17 +38,16 @@
 #include "nsNameSpaceManager.h"
 #include "nsDisplayList.h"
 #include "nsIScrollableFrame.h"
 #include "nsIObjectLoadingContent.h"
 #include "nsLayoutUtils.h"
 #include "FrameLayerBuilder.h"
 #include "nsPluginFrame.h"
 #include "nsContentUtils.h"
-#include "nsIPermissionManager.h"
 #include "nsServiceManagerUtils.h"
 #include "nsQueryObject.h"
 #include "RetainedDisplayListBuilder.h"
 
 #include "Layers.h"
 #include "BasicLayers.h"
 #include "mozilla/layers/WebRenderUserData.h"
 #include "mozilla/layers/WebRenderScrollData.h"
--- a/layout/generic/nsTextRunTransformations.cpp
+++ b/layout/generic/nsTextRunTransformations.cpp
@@ -13,17 +13,16 @@
 
 #include "nsGkAtoms.h"
 #include "nsStyleConsts.h"
 #include "nsUnicharUtils.h"
 #include "nsUnicodeProperties.h"
 #include "nsSpecialCasingData.h"
 #include "mozilla/gfx/2D.h"
 #include "nsTextFrameUtils.h"
-#include "nsIPersistentProperties2.h"
 #include "GreekCasing.h"
 #include "IrishCasing.h"
 
 using namespace mozilla;
 using namespace mozilla::gfx;
 
 // Unicode characters needing special casing treatment in tr/az languages
 #define LATIN_CAPITAL_LETTER_I_WITH_DOT_ABOVE 0x0130
--- a/layout/inspector/InspectorUtils.cpp
+++ b/layout/inspector/InspectorUtils.cpp
@@ -7,22 +7,20 @@
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/EventStates.h"
 
 #include "inLayoutUtils.h"
 
 #include "gfxTextRun.h"
 #include "nsArray.h"
 #include "nsAutoPtr.h"
-#include "nsIServiceManager.h"
 #include "nsString.h"
 #include "nsIStyleSheetLinkingElement.h"
 #include "nsIContentInlines.h"
 #include "mozilla/dom/Document.h"
-#include "nsIMutableArray.h"
 #include "ChildIterator.h"
 #include "nsComputedDOMStyle.h"
 #include "mozilla/EventStateManager.h"
 #include "nsAtom.h"
 #include "nsPresContext.h"
 #include "nsRange.h"
 #include "mozilla/PresShell.h"
 #include "mozilla/PresShellInlines.h"
--- a/layout/inspector/inLayoutUtils.cpp
+++ b/layout/inspector/inLayoutUtils.cpp
@@ -3,19 +3,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/. */
 
 #include "inLayoutUtils.h"
 
 #include "mozilla/dom/Document.h"
 #include "nsIContent.h"
-#include "nsIContentViewer.h"
 #include "nsPIDOMWindow.h"
-#include "nsIDocShell.h"
 #include "nsPresContext.h"
 #include "mozilla/EventStateManager.h"
 #include "mozilla/dom/DocumentInlines.h"
 #include "mozilla/dom/Element.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
--- a/layout/ipc/VsyncParent.cpp
+++ b/layout/ipc/VsyncParent.cpp
@@ -5,17 +5,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "VsyncParent.h"
 
 #include "BackgroundParent.h"
 #include "BackgroundParentImpl.h"
 #include "gfxPlatform.h"
 #include "mozilla/Unused.h"
-#include "nsIThread.h"
 #include "nsThreadUtils.h"
 #include "VsyncSource.h"
 
 namespace mozilla {
 
 using namespace ipc;
 
 namespace layout {
--- a/layout/painting/nsCSSRendering.cpp
+++ b/layout/painting/nsCSSRendering.cpp
@@ -32,17 +32,16 @@
 #include "nsPoint.h"
 #include "nsRect.h"
 #include "nsFrameManager.h"
 #include "nsGkAtoms.h"
 #include "nsCSSAnonBoxes.h"
 #include "nsIContent.h"
 #include "mozilla/dom/DocumentInlines.h"
 #include "nsIScrollableFrame.h"
-#include "imgIRequest.h"
 #include "imgIContainer.h"
 #include "ImageOps.h"
 #include "nsCSSRendering.h"
 #include "nsCSSColorUtils.h"
 #include "nsITheme.h"
 #include "nsLayoutUtils.h"
 #include "nsBlockFrame.h"
 #include "nsStyleStructInlines.h"
--- a/layout/painting/nsCSSRendering.h
+++ b/layout/painting/nsCSSRendering.h
@@ -6,17 +6,16 @@
 
 /* utility functions for drawing borders and backgrounds */
 
 #ifndef nsCSSRendering_h___
 #define nsCSSRendering_h___
 
 #include "gfxBlur.h"
 #include "gfxContext.h"
-#include "imgIContainer.h"
 #include "mozilla/gfx/PathHelpers.h"
 #include "mozilla/gfx/Rect.h"
 #include "mozilla/TypedEnumBits.h"
 #include "nsLayoutUtils.h"
 #include "nsStyleStruct.h"
 #include "nsIFrame.h"
 #include "nsImageRenderer.h"
 #include "nsCSSRenderingBorders.h"
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -31,17 +31,16 @@
 #include "mozilla/PresShell.h"
 #include "mozilla/ShapeUtils.h"
 #include "mozilla/StaticPrefs_apz.h"
 #include "mozilla/StaticPrefs_gfx.h"
 #include "mozilla/StaticPrefs_layers.h"
 #include "mozilla/StaticPrefs_layout.h"
 #include "nsCSSRendering.h"
 #include "nsCSSRenderingGradients.h"
-#include "nsISelectionController.h"
 #include "nsRegion.h"
 #include "nsStyleStructInlines.h"
 #include "nsStyleTransformMatrix.h"
 #include "nsTransitionManager.h"
 #include "gfxMatrix.h"
 #include "nsSVGIntegrationUtils.h"
 #include "nsSVGUtils.h"
 #include "nsLayoutUtils.h"
--- a/layout/painting/nsDisplayListInvalidation.h
+++ b/layout/painting/nsDisplayListInvalidation.h
@@ -4,17 +4,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef NSDISPLAYLISTINVALIDATION_H_
 #define NSDISPLAYLISTINVALIDATION_H_
 
 #include "mozilla/Attributes.h"
 #include "FrameLayerBuilder.h"
-#include "imgIContainer.h"
 #include "nsRect.h"
 #include "nsColor.h"
 #include "gfxRect.h"
 #include "mozilla/gfx/MatrixFwd.h"
 
 class nsDisplayBackgroundImage;
 class nsCharClipDisplayItem;
 class nsDisplayItem;
--- a/layout/printing/PrintPreviewUserEventSuppressor.cpp
+++ b/layout/printing/PrintPreviewUserEventSuppressor.cpp
@@ -6,17 +6,16 @@
 
 #include "PrintPreviewUserEventSuppressor.h"
 
 #include "mozilla/TextEvents.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/Event.h"  // for Event
 #include "nsPIDOMWindow.h"
 #include "mozilla/dom/Document.h"
-#include "nsIDocShell.h"
 #include "nsPresContext.h"
 #include "nsFocusManager.h"
 #include "nsLiteralString.h"
 
 using namespace mozilla::dom;
 
 namespace mozilla {
 
--- a/layout/printing/nsPagePrintTimer.cpp
+++ b/layout/printing/nsPagePrintTimer.cpp
@@ -2,18 +2,16 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsPagePrintTimer.h"
 
 #include "mozilla/Unused.h"
-#include "nsIContentViewer.h"
-#include "nsIServiceManager.h"
 #include "nsPrintJob.h"
 
 using namespace mozilla;
 
 NS_IMPL_ISUPPORTS_INHERITED(nsPagePrintTimer, mozilla::Runnable,
                             nsITimerCallback)
 
 nsPagePrintTimer::~nsPagePrintTimer() {
--- a/layout/printing/nsPrintData.cpp
+++ b/layout/printing/nsPrintData.cpp
@@ -2,17 +2,16 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsPrintData.h"
 
 #include "nsIStringBundle.h"
-#include "nsIServiceManager.h"
 #include "nsIWidget.h"
 #include "nsPrintObject.h"
 #include "nsIWebProgressListener.h"
 #include "mozilla/Services.h"
 #include "PrintPreviewUserEventSuppressor.h"
 
 //-----------------------------------------------------
 // PR LOGGING
--- a/layout/printing/nsPrintData.h
+++ b/layout/printing/nsPrintData.h
@@ -7,23 +7,23 @@
 #ifndef nsPrintData_h___
 #define nsPrintData_h___
 
 #include "mozilla/Attributes.h"
 #include "mozilla/UniquePtr.h"
 
 // Interfaces
 #include "nsDeviceContext.h"
-#include "nsIPrintProgressParams.h"
 #include "nsIPrintSettings.h"
 #include "nsISupportsImpl.h"
 #include "nsTArray.h"
 #include "nsCOMArray.h"
 
 class nsPrintObject;
+class nsIPrintProgressParams;
 class nsIWebProgressListener;
 
 namespace mozilla {
 class PrintPreviewUserEventSuppressor;
 }  // namespace mozilla
 
 //------------------------------------------------------------------------
 // nsPrintData Class
--- a/layout/printing/nsPrintJob.cpp
+++ b/layout/printing/nsPrintJob.cpp
@@ -2,17 +2,16 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsPrintJob.h"
 
 #include "nsDocShell.h"
-#include "nsIStringBundle.h"
 #include "nsReadableUtils.h"
 #include "nsCRT.h"
 
 #include "mozilla/AsyncEventDispatcher.h"
 #include "mozilla/ComputedStyleInlines.h"
 #include "mozilla/dom/BrowsingContext.h"
 #include "mozilla/dom/Selection.h"
 #include "mozilla/dom/CustomEvent.h"
@@ -27,99 +26,85 @@
 #include "nsView.h"
 #include <algorithm>
 
 // Print Options
 #include "nsIPrintSettings.h"
 #include "nsIPrintSettingsService.h"
 #include "nsIPrintSession.h"
 #include "nsGfxCIID.h"
-#include "nsIServiceManager.h"
 #include "nsGkAtoms.h"
 #include "nsXPCOM.h"
-#include "nsISupportsPrimitives.h"
 
 static const char sPrintSettingsServiceContractID[] =
     "@mozilla.org/gfx/printsettings-service;1";
 
 #include "nsThreadUtils.h"
 
 // Printing
 #include "nsIWebBrowserPrint.h"
 
 // Print Preview
-#include "imgIContainer.h"  // image animation mode constants
 
 // Print Progress
-#include "nsIPrintProgress.h"
-#include "nsIPrintProgressParams.h"
 #include "nsIObserver.h"
 
 // Print error dialog
-#include "nsIPrompt.h"
-#include "nsIWindowWatcher.h"
 
 // Printing Prompts
 #include "nsIPrintingPromptService.h"
 static const char kPrintingPromptService[] =
     "@mozilla.org/embedcomp/printingprompt-service;1";
 
 // Printing Timer
 #include "nsPagePrintTimer.h"
 
 // FrameSet
 #include "mozilla/dom/Document.h"
 #include "mozilla/dom/DocumentInlines.h"
 
 // Focus
-#include "nsISelectionController.h"
 
 // Misc
 #include "gfxContext.h"
 #include "mozilla/gfx/DrawEventRecorder.h"
 #include "mozilla/layout/RemotePrintJobChild.h"
 #include "nsISupportsUtils.h"
 #include "nsIScriptContext.h"
 #include "nsIDocumentObserver.h"
-#include "nsISelectionListener.h"
 #include "nsContentCID.h"
 #include "nsLayoutCID.h"
 #include "nsContentUtils.h"
 #include "nsLayoutUtils.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/PresShell.h"
 #include "Text.h"
 
 #include "nsWidgetsCID.h"
 #include "nsIDeviceContextSpec.h"
 #include "nsDeviceContextSpecProxy.h"
 #include "nsViewManager.h"
 
 #include "nsPageSequenceFrame.h"
-#include "nsIURL.h"
-#include "nsIContentViewerEdit.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIDocShellTreeOwner.h"
 #include "nsIWebBrowserChrome.h"
-#include "nsIBaseWindow.h"
-#include "nsILayoutHistoryState.h"
 #include "nsFrameManager.h"
 #include "mozilla/ReflowInput.h"
 #include "nsIContentViewer.h"
 #include "nsIDocumentViewerPrint.h"
 
 #include "nsFocusManager.h"
 #include "nsRange.h"
 #include "nsIURIFixup.h"
 #include "mozilla/Components.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/HTMLFrameElement.h"
 #include "nsContentList.h"
-#include "nsIChannel.h"
 #include "PrintPreviewUserEventSuppressor.h"
 #include "xpcpublic.h"
 #include "nsVariant.h"
 #include "mozilla/ServoStyleSet.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
--- a/layout/style/CSS.cpp
+++ b/layout/style/CSS.cpp
@@ -7,17 +7,16 @@
 /* DOM object holding utility CSS functions */
 
 #include "CSS.h"
 
 #include "mozilla/dom/BindingDeclarations.h"
 #include "mozilla/ServoBindings.h"
 #include "nsGlobalWindow.h"
 #include "mozilla/dom/Document.h"
-#include "nsIURI.h"
 #include "nsStyleUtil.h"
 #include "xpcpublic.h"
 
 namespace mozilla {
 namespace dom {
 
 /* static */
 bool CSS::Supports(const GlobalObject& aGlobal, const nsAString& aProperty,
--- a/layout/style/CachedInheritingStyles.cpp
+++ b/layout/style/CachedInheritingStyles.cpp
@@ -3,17 +3,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/CachedInheritingStyles.h"
 
 #include "mozilla/ComputedStyle.h"
 #include "nsCOMPtr.h"
-#include "nsIMemoryReporter.h"
 #include "nsWindowSizes.h"
 
 namespace mozilla {
 
 void CachedInheritingStyles::Insert(ComputedStyle* aStyle) {
   MOZ_ASSERT(aStyle);
   MOZ_ASSERT(aStyle->IsInheritingAnonBox() ||
              aStyle->IsLazilyCascadedPseudoElement());
--- a/layout/style/ComputedStyle.h
+++ b/layout/style/ComputedStyle.h
@@ -4,17 +4,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* the interface (to internal code) for retrieving computed style data */
 
 #ifndef _ComputedStyle_h_
 #define _ComputedStyle_h_
 
-#include "nsIMemoryReporter.h"
 #include <algorithm>
 #include "mozilla/Assertions.h"
 #include "mozilla/CachedInheritingStyles.h"
 #include "mozilla/Maybe.h"
 #include "mozilla/PseudoStyleType.h"
 #include "mozilla/ServoComputedData.h"
 #include "mozilla/ServoStyleConsts.h"
 #include "mozilla/ServoTypes.h"
--- a/layout/style/DeclarationBlock.cpp
+++ b/layout/style/DeclarationBlock.cpp
@@ -5,17 +5,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/DeclarationBlock.h"
 
 #include "mozilla/css/Rule.h"
 #include "mozilla/ServoBindings.h"
 
 #include "nsCSSProps.h"
-#include "nsIMemoryReporter.h"
 
 namespace mozilla {
 
 /* static */
 already_AddRefed<DeclarationBlock> DeclarationBlock::FromCssText(
     const nsAString& aCssText, URLExtraData* aExtraData, nsCompatibility aMode,
     css::Loader* aLoader) {
   NS_ConvertUTF16toUTF8 value(aCssText);
--- a/layout/style/ErrorReporter.cpp
+++ b/layout/style/ErrorReporter.cpp
@@ -15,17 +15,16 @@
 #include "mozilla/Services.h"
 #include "mozilla/SystemGroup.h"
 #include "nsIConsoleService.h"
 #include "mozilla/dom/Document.h"
 #include "nsIDocShell.h"
 #include "nsIFactory.h"
 #include "nsINode.h"
 #include "nsIScriptError.h"
-#include "nsISensitiveInfoHiddenURI.h"
 #include "nsIStringBundle.h"
 #include "nsServiceManagerUtils.h"
 #include "nsStyleUtil.h"
 #include "nsThreadUtils.h"
 #include "nsNetUtil.h"
 
 using namespace mozilla;
 using namespace mozilla::css;
--- a/layout/style/FontFaceSet.cpp
+++ b/layout/style/FontFaceSet.cpp
@@ -34,26 +34,24 @@
 #include "mozilla/LoadInfo.h"
 #include "nsAutoPtr.h"
 #include "nsContentPolicyUtils.h"
 #include "nsDeviceContext.h"
 #include "nsFontFaceLoader.h"
 #include "nsIClassOfService.h"
 #include "nsIConsoleService.h"
 #include "nsIContentPolicy.h"
-#include "nsIContentSecurityPolicy.h"
 #include "nsIDocShell.h"
 #include "mozilla/dom/Document.h"
 #include "nsILoadContext.h"
 #include "nsINetworkPredictor.h"
 #include "nsIPrincipal.h"
 #include "nsISupportsPriority.h"
 #include "nsIWebNavigation.h"
 #include "nsNetUtil.h"
-#include "nsIProtocolHandler.h"
 #include "nsIInputStream.h"
 #include "nsLayoutUtils.h"
 #include "nsPresContext.h"
 #include "nsPrintfCString.h"
 #include "nsUTF8Utils.h"
 #include "nsDOMNavigationTiming.h"
 #include "ReferrerInfo.h"
 
--- a/layout/style/GeckoBindings.cpp
+++ b/layout/style/GeckoBindings.cpp
@@ -18,24 +18,21 @@
 #include "nsAttrValueInlines.h"
 #include "nsCSSFrameConstructor.h"
 #include "nsCSSProps.h"
 #include "nsCSSPseudoElements.h"
 #include "nsContentUtils.h"
 #include "nsDOMTokenList.h"
 #include "nsDeviceContext.h"
 #include "nsIContentInlines.h"
-#include "nsICrashReporter.h"
 #include "mozilla/dom/DocumentInlines.h"
 #include "nsILoadContext.h"
 #include "nsIFrame.h"
-#include "nsIMemoryReporter.h"
 #include "nsIMozBrowserFrame.h"
 #include "nsINode.h"
-#include "nsIPrincipal.h"
 #include "nsIURI.h"
 #include "nsFontMetrics.h"
 #include "nsHTMLStyleSheet.h"
 #include "nsMappedAttributes.h"
 #include "nsMediaFeatures.h"
 #include "nsNameSpaceManager.h"
 #include "nsNetUtil.h"
 #include "nsProxyRelease.h"
--- a/layout/style/Loader.cpp
+++ b/layout/style/Loader.cpp
@@ -24,17 +24,16 @@
 #include "nsSyncLoadService.h"
 #include "nsCOMPtr.h"
 #include "nsString.h"
 #include "nsIContent.h"
 #include "nsIContentInlines.h"
 #include "mozilla/dom/Document.h"
 #include "nsIURI.h"
 #include "nsNetUtil.h"
-#include "nsIProtocolHandler.h"
 #include "nsContentUtils.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsContentPolicyUtils.h"
 #include "nsIHttpChannel.h"
 #include "nsIHttpChannelInternal.h"
 #include "nsIClassOfService.h"
 #include "nsIScriptError.h"
 #include "nsMimeTypes.h"
@@ -59,17 +58,16 @@
 #include "ReferrerInfo.h"
 
 #ifdef MOZ_XUL
 #  include "nsXULPrototypeCache.h"
 #endif
 
 #include "nsError.h"
 
-#include "nsIContentSecurityPolicy.h"
 #include "mozilla/dom/SRICheck.h"
 
 #include "mozilla/Encoding.h"
 
 using namespace mozilla::dom;
 
 // 1024 bytes is specified in https://drafts.csswg.org/css-syntax/
 #define SNIFFING_BUFFER_SIZE 1024
--- a/layout/style/ServoStyleSet.h
+++ b/layout/style/ServoStyleSet.h
@@ -19,16 +19,17 @@
 #include "MainThreadUtils.h"
 #include "nsCSSPseudoElements.h"
 #include "nsCSSAnonBoxes.h"
 #include "nsChangeHint.h"
 #include "nsCoord.h"
 #include "nsAtom.h"
 #include "nsIMemoryReporter.h"
 #include "nsTArray.h"
+#include "nsIMemoryReporter.h"
 
 namespace mozilla {
 namespace css {
 class Rule;
 }  // namespace css
 namespace dom {
 class CSSImportRule;
 class Element;
--- a/layout/style/StyleSheet.cpp
+++ b/layout/style/StyleSheet.cpp
@@ -19,17 +19,16 @@
 #include "mozilla/ServoBindings.h"
 #include "mozilla/ServoCSSRuleList.h"
 #include "mozilla/ServoStyleSet.h"
 #include "mozilla/StaticPrefs_layout.h"
 #include "mozilla/StyleSheetInlines.h"
 
 #include "mozAutoDocUpdate.h"
 #include "SheetLoadData.h"
-#include "nsIReferrerInfo.h"
 
 namespace mozilla {
 
 using namespace dom;
 
 StyleSheet::StyleSheet(css::SheetParsingMode aParsingMode, CORSMode aCORSMode,
                        const dom::SRIMetadata& aIntegrity)
     : mParent(nullptr),
@@ -385,31 +384,31 @@ void StyleSheet::DropStyleSet(ServoStyle
   MOZ_DIAGNOSTIC_ASSERT(found, "didn't find style set");
 #ifndef MOZ_DIAGNOSTIC_ASSERT_ENABLED
   Unused << found;
 #endif
 }
 
 // NOTE(emilio): Composed doc and containing shadow root are set in child sheets
 // too, so no need to do it for each ancestor.
-#define NOTIFY(function_, args_)                           \
-  do {                                                     \
-    if (auto* shadow = GetContainingShadow()) {            \
-      shadow->function_ args_;                             \
-    }                                                      \
-    if (auto* doc = GetComposedDoc()) {                    \
-      doc->function_ args_;                                \
-    }                                                      \
-    StyleSheet* current = this;                            \
-    do {                                                   \
-      for (ServoStyleSet* set : current->mStyleSets) {     \
-        set->function_ args_;                              \
-      }                                                    \
-      current = current->mParent;                          \
-    } while (current);                                     \
+#define NOTIFY(function_, args_)                        \
+  do {                                                  \
+    if (auto* shadow = GetContainingShadow()) {         \
+      shadow->function_ args_;                          \
+    }                                                   \
+    if (auto* doc = GetComposedDoc()) {                 \
+      doc->function_ args_;                             \
+    }                                                   \
+    StyleSheet* current = this;                         \
+    do {                                                \
+      for (ServoStyleSet * set : current->mStyleSets) { \
+        set->function_ args_;                           \
+      }                                                 \
+      current = current->mParent;                       \
+    } while (current);                                  \
   } while (0)
 
 void StyleSheet::EnsureUniqueInner() {
   MOZ_ASSERT(mInner->mSheets.Length() != 0, "unexpected number of outers");
 
   if (IsReadOnly()) {
     // Sheets that can't be modified don't need a unique inner.
     return;
--- a/layout/style/nsCSSValue.cpp
+++ b/layout/style/nsCSSValue.cpp
@@ -13,20 +13,18 @@
 #include "mozilla/ServoBindings.h"
 #include "mozilla/ServoStyleSet.h"
 #include "mozilla/ServoTypes.h"
 #include "mozilla/StyleSheetInlines.h"
 #include "mozilla/Likely.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/css/ImageLoader.h"
 #include "gfxFontConstants.h"
-#include "imgIRequest.h"
 #include "imgRequestProxy.h"
 #include "mozilla/dom/Document.h"
-#include "nsIURIMutator.h"
 #include "nsCSSProps.h"
 #include "nsNetUtil.h"
 #include "nsPresContext.h"
 #include "nsStyleUtil.h"
 #include "nsDeviceContext.h"
 #include "nsContentUtils.h"
 
 using namespace mozilla;
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -40,17 +40,16 @@
 
 #include "nsCSSProps.h"
 #include "nsCSSPseudoElements.h"
 #include "mozilla/EffectSet.h"
 #include "mozilla/IntegerRange.h"
 #include "mozilla/ServoStyleSet.h"
 #include "mozilla/RestyleManager.h"
 #include "mozilla/ViewportFrame.h"
-#include "imgIRequest.h"
 #include "nsLayoutUtils.h"
 #include "nsCSSKeywords.h"
 #include "nsDisplayList.h"
 #include "nsDOMCSSDeclaration.h"
 #include "nsStyleTransformMatrix.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/ElementInlines.h"
 #include "prtime.h"
--- a/layout/style/nsDOMCSSAttrDeclaration.cpp
+++ b/layout/style/nsDOMCSSAttrDeclaration.cpp
@@ -12,17 +12,16 @@
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/SVGElement.h"
 #include "mozilla/dom/MutationEventBinding.h"
 #include "mozilla/DeclarationBlock.h"
 #include "mozilla/InternalMutationEvent.h"
 #include "mozilla/SMILCSSValueType.h"
 #include "mozilla/SMILValue.h"
 #include "mozAutoDocUpdate.h"
-#include "nsIURI.h"
 #include "nsWrapperCacheInlines.h"
 #include "nsIFrame.h"
 #include "ActiveLayerTracker.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 nsDOMCSSAttributeDeclaration::nsDOMCSSAttributeDeclaration(Element* aElement,
--- a/layout/style/nsDOMCSSDeclaration.cpp
+++ b/layout/style/nsDOMCSSDeclaration.cpp
@@ -11,17 +11,16 @@
 #include "mozilla/DeclarationBlock.h"
 #include "mozilla/StyleSheetInlines.h"
 #include "mozilla/css/Rule.h"
 #include "mozilla/dom/CSS2PropertiesBinding.h"
 #include "mozilla/dom/MutationEventBinding.h"
 #include "nsCSSProps.h"
 #include "nsCOMPtr.h"
 #include "mozAutoDocUpdate.h"
-#include "nsIURI.h"
 #include "mozilla/dom/BindingUtils.h"
 #include "nsQueryObject.h"
 #include "mozilla/layers/ScrollLinkedEffectDetector.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 nsDOMCSSDeclaration::~nsDOMCSSDeclaration() = default;
--- a/layout/style/nsDOMCSSDeclaration.h
+++ b/layout/style/nsDOMCSSDeclaration.h
@@ -10,17 +10,16 @@
 #define nsDOMCSSDeclaration_h___
 
 #include "nsICSSDeclaration.h"
 
 #include "mozilla/Attributes.h"
 #include "mozilla/Maybe.h"
 #include "mozilla/URLExtraData.h"
 #include "nsAttrValue.h"
-#include "nsIURI.h"
 #include "nsCOMPtr.h"
 #include "nsCompatibility.h"
 
 class nsIPrincipal;
 struct JSContext;
 class JSObject;
 
 namespace mozilla {
--- a/layout/style/nsFontFaceLoader.cpp
+++ b/layout/style/nsFontFaceLoader.cpp
@@ -14,20 +14,17 @@
 #include "nsError.h"
 #include "mozilla/AutoRestore.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/StaticPrefs_layout.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/Unused.h"
 #include "FontFaceSet.h"
 #include "nsPresContext.h"
-#include "nsIPrincipal.h"
-#include "nsIScriptSecurityManager.h"
 #include "nsIHttpChannel.h"
-#include "nsIContentPolicy.h"
 #include "nsIThreadRetargetableRequest.h"
 #include "nsContentPolicyUtils.h"
 #include "nsNetCID.h"
 
 #include "mozilla/gfx/2D.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -9,17 +9,16 @@
  * internal API for computed style data for an element
  */
 
 #include "nsStyleStruct.h"
 #include "nsStyleStructInlines.h"
 #include "nsStyleConsts.h"
 #include "nsString.h"
 #include "nsPresContext.h"
-#include "nsIAppShellService.h"
 #include "nsIWidget.h"
 #include "nsCRTGlue.h"
 #include "nsCSSProps.h"
 #include "nsDeviceContext.h"
 #include "nsStyleUtil.h"
 #include "nsIURIMutator.h"
 
 #include "nsCOMPtr.h"
--- a/layout/style/nsStyleUtil.cpp
+++ b/layout/style/nsStyleUtil.cpp
@@ -11,18 +11,16 @@
 #include "mozilla/FontPropertyTypes.h"
 #include "nsIContent.h"
 #include "nsCSSProps.h"
 #include "nsContentUtils.h"
 #include "nsROCSSPrimitiveValue.h"
 #include "nsStyleStruct.h"
 #include "nsIContentPolicy.h"
 #include "nsIContentSecurityPolicy.h"
-#include "nsIURI.h"
-#include "nsISupportsPrimitives.h"
 #include "nsLayoutUtils.h"
 #include "nsPrintfCString.h"
 #include <cctype>
 
 using namespace mozilla;
 
 //------------------------------------------------------------------------------
 // Font Algorithm Code
--- a/layout/svg/nsSVGImageFrame.h
+++ b/layout/svg/nsSVGImageFrame.h
@@ -8,17 +8,16 @@
 #define __NS_SVGIMAGEFRAME_H__
 
 // Keep in (case-insensitive) order:
 #include "gfxContext.h"
 #include "gfxPlatform.h"
 #include "mozilla/gfx/2D.h"
 #include "imgIContainer.h"
 #include "nsContainerFrame.h"
-#include "nsIImageLoadingContent.h"
 #include "nsLayoutUtils.h"
 #include "imgINotificationObserver.h"
 #include "SVGObserverUtils.h"
 #include "nsSVGUtils.h"
 #include "SVGContentUtils.h"
 #include "SVGGeometryFrame.h"
 #include "SVGImageContext.h"
 #include "mozilla/dom/SVGImageElement.h"
--- a/layout/tables/nsTableCellFrame.cpp
+++ b/layout/tables/nsTableCellFrame.cpp
@@ -18,17 +18,16 @@
 #include "nsStyleConsts.h"
 #include "nsPresContext.h"
 #include "nsCSSRendering.h"
 #include "nsIContent.h"
 #include "nsGenericHTMLElement.h"
 #include "nsAttrValueInlines.h"
 #include "nsHTMLParts.h"
 #include "nsGkAtoms.h"
-#include "nsIServiceManager.h"
 #include "nsDisplayList.h"
 #include "nsLayoutUtils.h"
 #include "nsTextFrame.h"
 #include "FrameLayerBuilder.h"
 #include <algorithm>
 
 // TABLECELL SELECTION
 #include "nsFrameSelection.h"
--- a/layout/tables/nsTableFrame.h
+++ b/layout/tables/nsTableFrame.h
@@ -2,17 +2,16 @@
 /* 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 nsTableFrame_h__
 #define nsTableFrame_h__
 
 #include "mozilla/Attributes.h"
 #include "celldata.h"
-#include "imgIContainer.h"
 #include "nscore.h"
 #include "nsContainerFrame.h"
 #include "nsStyleConsts.h"
 #include "nsCellMap.h"
 #include "nsGkAtoms.h"
 #include "nsDisplayList.h"
 #include "TableArea.h"
 
--- a/layout/tables/nsTableWrapperFrame.cpp
+++ b/layout/tables/nsTableWrapperFrame.cpp
@@ -12,17 +12,16 @@
 #include "nsTableCellFrame.h"
 #include "nsStyleConsts.h"
 #include "nsPresContext.h"
 #include "nsCSSRendering.h"
 #include "nsIContent.h"
 #include "prinrval.h"
 #include "nsGkAtoms.h"
 #include "nsHTMLParts.h"
-#include "nsIServiceManager.h"
 #include "nsDisplayList.h"
 #include "nsLayoutUtils.h"
 #include "nsIFrameInlines.h"
 #include <algorithm>
 
 using namespace mozilla;
 using namespace mozilla::layout;
 
--- a/layout/tools/layout-debug/src/nsLayoutDebugCLH.cpp
+++ b/layout/tools/layout-debug/src/nsLayoutDebugCLH.cpp
@@ -3,22 +3,23 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsLayoutDebugCLH.h"
 #include "nsArray.h"
 #include "nsString.h"
 #include "plstr.h"
+#include "nsComponentManagerUtils.h"
 #include "nsCOMPtr.h"
 #include "nsIWindowWatcher.h"
-#include "nsIServiceManager.h"
 #include "nsISupportsPrimitives.h"
 #include "nsICommandLine.h"
 #include "nsIURI.h"
+#include "nsServiceManagerUtils.h"
 
 nsLayoutDebugCLH::nsLayoutDebugCLH() {}
 
 nsLayoutDebugCLH::~nsLayoutDebugCLH() {}
 
 NS_IMPL_ISUPPORTS(nsLayoutDebugCLH, ICOMMANDLINEHANDLER)
 
 static nsresult HandleFlagWithOptionalArgument(nsICommandLine* aCmdLine,
--- a/layout/tools/layout-debug/src/nsLayoutDebuggingTools.cpp
+++ b/layout/tools/layout-debug/src/nsLayoutDebuggingTools.cpp
@@ -7,28 +7,26 @@
 #include "nsLayoutDebuggingTools.h"
 
 #include "nsIDocShell.h"
 #include "nsPIDOMWindow.h"
 #include "nsIContentViewer.h"
 #include "nsIPrintSettings.h"
 #include "nsIPrintSettingsService.h"
 
-#include "nsIServiceManager.h"
 #include "nsAtom.h"
 #include "nsQuickSort.h"
 
 #include "nsIContent.h"
 
 #include "nsViewManager.h"
 #include "nsFrame.h"
 
 #include "nsLayoutCID.h"
 
-#include "nsISelectionController.h"
 #include "mozilla/dom/Document.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/PresShell.h"
 
 using namespace mozilla;
 using mozilla::dom::Document;
 
--- a/layout/xul/nsBox.cpp
+++ b/layout/xul/nsBox.cpp
@@ -10,17 +10,16 @@
 #include "nsDOMAttributeMap.h"
 #include "nsPresContext.h"
 #include "nsCOMPtr.h"
 #include "nsIContent.h"
 #include "nsContainerFrame.h"
 #include "nsNameSpaceManager.h"
 #include "nsGkAtoms.h"
 #include "nsITheme.h"
-#include "nsIServiceManager.h"
 #include "nsBoxLayout.h"
 #include "FrameLayerBuilder.h"
 #include "mozilla/dom/Attr.h"
 #include "mozilla/dom/Element.h"
 #include <algorithm>
 
 using namespace mozilla;
 
--- a/layout/xul/nsBoxFrame.cpp
+++ b/layout/xul/nsBoxFrame.cpp
@@ -54,17 +54,16 @@
 #include "nsCOMPtr.h"
 #include "nsNameSpaceManager.h"
 #include "nsGkAtoms.h"
 #include "nsIContent.h"
 #include "nsHTMLParts.h"
 #include "nsViewManager.h"
 #include "nsView.h"
 #include "nsCSSRendering.h"
-#include "nsIServiceManager.h"
 #include "nsBoxLayout.h"
 #include "nsSprocketLayout.h"
 #include "nsIScrollableFrame.h"
 #include "nsWidgetsCID.h"
 #include "nsCSSAnonBoxes.h"
 #include "nsContainerFrame.h"
 #include "nsITheme.h"
 #include "nsTransform2D.h"
@@ -73,17 +72,16 @@
 #include "nsDisplayList.h"
 #include "mozilla/Preferences.h"
 #include "nsStyleConsts.h"
 #include "nsLayoutUtils.h"
 #include "nsSliderFrame.h"
 #include <algorithm>
 
 // Needed for Print Preview
-#include "nsIURI.h"
 
 #include "mozilla/TouchEvents.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 using namespace mozilla::gfx;
 
 nsIFrame* NS_NewBoxFrame(PresShell* aPresShell, ComputedStyle* aStyle,
--- a/layout/xul/nsDocElementBoxFrame.cpp
+++ b/layout/xul/nsDocElementBoxFrame.cpp
@@ -12,17 +12,16 @@
 #include "nsContainerFrame.h"
 #include "nsCSSRendering.h"
 #include "nsPageFrame.h"
 #include "nsStyleConsts.h"
 #include "nsGkAtoms.h"
 #include "nsBoxFrame.h"
 #include "nsStackLayout.h"
 #include "nsIAnonymousContentCreator.h"
-#include "nsIServiceManager.h"
 #include "nsNodeInfoManager.h"
 #include "nsContentCreatorFunctions.h"
 
 //#define DEBUG_REFLOW
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
--- a/layout/xul/nsImageBoxFrame.cpp
+++ b/layout/xul/nsImageBoxFrame.cpp
@@ -22,26 +22,23 @@
 #include "nsBoxLayoutState.h"
 
 #include "nsHTMLParts.h"
 #include "nsString.h"
 #include "nsLeafFrame.h"
 #include "mozilla/dom/Document.h"
 #include "mozilla/dom/DocumentInlines.h"
 #include "nsImageMap.h"
-#include "nsIURL.h"
-#include "nsILoadGroup.h"
 #include "nsContainerFrame.h"
 #include "nsCSSRendering.h"
 #include "nsNameSpaceManager.h"
 #include "nsTextFragment.h"
 #include "nsTransform2D.h"
 #include "nsITheme.h"
 
-#include "nsIServiceManager.h"
 #include "nsIURI.h"
 #include "nsThreadUtils.h"
 #include "nsDisplayList.h"
 #include "ImageLayers.h"
 #include "ImageContainer.h"
 #include "nsIContent.h"
 
 #include "nsContentUtils.h"
--- a/layout/xul/nsImageBoxFrame.h
+++ b/layout/xul/nsImageBoxFrame.h
@@ -4,19 +4,19 @@
  * 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 nsImageBoxFrame_h___
 #define nsImageBoxFrame_h___
 
 #include "mozilla/Attributes.h"
 #include "nsLeafBoxFrame.h"
 
-#include "imgILoader.h"
 #include "imgIRequest.h"
 #include "imgIContainer.h"
+#include "imgINotificationObserver.h"
 
 class imgRequestProxy;
 class nsImageBoxFrame;
 
 class nsDisplayXULImage;
 
 namespace mozilla {
 class PresShell;
--- a/layout/xul/nsMenuBarFrame.cpp
+++ b/layout/xul/nsMenuBarFrame.cpp
@@ -1,16 +1,15 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsMenuBarFrame.h"
-#include "nsIServiceManager.h"
 #include "nsIContent.h"
 #include "nsAtom.h"
 #include "nsPresContext.h"
 #include "nsCSSRendering.h"
 #include "nsNameSpaceManager.h"
 #include "nsGkAtoms.h"
 #include "nsMenuFrame.h"
 #include "nsMenuPopupFrame.h"
--- a/layout/xul/nsMenuBarListener.cpp
+++ b/layout/xul/nsMenuBarListener.cpp
@@ -5,17 +5,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsMenuBarListener.h"
 #include "nsMenuBarFrame.h"
 #include "nsMenuPopupFrame.h"
 #include "nsPIWindowRoot.h"
 
 // Drag & Drop, Clipboard
-#include "nsIServiceManager.h"
 #include "nsWidgetsCID.h"
 #include "nsCOMPtr.h"
 #include "nsIContent.h"
 
 #include "nsContentUtils.h"
 #include "mozilla/BasicEvents.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/TextEvents.h"
--- a/layout/xul/nsMenuFrame.cpp
+++ b/layout/xul/nsMenuFrame.cpp
@@ -12,30 +12,27 @@
 #include "nsAtom.h"
 #include "nsPresContext.h"
 #include "mozilla/ComputedStyle.h"
 #include "nsCSSRendering.h"
 #include "nsNameSpaceManager.h"
 #include "nsMenuPopupFrame.h"
 #include "nsMenuBarFrame.h"
 #include "mozilla/dom/Document.h"
-#include "nsIComponentManager.h"
 #include "nsBoxLayoutState.h"
 #include "nsIScrollableFrame.h"
-#include "nsIServiceManager.h"
 #include "nsCSSFrameConstructor.h"
 #include "nsString.h"
 #include "nsReadableUtils.h"
 #include "nsUnicharUtils.h"
 #include "nsIStringBundle.h"
 #include "nsContentUtils.h"
 #include "nsDisplayList.h"
 #include "nsIReflowCallback.h"
 #include "nsISound.h"
-#include "nsIDOMXULMenuListElement.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/EventDispatcher.h"
 #include "mozilla/Likely.h"
 #include "mozilla/LookAndFeel.h"
 #include "mozilla/MouseEvents.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/PresShell.h"
 #include "mozilla/Services.h"
--- a/layout/xul/nsMenuPopupFrame.cpp
+++ b/layout/xul/nsMenuPopupFrame.cpp
@@ -16,38 +16,36 @@
 #include "nsWidgetsCID.h"
 #include "nsMenuFrame.h"
 #include "nsMenuBarFrame.h"
 #include "nsPopupSetFrame.h"
 #include "nsPIDOMWindow.h"
 #include "nsFrameManager.h"
 #include "mozilla/dom/Document.h"
 #include "nsRect.h"
-#include "nsIComponentManager.h"
 #include "nsBoxLayoutState.h"
 #include "nsIScrollableFrame.h"
 #include "nsIPopupContainer.h"
 #include "nsIDocShell.h"
 #include "nsReadableUtils.h"
 #include "nsUnicharUtils.h"
 #include "nsLayoutUtils.h"
 #include "nsContentUtils.h"
 #include "nsCSSFrameConstructor.h"
 #include "nsPIWindowRoot.h"
 #include "nsIReflowCallback.h"
 #include "nsIDocShellTreeOwner.h"
 #include "nsIBaseWindow.h"
 #include "nsISound.h"
 #include "nsIScreenManager.h"
-#include "nsIServiceManager.h"
 #include "nsStyleConsts.h"
 #include "nsStyleStructInlines.h"
 #include "nsTransitionManager.h"
 #include "nsDisplayList.h"
-#include "nsIDOMXULSelectCntrlItemEl.h"
+#include "nsIDOMXULSelectCntrlEl.h"
 #include "mozilla/AnimationUtils.h"
 #include "mozilla/BasePrincipal.h"
 #include "mozilla/EventDispatcher.h"
 #include "mozilla/EventStateManager.h"
 #include "mozilla/EventStates.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/LookAndFeel.h"
 #include "mozilla/MouseEvents.h"
--- a/layout/xul/nsMenuPopupFrame.h
+++ b/layout/xul/nsMenuPopupFrame.h
@@ -9,26 +9,23 @@
 //
 
 #ifndef nsMenuPopupFrame_h__
 #define nsMenuPopupFrame_h__
 
 #include "mozilla/Attributes.h"
 #include "mozilla/gfx/Types.h"
 #include "nsAtom.h"
-#include "nsIDOMXULSelectCntrlEl.h"
 #include "nsGkAtoms.h"
 #include "nsCOMPtr.h"
 #include "nsMenuFrame.h"
 
 #include "nsBoxFrame.h"
 #include "nsMenuParent.h"
 
-#include "nsITimer.h"
-
 #include "Units.h"
 
 class nsIWidget;
 
 namespace mozilla {
 class PresShell;
 namespace dom {
 class KeyboardEvent;
--- a/layout/xul/nsRepeatService.cpp
+++ b/layout/xul/nsRepeatService.cpp
@@ -9,17 +9,16 @@
 // Netscape Communications
 //
 // See documentation in associated header file
 //
 
 #include "nsRepeatService.h"
 #include "mozilla/StaticPtr.h"
 #include "mozilla/dom/Document.h"
-#include "nsIServiceManager.h"
 
 using namespace mozilla;
 
 static StaticAutoPtr<nsRepeatService> gRepeatService;
 
 nsRepeatService::nsRepeatService()
     : mCallback(nullptr), mCallbackData(nullptr) {}
 
--- a/layout/xul/nsResizerFrame.cpp
+++ b/layout/xul/nsResizerFrame.cpp
@@ -1,17 +1,16 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsAutoPtr.h"
 #include "nsCOMPtr.h"
-#include "nsIServiceManager.h"
 #include "nsResizerFrame.h"
 #include "nsIContent.h"
 #include "mozilla/PresShell.h"
 #include "mozilla/dom/Document.h"
 #include "nsGkAtoms.h"
 #include "nsNameSpaceManager.h"
 
 #include "nsPresContext.h"
--- a/layout/xul/nsScrollbarButtonFrame.h
+++ b/layout/xul/nsScrollbarButtonFrame.h
@@ -11,17 +11,16 @@
 
 **/
 
 #ifndef nsScrollbarButtonFrame_h___
 #define nsScrollbarButtonFrame_h___
 
 #include "mozilla/Attributes.h"
 #include "nsButtonBoxFrame.h"
-#include "nsITimer.h"
 #include "nsRepeatService.h"
 
 namespace mozilla {
 class PresShell;
 }  // namespace mozilla
 
 class nsScrollbarButtonFrame final : public nsButtonBoxFrame {
  public:
--- a/layout/xul/nsSliderFrame.cpp
+++ b/layout/xul/nsSliderFrame.cpp
@@ -24,17 +24,16 @@
 #include "nsScrollbarButtonFrame.h"
 #include "nsIScrollableFrame.h"
 #include "nsIScrollbarMediator.h"
 #include "nsISupportsImpl.h"
 #include "nsScrollbarFrame.h"
 #include "nsRepeatService.h"
 #include "nsBoxLayoutState.h"
 #include "nsSprocketLayout.h"
-#include "nsIServiceManager.h"
 #include "nsContentUtils.h"
 #include "nsLayoutUtils.h"
 #include "nsDisplayList.h"
 #include "nsRefreshDriver.h"  // for nsAPostRefreshObserver
 #include "nsSVGIntegrationUtils.h"
 #include "mozilla/Assertions.h"  // for MOZ_ASSERT
 #include "mozilla/LookAndFeel.h"
 #include "mozilla/MouseEvents.h"
--- a/layout/xul/nsSplitterFrame.cpp
+++ b/layout/xul/nsSplitterFrame.cpp
@@ -19,17 +19,16 @@
 #include "mozilla/dom/Document.h"
 #include "nsNameSpaceManager.h"
 #include "nsScrollbarButtonFrame.h"
 #include "nsIDOMEventListener.h"
 #include "nsFrameList.h"
 #include "nsHTMLParts.h"
 #include "mozilla/ComputedStyle.h"
 #include "nsBoxLayoutState.h"
-#include "nsIServiceManager.h"
 #include "nsContainerFrame.h"
 #include "nsContentCID.h"
 #include "nsLayoutUtils.h"
 #include "nsDisplayList.h"
 #include "nsContentUtils.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/Event.h"
 #include "mozilla/dom/MouseEvent.h"
--- a/layout/xul/nsTextBoxFrame.cpp
+++ b/layout/xul/nsTextBoxFrame.cpp
@@ -21,17 +21,16 @@
 #include "nsGkAtoms.h"
 #include "nsPresContext.h"
 #include "gfxContext.h"
 #include "nsIContent.h"
 #include "nsNameSpaceManager.h"
 #include "nsBoxLayoutState.h"
 #include "nsMenuBarListener.h"
 #include "nsString.h"
-#include "nsIServiceManager.h"
 #include "nsITheme.h"
 #include "nsUnicharUtils.h"
 #include "nsContentUtils.h"
 #include "nsDisplayList.h"
 #include "nsCSSRendering.h"
 #include "nsIReflowCallback.h"
 #include "nsBoxFrame.h"
 #include "nsLayoutUtils.h"
--- a/layout/xul/nsXULPopupManager.cpp
+++ b/layout/xul/nsXULPopupManager.cpp
@@ -7,24 +7,22 @@
 #include "nsGkAtoms.h"
 #include "nsXULPopupManager.h"
 #include "nsMenuFrame.h"
 #include "nsMenuPopupFrame.h"
 #include "nsMenuBarFrame.h"
 #include "nsMenuBarListener.h"
 #include "nsContentUtils.h"
 #include "nsXULElement.h"
-#include "nsIDOMXULMenuListElement.h"
 #include "nsIDOMXULCommandDispatcher.h"
 #include "nsCSSFrameConstructor.h"
 #include "nsGlobalWindow.h"
 #include "nsIContentInlines.h"
 #include "nsLayoutUtils.h"
 #include "nsViewManager.h"
-#include "nsIComponentManager.h"
 #include "nsITimer.h"
 #include "nsFocusManager.h"
 #include "nsIDocShell.h"
 #include "nsPIDOMWindow.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIBaseWindow.h"
 #include "nsCaret.h"
 #include "mozilla/dom/Document.h"
--- a/layout/xul/nsXULTooltipListener.cpp
+++ b/layout/xul/nsXULTooltipListener.cpp
@@ -5,17 +5,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsXULTooltipListener.h"
 
 #include "nsXULElement.h"
 #include "mozilla/dom/Document.h"
 #include "nsGkAtoms.h"
 #include "nsMenuPopupFrame.h"
-#include "nsIServiceManager.h"
 #include "nsIDragService.h"
 #include "nsIDragSession.h"
 #ifdef MOZ_XUL
 #  include "nsITreeView.h"
 #endif
 #include "nsIScriptContext.h"
 #include "nsPIDOMWindow.h"
 #ifdef MOZ_XUL
--- a/layout/xul/tree/nsTreeBodyFrame.cpp
+++ b/layout/xul/tree/nsTreeBodyFrame.cpp
@@ -39,25 +39,23 @@
 #include "nsString.h"
 #include "nsContainerFrame.h"
 #include "nsView.h"
 #include "nsViewManager.h"
 #include "nsVariant.h"
 #include "nsWidgetsCID.h"
 #include "nsIFrameInlines.h"
 #include "nsBoxFrame.h"
-#include "nsIURL.h"
 #include "nsBoxLayoutState.h"
 #include "nsTreeContentView.h"
 #include "nsTreeUtils.h"
 #include "nsStyleConsts.h"
 #include "nsITheme.h"
 #include "imgIRequest.h"
 #include "imgIContainer.h"
-#include "imgILoader.h"
 #include "mozilla/dom/NodeInfo.h"
 #include "nsContentUtils.h"
 #include "nsLayoutUtils.h"
 #include "nsIScrollableFrame.h"
 #include "nsDisplayList.h"
 #include "mozilla/dom/CustomEvent.h"
 #include "mozilla/dom/Event.h"
 #include "mozilla/dom/ScriptSettings.h"
--- a/media/mtransport/WebrtcTCPSocketWrapper.cpp
+++ b/media/mtransport/WebrtcTCPSocketWrapper.cpp
@@ -5,17 +5,16 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "WebrtcTCPSocketWrapper.h"
 
 #include "mozilla/net/WebrtcTCPSocketChild.h"
 #include "ipc/WebrtcTCPSocket.h"
 #include "mozilla/LoadInfo.h"
 
-#include "nsIEventTarget.h"
 #include "nsNetCID.h"
 #include "nsProxyRelease.h"
 
 #include "nr_socket_proxy_config.h"
 
 namespace mozilla {
 namespace net {
 
--- a/media/mtransport/ipc/StunAddrsRequestParent.h
+++ b/media/mtransport/ipc/StunAddrsRequestParent.h
@@ -2,19 +2,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_net_StunAddrsRequestParent_h
 #define mozilla_net_StunAddrsRequestParent_h
 
 #include "mozilla/net/PStunAddrsRequestParent.h"
 
-#include "nsICancelable.h"
-#include "nsIDNSServiceDiscovery.h"
-
 struct MDNSService;
 
 namespace mozilla {
 namespace net {
 
 class StunAddrsRequestParent : public PStunAddrsRequestParent {
   friend class PStunAddrsRequestParent;
 
--- a/media/mtransport/ipc/WebrtcTCPSocket.cpp
+++ b/media/mtransport/ipc/WebrtcTCPSocket.cpp
@@ -5,17 +5,16 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "WebrtcTCPSocket.h"
 
 #include "nsHttpChannel.h"
 #include "nsIChannel.h"
 #include "nsIClassOfService.h"
 #include "nsIContentPolicy.h"
-#include "nsIEventTarget.h"
 #include "nsIIOService.h"
 #include "nsILoadInfo.h"
 #include "nsIProtocolProxyService.h"
 #include "nsIURIMutator.h"
 #include "nsProxyRelease.h"
 #include "nsString.h"
 #include "mozilla/dom/ContentProcessManager.h"
 #include "mozilla/dom/BrowserParent.h"
--- a/media/mtransport/nr_socket_prsock.cpp
+++ b/media/mtransport/nr_socket_prsock.cpp
@@ -105,18 +105,16 @@ nrappkit copyright:
 #include "nsServiceManagerUtils.h"
 #include "nsComponentManagerUtils.h"
 #include "nsXPCOM.h"
 #include "nsXULAppAPI.h"
 #include "runnable_utils.h"
 #include "mozilla/SyncRunnable.h"
 #include "nsTArray.h"
 #include "mozilla/SystemGroup.h"
-#include "nsIPrefService.h"
-#include "nsIPrefBranch.h"
 #include "nsISocketFilter.h"
 #include "nsDebug.h"
 #include "nsNetUtil.h"
 
 #ifdef XP_WIN
 #  include "mozilla/WindowsVersion.h"
 #endif
 
--- a/media/mtransport/nr_socket_prsock.h
+++ b/media/mtransport/nr_socket_prsock.h
@@ -49,17 +49,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 #include <queue>
 
 #include "nspr.h"
 #include "prio.h"
 
 #include "nsAutoPtr.h"
 #include "nsCOMPtr.h"
 #include "nsASocketHandler.h"
-#include "nsISocketTransportService.h"
 #include "nsXPCOM.h"
 #include "nsIEventTarget.h"
 #include "nsIUDPSocketChild.h"
 #include "nsProxyRelease.h"
 #include "nsThreadUtils.h"
 
 #include "mediapacket.h"
 #include "m_cpp_utils.h"
--- a/media/mtransport/nricectx.cpp
+++ b/media/mtransport/nricectx.cpp
@@ -51,18 +51,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 #include "nspr.h"
 #include "nss.h"
 #include "pk11pub.h"
 #include "plbase64.h"
 
 #include "nsCOMPtr.h"
 #include "nsComponentManagerUtils.h"
 #include "nsError.h"
-#include "nsIEventTarget.h"
-#include "nsIUUIDGenerator.h"
 #include "nsNetCID.h"
 #include "nsComponentManagerUtils.h"
 #include "nsServiceManagerUtils.h"
 #include "ScopedNSSTypes.h"
 #include "runnable_utils.h"
 #include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 
--- a/media/mtransport/nricectx.h
+++ b/media/mtransport/nricectx.h
@@ -58,17 +58,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 #include "sigslot.h"
 
 #include "prnetdb.h"
 
 #include "mozilla/RefPtr.h"
 #include "mozilla/UniquePtr.h"
 #include "nsAutoPtr.h"
 #include "nsIEventTarget.h"
-#include "nsITimer.h"
 #include "nsTArray.h"
 
 #include "m_cpp_utils.h"
 #include "nricestunaddr.h"
 #include "nricemediastream.h"
 
 typedef struct nr_ice_ctx_ nr_ice_ctx;
 typedef struct nr_ice_peer_ctx_ nr_ice_peer_ctx;
--- a/media/mtransport/nricemediastream.h
+++ b/media/mtransport/nricemediastream.h
@@ -47,18 +47,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 #include <string>
 #include <vector>
 
 #include "sigslot.h"
 
 #include "mozilla/RefPtr.h"
 #include "mozilla/UniquePtr.h"
 #include "nsCOMPtr.h"
-#include "nsIEventTarget.h"
-#include "nsITimer.h"
 
 #include "m_cpp_utils.h"
 
 namespace mozilla {
 
 typedef struct nr_ice_ctx_ nr_ice_ctx;
 typedef struct nr_ice_peer_ctx_ nr_ice_peer_ctx;
 typedef struct nr_ice_media_stream_ nr_ice_media_stream;
--- a/media/mtransport/test/runnable_utils_unittest.cpp
+++ b/media/mtransport/test/runnable_utils_unittest.cpp
@@ -9,21 +9,16 @@
 
 #include "prio.h"
 
 #include "nsCOMPtr.h"
 #include "nsNetCID.h"
 #include "nsXPCOM.h"
 
 #include "mozilla/RefPtr.h"
-#include "nsIComponentManager.h"
-#include "nsIComponentRegistrar.h"
-#include "nsIIOService.h"
-#include "nsIServiceManager.h"
-#include "nsISocketTransportService.h"
 
 #include "nsASocketHandler.h"
 #include "nsServiceManagerUtils.h"
 #include "nsThreadUtils.h"
 
 #include "runnable_utils.h"
 
 #define GTEST_HAS_RTTI 0
--- a/media/mtransport/test/sockettransportservice_unittest.cpp
+++ b/media/mtransport/test/sockettransportservice_unittest.cpp
@@ -8,20 +8,16 @@
 #include <iostream>
 
 #include "prio.h"
 
 #include "nsCOMPtr.h"
 #include "nsNetCID.h"
 #include "nsXPCOM.h"
 
-#include "nsIComponentManager.h"
-#include "nsIComponentRegistrar.h"
-#include "nsIIOService.h"
-#include "nsIServiceManager.h"
 #include "nsISocketTransportService.h"
 
 #include "nsASocketHandler.h"
 #include "nsServiceManagerUtils.h"
 #include "nsThreadUtils.h"
 
 #define GTEST_HAS_RTTI 0
 #include "gtest/gtest.h"
--- a/media/mtransport/transportlayerdtls.cpp
+++ b/media/mtransport/transportlayerdtls.cpp
@@ -16,17 +16,16 @@
 #include "keyhi.h"
 #include "logging.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/UniquePtr.h"
 #include "mozilla/Unused.h"
 #include "nsCOMPtr.h"
 #include "nsComponentManagerUtils.h"
 #include "nsComponentManagerUtils.h"
-#include "nsIEventTarget.h"
 #include "nsNetCID.h"
 #include "nsServiceManagerUtils.h"
 #include "sslexp.h"
 #include "sslproto.h"
 #include "transportflow.h"
 
 namespace mozilla {
 
--- a/media/mtransport/transportlayerdtls.h
+++ b/media/mtransport/transportlayerdtls.h
@@ -19,17 +19,16 @@
 #endif
 
 #include "sigslot.h"
 
 #include "mozilla/RefPtr.h"
 #include "mozilla/UniquePtr.h"
 #include "mozilla/TimeStamp.h"
 #include "nsCOMPtr.h"
-#include "nsIEventTarget.h"
 #include "nsITimer.h"
 #include "ScopedNSSTypes.h"
 #include "m_cpp_utils.h"
 #include "dtlsidentity.h"
 #include "transportlayer.h"
 #include "ssl.h"
 #include "sslproto.h"
 
--- a/media/mtransport/transportlayerice.cpp
+++ b/media/mtransport/transportlayerice.cpp
@@ -41,17 +41,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 */
 
 #include <string>
 #include <vector>
 
 #include "nsCOMPtr.h"
 #include "nsComponentManagerUtils.h"
 #include "nsError.h"
-#include "nsIEventTarget.h"
 #include "nsNetCID.h"
 #include "nsComponentManagerUtils.h"
 #include "nsServiceManagerUtils.h"
 
 // nICEr includes
 extern "C" {
 #include "nr_api.h"
 #include "registry.h"
--- a/media/mtransport/transportlayerice.h
+++ b/media/mtransport/transportlayerice.h
@@ -11,18 +11,16 @@
 #define transportlayerice_h__
 
 #include <vector>
 
 #include "sigslot.h"
 
 #include "mozilla/RefPtr.h"
 #include "nsCOMPtr.h"
-#include "nsIEventTarget.h"
-#include "nsITimer.h"
 
 #include "m_cpp_utils.h"
 
 #include "nricemediastream.h"
 #include "transportflow.h"
 #include "transportlayer.h"
 
 // An ICE transport layer -- corresponds to a single ICE
--- a/media/mtransport/transportlayerloopback.cpp
+++ b/media/mtransport/transportlayerloopback.cpp
@@ -6,23 +6,17 @@
 
 // Original author: ekr@rtfm.com
 
 #include "logging.h"
 #include "nspr.h"
 #include "prlock.h"
 
 #include "nsNetCID.h"
-#include "nsIComponentManager.h"
 #include "nsComponentManagerUtils.h"
-#include "nsIComponentRegistrar.h"
-#include "nsIEventTarget.h"
-#include "nsIIOService.h"
-#include "nsIServiceManager.h"
-#include "nsISocketTransportService.h"
 #include "nsServiceManagerUtils.h"
 #include "nsString.h"
 
 #include "transportflow.h"
 #include "transportlayerloopback.h"
 
 namespace mozilla {
 
--- a/media/webrtc/signaling/src/media-conduit/AudioConduit.cpp
+++ b/media/webrtc/signaling/src/media-conduit/AudioConduit.cpp
@@ -10,18 +10,16 @@
 #elif defined XP_WIN
 #  include <winsock2.h>
 #endif
 
 #include "AudioConduit.h"
 #include "nsCOMPtr.h"
 #include "mozilla/media/MediaUtils.h"
 #include "nsServiceManagerUtils.h"
-#include "nsIPrefService.h"
-#include "nsIPrefBranch.h"
 #include "nsThreadUtils.h"
 #include "mozilla/Telemetry.h"
 #include "mtransport/runnable_utils.h"
 
 #include "pk11pub.h"
 
 #include "webrtc/modules/audio_coding/codecs/builtin_audio_decoder_factory.h"
 #include "webrtc/modules/audio_coding/codecs/builtin_audio_encoder_factory.h"
--- a/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp
+++ b/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp
@@ -5,17 +5,16 @@
 #include "WebrtcGmpVideoCodec.h"
 
 #include <vector>
 
 #include "gmp-video-frame-i420.h"
 #include "gmp-video-frame-encoded.h"
 #include "GMPLog.h"
 #include "MainThreadUtils.h"
-#include "mozIGeckoMediaPluginService.h"
 #include "mozilla/CheckedInt.h"
 #include "mozilla/EndianUtils.h"
 #include "mozilla/IntegerPrintfMacros.h"
 #include "mozilla/Move.h"
 #include "mozilla/SyncRunnable.h"
 #include "nsServiceManagerUtils.h"
 #include "runnable_utils.h"
 #include "VideoConduit.h"
--- a/media/webrtc/signaling/src/peerconnection/MediaTransportHandler.cpp
+++ b/media/webrtc/signaling/src/peerconnection/MediaTransportHandler.cpp
@@ -7,17 +7,16 @@
 #include "nricemediastream.h"
 #include "nriceresolver.h"
 #include "transportflow.h"
 #include "transportlayerice.h"
 #include "transportlayerdtls.h"
 #include "transportlayersrtp.h"
 
 // Config stuff
-#include "nsIPrefService.h"
 #include "mozilla/dom/RTCConfigurationBinding.h"
 
 // Parsing STUN/TURN URIs
 #include "nsIURI.h"
 #include "nsNetUtil.h"
 #include "nsURLHelper.h"
 #include "nsIURLParser.h"
 
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.cpp
@@ -15,17 +15,16 @@
 #include "mozilla/dom/RTCPeerConnectionBinding.h"
 #include "mozilla/Preferences.h"
 #include <mozilla/Types.h>
 
 #include "nsNetCID.h"               // NS_SOCKETTRANSPORTSERVICE_CONTRACTID
 #include "nsServiceManagerUtils.h"  // do_GetService
 #include "nsIObserverService.h"
 #include "nsIObserver.h"
-#include "nsIIOService.h"  // NS_IOSERVICE_*
 #include "mozilla/Services.h"
 #include "mozilla/StaticPtr.h"
 
 #include "nsCRTGlue.h"
 
 #include "gmp-video-decode.h"  // GMP_API_VIDEO_DECODER
 #include "gmp-video-encode.h"  // GMP_API_VIDEO_ENCODER
 
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
@@ -15,33 +15,28 @@
 
 #include "jsapi.h"
 #include "nspr.h"
 #include "nss.h"
 #include "pk11pub.h"
 
 #include "nsNetCID.h"
 #include "nsILoadContext.h"
-#include "nsIProperty.h"
-#include "nsIPropertyBag2.h"
-#include "nsIServiceManager.h"
-#include "nsISimpleEnumerator.h"
 #include "nsServiceManagerUtils.h"
-#include "nsISocketTransportService.h"
-#include "nsIConsoleService.h"
 #include "nsThreadUtils.h"
 #include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 #include "nsProxyRelease.h"
 #include "prtime.h"
 
 #include "AudioConduit.h"
 #include "VideoConduit.h"
 #include "MediaTrackGraph.h"
 #include "runnable_utils.h"
+#include "IPeerConnection.h"
 #include "PeerConnectionCtx.h"
 #include "PeerConnectionImpl.h"
 #include "PeerConnectionMedia.h"
 #include "RemoteTrackSource.h"
 #include "nsDOMDataChannelDeclarations.h"
 #include "dtlsidentity.h"
 #include "signaling/src/sdp/SdpAttribute.h"
 
@@ -68,21 +63,19 @@
 #include "mozilla/NullPrincipal.h"
 #include "mozilla/TimeStamp.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/PublicSSL.h"
 #include "nsXULAppAPI.h"
 #include "nsContentUtils.h"
 #include "nsDOMJSUtils.h"
-#include "nsIScriptError.h"
 #include "nsPrintfCString.h"
 #include "nsURLHelper.h"
 #include "nsNetUtil.h"
-#include "nsIURLParser.h"
 #include "js/ArrayBuffer.h"    // JS::NewArrayBufferWithContents
 #include "js/GCAnnotations.h"  // JS_HAZ_ROOTED
 #include "js/RootingAPI.h"     // JS::{{,Mutable}Handle,Rooted}
 #include "mozilla/PeerIdentity.h"
 #include "mozilla/dom/RTCCertificate.h"
 #include "mozilla/dom/RTCDTMFSenderBinding.h"
 #include "mozilla/dom/RTCDTMFToneChangeEvent.h"
 #include "mozilla/dom/RTCRtpReceiverBinding.h"
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
@@ -8,17 +8,16 @@
 #include <string>
 #include <vector>
 #include <map>
 #include <cmath>
 
 #include "prlock.h"
 #include "mozilla/RefPtr.h"
 #include "nsAutoPtr.h"
-#include "IPeerConnection.h"
 #include "nsComponentManagerUtils.h"
 #include "nsPIDOMWindow.h"
 #include "nsIUUIDGenerator.h"
 #include "nsIThread.h"
 #include "mozilla/Mutex.h"
 
 // Work around nasty macro in webrtc/voice_engine/voice_engine_defines.h
 #ifdef GetLastError
@@ -35,17 +34,16 @@
 #include "mozilla/dom/RTCConfigurationBinding.h"
 #include "PrincipalChangeObserver.h"
 
 #include "mozilla/TimeStamp.h"
 #include "mozilla/net/DataChannel.h"
 #include "VideoUtils.h"
 #include "VideoSegment.h"
 #include "mozilla/dom/RTCStatsReportBinding.h"
-#include "nsIPrincipal.h"
 #include "mozilla/PeerIdentity.h"
 #include "RTCStatsReport.h"
 
 namespace test {
 #ifdef USE_FAKE_PCOBSERVER
 class AFakePCObserver;
 #endif
 }  // namespace test
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp
@@ -9,22 +9,18 @@
 #include "MediaPipeline.h"
 #include "PeerConnectionImpl.h"
 #include "PeerConnectionMedia.h"
 #include "runnable_utils.h"
 #include "signaling/src/jsep/JsepSession.h"
 #include "signaling/src/jsep/JsepTransport.h"
 
 #include "nsContentUtils.h"
-#include "nsIURI.h"
-#include "nsIScriptSecurityManager.h"
-#include "nsICancelable.h"
 #include "nsIIDNService.h"
 #include "nsILoadInfo.h"
-#include "nsIContentPolicy.h"
 #include "nsIProxyInfo.h"
 #include "nsIPrincipal.h"
 #include "mozilla/LoadInfo.h"
 #include "nsIProxiedChannel.h"
 
 #include "nsIScriptGlobalObject.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/dom/BrowserChild.h"
--- a/netwerk/cookie/nsCookie.h
+++ b/netwerk/cookie/nsCookie.h
@@ -2,16 +2,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 nsCookie_h__
 #define nsCookie_h__
 
 #include "nsICookie.h"
+#include "nsIMemoryReporter.h"
 #include "nsString.h"
 
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/BasePrincipal.h"
 #include "mozilla/net/NeckoChannelParams.h"
 
 using mozilla::OriginAttributes;
 
--- a/widget/android/ImageDecoderSupport.cpp
+++ b/widget/android/ImageDecoderSupport.cpp
@@ -1,14 +1,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "ImageDecoderSupport.h"
 
+#include "imgINotificationObserver.h"
 #include "imgITools.h"
 #include "gfxUtils.h"
 #include "AndroidGraphics.h"
 #include "JavaExceptions.h"
 #include "mozilla/gfx/Point.h"
 #include "mozilla/gfx/Swizzle.h"
 
 namespace mozilla {