Bug 921753 - Part 3: Avoid #including nsStyleStructInlines.h in nsHTMLReflowState.h; r=roc
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 01 Oct 2013 17:01:49 -0400
changeset 164317 236de57e3215e4c9d849c91f7ff2de78f7a280ad
parent 164316 dbff283df8c12c3340ae54d13f363a7eae8386fe
child 164318 ae6c7a11874eb2fcd05cc4c96b886a1e3757663c
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs921753
milestone27.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 921753 - Part 3: Avoid #including nsStyleStructInlines.h in nsHTMLReflowState.h; r=roc This patch reduces the number of files that transitively #include gfx/2d.h from 1362 to 1268.
layout/base/nsCSSRenderingBorders.h
layout/base/nsCounterManager.cpp
layout/generic/nsHTMLReflowState.cpp
layout/generic/nsHTMLReflowState.h
layout/generic/nsImageFrame.cpp
layout/generic/nsLineLayout.cpp
layout/svg/nsSVGGlyphFrame.h
layout/xul/base/src/nsScrollBoxFrame.cpp
layout/xul/base/src/nsScrollbarFrame.cpp
--- a/layout/base/nsCSSRenderingBorders.h
+++ b/layout/base/nsCSSRenderingBorders.h
@@ -5,16 +5,24 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef NS_CSS_RENDERING_BORDERS_H
 #define NS_CSS_RENDERING_BORDERS_H
 
 #include "nsColor.h"
 
 class gfxContext;
+class gfxPattern;
+struct gfxRGBA;
+
+namespace mozilla {
+namespace gfx {
+class GradientStops;
+}
+}
 
 // define this to enable a bunch of debug dump info
 #undef DEBUG_NEW_BORDERS
 
 //thickness of dashed line relative to dotted line
 #define DOT_LENGTH  1           //square
 #define DASH_LENGTH 3           //3 times longer than dot
 
--- a/layout/base/nsCounterManager.cpp
+++ b/layout/base/nsCounterManager.cpp
@@ -6,16 +6,17 @@
 
 /* implementation of CSS counters (for numbering things) */
 
 #include "nsCounterManager.h"
 #include "nsBulletFrame.h" // legacy location for list style type to text code
 #include "nsContentUtils.h"
 #include "nsTArray.h"
 #include "mozilla/Likely.h"
+#include "nsIContent.h"
 
 bool
 nsCounterUseNode::InitTextFrame(nsGenConList* aList,
         nsIFrame* aPseudoFrame, nsIFrame* aTextFrame)
 {
   nsCounterNode::InitTextFrame(aList, aPseudoFrame, aTextFrame);
 
   nsCounterList *counterList = static_cast<nsCounterList*>(aList);
--- a/layout/generic/nsHTMLReflowState.cpp
+++ b/layout/generic/nsHTMLReflowState.cpp
@@ -2628,8 +2628,20 @@ nsHTMLReflowState::SetTruncated(const ns
   if (availableHeight != NS_UNCONSTRAINEDSIZE &&
       availableHeight < aMetrics.height &&
       !mFlags.mIsTopOfPage) {
     *aStatus |= NS_FRAME_TRUNCATED;
   } else {
     *aStatus &= ~NS_FRAME_TRUNCATED;
   }
 }
+
+bool
+nsHTMLReflowState::IsFloating() const
+{
+  return mStyleDisplay->IsFloating(frame);
+}
+
+uint8_t
+nsHTMLReflowState::GetDisplay() const
+{
+  return mStyleDisplay->GetDisplay(frame);
+}
--- a/layout/generic/nsHTMLReflowState.h
+++ b/layout/generic/nsHTMLReflowState.h
@@ -5,17 +5,16 @@
 
 /* struct containing the input to nsIFrame::Reflow */
 
 #ifndef nsHTMLReflowState_h___
 #define nsHTMLReflowState_h___
 
 #include "nsMargin.h"
 #include "nsStyleCoord.h"
-#include "nsStyleStructInlines.h"
 #include "nsIFrame.h"
 #include "mozilla/Assertions.h"
 #include <algorithm>
 
 class nsPresContext;
 class nsRenderingContext;
 class nsFloatManager;
 class nsLineLayout;
@@ -306,23 +305,19 @@ public:
   const nsStyleDisplay*    mStyleDisplay;
   const nsStyleVisibility* mStyleVisibility;
   const nsStylePosition*   mStylePosition;
   const nsStyleBorder*     mStyleBorder;
   const nsStyleMargin*     mStyleMargin;
   const nsStylePadding*    mStylePadding;
   const nsStyleText*       mStyleText;
 
-  bool IsFloating() const {
-    return mStyleDisplay->IsFloating(frame);
-  }
+  bool IsFloating() const;
 
-  uint8_t GetDisplay() const {
-    return mStyleDisplay->GetDisplay(frame);
-  }
+  uint8_t GetDisplay() const;
 
   // a frame (e.g. nsTableCellFrame) which may need to generate a special 
   // reflow for percent height calculations 
   nsIPercentHeightObserver* mPercentHeightObserver;
 
   // CSS margin collapsing sometimes requires us to reflow
   // optimistically assuming that margins collapse to see if clearance
   // is required. When we discover that clearance is required, we
--- a/layout/generic/nsImageFrame.cpp
+++ b/layout/generic/nsImageFrame.cpp
@@ -53,16 +53,17 @@
 #include "nsBidiUtils.h"
 #include "nsBidiPresUtils.h"
 
 #include "gfxRect.h"
 #include "ImageLayers.h"
 #include "ImageContainer.h"
 #include "nsStyleSet.h"
 #include "nsBlockFrame.h"
+#include "nsStyleStructInlines.h"
 
 #include "mozilla/Preferences.h"
 
 #include "mozilla/dom/Link.h"
 
 using namespace mozilla;
 
 // sizes (pixels) for image icon, padding and border frame
--- a/layout/generic/nsLineLayout.cpp
+++ b/layout/generic/nsLineLayout.cpp
@@ -17,16 +17,17 @@
 #include "nsFloatManager.h"
 #include "nsStyleContext.h"
 #include "nsPresContext.h"
 #include "nsRenderingContext.h"
 #include "nsGkAtoms.h"
 #include "nsIContent.h"
 #include "nsLayoutUtils.h"
 #include "nsTextFrame.h"
+#include "nsStyleStructInlines.h"
 #include <algorithm>
 
 #ifdef DEBUG
 #undef  NOISY_HORIZONTAL_ALIGN
 #undef  NOISY_VERTICAL_ALIGN
 #undef  REALLY_NOISY_VERTICAL_ALIGN
 #undef  NOISY_REFLOW
 #undef  REALLY_NOISY_REFLOW
--- a/layout/svg/nsSVGGlyphFrame.h
+++ b/layout/svg/nsSVGGlyphFrame.h
@@ -9,16 +9,17 @@
 #include "mozilla/Attributes.h"
 #include "gfxFont.h"
 #include "gfxSVGGlyphs.h"
 #include "nsISVGChildFrame.h"
 #include "nsISVGGlyphFragmentNode.h"
 #include "nsSVGGeometryFrame.h"
 #include "nsSVGUtils.h"
 #include "nsTextFragment.h"
+#include "nsIContent.h"
 
 class CharacterIterator;
 class gfxContext;
 class nsDisplaySVGGlyphs;
 class nsRenderingContext;
 class nsSVGGlyphFrame;
 class nsSVGTextFrame;
 class nsSVGTextPathFrame;
--- a/layout/xul/base/src/nsScrollBoxFrame.cpp
+++ b/layout/xul/base/src/nsScrollBoxFrame.cpp
@@ -5,16 +5,17 @@
 
 #include "nsCOMPtr.h"
 #include "nsPresContext.h"
 #include "nsGkAtoms.h"
 #include "nsButtonBoxFrame.h"
 #include "nsITimer.h"
 #include "nsRepeatService.h"
 #include "mozilla/BasicEvents.h"
+#include "nsIContent.h"
 
 class nsAutoRepeatBoxFrame : public nsButtonBoxFrame
 {
 public:
   NS_DECL_FRAMEARENA_HELPERS
 
   friend nsIFrame* NS_NewAutoRepeatBoxFrame(nsIPresShell* aPresShell,
                                             nsStyleContext* aContext);
--- a/layout/xul/base/src/nsScrollbarFrame.cpp
+++ b/layout/xul/base/src/nsScrollbarFrame.cpp
@@ -13,16 +13,17 @@
 #include "nsScrollbarFrame.h"
 #include "nsScrollbarButtonFrame.h"
 #include "nsGkAtoms.h"
 #include "nsIScrollableFrame.h"
 #include "nsIScrollbarMediator.h"
 #include "mozilla/LookAndFeel.h"
 #include "nsThemeConstants.h"
 #include "nsRenderingContext.h"
+#include "nsIContent.h"
 
 using namespace mozilla;
 
 //
 // NS_NewScrollbarFrame
 //
 // Creates a new scrollbar frame and returns it
 //