Bug 1277129 Part 2a - Move nsBlockReflowState into mozilla namespace. draft
authorTing-Yu Lin <tlin@mozilla.com>
Thu, 21 Jul 2016 12:58:26 +0800
changeset 390445 f96f93d5929481dacb982a5b7450f774982e62a2
parent 390444 3145e5c67a478f5d48f55743984125781f19a4b9
child 390446 0d55e9c9cd7c97a3f8ab292b6c411eb991574478
push id23670
push usertlin@mozilla.com
push dateThu, 21 Jul 2016 05:05:21 +0000
bugs1277129
milestone50.0a1
Bug 1277129 Part 2a - Move nsBlockReflowState into mozilla namespace. MozReview-Commit-ID: GRmxZFVDGBW
layout/generic/nsBlockFrame.h
layout/generic/nsBlockReflowContext.h
layout/generic/nsBlockReflowState.h
layout/generic/nsLineLayout.h
--- a/layout/generic/nsBlockFrame.h
+++ b/layout/generic/nsBlockFrame.h
@@ -35,19 +35,21 @@ enum LineReflowStatus {
   // We need to reflow the line again at a lower vertical postion where there
   // may be more horizontal space due to different float configuration.
   LINE_REFLOW_REDO_NEXT_BAND,
   // The line did not fit in the available vertical space. Try pushing it to
   // the next page or column if it's not the first line on the current page/column.
   LINE_REFLOW_TRUNCATED
 };
 
-class nsBlockReflowState;
 class nsBlockInFlowLineIterator;
 class nsBulletFrame;
+namespace mozilla {
+class nsBlockReflowState;
+} // namespace mozilla
 
 /**
  * Some invariants:
  * -- The overflow out-of-flows list contains the out-of-
  * flow frames whose placeholders are in the overflow list.
  * -- A given piece of content has at most one placeholder
  * frame in a block's normal child list.
  * -- While a block is being reflowed, and from then until
@@ -70,16 +72,18 @@ class nsBulletFrame;
 
 /*
  * Base class for block and inline frames.
  * The block frame has an additional child list, kAbsoluteList, which
  * contains the absolutely positioned frames.
  */
 class nsBlockFrame : public nsContainerFrame
 {
+  using nsBlockReflowState = mozilla::nsBlockReflowState;
+
 public:
   NS_DECL_QUERYFRAME_TARGET(nsBlockFrame)
   NS_DECL_FRAMEARENA_HELPERS
 
   typedef nsLineList::iterator                  line_iterator;
   typedef nsLineList::const_iterator            const_line_iterator;
   typedef nsLineList::reverse_iterator          reverse_line_iterator;
   typedef nsLineList::const_reverse_iterator    const_reverse_line_iterator;
@@ -883,17 +887,17 @@ protected:
   nscoord mMinWidth, mPrefWidth;
 
   nsLineList mLines;
 
   // List of all floats in this block
   // XXXmats blocks rarely have floats, make it a frame property
   nsFrameList mFloats;
 
-  friend class nsBlockReflowState;
+  friend class mozilla::nsBlockReflowState;
   friend class nsBlockInFlowLineIterator;
 
 #ifdef DEBUG
 public:
   static bool gLamePaintMetrics;
   static bool gLameReflowMetrics;
   static bool gNoisy;
   static bool gNoisyDamageRepair;
--- a/layout/generic/nsBlockReflowContext.h
+++ b/layout/generic/nsBlockReflowContext.h
@@ -7,24 +7,27 @@
 /* class that a parent frame uses to reflow a block frame */
 
 #ifndef nsBlockReflowContext_h___
 #define nsBlockReflowContext_h___
 
 #include "nsIFrame.h"
 #include "nsHTMLReflowMetrics.h"
 
-class nsBlockReflowState;
 class nsLineBox;
 class nsPresContext;
+namespace mozilla {
+class nsBlockReflowState;
+} // namespace mozilla
 
 /**
  * An encapsulation of the state and algorithm for reflowing block frames.
  */
 class nsBlockReflowContext {
+  using nsBlockReflowState = mozilla::nsBlockReflowState;
   using ReflowInput = mozilla::ReflowInput;
 
 public:
   nsBlockReflowContext(nsPresContext* aPresContext,
                        const ReflowInput& aParentRS);
   ~nsBlockReflowContext() { }
 
   void ReflowBlock(const mozilla::LogicalRect& aSpace,
--- a/layout/generic/nsBlockReflowState.h
+++ b/layout/generic/nsBlockReflowState.h
@@ -1,17 +1,17 @@
 /* -*- 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/. */
 
 /* state used in reflow of block frames */
 
-#ifndef nsBlockReflowState_h__
-#define nsBlockReflowState_h__
+#ifndef mozilla_nsBlockReflowState_h
+#define mozilla_nsBlockReflowState_h
 
 #include "nsFloatManager.h"
 #include "nsLineBox.h"
 #include "mozilla/ReflowInput.h"
 
 class nsBlockFrame;
 class nsFrameList;
 class nsOverflowContinuationTracker;
@@ -66,16 +66,18 @@ class nsOverflowContinuationTracker;
 #define BRS_LINE_LAYOUT_EMPTY     0x00000080
 #define BRS_ISOVERFLOWCONTAINER   0x00000100
 // Our mPushedFloats list is stored on the blocks' proptable
 #define BRS_PROPTABLE_FLOATCLIST  0x00000200
 // Set when the pref layout.float-fragments-inside-column.enabled is true.
 #define BRS_FLOAT_FRAGMENTS_INSIDE_COLUMN_ENABLED 0x00000400
 #define BRS_LASTFLAG              BRS_FLOAT_FRAGMENTS_INSIDE_COLUMN_ENABLED
 
+namespace mozilla {
+
 // nsBlockReflowState contains additional reflow state information that the
 // block frame uses along with ReflowInput. Like ReflowInput, this
 // is read-only data that is passed down from a parent frame to its children.
 class nsBlockReflowState {
   using ReflowInput = mozilla::ReflowInput;
 
 public:
   nsBlockReflowState(const ReflowInput& aReflowState,
@@ -373,9 +375,11 @@ private:
   bool CanPlaceFloat(nscoord aFloatISize,
                      const nsFlowAreaRect& aFloatAvailableSpace);
 
   void PushFloatPastBreak(nsIFrame* aFloat);
 
   void RecoverFloats(nsLineList::iterator aLine, nscoord aDeltaBCoord);
 };
 
-#endif // nsBlockReflowState_h__
+}; // namespace mozilla
+
+#endif // mozilla_nsBlockReflowState_h
--- a/layout/generic/nsLineLayout.h
+++ b/layout/generic/nsLineLayout.h
@@ -23,16 +23,17 @@
 #include "nsBlockReflowState.h"
 #include "nsLineBox.h"
 #include "plarena.h"
 
 class nsFloatManager;
 struct nsStyleText;
 
 class nsLineLayout {
+  using nsBlockReflowState = mozilla::nsBlockReflowState;
   using ReflowInput = mozilla::ReflowInput;
 
 public:
   /**
    * @param aBaseLineLayout the nsLineLayout for ruby base,
    * nullptr if no separate base nsLineLayout is needed.
    */
   nsLineLayout(nsPresContext* aPresContext,