Bug 1448551 - Fix reported intrinsic size in reflow log of some frames. r?dbaron
MozReview-Commit-ID: 4jcrurjqGgu
--- 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;