Bug 1165667: Use reflow state's reference rendering context during flex layout, instead of creating a temporary one. r=mats
authorDaniel Holbert <dholbert@cs.stanford.edu>
Thu, 21 May 2015 18:35:16 -0700
changeset 266213 a33ee01bca86051f053ba83251b1fe702907c1f9
parent 266212 e9b68252df54c12015382d022f01e06c5605e27a
child 266214 3dcfe0aa8ea292c0abb0c4f6224a219a87a9333f
push id2231
push usermichael.l.comella@gmail.com
push dateFri, 22 May 2015 20:04:59 +0000
reviewersmats
bugs1165667
milestone41.0a1
Bug 1165667: Use reflow state's reference rendering context during flex layout, instead of creating a temporary one. r=mats
layout/generic/nsFlexContainerFrame.cpp
--- a/layout/generic/nsFlexContainerFrame.cpp
+++ b/layout/generic/nsFlexContainerFrame.cpp
@@ -1419,20 +1419,20 @@ nsFlexContainerFrame::
                                        ratio, aAxisTracker)) {
       flexBasisNeedsToMeasureContent = true;
     }
   }
 
   // Measure content, if needed (w/ intrinsic-width method or a reflow)
   if (minSizeNeedsToMeasureContent || flexBasisNeedsToMeasureContent) {
     if (aAxisTracker.IsMainAxisHorizontal()) {
-      nsRenderingContext rctx(
-        aPresContext->PresShell()->CreateReferenceRenderingContext());
       if (minSizeNeedsToMeasureContent) {
-        resolvedMinSize = std::min(resolvedMinSize, aFlexItem.Frame()->GetMinISize(&rctx));
+        nscoord frameMinISize =
+          aFlexItem.Frame()->GetMinISize(aItemReflowState.rendContext);
+        resolvedMinSize = std::min(resolvedMinSize, frameMinISize);
       }
       NS_ASSERTION(!flexBasisNeedsToMeasureContent,
                    "flex-basis:auto should have been resolved in the "
                    "reflow state, for horizontal flexbox. It shouldn't need "
                    "special handling here");
     } else {
       // If this item is flexible (vertically), or if we're measuring the
       // 'auto' min-height and our main-size is something else, then we assume