From 9cefaf0382972f5db5c3754c20c88e6126bffb33 Mon Sep 17 00:00:00 2001 From: "L. David Baron" Date: Sun, 4 Jan 2009 14:52:38 -0500 Subject: [PATCH] Remove the VerifyReflow code that checked the space manager state. (Bug 191448) r+sr=roc --- content/base/src/nsGkAtomList.h | 1 - layout/base/nsIPresShell.h | 3 +- layout/base/nsPresShell.cpp | 99 +------------------------------ layout/generic/nsBlockFrame.cpp | 18 ------ layout/generic/nsSpaceManager.cpp | 5 +- layout/generic/nsSpaceManager.h | 15 ----- 6 files changed, 3 insertions(+), 138 deletions(-) diff --git a/content/base/src/nsGkAtomList.h b/content/base/src/nsGkAtomList.h index a0ba4b005841..043c180b6ed5 100755 --- a/content/base/src/nsGkAtomList.h +++ b/content/base/src/nsGkAtomList.h @@ -1629,7 +1629,6 @@ GK_ATOM(overflowPlaceholdersProperty, "OverflowPlaceholdersProperty") // nsFram GK_ATOM(preEffectsBBoxProperty, "PreEffectsBBoxProperty") // nsRect* GK_ATOM(preTransformBBoxProperty, "PreTransformBBoxProperty") // nsRect* GK_ATOM(rowUnpaginatedHeightProperty, "RowUnpaginatedHeightProperty") // nscoord* -GK_ATOM(spaceManagerProperty, "SpaceManagerProperty") // the space manager for a block GK_ATOM(tabWidthProperty, "TabWidthProperty") // nsTArray* array of tab widths GK_ATOM(tableBCProperty, "TableBCProperty") // table border collapsing info (e.g. damage area, table border widths) GK_ATOM(usedMarginProperty, "UsedMarginProperty") // nsMargin* diff --git a/layout/base/nsIPresShell.h b/layout/base/nsIPresShell.h index b3c13ac9fd50..9652b0e29312 100644 --- a/layout/base/nsIPresShell.h +++ b/layout/base/nsIPresShell.h @@ -123,8 +123,7 @@ typedef PRUint32 nsFrameState; #define VERIFY_REFLOW_DUMP_COMMANDS 0x08 #define VERIFY_REFLOW_NOISY_RC 0x10 #define VERIFY_REFLOW_REALLY_NOISY_RC 0x20 -#define VERIFY_REFLOW_INCLUDE_SPACE_MANAGER 0x40 -#define VERIFY_REFLOW_DURING_RESIZE_REFLOW 0x80 +#define VERIFY_REFLOW_DURING_RESIZE_REFLOW 0x40 /** * Presentation shell interface. Presentation shells are the diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 2654a60272ff..6581806e2371 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -137,7 +137,6 @@ #include "nsIFrameDebug.h" #endif // for |#ifdef DEBUG| code -#include "nsSpaceManager.h" #include "prenv.h" #include "nsIAttribute.h" #include "nsIGlobalHistory2.h" @@ -257,7 +256,6 @@ static const VerifyReflowFlags gFlags[] = { { "list-commands", VERIFY_REFLOW_DUMP_COMMANDS }, { "noisy-commands", VERIFY_REFLOW_NOISY_RC }, { "really-noisy-commands", VERIFY_REFLOW_REALLY_NOISY_RC }, - { "space-manager", VERIFY_REFLOW_INCLUDE_SPACE_MANAGER }, { "resize", VERIFY_REFLOW_DURING_RESIZE_REFLOW }, }; @@ -6792,102 +6790,7 @@ CompareTrees(nsPresContext* aFirstPresContext, nsIFrame* aFirstFrame, break; } - // verify that neither frame has a space manager, - // or they both do and the space managers are equivalent - nsSpaceManager *sm1 = static_cast - (k1->GetProperty(nsGkAtoms::spaceManagerProperty)); - - // look at the test frame - nsSpaceManager *sm2 = static_cast - (k2->GetProperty(nsGkAtoms::spaceManagerProperty)); - - // now compare the space managers - if (((nsnull == sm1) && (nsnull != sm2)) || - ((nsnull != sm1) && (nsnull == sm2))) { // one is null, and the other is not - ok = PR_FALSE; - LogVerifyMessage(k1, k2, "space managers are not matched\n"); - } - else if (sm1 && sm2) { // both are not null, compare them - // first, compare yMost - nscoord yMost1, yMost2; - nsresult smresult = sm1->YMost(yMost1); - if (NS_ERROR_ABORT != smresult) - { - NS_ASSERTION(NS_SUCCEEDED(smresult), "bad result"); - smresult = sm2->YMost(yMost2); - NS_ASSERTION(NS_SUCCEEDED(smresult), "bad result"); - if (yMost1 != yMost2) { - LogVerifyMessage(k1, k2, "yMost of space managers differs\n"); - } - // now compare bands by sampling - PRInt32 yIncrement = yMost1/100; - if (0==yIncrement) { - yIncrement = 1; // guarantee we make progress in the loop below - } - nscoord yOffset = 0; - for ( ; ok && yOffset < yMost1; yOffset += yIncrement) - { - nscoord small=5, large=100; - nsBandData band1, band2; - nsBandTrapezoid trap1[20], trap2[20]; - band1.mSize = band2.mSize = 20; - band1.mTrapezoids = trap1; - band2.mTrapezoids = trap2; - sm1->GetBandData(yOffset, nsSize(small,small), band1); - sm2->GetBandData(yOffset, nsSize(small,small), band2); - if (band1.mCount != band2.mCount) - { // count mismatch, stop comparing - LogVerifyMessage(k1, k2, "band.mCount of space managers differs\n"); - printf("count1= %d, count2=%d, yOffset = %d, size=%d\n", - band1.mCount, band2.mCount, yOffset, small); - ok = PR_FALSE; - - } - else // band counts match, compare individual traps - { - PRInt32 trapIndex=0; - for ( ;trapIndexGetBandData(yOffset, nsSize(large,large), band1); - sm2->GetBandData(yOffset, nsSize(large,large), band2); - if (band1.mCount != band2.mCount) - { // count mismatch, stop comparing - LogVerifyMessage(k1, k2, "band.mCount of space managers differs\n"); - printf("count1= %d, count2=%d, yOffset = %d, size=%d\n", - band1.mCount, band2.mCount, yOffset, small); - ok = PR_FALSE; - - } - else // band counts match, compare individual traps - { - PRInt32 trapIndex=0; - for ( ; trapIndexGetPresShell(); - if (shell) { - nsHTMLReflowState& reflowState = (nsHTMLReflowState&)aReflowState; - rv = SetProperty(nsGkAtoms::spaceManagerProperty, - reflowState.mSpaceManager, - nsnull /* should be nsSpaceManagerDestroyer*/); - - autoSpaceManager.DebugOrphanSpaceManager(); - } - } -#endif - // Let the absolutely positioned container reflow any absolutely positioned // child frames that need to be reflowed, e.g., elements with a percentage // based width/height diff --git a/layout/generic/nsSpaceManager.cpp b/layout/generic/nsSpaceManager.cpp index ccdf5d620c09..91d4841214ba 100644 --- a/layout/generic/nsSpaceManager.cpp +++ b/layout/generic/nsSpaceManager.cpp @@ -1451,10 +1451,7 @@ nsAutoSpaceManager::~nsAutoSpaceManager() } #endif -#ifdef DEBUG - if (mOwns) -#endif - delete mNew; + delete mNew; } } diff --git a/layout/generic/nsSpaceManager.h b/layout/generic/nsSpaceManager.h index eb045de3a75e..7e06117fec69 100644 --- a/layout/generic/nsSpaceManager.h +++ b/layout/generic/nsSpaceManager.h @@ -468,9 +468,6 @@ class nsAutoSpaceManager { public: nsAutoSpaceManager(nsHTMLReflowState& aReflowState) : mReflowState(aReflowState), -#ifdef DEBUG - mOwns(PR_TRUE), -#endif mNew(nsnull), mOld(nsnull) {} @@ -484,20 +481,8 @@ public: nsresult CreateSpaceManager(nsPresContext *aPresContext); -#ifdef DEBUG - /** - * `Orphan' any space manager that the nsAutoSpaceManager created; - * i.e., make it so that we don't destroy the space manager when we - * go out of scope. - */ - void DebugOrphanSpaceManager() { mOwns = PR_FALSE; } -#endif - protected: nsHTMLReflowState &mReflowState; -#ifdef DEBUG - PRBool mOwns; -#endif nsSpaceManager *mNew; nsSpaceManager *mOld; };