Bug 965897: Assert that we have the right prescontext in nsHTMLReflowState constructor, and convert some existing NS_PRECONDITION null-checks into MOZ_ASSERTs. r=mats

This commit is contained in:
Daniel Holbert 2014-02-06 01:02:12 -08:00
parent f66bb84889
commit f2d773ab79

View File

@ -59,9 +59,10 @@ nsHTMLReflowState::nsHTMLReflowState(nsPresContext* aPresContext,
, mBlockDelta(0)
, mReflowDepth(0)
{
NS_PRECONDITION(aPresContext, "no pres context");
NS_PRECONDITION(aRenderingContext, "no rendering context");
NS_PRECONDITION(aFrame, "no frame");
MOZ_ASSERT(aPresContext, "no pres context");
MOZ_ASSERT(aFrame, "no frame");
MOZ_ASSERT(aPresContext == aFrame->PresContext(), "wrong pres context");
parentReflowState = nullptr;
AvailableWidth() = aAvailableSpace.width;
AvailableHeight() = aAvailableSpace.height;
@ -159,8 +160,9 @@ nsHTMLReflowState::nsHTMLReflowState(nsPresContext* aPresContext,
, mReflowDepth(aParentReflowState.mReflowDepth + 1)
, mFlags(aParentReflowState.mFlags)
{
NS_PRECONDITION(aPresContext, "no pres context");
NS_PRECONDITION(aFrame, "no frame");
MOZ_ASSERT(aPresContext, "no pres context");
MOZ_ASSERT(aFrame, "no frame");
MOZ_ASSERT(aPresContext == aFrame->PresContext(), "wrong pres context");
NS_PRECONDITION((aContainingBlockWidth == -1) ==
(aContainingBlockHeight == -1),
"cb width and height should only be non-default together");