Bug 1277129 Part 5a - Move nsHTMLReflowMetrics into mozilla namespace. draft
authorTing-Yu Lin <tlin@mozilla.com>
Thu, 21 Jul 2016 12:58:27 +0800
changeset 390452 112a5ac659ba84ea51dc5541c11a44ece4accf7c
parent 390451 fa38d175eca21f753d727fa7691cb2c553a4299d
child 390453 8fe068518bf4f95867e18826101320ce8f1d5f2c
push id23670
push usertlin@mozilla.com
push dateThu, 21 Jul 2016 05:05:21 +0000
bugs1277129
milestone50.0a1
Bug 1277129 Part 5a - Move nsHTMLReflowMetrics into mozilla namespace. MozReview-Commit-ID: GQDnt0e8yMl
layout/base/nsLayoutUtils.h
layout/generic/nsBlockReflowContext.h
layout/generic/nsFrame.h
layout/generic/nsHTMLReflowMetrics.h
layout/generic/nsIFrame.h
layout/generic/nsImageFrame.h
layout/generic/nsLineLayout.h
layout/mathml/nsIMathMLFrame.h
layout/mathml/nsMathMLFrame.h
--- a/layout/base/nsLayoutUtils.h
+++ b/layout/base/nsLayoutUtils.h
@@ -2727,17 +2727,17 @@ public:
    * displayport and attempts to trigger the displayport expiry on that
    * ancestor.
    */
   static void ExpireDisplayPortOnAsyncScrollableAncestor(nsIFrame* aFrame);
 
   static bool IsOutlineStyleAutoEnabled();
 
   static void SetBSizeFromFontMetrics(const nsIFrame* aFrame,
-                                      nsHTMLReflowMetrics& aMetrics,
+                                      mozilla::nsHTMLReflowMetrics& aMetrics,
                                       const mozilla::LogicalMargin& aFramePadding,
                                       mozilla::WritingMode aLineWM,
                                       mozilla::WritingMode aFrameWM);
 
   static bool HasDocumentLevelListenersForApzAwareEvents(nsIPresShell* aShell);
 
   /**
    * Set the scroll port size for the purpose of clamping the scroll position
--- a/layout/generic/nsBlockReflowContext.h
+++ b/layout/generic/nsBlockReflowContext.h
@@ -19,16 +19,17 @@ class BlockReflowInput;
 } // namespace mozilla
 
 /**
  * An encapsulation of the state and algorithm for reflowing block frames.
  */
 class nsBlockReflowContext {
   using BlockReflowInput = mozilla::BlockReflowInput;
   using ReflowInput = mozilla::ReflowInput;
+  using nsHTMLReflowMetrics = mozilla::nsHTMLReflowMetrics;
 
 public:
   nsBlockReflowContext(nsPresContext* aPresContext,
                        const ReflowInput& aParentRS);
   ~nsBlockReflowContext() { }
 
   void ReflowBlock(const mozilla::LogicalRect& aSpace,
                    bool                        aApplyBStartMargin,
--- a/layout/generic/nsFrame.h
+++ b/layout/generic/nsFrame.h
@@ -765,25 +765,25 @@ public:
 
 // Start Display Reflow Debugging
 #ifdef DEBUG
 
   struct DR_cookie {
     DR_cookie(nsPresContext*          aPresContext,
               nsIFrame*                aFrame, 
               const mozilla::ReflowInput& aReflowState,
-              nsHTMLReflowMetrics&     aMetrics,
+              mozilla::nsHTMLReflowMetrics&     aMetrics,
               nsReflowStatus&          aStatus);     
     ~DR_cookie();
     void Change() const;
 
     nsPresContext*          mPresContext;
     nsIFrame*                mFrame;
     const mozilla::ReflowInput& mReflowState;
-    nsHTMLReflowMetrics&     mMetrics;
+    mozilla::nsHTMLReflowMetrics&     mMetrics;
     nsReflowStatus&          mStatus;    
     void*                    mValue;
   };
 
   struct DR_layout_cookie {
     explicit DR_layout_cookie(nsIFrame* aFrame);
     ~DR_layout_cookie();
 
--- a/layout/generic/nsHTMLReflowMetrics.h
+++ b/layout/generic/nsHTMLReflowMetrics.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/. */
 
 /* struct containing the output from nsIFrame::Reflow */
 
-#ifndef nsHTMLReflowMetrics_h___
-#define nsHTMLReflowMetrics_h___
+#ifndef mozilla_nsHTMLReflowMetrics_h
+#define mozilla_nsHTMLReflowMetrics_h
 
 #include "mozilla/WritingModes.h"
 #include "nsBoundingMetrics.h"
 #include "nsRect.h"
 
 //----------------------------------------------------------------------
 
 namespace mozilla {
@@ -187,25 +187,25 @@ struct nsCollapsingMargin {
       }
 
     nscoord get() const
       {
         return mMostPos + mMostNeg;
       }
 };
 
+namespace mozilla {
+
 /**
  * Reflow metrics used to return the frame's desired size and alignment
  * information.
  *
  * @see #Reflow()
  */
 class nsHTMLReflowMetrics {
-  using ReflowInput = mozilla::ReflowInput;
-
 public:
   // XXXldb Should |aFlags| generally be passed from parent to child?
   // Some places do it, and some don't.  |aFlags| should perhaps go away
   // entirely.
   // XXX width/height/ascent are OUT parameters and so they shouldn't
   // have to be initialized, but there are some bad frame classes that
   // aren't properly setting them when returning from Reflow()...
   explicit nsHTMLReflowMetrics(mozilla::WritingMode aWritingMode, uint32_t aFlags = 0)
@@ -338,9 +338,11 @@ private:
 
 public:
   uint32_t mFlags;
 
 private:
   mozilla::WritingMode mWritingMode;
 };
 
-#endif /* nsHTMLReflowMetrics_h___ */
+} // mozilla namespace
+
+#endif // mozilla_nsHTMLReflowMetrics_h
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -89,16 +89,17 @@ struct nsSize;
 struct nsMargin;
 struct CharacterDataChangeInfo;
 
 namespace mozilla {
 
 enum class CSSPseudoElementType : uint8_t;
 class EventStates;
 struct ReflowInput;
+class nsHTMLReflowMetrics;
 
 namespace layers {
 class Layer;
 } // namespace layers
 
 namespace gfx {
 class Matrix;
 } // namespace gfx
@@ -419,16 +420,17 @@ class nsIFrame : public nsQueryFrame
 {
 public:
   template <typename T> using Maybe = mozilla::Maybe<T>;
   using Nothing = mozilla::Nothing;
   using OnNonvisible = mozilla::OnNonvisible;
   template<typename T=void>
   using PropertyDescriptor = const mozilla::FramePropertyDescriptor<T>*;
   using ReflowInput = mozilla::ReflowInput;
+  using nsHTMLReflowMetrics = mozilla::nsHTMLReflowMetrics;
   using Visibility = mozilla::Visibility;
   using VisibilityCounter = mozilla::VisibilityCounter;
 
   typedef mozilla::FrameProperties FrameProperties;
   typedef mozilla::layers::Layer Layer;
   typedef mozilla::layout::FrameChildList ChildList;
   typedef mozilla::layout::FrameChildListID ChildListID;
   typedef mozilla::layout::FrameChildListIDs ChildListIDs;
--- a/layout/generic/nsImageFrame.h
+++ b/layout/generic/nsImageFrame.h
@@ -20,17 +20,16 @@
 #include "mozilla/DebugOnly.h"
 #include "nsIReflowCallback.h"
 #include "nsTObserverArray.h"
 
 class nsFontMetrics;
 class nsImageMap;
 class nsIURI;
 class nsILoadGroup;
-class nsHTMLReflowMetrics;
 class nsDisplayImage;
 class nsPresContext;
 class nsImageFrame;
 class nsTransform2D;
 class nsImageLoadingContent;
 
 namespace mozilla {
 namespace layers {
--- a/layout/generic/nsLineLayout.h
+++ b/layout/generic/nsLineLayout.h
@@ -25,17 +25,18 @@
 #include "plarena.h"
 
 class nsFloatManager;
 struct nsStyleText;
 
 class nsLineLayout {
   using BlockReflowInput = mozilla::BlockReflowInput;
   using ReflowInput = mozilla::ReflowInput;
-
+  using nsHTMLReflowMetrics = mozilla::nsHTMLReflowMetrics;
+  
 public:
   /**
    * @param aBaseLineLayout the nsLineLayout for ruby base,
    * nullptr if no separate base nsLineLayout is needed.
    */
   nsLineLayout(nsPresContext* aPresContext,
                nsFloatManager* aFloatManager,
                const ReflowInput* aOuterReflowState,
--- a/layout/mathml/nsIMathMLFrame.h
+++ b/layout/mathml/nsIMathMLFrame.h
@@ -6,19 +6,21 @@
 #ifndef nsIMathMLFrame_h___
 #define nsIMathMLFrame_h___
 
 #include "nsQueryFrame.h"
 #include "nsMathMLOperators.h"
 
 struct nsPresentationData;
 struct nsEmbellishData;
-class nsHTMLReflowMetrics;
 class nsRenderingContext;
 class nsIFrame;
+namespace mozilla {
+class nsHTMLReflowMetrics;
+} // namespace mozilla
 
 // For MathML, this 'type' will be used to determine the spacing between frames
 // Subclasses can return a 'type' that will give them a particular spacing
 enum eMathMLFrameType {
   eMathMLFrameType_UNKNOWN = -1,
   eMathMLFrameType_Ordinary,
   eMathMLFrameType_OperatorOrdinary,
   eMathMLFrameType_OperatorInvisible,
@@ -79,17 +81,17 @@ public:
   *        relevant to the direction are used (the rest is ignored). 
   * @param aDesiredStretchSize [in/out] On input the current size
   *        of the frame, on output the size after stretching.
   */
   NS_IMETHOD 
   Stretch(mozilla::gfx::DrawTarget* aDrawTarget,
           nsStretchDirection   aStretchDirection,
           nsBoundingMetrics&   aContainerSize,
-          nsHTMLReflowMetrics& aDesiredStretchSize) = 0;
+          mozilla::nsHTMLReflowMetrics& aDesiredStretchSize) = 0;
 
  /* Get the mEmbellishData member variable. */
  
   NS_IMETHOD
   GetEmbellishData(nsEmbellishData& aEmbellishData) = 0;
 
 
  /* SUPPORT FOR SCRIPTING ELEMENTS */
--- a/layout/mathml/nsMathMLFrame.h
+++ b/layout/mathml/nsMathMLFrame.h
@@ -47,17 +47,17 @@ public:
   }
 
   virtual eMathMLFrameType GetMathMLFrameType() override;
 
   NS_IMETHOD
   Stretch(mozilla::gfx::DrawTarget* aDrawTarget,
           nsStretchDirection   aStretchDirection,
           nsBoundingMetrics&   aContainerSize,
-          nsHTMLReflowMetrics& aDesiredStretchSize) override
+          mozilla::nsHTMLReflowMetrics& aDesiredStretchSize) override
   {
     return NS_OK;
   }
 
   NS_IMETHOD
   GetEmbellishData(nsEmbellishData& aEmbellishData) override {
     aEmbellishData = mEmbellishData;
     return NS_OK;