Bug 1466448 - Part 1: Remove unused NS_REFLOW_CALC_BOUNDING_METRICS flag. r?jfkthame draft
authorCameron McCormack <cam@mcc.id.au>
Mon, 04 Jun 2018 16:14:09 +1000
changeset 803460 0d38f2812d6e0e5f6234b54dc1e25e23991f177b
parent 803317 1f62ecdf59b6ecaa3c0fdda39bb296ec092a156b
child 803461 9bd198ee289c7885d38cf61a22e68d67f3593e89
child 803966 ed941c8c1d9542f5b938b2f9047662a318ab1081
push id112109
push userbmo:cam@mcc.id.au
push dateMon, 04 Jun 2018 08:29:59 +0000
reviewersjfkthame
bugs1466448
milestone62.0a1
Bug 1466448 - Part 1: Remove unused NS_REFLOW_CALC_BOUNDING_METRICS flag. r?jfkthame
layout/generic/ReflowOutput.h
layout/generic/nsTextFrame.cpp
layout/mathml/nsMathMLTokenFrame.cpp
layout/mathml/nsMathMLmfencedFrame.cpp
layout/mathml/nsMathMLmrootFrame.cpp
--- a/layout/generic/ReflowOutput.h
+++ b/layout/generic/ReflowOutput.h
@@ -14,19 +14,16 @@
 #include "nsRect.h"
 
 //----------------------------------------------------------------------
 
 namespace mozilla {
 struct ReflowInput;
 } // namespace mozilla
 
-// Option flags
-#define NS_REFLOW_CALC_BOUNDING_METRICS  0x0001
-
 /**
  * When we store overflow areas as an array of scrollable and visual
  * overflow, we use these indices.
  *
  * eOverflowType_LENGTH is needed (for gcc 4.5.*, at least) to ensure
  * that 2 is a valid value of nsOverflowType for use in
  * NS_FOR_FRAME_OVERFLOW_TYPES.
  */
@@ -290,21 +287,16 @@ public:
   void SetBlockStartAscent(nscoord aAscent)
   {
     mBlockStartAscent = aAscent;
   }
 
   enum { ASK_FOR_BASELINE = nscoord_MAX };
 
   // Metrics that _exactly_ enclose the text to allow precise MathML placements.
-  // If the NS_REFLOW_CALC_BOUNDING_METRICS flag is set, then the caller is
-  // requesting that you also compute additional details about your inner
-  // bounding box and italic correction. For example, the bounding box of
-  // msup is the smallest rectangle that _exactly_ encloses both the text
-  // of the base and the text of the superscript.
   nsBoundingMetrics mBoundingMetrics;  // [OUT]
 
   // Carried out block-end margin values. This is the collapsed
   // (generational) block-end margin value.
   nsCollapsingMargin mCarriedOutBEndMargin;
 
   // For frames that have content that overflow their content area
   // (HasOverflowAreas() is true) these rectangles represent the total
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -9450,18 +9450,16 @@ nsTextFrame::ReflowText(nsLineLayout& aL
   uint32_t transformedOffset = provider.GetStart().GetSkippedOffset();
 
   // The metrics for the text go in here
   gfxTextRun::Metrics textMetrics;
   gfxFont::BoundingBoxType boundingBoxType =
     IsFloatingFirstLetterChild() || IsInitialLetterChild()
     ? gfxFont::TIGHT_HINTED_OUTLINE_EXTENTS
     : gfxFont::LOOSE_INK_EXTENTS;
-  NS_ASSERTION(!(NS_REFLOW_CALC_BOUNDING_METRICS & aMetrics.mFlags),
-               "We shouldn't be passed NS_REFLOW_CALC_BOUNDING_METRICS anymore");
 
   int32_t limitLength = length;
   int32_t forceBreak = aLineLayout.GetForcedBreakPosition(this);
   bool forceBreakAfter = false;
   if (forceBreak >= length) {
     forceBreakAfter = forceBreak == length;
     // The break is not within the text considered for this textframe.
     forceBreak = -1;
--- a/layout/mathml/nsMathMLTokenFrame.cpp
+++ b/layout/mathml/nsMathMLTokenFrame.cpp
@@ -132,18 +132,17 @@ nsMathMLTokenFrame::Reflow(nsPresContext
   // initializations needed for empty markup like <mtag></mtag>
   aDesiredSize.ClearSize();
   aDesiredSize.SetBlockStartAscent(0);
   aDesiredSize.mBoundingMetrics = nsBoundingMetrics();
 
   for (nsIFrame* childFrame : PrincipalChildList()) {
     // ask our children to compute their bounding metrics
     ReflowOutput childDesiredSize(aReflowInput.GetWritingMode(),
-                                         aDesiredSize.mFlags
-                                         | NS_REFLOW_CALC_BOUNDING_METRICS);
+                                         aDesiredSize.mFlags);
     WritingMode wm = childFrame->GetWritingMode();
     LogicalSize availSize = aReflowInput.ComputedSize(wm);
     availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
     ReflowInput childReflowInput(aPresContext, aReflowInput,
                                        childFrame, availSize);
     ReflowChild(childFrame, aPresContext, childDesiredSize,
                 childReflowInput, aStatus);
     //NS_ASSERTION(aStatus.IsComplete(), "bad status");
--- a/layout/mathml/nsMathMLmfencedFrame.cpp
+++ b/layout/mathml/nsMathMLmfencedFrame.cpp
@@ -256,18 +256,17 @@ nsMathMLmfencedFrame::Reflow(nsPresConte
     // We use the ASCII metrics to get our minimum height. This way,
     // if we have borders or a background, they will fit better with
     // other elements on the line.
     ascent = fm->MaxAscent();
     descent = fm->MaxDescent();
   }
   while (childFrame) {
     ReflowOutput childDesiredSize(aReflowInput,
-                                         aDesiredSize.mFlags
-                                         | NS_REFLOW_CALC_BOUNDING_METRICS);
+                                         aDesiredSize.mFlags);
     WritingMode wm = childFrame->GetWritingMode();
     LogicalSize availSize = aReflowInput.ComputedSize(wm);
     availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
     ReflowInput childReflowInput(aPresContext, aReflowInput,
                                        childFrame, availSize);
     ReflowChild(childFrame, aPresContext, childDesiredSize,
                 childReflowInput, childStatus);
     //NS_ASSERTION(childStatus.IsComplete(), "bad status");
--- a/layout/mathml/nsMathMLmrootFrame.cpp
+++ b/layout/mathml/nsMathMLmrootFrame.cpp
@@ -183,18 +183,17 @@ nsMathMLmrootFrame::Reflow(nsPresContext
   nsIFrame* baseFrame = nullptr;
   nsIFrame* indexFrame = nullptr;
   ReflowOutput baseSize(aReflowInput);
   ReflowOutput indexSize(aReflowInput);
   nsIFrame* childFrame = mFrames.FirstChild();
   while (childFrame) {
     // ask our children to compute their bounding metrics
     ReflowOutput childDesiredSize(aReflowInput,
-                                         aDesiredSize.mFlags
-                                         | NS_REFLOW_CALC_BOUNDING_METRICS);
+                                         aDesiredSize.mFlags);
     WritingMode wm = childFrame->GetWritingMode();
     LogicalSize availSize = aReflowInput.ComputedSize(wm);
     availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
     ReflowInput childReflowInput(aPresContext, aReflowInput,
                                        childFrame, availSize);
     ReflowChild(childFrame, aPresContext,
                      childDesiredSize, childReflowInput, childStatus);
     //NS_ASSERTION(childStatus.IsComplete(), "bad status");