Bug 1652017 - Remove unnecessary includes for expensive nsIFrame.h. r=emilio
authorSimon Giesecke <sgiesecke@mozilla.com>
Wed, 15 Jul 2020 13:44:39 +0000
changeset 540592 bf2bf7e462edb8491e2d7b31b0e6c8669cf091b3
parent 540591 27cd47c0e5e66b3ca5985c9a2e3c3ffcf3366792
child 540593 99e5d60ceb7901f2ad11c81d780bfd858ec64625
push id121807
push usersgiesecke@mozilla.com
push dateWed, 15 Jul 2020 17:09:41 +0000
treeherderautoland@4916e2e9646c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1652017
milestone80.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 1652017 - Remove unnecessary includes for expensive nsIFrame.h. r=emilio Differential Revision: https://phabricator.services.mozilla.com/D83111
accessible/base/SelectionManager.cpp
accessible/base/SelectionManager.h
accessible/generic/HyperTextAccessible.h
dom/base/nsFrameLoader.h
dom/base/nsObjectLoadingContent.h
dom/events/EventStateManager.h
dom/events/WheelHandlingHelper.h
layout/base/AccessibleCaret.h
layout/base/AccessibleCaretEventHub.h
layout/base/nsGenConList.h
layout/base/nsIFrameTraversal.h
layout/generic/nsBlockReflowContext.h
layout/generic/nsHTMLParts.h
layout/printing/nsPrintJob.h
layout/style/ImageLoader.h
layout/svg/FilterInstance.cpp
layout/svg/FilterInstance.h
layout/svg/SVGFilterFrame.h
layout/svg/SVGObserverUtils.h
layout/svg/SVGUtils.h
layout/xul/grid/nsGrid.cpp
layout/xul/nsSprocketLayout.h
widget/gtk/nsWindow.h
--- a/accessible/base/SelectionManager.cpp
+++ b/accessible/base/SelectionManager.cpp
@@ -198,8 +198,10 @@ void SelectionManager::ProcessSelectionC
 
   } else if (selection->GetType() == SelectionType::eSpellCheck) {
     // XXX: fire an event for container accessible of the focus/anchor range
     // of the spelcheck selection.
     text->Document()->FireDelayedEvent(
         nsIAccessibleEvent::EVENT_TEXT_ATTRIBUTE_CHANGED, text);
   }
 }
+
+SelectionManager::~SelectionManager() = default;
--- a/accessible/base/SelectionManager.h
+++ b/accessible/base/SelectionManager.h
@@ -1,17 +1,16 @@
 /* -*- 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/. */
 
 #ifndef mozilla_a11y_SelectionManager_h__
 #define mozilla_a11y_SelectionManager_h__
 
-#include "nsIFrame.h"
 #include "nsISelectionListener.h"
 #include "mozilla/WeakPtr.h"
 
 namespace mozilla {
 
 class PresShell;
 
 namespace dom {
@@ -102,16 +101,18 @@ class SelectionManager : public nsISelec
     mCaretOffset = aOffset;
   }
 
   inline void ResetCaretOffset() {
     mCaretOffset = -1;
     mAccWithCaret = nullptr;
   }
 
+  ~SelectionManager();
+
  protected:
   SelectionManager();
 
   /**
    * Process DOM selection change. Fire selection and caret move events.
    */
   void ProcessSelectionChanged(SelData* aSelData);
 
--- a/accessible/generic/HyperTextAccessible.h
+++ b/accessible/generic/HyperTextAccessible.h
@@ -6,19 +6,19 @@
 #ifndef mozilla_a11y_HyperTextAccessible_h__
 #define mozilla_a11y_HyperTextAccessible_h__
 
 #include "AccessibleWrap.h"
 #include "nsIAccessibleText.h"
 #include "nsIAccessibleTypes.h"
 #include "nsDirection.h"
 #include "WordMovementType.h"
-#include "nsIFrame.h"
 
 class nsFrameSelection;
+class nsIFrame;
 class nsRange;
 class nsIWidget;
 
 namespace mozilla {
 class TextEditor;
 namespace dom {
 class Selection;
 }
--- a/dom/base/nsFrameLoader.h
+++ b/dom/base/nsFrameLoader.h
@@ -8,32 +8,32 @@
  * Class for managing loading of a subframe (creation of the docshell,
  * handling of loads in it, recursion-checking).
  */
 
 #ifndef nsFrameLoader_h_
 #define nsFrameLoader_h_
 
 #include "nsDocShell.h"
+#include "nsIFrame.h"
 #include "nsStringFwd.h"
 #include "nsPoint.h"
 #include "nsSize.h"
 #include "nsWrapperCache.h"
 #include "nsIURI.h"
 #include "nsFrameMessageManager.h"
 #include "mozilla/dom/BindingUtils.h"
 #include "mozilla/dom/BrowsingContext.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/RemoteBrowser.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/ScrollbarPreferences.h"
 #include "mozilla/layers/LayersTypes.h"
 #include "nsStubMutationObserver.h"
 #include "Units.h"
-#include "nsIFrame.h"
 #include "nsPluginTags.h"
 
 class nsIURI;
 class nsSubDocumentFrame;
 class nsView;
 class AutoResetInShow;
 class AutoResetInFrameSwap;
 class nsFrameLoaderOwner;
--- a/dom/base/nsObjectLoadingContent.h
+++ b/dom/base/nsObjectLoadingContent.h
@@ -10,22 +10,22 @@
  * loading functionality (eg <embed>, <object>, etc).
  */
 
 #ifndef NSOBJECTLOADINGCONTENT_H_
 #define NSOBJECTLOADINGCONTENT_H_
 
 #include "mozilla/Attributes.h"
 #include "mozilla/dom/BindingDeclarations.h"
+#include "nsIFrame.h"  // for WeakFrame only
 #include "nsImageLoadingContent.h"
 #include "nsIStreamListener.h"
 #include "nsIChannelEventSink.h"
 #include "nsIObjectLoadingContent.h"
 #include "nsIRunnable.h"
-#include "nsIFrame.h"
 #include "nsFrameLoaderOwner.h"
 
 class nsAsyncInstantiateEvent;
 class nsStopPluginRunnable;
 class AutoSetInstantiatingToFalse;
 class nsIPrincipal;
 class nsFrameLoader;
 class nsPluginFrame;
--- a/dom/events/EventStateManager.h
+++ b/dom/events/EventStateManager.h
@@ -11,24 +11,24 @@
 
 #include "nsIObserver.h"
 #include "nsWeakReference.h"
 #include "nsCOMPtr.h"
 #include "nsCOMArray.h"
 #include "nsCycleCollectionParticipant.h"
 #include "mozilla/TimeStamp.h"
 #include "mozilla/layers/APZUtils.h"
-#include "nsIFrame.h"
 #include "Units.h"
 #include "WheelHandlingHelper.h"  // for WheelDeltaAdjustmentStrategy
 
 class nsFrameLoader;
 class nsIContent;
 class nsIDocShell;
 class nsIDocShellTreeItem;
+class nsIFrame;
 class imgIContainer;
 class nsIContentViewer;
 class nsIScrollableFrame;
 class nsITimer;
 class nsPresContext;
 
 namespace mozilla {
 
--- a/dom/events/WheelHandlingHelper.h
+++ b/dom/events/WheelHandlingHelper.h
@@ -5,19 +5,20 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_WheelHandlingHelper_h_
 #define mozilla_WheelHandlingHelper_h_
 
 #include "mozilla/Attributes.h"
 #include "mozilla/EventForwards.h"
 #include "nsCoord.h"
-#include "nsIFrame.h"
+#include "nsIFrame.h"  // for AutoWeakFrame only
 #include "nsPoint.h"
 
+class nsIFrame;
 class nsIScrollableFrame;
 class nsITimer;
 
 namespace mozilla {
 
 class EventStateManager;
 
 /**
--- a/layout/base/AccessibleCaret.h
+++ b/layout/base/AccessibleCaret.h
@@ -7,17 +7,17 @@
 #ifndef AccessibleCaret_h__
 #define AccessibleCaret_h__
 
 #include "mozilla/Attributes.h"
 #include "mozilla/dom/AnonymousContent.h"
 #include "mozilla/dom/Element.h"
 #include "nsCOMPtr.h"
 #include "nsIDOMEventListener.h"
-#include "nsIFrame.h"
+#include "nsIFrame.h"  // for WeakFrame only
 #include "nsISupportsBase.h"
 #include "nsISupportsImpl.h"
 #include "nsLiteralString.h"
 #include "nsRect.h"
 #include "mozilla/RefPtr.h"
 #include "nsString.h"
 
 class nsIFrame;
--- a/layout/base/AccessibleCaretEventHub.h
+++ b/layout/base/AccessibleCaretEventHub.h
@@ -8,17 +8,16 @@
 #define mozilla_AccessibleCaretEventHub_h
 
 #include "mozilla/EventForwards.h"
 #include "mozilla/MouseEvents.h"
 #include "mozilla/UniquePtr.h"
 #include "mozilla/WeakPtr.h"
 #include "nsCOMPtr.h"
 #include "nsDocShell.h"
-#include "nsIFrame.h"
 #include "nsIReflowObserver.h"
 #include "nsIScrollObserver.h"
 #include "nsPoint.h"
 #include "mozilla/RefPtr.h"
 #include "nsWeakReference.h"
 
 class nsITimer;
 
--- a/layout/base/nsGenConList.h
+++ b/layout/base/nsGenConList.h
@@ -5,22 +5,22 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* base class for nsCounterList and nsQuoteList */
 
 #ifndef nsGenConList_h___
 #define nsGenConList_h___
 
 #include "mozilla/LinkedList.h"
-#include "nsIFrame.h"
 #include "nsStyleStruct.h"
 #include "nsCSSPseudoElements.h"
 #include "nsTextNode.h"
 
 class nsGenConList;
+class nsIFrame;
 
 struct nsGenConNode : public mozilla::LinkedListElement<nsGenConNode> {
   using StyleContentType = mozilla::StyleContentItem::Tag;
 
   // The wrapper frame for all of the pseudo-element's content.  This
   // frame generally has useful style data and has the
   // NS_FRAME_GENERATED_CONTENT bit set (so we use it to track removal),
   // but does not necessarily for |nsCounterChangeNode|s.
--- a/layout/base/nsIFrameTraversal.h
+++ b/layout/base/nsIFrameTraversal.h
@@ -2,17 +2,18 @@
 /* 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 NSIFRAMETRAVERSAL_H
 #define NSIFRAMETRAVERSAL_H
 
 #include "nsISupports.h"
-#include "nsIFrame.h"
+
+class nsIFrame;
 
 #define NS_IFRAMEENUMERATOR_IID                      \
   {                                                  \
     0x7c633f5d, 0x91eb, 0x494e, {                    \
       0xa1, 0x40, 0x17, 0x46, 0x17, 0x4c, 0x23, 0xd3 \
     }                                                \
   }
 
--- a/layout/generic/nsBlockReflowContext.h
+++ b/layout/generic/nsBlockReflowContext.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/. */
 
 /* class that a parent frame uses to reflow a block frame */
 
 #ifndef nsBlockReflowContext_h___
 #define nsBlockReflowContext_h___
 
-#include "nsIFrame.h"
 #include "mozilla/ReflowOutput.h"
 
+class nsIFrame;
 class nsLineBox;
 class nsPresContext;
 namespace mozilla {
 class BlockReflowInput;
 }  // namespace mozilla
 
 /**
  * An encapsulation of the state and algorithm for reflowing block frames.
--- a/layout/generic/nsHTMLParts.h
+++ b/layout/generic/nsHTMLParts.h
@@ -5,33 +5,40 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* factory functions for rendering object classes */
 
 #ifndef nsHTMLParts_h___
 #define nsHTMLParts_h___
 
 #include "nscore.h"
+#include "nsFrameState.h"
 #include "nsISupports.h"
-#include "nsIFrame.h"
+
+class nsContainerFrame;
 class nsComboboxControlFrame;
 class nsCheckboxRadioFrame;
 class nsAtom;
 class nsNodeInfoManager;
 class nsIContent;
 
 class nsIFrame;
 class nsIHTMLContentSink;
 class nsIFragmentContentSink;
 class nsIURI;
 class nsIChannel;
 class nsTableColFrame;
 namespace mozilla {
+class ComputedStyle;
 class PresShell;
 class ViewportFrame;
+
+namespace dom {
+class Document;
+}
 }  // namespace mozilla
 
 // Factory methods for creating html layout objects
 
 // Create a frame that supports "display: block" layout behavior
 class nsBlockFrame;
 nsBlockFrame* NS_NewBlockFrame(mozilla::PresShell* aPresShell,
                                mozilla::ComputedStyle* aStyle);
--- a/layout/printing/nsPrintJob.h
+++ b/layout/printing/nsPrintJob.h
@@ -9,29 +9,30 @@
 #include "mozilla/Attributes.h"
 #include "mozilla/UniquePtr.h"
 
 #include "nsCOMPtr.h"
 
 #include "nsPrintObject.h"
 #include "nsPrintData.h"
 #include "nsFrameList.h"
-#include "nsIFrame.h"
 #include "nsIWebProgress.h"
 #include "mozilla/dom/HTMLCanvasElement.h"
+#include "nsIFrame.h"  // for WeakFrame only
 #include "nsIWebProgressListener.h"
 #include "nsWeakReference.h"
 
 // Interfaces
 #include "nsIObserver.h"
 
 // Classes
 class nsPagePrintTimer;
 class nsIDocShell;
 class nsIDocumentViewerPrint;
+class nsIFrame;
 class nsPrintObject;
 class nsIDocShell;
 class nsPageSequenceFrame;
 
 namespace mozilla {
 class PresShell;
 namespace dom {
 class Document;
--- a/layout/style/ImageLoader.h
+++ b/layout/style/ImageLoader.h
@@ -16,17 +16,16 @@
 #include "nsIFrame.h"
 #include "nsIReflowCallback.h"
 #include "nsTArray.h"
 #include "imgIRequest.h"
 #include "imgINotificationObserver.h"
 #include "mozilla/Attributes.h"
 
 class imgIContainer;
-class nsIFrame;
 class nsPresContext;
 class nsIURI;
 class nsIPrincipal;
 
 namespace mozilla {
 struct MediaFeatureChange;
 namespace dom {
 class Document;
--- a/layout/svg/FilterInstance.cpp
+++ b/layout/svg/FilterInstance.cpp
@@ -24,16 +24,17 @@
 #include "mozilla/gfx/Helpers.h"
 #include "mozilla/gfx/PatternHelpers.h"
 #include "mozilla/ISVGDisplayableFrame.h"
 #include "mozilla/StaticPrefs_gfx.h"
 #include "mozilla/SVGFilterInstance.h"
 #include "mozilla/SVGUtils.h"
 #include "CSSFilterInstance.h"
 #include "SVGFilterPaintCallback.h"
+#include "SVGIntegrationUtils.h"
 
 using namespace mozilla::dom;
 using namespace mozilla::gfx;
 using namespace mozilla::image;
 
 namespace mozilla {
 
 FilterDescription FilterInstance::GetFilterDescription(
--- a/layout/svg/FilterInstance.h
+++ b/layout/svg/FilterInstance.h
@@ -12,17 +12,16 @@
 #include "gfxRect.h"
 #include "nsCOMPtr.h"
 #include "FilterSupport.h"
 #include "nsHashKeys.h"
 #include "nsPoint.h"
 #include "nsRect.h"
 #include "nsSize.h"
 #include "nsTArray.h"
-#include "nsIFrame.h"
 #include "mozilla/gfx/2D.h"
 #include "mozilla/webrender/WebRenderTypes.h"
 
 class gfxContext;
 class nsIFrame;
 struct WrFiltersHolder;
 
 namespace mozilla {
--- a/layout/svg/SVGFilterFrame.h
+++ b/layout/svg/SVGFilterFrame.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 LAYOUT_SVG_SVGFILTERFRAME_H_
 #define LAYOUT_SVG_SVGFILTERFRAME_H_
 
 #include "mozilla/Attributes.h"
 #include "mozilla/SVGContainerFrame.h"
-#include "nsIFrame.h"
 #include "nsQueryFrame.h"
 
 class nsAtom;
 class nsIContent;
 class nsIFrame;
 
 struct nsRect;
 
--- a/layout/svg/SVGObserverUtils.h
+++ b/layout/svg/SVGObserverUtils.h
@@ -7,26 +7,28 @@
 #ifndef LAYOUT_SVG_SVGOBSERVERUTILS_H_
 #define LAYOUT_SVG_SVGOBSERVERUTILS_H_
 
 #include "mozilla/Attributes.h"
 #include "mozilla/dom/IDTracker.h"
 #include "FrameProperties.h"
 #include "mozilla/dom/Element.h"
 #include "nsID.h"
-#include "nsIFrame.h"
+#include "nsIFrame.h"  // only for LayoutFrameType
 #include "nsIMutationObserver.h"
 #include "nsISupportsBase.h"
 #include "nsISupportsImpl.h"
 #include "nsIReferrerInfo.h"
 #include "nsStringFwd.h"
 #include "nsStubMutationObserver.h"
+#include "nsStyleStruct.h"
 #include "nsCycleCollectionParticipant.h"
 
 class nsAtom;
+class nsIFrame;
 class nsIURI;
 
 namespace mozilla {
 class SVGClipPathFrame;
 class SVGFilterFrame;
 class SVGMarkerFrame;
 class SVGMaskFrame;
 class SVGPaintServerFrame;
--- a/layout/svg/SVGUtils.h
+++ b/layout/svg/SVGUtils.h
@@ -27,17 +27,16 @@
 #include "nsMathUtils.h"
 #include "nsStyleStruct.h"
 #include <algorithm>
 
 class gfxContext;
 class nsFrameList;
 class nsIContent;
 
-class nsIFrame;
 class nsPresContext;
 class nsTextFrame;
 
 struct nsStyleSVG;
 struct nsRect;
 
 namespace mozilla {
 class SVGAnimatedEnumeration;
--- a/layout/xul/grid/nsGrid.cpp
+++ b/layout/xul/grid/nsGrid.cpp
@@ -8,16 +8,17 @@
 // Eric Vaughan
 // Netscape Communications
 //
 // See documentation in associated header file
 //
 
 #include "nsGrid.h"
 #include "nsGridRowGroupLayout.h"
+#include "nsIFrame.h"
 #include "nsIScrollableFrame.h"
 #include "nsSprocketLayout.h"
 #include "nsGridLayout2.h"
 #include "nsGridRow.h"
 #include "nsGridCell.h"
 #include "mozilla/ReflowInput.h"
 
 /*
--- a/layout/xul/nsSprocketLayout.h
+++ b/layout/xul/nsSprocketLayout.h
@@ -5,17 +5,20 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsSprocketLayout_h___
 #define nsSprocketLayout_h___
 
 #include "mozilla/Attributes.h"
 #include "nsBoxLayout.h"
 #include "nsCOMPtr.h"
-#include "nsIFrame.h"
+#include "nsFrameState.h"
+
+class nsIFrame;
+struct nsRect;
 
 class nsBoxSize {
  public:
   nsBoxSize();
 
   nscoord pref;
   nscoord min;
   nscoord max;
--- a/widget/gtk/nsWindow.h
+++ b/widget/gtk/nsWindow.h
@@ -20,17 +20,16 @@
 #  include "WaylandVsyncSource.h"
 #endif
 #include "MozContainer.h"
 #include "mozilla/RefPtr.h"
 #include "mozilla/UniquePtr.h"
 #include "nsIDragService.h"
 #include "nsGkAtoms.h"
 #include "nsRefPtrHashtable.h"
-#include "nsIFrame.h"
 #include "nsBaseWidget.h"
 #include "CompositorWidget.h"
 #include "mozilla/widget/WindowSurface.h"
 #include "mozilla/widget/WindowSurfaceProvider.h"
 #include "mozilla/Maybe.h"
 
 #ifdef ACCESSIBILITY
 #  include "mozilla/a11y/Accessible.h"
@@ -76,16 +75,17 @@ gboolean WindowDragMotionHandler(GtkWidg
                                  gint aX, gint aY, guint aTime);
 gboolean WindowDragDropHandler(GtkWidget* aWidget, GdkDragContext* aDragContext,
                                nsWaylandDragContext* aWaylandDragContext,
                                gint aX, gint aY, guint aTime);
 void WindowDragLeaveHandler(GtkWidget* aWidget);
 #endif
 
 class gfxPattern;
+class nsIFrame;
 
 namespace mozilla {
 class TimeStamp;
 class CurrentX11TimeGetter;
 
 }  // namespace mozilla
 
 class OpaqueRegionState {