From 79c749bdc4e3df57c8739f2b18770cab8db899ff Mon Sep 17 00:00:00 2001 From: "peterl%netscape.com" Date: Fri, 5 Feb 1999 03:58:27 +0000 Subject: [PATCH] added assertion for switching style contexts during reflow git-svn-id: svn://10.0.0.236/trunk@19815 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsFrame.cpp | 2 ++ mozilla/layout/html/base/src/nsFrame.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/mozilla/layout/generic/nsFrame.cpp b/mozilla/layout/generic/nsFrame.cpp index 9920f835a42..e3e4f2713f8 100644 --- a/mozilla/layout/generic/nsFrame.cpp +++ b/mozilla/layout/generic/nsFrame.cpp @@ -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; diff --git a/mozilla/layout/html/base/src/nsFrame.cpp b/mozilla/layout/html/base/src/nsFrame.cpp index 9920f835a42..e3e4f2713f8 100644 --- a/mozilla/layout/html/base/src/nsFrame.cpp +++ b/mozilla/layout/html/base/src/nsFrame.cpp @@ -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;