From 003aeba6b50c05cfe1a314f567a7510f88a1c03f Mon Sep 17 00:00:00 2001 From: "karnaze%netscape.com" Date: Thu, 11 Nov 1999 05:43:35 +0000 Subject: [PATCH] fixed crash (cnn and other sites with javascript) in nsCellMap due to it not being invalidated. git-svn-id: svn://10.0.0.236/trunk@53196 18797224-902f-48f8-a5cc-f745e15eee43 --- .../layout/html/table/src/nsTableFrame.cpp | 24 +++++++++++-------- mozilla/layout/tables/nsTableFrame.cpp | 24 +++++++++++-------- 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/mozilla/layout/html/table/src/nsTableFrame.cpp b/mozilla/layout/html/table/src/nsTableFrame.cpp index dbcd835726e..8fe2372ae55 100644 --- a/mozilla/layout/html/table/src/nsTableFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableFrame.cpp @@ -1209,11 +1209,24 @@ NS_METHOD nsTableFrame::Reflow(nsIPresContext& aPresContext, if (nsDebugTable::gRflTable) nsTableFrame::DebugReflow("T::Rfl en", this, &aReflowState, nsnull); // this is a temporary fix to prevent a recent crash due to incremental content - // sink changes. this will go away when the col cache and cell map are synchronized + // sink changes. XXX remove this when the col cache and cell map are synchronized if (!IsColumnCacheValid()) { CacheColFrames(aPresContext, PR_TRUE); } + PRBool needsRecalc=PR_FALSE; + // this is necessary here because the cell map can change even before the first reflow. + // XXX remove this when the incremental cell map is finished + if (!IsCellMapValid()) { + if (mCellMap) { + delete mCellMap; + mCellMap = new nsCellMap(0,0); + ReBuildCellMap(); + needsRecalc = PR_TRUE; + } + } + + // Initialize out parameter if (nsnull != aDesiredSize.maxElementSize) { aDesiredSize.maxElementSize->width = 0; @@ -1235,15 +1248,6 @@ NS_METHOD nsTableFrame::Reflow(nsIPresContext& aPresContext, // NeedsReflow and IsFirstPassValid take into account reflow type = Initial_Reflow if (PR_TRUE==NeedsReflow(aReflowState)) { - PRBool needsRecalc=PR_FALSE; - if (eReflowReason_Initial!=aReflowState.reason && PR_FALSE==IsCellMapValid()) - { - if (nsnull!=mCellMap) - delete mCellMap; - mCellMap = new nsCellMap(0,0); - ReBuildCellMap(); - needsRecalc=PR_TRUE; - } if ((NS_UNCONSTRAINEDSIZE == aReflowState.availableWidth) || (PR_FALSE==IsFirstPassValid())) { diff --git a/mozilla/layout/tables/nsTableFrame.cpp b/mozilla/layout/tables/nsTableFrame.cpp index dbcd835726e..8fe2372ae55 100644 --- a/mozilla/layout/tables/nsTableFrame.cpp +++ b/mozilla/layout/tables/nsTableFrame.cpp @@ -1209,11 +1209,24 @@ NS_METHOD nsTableFrame::Reflow(nsIPresContext& aPresContext, if (nsDebugTable::gRflTable) nsTableFrame::DebugReflow("T::Rfl en", this, &aReflowState, nsnull); // this is a temporary fix to prevent a recent crash due to incremental content - // sink changes. this will go away when the col cache and cell map are synchronized + // sink changes. XXX remove this when the col cache and cell map are synchronized if (!IsColumnCacheValid()) { CacheColFrames(aPresContext, PR_TRUE); } + PRBool needsRecalc=PR_FALSE; + // this is necessary here because the cell map can change even before the first reflow. + // XXX remove this when the incremental cell map is finished + if (!IsCellMapValid()) { + if (mCellMap) { + delete mCellMap; + mCellMap = new nsCellMap(0,0); + ReBuildCellMap(); + needsRecalc = PR_TRUE; + } + } + + // Initialize out parameter if (nsnull != aDesiredSize.maxElementSize) { aDesiredSize.maxElementSize->width = 0; @@ -1235,15 +1248,6 @@ NS_METHOD nsTableFrame::Reflow(nsIPresContext& aPresContext, // NeedsReflow and IsFirstPassValid take into account reflow type = Initial_Reflow if (PR_TRUE==NeedsReflow(aReflowState)) { - PRBool needsRecalc=PR_FALSE; - if (eReflowReason_Initial!=aReflowState.reason && PR_FALSE==IsCellMapValid()) - { - if (nsnull!=mCellMap) - delete mCellMap; - mCellMap = new nsCellMap(0,0); - ReBuildCellMap(); - needsRecalc=PR_TRUE; - } if ((NS_UNCONSTRAINEDSIZE == aReflowState.availableWidth) || (PR_FALSE==IsFirstPassValid())) {