Bug 1448551 - Fix reported intrinsic size in reflow log of some frames. r?dbaron draft
authorXidorn Quan <me@upsuper.org>
Sun, 25 Mar 2018 00:17:33 +1100
changeset 771986 9abb9b406db8babe6f787bf8ae277f0f392f9f90
parent 771964 1c6a0b0aae636f658555d4e2261eb3731df71f65
child 771994 3a718094c4db6bfed86d8e6a917b066cf2fc9cca
push id103818
push userxquan@mozilla.com
push dateSat, 24 Mar 2018 13:19:05 +0000
reviewersdbaron
bugs1448551
milestone61.0a1
Bug 1448551 - Fix reported intrinsic size in reflow log of some frames. r?dbaron MozReview-Commit-ID: 4jcrurjqGgu
layout/generic/nsFrame.cpp
layout/xul/nsBoxFrame.cpp
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -10225,17 +10225,18 @@ nsSize
 nsFrame::GetXULPrefSize(nsBoxLayoutState& aState)
 {
   nsSize size(0,0);
   DISPLAY_PREF_SIZE(this, size);
   // If the size is cached, and there are no HTML constraints that we might
   // be depending on, then we just return the cached size.
   nsBoxLayoutMetrics *metrics = BoxMetrics();
   if (!DoesNeedRecalc(metrics->mPrefSize)) {
-    return metrics->mPrefSize;
+    size = metrics->mPrefSize;
+    return size;
   }
 
   if (IsXULCollapsed())
     return size;
 
   // get our size in CSS.
   bool widthSet, heightSet;
   bool completelyRedefined = nsIFrame::AddXULPrefSize(this, size, widthSet, heightSet);
--- a/layout/xul/nsBoxFrame.cpp
+++ b/layout/xul/nsBoxFrame.cpp
@@ -765,17 +765,18 @@ nsSize
 nsBoxFrame::GetXULPrefSize(nsBoxLayoutState& aBoxLayoutState)
 {
   NS_ASSERTION(aBoxLayoutState.GetRenderingContext(),
                "must have rendering context");
 
   nsSize size(0,0);
   DISPLAY_PREF_SIZE(this, size);
   if (!DoesNeedRecalc(mPrefSize)) {
-     return mPrefSize;
+    size = mPrefSize;
+    return size;
   }
 
 #ifdef DEBUG_LAYOUT
   PropagateDebug(aBoxLayoutState);
 #endif
 
   if (IsXULCollapsed())
     return size;
@@ -828,17 +829,18 @@ nsSize
 nsBoxFrame::GetXULMinSize(nsBoxLayoutState& aBoxLayoutState)
 {
   NS_ASSERTION(aBoxLayoutState.GetRenderingContext(),
                "must have rendering context");
 
   nsSize size(0,0);
   DISPLAY_MIN_SIZE(this, size);
   if (!DoesNeedRecalc(mMinSize)) {
-    return mMinSize;
+    size = mMinSize;
+    return size;
   }
 
 #ifdef DEBUG_LAYOUT
   PropagateDebug(aBoxLayoutState);
 #endif
 
   if (IsXULCollapsed())
     return size;
@@ -868,17 +870,18 @@ nsSize
 nsBoxFrame::GetXULMaxSize(nsBoxLayoutState& aBoxLayoutState)
 {
   NS_ASSERTION(aBoxLayoutState.GetRenderingContext(),
                "must have rendering context");
 
   nsSize size(NS_INTRINSICSIZE, NS_INTRINSICSIZE);
   DISPLAY_MAX_SIZE(this, size);
   if (!DoesNeedRecalc(mMaxSize)) {
-    return mMaxSize;
+    size = mMaxSize;
+    return size;
   }
 
 #ifdef DEBUG_LAYOUT
   PropagateDebug(aBoxLayoutState);
 #endif
 
   if (IsXULCollapsed())
     return size;