From f2d773ab79c537f064dec1129299234f69bfa130 Mon Sep 17 00:00:00 2001 From: Daniel Holbert Date: Thu, 6 Feb 2014 01:02:12 -0800 Subject: [PATCH] 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 --- layout/generic/nsHTMLReflowState.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/layout/generic/nsHTMLReflowState.cpp b/layout/generic/nsHTMLReflowState.cpp index 751e28d3023..c29acfee543 100644 --- a/layout/generic/nsHTMLReflowState.cpp +++ b/layout/generic/nsHTMLReflowState.cpp @@ -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");