diff --git a/layout/generic/nsBlockReflowState.cpp b/layout/generic/nsBlockReflowState.cpp index 8b6af60be76..144606a5e88 100644 --- a/layout/generic/nsBlockReflowState.cpp +++ b/layout/generic/nsBlockReflowState.cpp @@ -62,6 +62,7 @@ #endif using namespace mozilla; +using namespace mozilla::layout; nsBlockReflowState::nsBlockReflowState(const nsHTMLReflowState& aReflowState, nsPresContext* aPresContext, @@ -597,6 +598,7 @@ FloatMarginWidth(const nsHTMLReflowState& aCBReflowState, nsIFrame *aFloat, const nsCSSOffsetState& aFloatOffsetState) { + AutoMaybeNullInflationContainer an(aFloat); return aFloat->ComputeSize( aCBReflowState.rendContext, nsSize(aCBReflowState.ComputedWidth(), diff --git a/layout/generic/nsHTMLReflowState.cpp b/layout/generic/nsHTMLReflowState.cpp index 969e9a2082b..976117ff44f 100644 --- a/layout/generic/nsHTMLReflowState.cpp +++ b/layout/generic/nsHTMLReflowState.cpp @@ -67,6 +67,7 @@ #endif using namespace mozilla; +using namespace mozilla::layout; // Prefs-driven control for |text-decoration: blink| static bool sPrefIsLoaded = false; @@ -1243,24 +1244,28 @@ nsHTMLReflowState::InitAbsoluteConstraints(nsPresContext* aPresContext, bool heightIsAuto = eStyleUnit_Auto == mStylePosition->mHeight.GetUnit(); bool shrinkWrap = leftIsAuto || rightIsAuto; - nsSize size = - frame->ComputeSize(rendContext, - nsSize(containingBlockWidth, - containingBlockHeight), - containingBlockWidth, // XXX or availableWidth? - nsSize(mComputedMargin.LeftRight() + - mComputedOffsets.LeftRight(), - mComputedMargin.TopBottom() + - mComputedOffsets.TopBottom()), - nsSize(mComputedBorderPadding.LeftRight() - - mComputedPadding.LeftRight(), - mComputedBorderPadding.TopBottom() - + { + AutoMaybeNullInflationContainer an(frame); + + nsSize size = + frame->ComputeSize(rendContext, + nsSize(containingBlockWidth, + containingBlockHeight), + containingBlockWidth, // XXX or availableWidth? + nsSize(mComputedMargin.LeftRight() + + mComputedOffsets.LeftRight(), + mComputedMargin.TopBottom() + + mComputedOffsets.TopBottom()), + nsSize(mComputedBorderPadding.LeftRight() - + mComputedPadding.LeftRight(), + mComputedBorderPadding.TopBottom() - + mComputedPadding.TopBottom()), + nsSize(mComputedPadding.LeftRight(), mComputedPadding.TopBottom()), - nsSize(mComputedPadding.LeftRight(), - mComputedPadding.TopBottom()), - shrinkWrap); - mComputedWidth = size.width; - mComputedHeight = size.height; + shrinkWrap); + mComputedWidth = size.width; + mComputedHeight = size.height; + } NS_ASSERTION(mComputedWidth >= 0, "Bogus width"); NS_ASSERTION(mComputedHeight == NS_UNCONSTRAINEDSIZE || mComputedHeight >= 0, "Bogus height"); @@ -1862,6 +1867,8 @@ nsHTMLReflowState::InitConstraints(nsPresContext* aPresContext, InitAbsoluteConstraints(aPresContext, cbrs, aContainingBlockWidth, aContainingBlockHeight, aFrameType); } else { + AutoMaybeNullInflationContainer an(frame); + bool isBlock = NS_CSS_FRAME_TYPE_BLOCK == NS_FRAME_GET_TYPE(mFrameType); // make sure legend frames with display:block and width:auto still diff --git a/layout/tables/nsTableOuterFrame.cpp b/layout/tables/nsTableOuterFrame.cpp index efa32bfeb62..c879f9f0744 100644 --- a/layout/tables/nsTableOuterFrame.cpp +++ b/layout/tables/nsTableOuterFrame.cpp @@ -535,6 +535,8 @@ ChildShrinkWrapWidth(nsRenderingContext *aRenderingContext, nsSize aCBSize, nscoord aAvailableWidth, nscoord *aMarginResult = nsnull) { + AutoMaybeNullInflationContainer an(aChildFrame); + nsCSSOffsetState offsets(aChildFrame, aRenderingContext, aCBSize.width); nsSize size = aChildFrame->ComputeSize(aRenderingContext, aCBSize, aAvailableWidth,