Bug 1300369 part 9 - Add a ComputeSizeFlags param to nsFrame::ComputeSizeWithIntrinsicDimensions (idempotent patch). r=dholbert
authorMats Palmgren <mats@mozilla.com>
Sat, 05 Nov 2016 02:57:06 +0100
changeset 347948 96b1c6a3844608cadf76da9cd23323c884e29d0f
parent 347947 4bc29ce155bda34dc1638a588755c95fcbd092ef
child 347949 dc204b727b53f9c81b596ace9680ac28be2216d1
push id10298
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:33:03 +0000
treeherdermozilla-aurora@7e29173b1641 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1300369
milestone52.0a1
Bug 1300369 part 9 - Add a ComputeSizeFlags param to nsFrame::ComputeSizeWithIntrinsicDimensions (idempotent patch). r=dholbert
layout/generic/nsFrame.cpp
layout/generic/nsFrame.h
layout/generic/nsHTMLCanvasFrame.cpp
layout/generic/nsImageFrame.cpp
layout/generic/nsSubDocumentFrame.cpp
layout/generic/nsVideoFrame.cpp
layout/svg/nsSVGOuterSVGFrame.cpp
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -4859,17 +4859,18 @@ nsFrame::ComputeSize(nsRenderingContext*
 LogicalSize
 nsFrame::ComputeSizeWithIntrinsicDimensions(nsRenderingContext*  aRenderingContext,
                                             WritingMode          aWM,
                                             const IntrinsicSize& aIntrinsicSize,
                                             nsSize               aIntrinsicRatio,
                                             const LogicalSize&   aCBSize,
                                             const LogicalSize&   aMargin,
                                             const LogicalSize&   aBorder,
-                                            const LogicalSize&   aPadding)
+                                            const LogicalSize&   aPadding,
+                                            ComputeSizeFlags     aFlags)
 {
   const nsStylePosition* stylePos = StylePosition();
   const nsStyleCoord* inlineStyleCoord = &stylePos->ISize(aWM);
   const nsStyleCoord* blockStyleCoord = &stylePos->BSize(aWM);
   const nsIAtom* parentFrameType =
     GetParent() ? GetParent()->GetType() : nullptr;
   const bool isGridItem = (parentFrameType == nsGkAtoms::gridContainerFrame &&
                            !(GetStateBits() & NS_FRAME_OUT_OF_FLOW));
--- a/layout/generic/nsFrame.h
+++ b/layout/generic/nsFrame.h
@@ -283,17 +283,18 @@ public:
   ComputeSizeWithIntrinsicDimensions(
               nsRenderingContext*           aRenderingContext,
               mozilla::WritingMode          aWM,
               const mozilla::IntrinsicSize& aIntrinsicSize,
               nsSize                        aIntrinsicRatio,
               const mozilla::LogicalSize&   aCBSize,
               const mozilla::LogicalSize&   aMargin,
               const mozilla::LogicalSize&   aBorder,
-              const mozilla::LogicalSize&   aPadding);
+              const mozilla::LogicalSize&   aPadding,
+              ComputeSizeFlags              aFlags);
 
   // Compute tight bounds assuming this frame honours its border, background
   // and outline, its children's tight bounds, and nothing else.
   nsRect ComputeSimpleTightBounds(mozilla::gfx::DrawTarget* aDrawTarget) const;
   
   /**
    * A helper, used by |nsFrame::ComputeSize| (for frames that need to
    * override only this part of ComputeSize), that computes the size
--- a/layout/generic/nsHTMLCanvasFrame.cpp
+++ b/layout/generic/nsHTMLCanvasFrame.cpp
@@ -233,17 +233,18 @@ nsHTMLCanvasFrame::ComputeSize(nsRenderi
   IntrinsicSize intrinsicSize;
   intrinsicSize.width.SetCoordValue(nsPresContext::CSSPixelsToAppUnits(size.width));
   intrinsicSize.height.SetCoordValue(nsPresContext::CSSPixelsToAppUnits(size.height));
 
   nsSize intrinsicRatio = GetIntrinsicRatio(); // won't actually be used
 
   return ComputeSizeWithIntrinsicDimensions(aRenderingContext, aWM,
                                             intrinsicSize, intrinsicRatio,
-                                            aCBSize, aMargin, aBorder, aPadding);
+                                            aCBSize, aMargin, aBorder, aPadding,
+                                            aFlags);
 }
 
 void
 nsHTMLCanvasFrame::Reflow(nsPresContext*           aPresContext,
                           ReflowOutput&     aMetrics,
                           const ReflowInput& aReflowInput,
                           nsReflowStatus&          aStatus)
 {
--- a/layout/generic/nsImageFrame.cpp
+++ b/layout/generic/nsImageFrame.cpp
@@ -867,17 +867,18 @@ nsImageFrame::ComputeSize(nsRenderingCon
       }
       intrinsicSize.width.SetCoordValue(coordFlip ? appHeight : appWidth);
       intrinsicSize.height.SetCoordValue(coordFlip ? appWidth : appHeight);
     }
   }
 
   return ComputeSizeWithIntrinsicDimensions(aRenderingContext, aWM,
                                             intrinsicSize, mIntrinsicRatio,
-                                            aCBSize, aMargin, aBorder, aPadding);
+                                            aCBSize, aMargin, aBorder, aPadding,
+                                            aFlags);
 }
 
 // XXXdholbert This function's clients should probably just be calling
 // GetContentRectRelativeToSelf() directly.
 nsRect 
 nsImageFrame::GetInnerArea() const
 {
   return GetContentRectRelativeToSelf();
--- a/layout/generic/nsSubDocumentFrame.cpp
+++ b/layout/generic/nsSubDocumentFrame.cpp
@@ -716,17 +716,17 @@ nsSubDocumentFrame::ComputeSize(nsRender
                                 ComputeSizeFlags    aFlags)
 {
   nsIFrame* subDocRoot = ObtainIntrinsicSizeFrame();
   if (subDocRoot) {
     return ComputeSizeWithIntrinsicDimensions(aRenderingContext, aWM,
                                               subDocRoot->GetIntrinsicSize(),
                                               subDocRoot->GetIntrinsicRatio(),
                                               aCBSize, aMargin, aBorder,
-                                              aPadding);
+                                              aPadding, aFlags);
   }
   return nsAtomicContainerFrame::ComputeSize(aRenderingContext, aWM,
                                              aCBSize, aAvailableISize,
                                              aMargin, aBorder, aPadding,
                                              aFlags);
 }
 
 void
--- a/layout/generic/nsVideoFrame.cpp
+++ b/layout/generic/nsVideoFrame.cpp
@@ -532,17 +532,18 @@ nsVideoFrame::ComputeSize(nsRenderingCon
   intrinsicSize.width.SetCoordValue(size.width);
   intrinsicSize.height.SetCoordValue(size.height);
 
   // Only video elements have an intrinsic ratio.
   nsSize intrinsicRatio = HasVideoElement() ? size : nsSize(0, 0);
 
   return ComputeSizeWithIntrinsicDimensions(aRenderingContext, aWM,
                                             intrinsicSize, intrinsicRatio,
-                                            aCBSize, aMargin, aBorder, aPadding);
+                                            aCBSize, aMargin, aBorder, aPadding,
+                                            aFlags);
 }
 
 nscoord nsVideoFrame::GetMinISize(nsRenderingContext *aRenderingContext)
 {
   nsSize size = GetVideoIntrinsicSize(aRenderingContext);
   nscoord result = GetWritingMode().IsVertical() ? size.height : size.width;
   DISPLAY_MIN_WIDTH(this, result);
   return result;
--- a/layout/svg/nsSVGOuterSVGFrame.cpp
+++ b/layout/svg/nsSVGOuterSVGFrame.cpp
@@ -344,17 +344,18 @@ nsSVGOuterSVGFrame::ComputeSize(nsRender
     MOZ_ASSERT(intrinsicSize.height.GetUnit() == eStyleUnit_Coord &&
                intrinsicSize.width.GetUnit() == eStyleUnit_Coord,
                "We should have just handled the only situation where"
                "we lack an intrinsic height or width.");
   }
 
   return ComputeSizeWithIntrinsicDimensions(aRenderingContext, aWM,
                                             intrinsicSize, GetIntrinsicRatio(),
-                                            cbSize, aMargin, aBorder, aPadding);
+                                            cbSize, aMargin, aBorder, aPadding,
+                                            aFlags);
 }
 
 void
 nsSVGOuterSVGFrame::Reflow(nsPresContext*           aPresContext,
                            ReflowOutput&     aDesiredSize,
                            const ReflowInput& aReflowInput,
                            nsReflowStatus&          aStatus)
 {