added assertion for switching style contexts during reflow

This commit is contained in:
peterl@netscape.com
1999-02-05 03:58:27 +00:00
parent bbd662b471
commit 311bd3a382
2 changed files with 4 additions and 0 deletions

View File

@@ -400,6 +400,7 @@ nsFrame::GetStyleContext(nsIStyleContext*& aStyleContext) const
NS_IMETHODIMP nsFrame::SetStyleContext(nsIPresContext* aPresContext,nsIStyleContext* aContext)
{
NS_PRECONDITION(0 == (mState & NS_FRAME_IN_REFLOW), "Shouldn't set style context during reflow");
NS_PRECONDITION(nsnull != aContext, "null ptr");
if (aContext != mStyleContext) {
NS_IF_RELEASE(mStyleContext);
@@ -433,6 +434,7 @@ NS_IMETHODIMP nsFrame::GetStyleData(nsStyleStructID aSID, const nsStyleStruct*&
NS_IMETHODIMP nsFrame::ReResolveStyleContext(nsIPresContext* aPresContext,
nsIStyleContext* aParentContext)
{
// XXX TURN THIS ON NS_PRECONDITION(0 == (mState & NS_FRAME_IN_REFLOW), "Shouldn't set style context during reflow");
NS_ASSERTION(nsnull != mStyleContext, "null style context");
if (nsnull != mStyleContext) {
nsIAtom* pseudoTag = nsnull;