Bug 510651: Fold nsIFrameDebug into nsFrame. r=dbaron sr=mrbkap

This commit is contained in:
Zack Weinberg 2009-08-20 14:52:48 -07:00
Родитель 59e4f8561c
Коммит 430c5ceb95
31 изменённых файлов: 213 добавлений и 410 удалений

Просмотреть файл

@ -94,7 +94,6 @@
#include "nsNetUtil.h"
#ifdef NS_DEBUG
#include "nsIFrameDebug.h"
#include "nsIDOMCharacterData.h"
#endif

Просмотреть файл

@ -58,7 +58,6 @@
#include "nsIPresShell.h"
#include "nsIViewManager.h"
#include "nsIFrame.h"
#include "nsIFrameDebug.h"
#include "nsILayoutDebugger.h"
#include "nsLayoutCID.h"
@ -434,10 +433,7 @@ DumpFramesRecur(nsIDocShell* aDocShell, FILE* out)
if (shell) {
nsIFrame* root = shell->GetRootFrame();
if (root) {
nsIFrameDebug* fdbg = do_QueryFrame(root);
if (fdbg) {
fdbg->List(out, 0);
}
root->List(out, 0);
}
}
else {

Просмотреть файл

@ -55,7 +55,6 @@
#include "nsIDocShell.h"
#include "nsIContentViewer.h"
#include "nsIContentViewerFile.h"
#include "nsIFrameDebug.h"
#include "nsIFrame.h"
#include "nsStyleStruct.h"
#include "nsIFrameUtil.h"
@ -111,9 +110,6 @@ nsRegressionTester::DumpFrameModel(nsIDOMWindow *aWindowToDump, nsILocalFile *aD
nsIFrame* root = presShell->GetRootFrame();
nsIFrameDebug* fdbg = do_QueryFrame(root);
if (NS_FAILED(rv)) return rv;
FILE* fp = stdout;
if (aDestFile)
{
@ -131,7 +127,7 @@ nsRegressionTester::DumpFrameModel(nsIDOMWindow *aWindowToDump, nsILocalFile *aD
}
}
else {
fdbg->DumpRegressionData(presShell->GetPresContext(), fp, 0);
root->DumpRegressionData(presShell->GetPresContext(), fp, 0);
}
if (fp != stdout)
fclose(fp);

Просмотреть файл

@ -6458,11 +6458,8 @@ nsCSSFrameConstructor::ContentAppended(nsIContent* aContainer,
#ifdef DEBUG
if (gReallyNoisyContentUpdates) {
nsIFrameDebug* fdbg = do_QueryFrame(parentFrame);
if (fdbg) {
printf("nsCSSFrameConstructor::ContentAppended: resulting frame model:\n");
fdbg->List(stdout, 0);
}
parentFrame->List(stdout, 0);
}
#endif
@ -6569,12 +6566,9 @@ nsCSSFrameConstructor::ContentInserted(nsIContent* aContainer,
InvalidateCanvasIfNeeded(mPresShell, aChild);
#ifdef DEBUG
if (gReallyNoisyContentUpdates) {
nsIFrameDebug* fdbg = do_QueryFrame(mFixedContainingBlock);
if (fdbg) {
printf("nsCSSFrameConstructor::ContentInserted: resulting frame "
"model:\n");
fdbg->List(stdout, 0);
}
mFixedContainingBlock->List(stdout, 0);
}
#endif
}
@ -6883,11 +6877,8 @@ nsCSSFrameConstructor::ContentInserted(nsIContent* aContainer,
#ifdef DEBUG
if (gReallyNoisyContentUpdates && parentFrame) {
nsIFrameDebug* fdbg = do_QueryFrame(parentFrame);
if (fdbg) {
printf("nsCSSFrameConstructor::ContentInserted: resulting frame model:\n");
fdbg->List(stdout, 0);
}
parentFrame->List(stdout, 0);
}
#endif
@ -7279,11 +7270,8 @@ nsCSSFrameConstructor::ContentRemoved(nsIContent* aContainer,
if (gReallyNoisyContentUpdates) {
printf("nsCSSFrameConstructor::ContentRemoved: childFrame=");
nsFrame::ListTag(stdout, childFrame);
printf("\n");
nsIFrameDebug* fdbg = do_QueryFrame(parentFrame);
if (fdbg)
fdbg->List(stdout, 0);
putchar('\n');
parentFrame->List(stdout, 0);
}
#endif
@ -7381,11 +7369,8 @@ nsCSSFrameConstructor::ContentRemoved(nsIContent* aContainer,
#ifdef DEBUG
if (gReallyNoisyContentUpdates && parentFrame) {
nsIFrameDebug* fdbg = do_QueryFrame(parentFrame);
if (fdbg) {
printf("nsCSSFrameConstructor::ContentRemoved: resulting frame model:\n");
fdbg->List(stdout, 0);
}
parentFrame->List(stdout, 0);
}
#endif
}
@ -10830,22 +10815,20 @@ nsCSSFrameConstructor::ConstructInline(nsFrameConstructorState& aState,
MarkIBSpecialPrevSibling(blockFrame, newFrame);
MarkIBSpecialPrevSibling(inlineFrame, blockFrame);
#ifdef DEBUG
#ifdef DEBUG
if (gNoisyInlineConstruction) {
nsIFrameDebug* frameDebug;
printf("nsCSSFrameConstructor::ConstructInline:\n");
if ( (frameDebug = do_QueryFrame(*aNewFrame)) ) {
if (*aNewFrame) {
printf(" ==> leading inline frame:\n");
frameDebug->List(stdout, 2);
(*aNewFrame)->List(stdout, 2);
}
if ( (frameDebug = do_QueryFrame(blockFrame)) ) {
if (blockFrame) {
printf(" ==> block frame:\n");
frameDebug->List(stdout, 2);
blockFrame->List(stdout, 2);
}
if ( (frameDebug = do_QueryFrame(inlineFrame)) ) {
if (inlineFrame) {
printf(" ==> trailing inline frame:\n");
frameDebug->List(stdout, 2);
inlineFrame->List(stdout, 2);
}
}
#endif

Просмотреть файл

@ -944,7 +944,7 @@ protected:
#if defined(MOZ_REFLOW_PERF_DSP) && defined(MOZ_REFLOW_PERF)
/**
* This class implements painting of reflow counts. Ideally, we would simply
* make all the frame names be those returned by nsIFrameDebug::GetFrameName
* make all the frame names be those returned by nsFrame::GetFrameName
* (except that tosses in the content tag name!) and support only one color
* and eliminate this class altogether in favor of nsDisplayGeneric, but for
* the time being we can't pass args to a PaintCallback, so just have a

Просмотреть файл

@ -98,7 +98,6 @@
#include "nsIDocShellTreeOwner.h"
#include "nsIDocShell.h"
#include "nsIBaseWindow.h"
#include "nsIFrameDebug.h"
#include "nsILayoutHistoryState.h"
#include "nsIParser.h"
#include "nsGUIEvent.h"

Просмотреть файл

@ -766,11 +766,8 @@ DumpContext(nsIFrame* aFrame, nsStyleContext* aContext)
if (aFrame) {
fputs("frame: ", stdout);
nsAutoString name;
nsIFrameDebug *frameDebug = do_QueryFrame(aFrame);
if (frameDebug) {
frameDebug->GetFrameName(name);
aFrame->GetFrameName(name);
fputs(NS_LossyConvertUTF16toASCII(name).get(), stdout);
}
fprintf(stdout, " (%p)", static_cast<void*>(aFrame));
}
if (aContext) {

Просмотреть файл

@ -41,8 +41,7 @@
*/
#include "nsILayoutDebugger.h"
#include "nsIFrame.h"
#include "nsIFrameDebug.h"
#include "nsFrame.h"
#include "nsDisplayList.h"
#include <stdio.h>
@ -101,28 +100,28 @@ NS_IMPL_ISUPPORTS1(nsLayoutDebugger, nsILayoutDebugger)
NS_IMETHODIMP
nsLayoutDebugger::SetShowFrameBorders(PRBool aEnable)
{
nsIFrameDebug::ShowFrameBorders(aEnable);
nsFrame::ShowFrameBorders(aEnable);
return NS_OK;
}
NS_IMETHODIMP
nsLayoutDebugger::GetShowFrameBorders(PRBool* aResult)
{
*aResult = nsIFrameDebug::GetShowFrameBorders();
*aResult = nsFrame::GetShowFrameBorders();
return NS_OK;
}
NS_IMETHODIMP
nsLayoutDebugger::SetShowEventTargetFrameBorder(PRBool aEnable)
{
nsIFrameDebug::ShowEventTargetFrameBorder(aEnable);
nsFrame::ShowEventTargetFrameBorder(aEnable);
return NS_OK;
}
NS_IMETHODIMP
nsLayoutDebugger::GetShowEventTargetFrameBorder(PRBool* aResult)
{
*aResult = nsIFrameDebug::GetShowEventTargetFrameBorder();
*aResult = nsFrame::GetShowEventTargetFrameBorder();
return NS_OK;
}
@ -159,10 +158,9 @@ PrintDisplayListTo(nsDisplayListBuilder* aBuilder, const nsDisplayList& aList,
fputc(' ', aOutput);
}
nsIFrame* f = i->GetUnderlyingFrame();
nsIFrameDebug* fDebug = do_QueryFrame(f);
nsAutoString fName;
if (fDebug) {
fDebug->GetFrameName(fName);
if (f) {
f->GetFrameName(fName);
}
nsRect rect = i->GetBounds(aBuilder);
switch (i->GetType()) {
@ -194,7 +192,8 @@ PrintDisplayListTo(nsDisplayListBuilder* aBuilder, const nsDisplayList& aList,
}
void
nsIFrameDebug::PrintDisplayList(nsDisplayListBuilder* aBuilder, const nsDisplayList& aList)
nsFrame::PrintDisplayList(nsDisplayListBuilder* aBuilder,
const nsDisplayList& aList)
{
PrintDisplayListTo(aBuilder, aList, 0, stderr);
}

Просмотреть файл

@ -942,7 +942,7 @@ nsLayoutUtils::GetFrameForPoint(nsIFrame* aFrame, nsPoint aPt,
#ifdef DEBUG
if (gDumpEventList) {
fprintf(stderr, "Event handling --- (%d,%d):\n", aPt.x, aPt.y);
nsIFrameDebug::PrintDisplayList(&builder, list);
nsFrame::PrintDisplayList(&builder, list);
}
#endif
@ -1114,7 +1114,7 @@ nsLayoutUtils::PaintFrame(nsIRenderingContext* aRenderingContext, nsIFrame* aFra
if (gDumpPaintList) {
fprintf(stderr, "Painting --- before optimization (dirty %d,%d,%d,%d):\n",
dirtyRect.x, dirtyRect.y, dirtyRect.width, dirtyRect.height);
nsIFrameDebug::PrintDisplayList(&builder, list);
nsFrame::PrintDisplayList(&builder, list);
}
#endif
@ -1124,7 +1124,7 @@ nsLayoutUtils::PaintFrame(nsIRenderingContext* aRenderingContext, nsIFrame* aFra
#ifdef DEBUG
if (gDumpPaintList) {
fprintf(stderr, "Painting --- after optimization:\n");
nsIFrameDebug::PrintDisplayList(&builder, list);
nsFrame::PrintDisplayList(&builder, list);
}
#endif
@ -1279,7 +1279,7 @@ nsLayoutUtils::ComputeRepaintRegionForCopy(nsIFrame* aRootFrame,
fprintf(stderr,
"Repaint region for copy --- before optimization (area %d,%d,%d,%d, frame %p):\n",
rect.x, rect.y, rect.width, rect.height, (void*)aMovingFrame);
nsIFrameDebug::PrintDisplayList(&builder, list);
nsFrame::PrintDisplayList(&builder, list);
}
#endif
@ -1292,7 +1292,7 @@ nsLayoutUtils::ComputeRepaintRegionForCopy(nsIFrame* aRootFrame,
#ifdef DEBUG
if (gDumpRepaintRegionForCopy) {
fprintf(stderr, "Repaint region for copy --- after optimization:\n");
nsIFrameDebug::PrintDisplayList(&builder, list);
nsFrame::PrintDisplayList(&builder, list);
}
#endif

Просмотреть файл

@ -2299,7 +2299,7 @@ nsRootPresContext::GetPluginGeometryUpdates(nsIFrame* aChangedSubtree,
if (gDumpPluginList) {
fprintf(stderr, "Plugins --- before optimization (bounds %d,%d,%d,%d):\n",
bounds.x, bounds.y, bounds.width, bounds.height);
nsIFrameDebug::PrintDisplayList(&builder, list);
nsFrame::PrintDisplayList(&builder, list);
}
#endif
@ -2309,7 +2309,7 @@ nsRootPresContext::GetPluginGeometryUpdates(nsIFrame* aChangedSubtree,
#ifdef DEBUG
if (gDumpPluginList) {
fprintf(stderr, "Plugins --- after optimization:\n");
nsIFrameDebug::PrintDisplayList(&builder, list);
nsFrame::PrintDisplayList(&builder, list);
}
#endif

Просмотреть файл

@ -131,9 +131,6 @@
#include "nsLayoutErrors.h"
#include "nsLayoutUtils.h"
#include "nsCSSRendering.h"
#ifdef NS_DEBUG
#include "nsIFrameDebug.h"
#endif
// for |#ifdef DEBUG| code
#include "prenv.h"
#include "nsIAttribute.h"
@ -1455,7 +1452,7 @@ PRLogModuleInfo* PresShell::gLog;
static void
VerifyStyleTree(nsPresContext* aPresContext, nsFrameManager* aFrameManager)
{
if (nsIFrameDebug::GetVerifyStyleTreeEnable()) {
if (nsFrame::GetVerifyStyleTreeEnable()) {
nsIFrame* rootFrame = aFrameManager->GetRootFrame();
aFrameManager->DebugVerifyStyleTree(rootFrame);
}
@ -6142,7 +6139,7 @@ PresShell::HandleEvent(nsIView *aView,
void
PresShell::ShowEventTargetDebug()
{
if (nsIFrameDebug::GetShowEventTargetFrameBorder() &&
if (nsFrame::GetShowEventTargetFrameBorder() &&
GetCurrentEventFrame()) {
if (mDrawEventTargetFrame) {
mDrawEventTargetFrame->Invalidate(
@ -7494,37 +7491,22 @@ static NS_DEFINE_CID(kWidgetCID, NS_CHILD_CID);
static void
LogVerifyMessage(nsIFrame* k1, nsIFrame* k2, const char* aMsg)
{
printf("verifyreflow: ");
nsAutoString name;
if (nsnull != k1) {
nsIFrameDebug *frameDebug = do_QueryFrame(k1);
if (frameDebug) {
frameDebug->GetFrameName(name);
nsAutoString n1, n2;
if (k1) {
k1->GetFrameName(n1);
} else {
n1.Assign(NS_LITERAL_STRING("(null)"));
}
}
else {
name.Assign(NS_LITERAL_STRING("(null)"));
}
fputs(NS_LossyConvertUTF16toASCII(name).get(), stdout);
fprintf(stdout, " %p ", (void*)k1);
printf(" != ");
if (nsnull != k2) {
nsIFrameDebug *frameDebug = do_QueryFrame(k2);
if (frameDebug) {
frameDebug->GetFrameName(name);
if (k2) {
k2->GetFrameName(n2);
} else {
n2.Assign(NS_LITERAL_STRING("(null)"));
}
}
else {
name.Assign(NS_LITERAL_STRING("(null)"));
}
fputs(NS_LossyConvertUTF16toASCII(name).get(), stdout);
fprintf(stdout, " %p ", (void*)k2);
printf(" %s", aMsg);
printf("verifyreflow: %s %p != %s %p %s\n",
NS_LossyConvertUTF16toASCII(n1).get(), (void*)k1,
NS_LossyConvertUTF16toASCII(n2).get(), (void*)k2, aMsg);
}
static void
@ -7533,27 +7515,19 @@ LogVerifyMessage(nsIFrame* k1, nsIFrame* k2, const char* aMsg,
{
printf("VerifyReflow Error:\n");
nsAutoString name;
nsIFrameDebug *frameDebug = do_QueryFrame(k1);
if (frameDebug) {
fprintf(stdout, " ");
frameDebug->GetFrameName(name);
fputs(NS_LossyConvertUTF16toASCII(name).get(), stdout);
fprintf(stdout, " %p ", (void*)k1);
if (k1) {
k1->GetFrameName(name);
printf(" %s %p ", NS_LossyConvertUTF16toASCII(name).get(), (void*)k1);
}
printf("{%d, %d, %d, %d}", r1.x, r1.y, r1.width, r1.height);
printf("{%d, %d, %d, %d} != \n", r1.x, r1.y, r1.width, r1.height);
printf(" != \n");
frameDebug = do_QueryFrame(k2);
if (frameDebug) {
fprintf(stdout, " ");
frameDebug->GetFrameName(name);
fputs(NS_LossyConvertUTF16toASCII(name).get(), stdout);
fprintf(stdout, " %p ", (void*)k2);
if (k2) {
k2->GetFrameName(name);
printf(" %s %p ", NS_LossyConvertUTF16toASCII(name).get(), (void*)k2);
}
printf("{%d, %d, %d, %d}\n", r2.x, r2.y, r2.width, r2.height);
printf(" %s\n", aMsg);
printf("{%d, %d, %d, %d}\n %s\n",
r2.x, r2.y, r2.width, r2.height, aMsg);
}
static void
@ -7562,27 +7536,19 @@ LogVerifyMessage(nsIFrame* k1, nsIFrame* k2, const char* aMsg,
{
printf("VerifyReflow Error:\n");
nsAutoString name;
nsIFrameDebug *frameDebug = do_QueryFrame(k1);
if (frameDebug) {
fprintf(stdout, " ");
frameDebug->GetFrameName(name);
fputs(NS_LossyConvertUTF16toASCII(name).get(), stdout);
fprintf(stdout, " %p ", (void*)k1);
if (k1) {
k1->GetFrameName(name);
printf(" %s %p ", NS_LossyConvertUTF16toASCII(name).get(), (void*)k1);
}
printf("{%d, %d, %d, %d}", r1.x, r1.y, r1.width, r1.height);
printf("{%d, %d, %d, %d} != \n", r1.x, r1.y, r1.width, r1.height);
printf(" != \n");
frameDebug = do_QueryFrame(k2);
if (frameDebug) {
fprintf(stdout, " ");
frameDebug->GetFrameName(name);
fputs(NS_LossyConvertUTF16toASCII(name).get(), stdout);
fprintf(stdout, " %p ", (void*)k2);
if (k2) {
k2->GetFrameName(name);
printf(" %s %p ", NS_LossyConvertUTF16toASCII(name).get(), (void*)k2);
}
printf("{%d, %d, %d, %d}\n", r2.x, r2.y, r2.width, r2.height);
printf(" %s\n", aMsg);
printf("{%d, %d, %d, %d}\n %s\n",
r2.x, r2.y, r2.width, r2.height, aMsg);
}
static PRBool
@ -7935,15 +7901,9 @@ PresShell::VerifyIncrementalReflow()
PRBool ok = CompareTrees(mPresContext, root1, cx, root2);
if (!ok && (VERIFY_REFLOW_NOISY & gVerifyReflowFlags)) {
printf("Verify reflow failed, primary tree:\n");
nsIFrameDebug* frameDebug = do_QueryFrame(root1);
if (frameDebug) {
frameDebug->List(stdout, 0);
}
root1->List(stdout, 0);
printf("Verification tree:\n");
frameDebug = do_QueryFrame(root2);
if (frameDebug) {
frameDebug->List(stdout, 0);
}
root2->List(stdout, 0);
}
#ifdef DEBUG_Eli

Просмотреть файл

@ -130,7 +130,6 @@ public:
PRUint32 aFlags);
#ifdef DEBUG
// nsIFrameDebug
NS_IMETHOD GetFrameName(nsAString& aResult) const;
#endif

Просмотреть файл

@ -90,7 +90,6 @@ EXPORTS = \
nsIAnonymousContentCreator.h \
nsICanvasFrame.h \
nsIFrame.h \
nsIFrameDebug.h \
nsIFrameFrame.h \
nsIFrameUtil.h \
nsIImageFrame.h \

Просмотреть файл

@ -403,14 +403,11 @@ nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame* aDelegat
if (nsBlockFrame::gNoisyReflow) {
nsFrame::IndentBy(stdout,nsBlockFrame::gNoiseIndent);
printf("abs pos ");
if (nsnull != aKidFrame) {
nsIFrameDebug *frameDebug = do_QueryFrame(aKidFrame);
if (frameDebug) {
if (aKidFrame) {
nsAutoString name;
frameDebug->GetFrameName(name);
aKidFrame->GetFrameName(name);
printf("%s ", NS_LossyConvertUTF16toASCII(name).get());
}
}
char width[16];
char height[16];
@ -547,16 +544,13 @@ nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame* aDelegat
if (nsBlockFrame::gNoisyReflow) {
nsFrame::IndentBy(stdout,nsBlockFrame::gNoiseIndent - 1);
printf("abs pos ");
if (nsnull != aKidFrame) {
nsIFrameDebug *frameDebug = do_QueryFrame(aKidFrame);
if (frameDebug) {
if (aKidFrame) {
nsAutoString name;
frameDebug->GetFrameName(name);
aKidFrame->GetFrameName(name);
printf("%s ", NS_LossyConvertUTF16toASCII(name).get());
}
}
printf("%p rect=%d,%d,%d,%d", aKidFrame, rect.x, rect.y, rect.width, rect.height);
printf("\n");
printf("%p rect=%d,%d,%d,%d\n", (void*)aKidFrame,
rect.x, rect.y, rect.width, rect.height);
}
#endif

Просмотреть файл

@ -439,10 +439,7 @@ nsBlockFrame::List(FILE* out, PRInt32 aIndent) const
}
fputs("<\n", out);
while (kid) {
nsIFrameDebug *frameDebug = do_QueryFrame(kid);
if (frameDebug) {
frameDebug->List(out, aIndent + 1);
}
kid->List(out, aIndent + 1);
kid = kid->GetNextSibling();
}
IndentBy(out, aIndent);
@ -6845,7 +6842,7 @@ nsBlockFrame::CheckFloats(nsBlockReflowState& aState)
if ((!equal || lineFloats.Length() != storedFloats.Length()) && !anyLineDirty) {
NS_WARNING("nsBlockFrame::CheckFloats: Explicit float list is out of sync with float cache");
#if defined(DEBUG_roc)
nsIFrameDebug::RootFrameList(PresContext(), stdout, 0);
nsFrame::RootFrameList(PresContext(), stdout, 0);
for (i = 0; i < lineFloats.Length(); ++i) {
printf("Line float: %p\n", lineFloats.ElementAt(i));
}

Просмотреть файл

@ -1629,10 +1629,7 @@ nsContainerFrame::List(FILE* out, PRInt32 aIndent) const
NS_ASSERTION(kid->GetParent() == (nsIFrame*)this, "bad parent frame pointer");
// Have the child frame list
nsIFrameDebug *frameDebug = do_QueryFrame(kid);
if (frameDebug) {
frameDebug->List(out, aIndent + 1);
}
kid->List(out, aIndent + 1);
kid = kid->GetNextSibling();
}
IndentBy(out, aIndent);

Просмотреть файл

@ -168,29 +168,29 @@ static void RefreshContentFrames(nsPresContext* aPresContext, nsIContent * aStar
#include "prenv.h"
// start nsIFrameDebug
// Formerly the nsIFrameDebug interface
#ifdef NS_DEBUG
static PRBool gShowFrameBorders = PR_FALSE;
void nsIFrameDebug::ShowFrameBorders(PRBool aEnable)
void nsFrame::ShowFrameBorders(PRBool aEnable)
{
gShowFrameBorders = aEnable;
}
PRBool nsIFrameDebug::GetShowFrameBorders()
PRBool nsFrame::GetShowFrameBorders()
{
return gShowFrameBorders;
}
static PRBool gShowEventTargetFrameBorder = PR_FALSE;
void nsIFrameDebug::ShowEventTargetFrameBorder(PRBool aEnable)
void nsFrame::ShowEventTargetFrameBorder(PRBool aEnable)
{
gShowEventTargetFrameBorder = aEnable;
}
PRBool nsIFrameDebug::GetShowEventTargetFrameBorder()
PRBool nsFrame::GetShowEventTargetFrameBorder()
{
return gShowEventTargetFrameBorder;
}
@ -206,7 +206,7 @@ static PRLogModuleInfo* gStyleVerifyTreeLogModuleInfo;
static PRBool gStyleVerifyTreeEnable = PRBool(0x55);
PRBool
nsIFrameDebug::GetVerifyStyleTreeEnable()
nsFrame::GetVerifyStyleTreeEnable()
{
if (gStyleVerifyTreeEnable == PRBool(0x55)) {
if (nsnull == gStyleVerifyTreeLogModuleInfo) {
@ -218,13 +218,13 @@ nsIFrameDebug::GetVerifyStyleTreeEnable()
}
void
nsIFrameDebug::SetVerifyStyleTreeEnable(PRBool aEnabled)
nsFrame::SetVerifyStyleTreeEnable(PRBool aEnabled)
{
gStyleVerifyTreeEnable = aEnabled;
}
PRLogModuleInfo*
nsIFrameDebug::GetLogModuleInfo()
nsFrame::GetLogModuleInfo()
{
if (nsnull == gLogModule) {
gLogModule = PR_NewLogModule("frame");
@ -233,29 +233,26 @@ nsIFrameDebug::GetLogModuleInfo()
}
void
nsIFrameDebug::DumpFrameTree(nsIFrame* aFrame)
nsFrame::DumpFrameTree(nsIFrame* aFrame)
{
RootFrameList(aFrame->PresContext(), stdout, 0);
}
void
nsIFrameDebug::RootFrameList(nsPresContext* aPresContext, FILE* out, PRInt32 aIndent)
nsFrame::RootFrameList(nsPresContext* aPresContext, FILE* out, PRInt32 aIndent)
{
if((nsnull == aPresContext) || (nsnull == out))
if (!aPresContext || !out)
return;
nsIPresShell *shell = aPresContext->GetPresShell();
if (nsnull != shell) {
if (shell) {
nsIFrame* frame = shell->FrameManager()->GetRootFrame();
if(nsnull != frame) {
nsIFrameDebug* debugFrame = do_QueryFrame(frame);
if (debugFrame)
debugFrame->List(out, aIndent);
if(frame) {
frame->List(out, aIndent);
}
}
}
#endif
// end nsIFrameDebug
void
NS_MergeReflowStatusInto(nsReflowStatus* aPrimary, nsReflowStatus aSecondary)
@ -334,9 +331,6 @@ nsFrame::~nsFrame()
NS_QUERYFRAME_HEAD(nsFrame)
NS_QUERYFRAME_ENTRY(nsIFrame)
#ifdef DEBUG
NS_QUERYFRAME_ENTRY(nsIFrameDebug)
#endif
NS_QUERYFRAME_TAIL
/////////////////////////////////////////////////////////////////////////////
@ -1212,12 +1206,12 @@ DisplayDebugBorders(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
const nsDisplayListSet& aLists) {
// Draw a border around the child
// REVIEW: From nsContainerFrame::PaintChild
if (nsIFrameDebug::GetShowFrameBorders() && !aFrame->GetRect().IsEmpty()) {
if (nsFrame::GetShowFrameBorders() && !aFrame->GetRect().IsEmpty()) {
aLists.Outlines()->AppendNewToTop(new (aBuilder)
nsDisplayGeneric(aFrame, PaintDebugBorder, "DebugBorder"));
}
// Draw a border around the current event target
if (nsIFrameDebug::GetShowEventTargetFrameBorder() &&
if (nsFrame::GetShowEventTargetFrameBorder() &&
aFrame->PresContext()->PresShell()->GetDrawEventTargetFrame() == aFrame) {
aLists.Outlines()->AppendNewToTop(new (aBuilder)
nsDisplayGeneric(aFrame, PaintEventTargetBorder, "EventTargetBorder"));
@ -4391,10 +4385,7 @@ nsFrame::DumpBaseRegressionData(nsPresContext* aPresContext, FILE* out, PRInt32
}
aIndent++;
while (kid) {
nsIFrameDebug* frameDebug = do_QueryFrame(kid);
if (kid) {
frameDebug->DumpRegressionData(aPresContext, out, aIndent);
}
kid->DumpRegressionData(aPresContext, out, aIndent);
kid = kid->GetNextSibling();
}
aIndent--;
@ -6742,13 +6733,7 @@ nsAdaptorPrintReason(nsHTMLReflowState& aReflowState)
void
nsFrame::GetBoxName(nsAutoString& aName)
{
nsIFrameDebug* frameDebug;
nsAutoString name;
if (NS_SUCCEEDED(QueryInterface(NS_GET_IID(nsIFrameDebug), (void**)&frameDebug))) {
frameDebug->GetFrameName(name);
}
aName = name;
GetFrameName(aName);
}
#endif
@ -7288,10 +7273,9 @@ void DR_State::DisplayFrameTypeInfo(nsIFrame* aFrame,
printf(" ");
}
if(!strcmp(frameTypeInfo->mNameAbbrev, "unknown")) {
if (aFrame) {
nsAutoString name;
nsIFrameDebug* frameDebug = do_QueryFrame(aFrame);
if (frameDebug) {
frameDebug->GetFrameName(name);
aFrame->GetFrameName(name);
printf("%s %p ", NS_LossyConvertUTF16toASCII(name).get(), (void*)aFrame);
}
else {

Просмотреть файл

@ -45,9 +45,6 @@
#include "nsRect.h"
#include "nsString.h"
#include "prlog.h"
#ifdef NS_DEBUG
#include "nsIFrameDebug.h"
#endif
#include "nsIPresShell.h"
#include "nsFrameSelection.h"
@ -70,7 +67,7 @@
#ifdef NS_DEBUG
#define NS_FRAME_LOG(_bit,_args) \
PR_BEGIN_MACRO \
if (NS_FRAME_LOG_TEST(nsIFrameDebug::GetLogModuleInfo(),_bit)) { \
if (NS_FRAME_LOG_TEST(nsFrame::GetLogModuleInfo(),_bit)) { \
PR_LogPrint _args; \
} \
PR_END_MACRO
@ -87,14 +84,14 @@
// XXX remove me
#define NS_FRAME_TRACE_MSG(_bit,_args) \
PR_BEGIN_MACRO \
if (NS_FRAME_LOG_TEST(nsIFrameDebug::GetLogModuleInfo(),_bit)) { \
if (NS_FRAME_LOG_TEST(nsFrame::GetLogModuleInfo(),_bit)) { \
TraceMsg _args; \
} \
PR_END_MACRO
#define NS_FRAME_TRACE(_bit,_args) \
PR_BEGIN_MACRO \
if (NS_FRAME_LOG_TEST(nsIFrameDebug::GetLogModuleInfo(),_bit)) { \
if (NS_FRAME_LOG_TEST(nsFrame::GetLogModuleInfo(),_bit)) { \
TraceMsg _args; \
} \
PR_END_MACRO
@ -125,9 +122,6 @@ struct nsBoxLayoutMetrics;
* behavior is to keep the frame and view position and size in sync.
*/
class nsFrame : public nsBox
#ifdef NS_DEBUG
, public nsIFrameDebug
#endif
{
public:
/**
@ -232,12 +226,6 @@ public:
NS_IMETHOD GetOffsetFromView(nsPoint& aOffset, nsIView** aView) const;
virtual nsIAtom* GetType() const;
virtual PRBool IsContainingBlock() const;
#ifdef NS_DEBUG
NS_IMETHOD List(FILE* out, PRInt32 aIndent) const;
NS_IMETHOD GetFrameName(nsAString& aResult) const;
NS_IMETHOD_(nsFrameState) GetDebugStateBits() const;
NS_IMETHOD DumpRegressionData(nsPresContext* aPresContext, FILE* out, PRInt32 aIndent);
#endif
NS_IMETHOD GetSelected(PRBool *aSelected) const;
NS_IMETHOD IsSelectable(PRBool* aIsSelectable, PRUint8* aSelectStyle) const;
@ -445,17 +433,14 @@ public:
}
void ListTag(FILE* out) const {
ListTag(out, (nsIFrame*)this);
ListTag(out, this);
}
static void ListTag(FILE* out, nsIFrame* aFrame) {
static void ListTag(FILE* out, const nsIFrame* aFrame) {
nsAutoString tmp;
nsIFrameDebug* frameDebug = do_QueryFrame(aFrame);
if (frameDebug) {
frameDebug->GetFrameName(tmp);
}
aFrame->GetFrameName(tmp);
fputs(NS_LossyConvertUTF16toASCII(tmp).get(), out);
fprintf(out, "@%p", static_cast<void*>(aFrame));
fprintf(out, "@%p", static_cast<const void*>(aFrame));
}
static void XMLQuote(nsString& aString);
@ -631,6 +616,76 @@ private:
NS_IMETHODIMP RefreshSizeCache(nsBoxLayoutState& aState);
virtual nsILineIterator* GetLineIterator();
#ifdef NS_DEBUG
public:
// Formerly the nsIFrameDebug interface
NS_IMETHOD List(FILE* out, PRInt32 aIndent) const;
/**
* lists the frames beginning from the root frame
* - calls root frame's List(...)
*/
static void RootFrameList(nsPresContext* aPresContext,
FILE* out, PRInt32 aIndent);
static void DumpFrameTree(nsIFrame* aFrame);
/**
* Get a printable from of the name of the frame type.
* XXX This should be eliminated and we use GetType() instead...
*/
NS_IMETHOD GetFrameName(nsAString& aResult) const;
/**
* Return the state bits that are relevant to regression tests (that
* is, those bits which indicate a real difference when they differ
*/
NS_IMETHOD_(nsFrameState) GetDebugStateBits() const;
/**
* Called to dump out regression data that describes the layout
* of the frame and its children, and so on. The format of the
* data is dictated to be XML (using a specific DTD); the
* specific kind of data dumped is up to the frame itself, with
* the caveat that some base types are defined.
* For more information, see XXX.
*/
NS_IMETHOD DumpRegressionData(nsPresContext* aPresContext,
FILE* out, PRInt32 aIndent);
/**
* See if style tree verification is enabled. To enable style tree
* verification add "styleverifytree:1" to your NSPR_LOG_MODULES
* environment variable (any non-zero debug level will work). Or,
* call SetVerifyStyleTreeEnable with PR_TRUE.
*/
static PRBool GetVerifyStyleTreeEnable();
/**
* Set the verify-style-tree enable flag.
*/
static void SetVerifyStyleTreeEnable(PRBool aEnabled);
/**
* The frame class and related classes share an nspr log module
* for logging frame activity.
*
* Note: the log module is created during library initialization which
* means that you cannot perform logging before then.
*/
static PRLogModuleInfo* GetLogModuleInfo();
// Show frame borders when rendering
static void ShowFrameBorders(PRBool aEnable);
static PRBool GetShowFrameBorders();
// Show frame border of event target
static void ShowEventTargetFrameBorder(PRBool aEnable);
static PRBool GetShowEventTargetFrameBorder();
static void PrintDisplayList(nsDisplayListBuilder* aBuilder,
const nsDisplayList& aList);
#endif
};
// Start Display Reflow Debugging

Просмотреть файл

@ -40,9 +40,6 @@
#include "nsFrameList.h"
#include "nsIFrame.h"
#ifdef DEBUG
#include "nsIFrameDebug.h"
#endif
#include "nsLayoutUtils.h"
#ifdef IBMBIDI
@ -424,10 +421,7 @@ nsFrameList::List(FILE* out) const
fputs("<\n", out);
for (nsIFrame* frame = mFirstChild; frame;
frame = frame->GetNextSibling()) {
nsIFrameDebug *frameDebug = do_QueryFrame(frame);
if (frameDebug) {
frameDebug->List(out, 1);
}
frame->List(out, 1);
}
fputs(">\n", out);
}

Просмотреть файл

@ -935,9 +935,6 @@ NS_QUERYFRAME_HEAD(nsHTMLScrollFrame)
NS_QUERYFRAME_ENTRY(nsIScrollableFrame)
NS_QUERYFRAME_ENTRY(nsIScrollableViewProvider)
NS_QUERYFRAME_ENTRY(nsIStatefulFrame)
#ifdef DEBUG
NS_QUERYFRAME_ENTRY(nsIFrameDebug)
#endif
NS_QUERYFRAME_TAIL_INHERITING(nsHTMLContainerFrame)
//----------nsXULScrollFrame-------------------------------------------
@ -1278,9 +1275,6 @@ NS_QUERYFRAME_HEAD(nsXULScrollFrame)
NS_QUERYFRAME_ENTRY(nsIScrollableFrame)
NS_QUERYFRAME_ENTRY(nsIScrollableViewProvider)
NS_QUERYFRAME_ENTRY(nsIStatefulFrame)
#ifdef DEBUG
NS_QUERYFRAME_ENTRY(nsIFrameDebug)
#endif
NS_QUERYFRAME_TAIL_INHERITING(nsBoxFrame)
//-------------------- Inner ----------------------

Просмотреть файл

@ -2467,6 +2467,16 @@ protected:
private:
nsRect* GetOverflowAreaProperty(PRBool aCreateIfNecessary = PR_FALSE);
void SetOverflowRect(const nsRect& aRect);
#ifdef NS_DEBUG
public:
// Formerly nsIFrameDebug
NS_IMETHOD List(FILE* out, PRInt32 aIndent) const = 0;
NS_IMETHOD GetFrameName(nsAString& aResult) const = 0;
NS_IMETHOD_(nsFrameState) GetDebugStateBits() const = 0;
NS_IMETHOD DumpRegressionData(nsPresContext* aPresContext,
FILE* out, PRInt32 aIndent) = 0;
#endif
};
//----------------------------------------------------------------------

Просмотреть файл

@ -1,116 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/* debugging interface for all rendering objects */
#ifndef nsIFrameDebug_h___
#define nsIFrameDebug_h___
#include "nsIFrame.h"
class nsPresContext;
struct PRLogModuleInfo;
/**
* Debug related functions
*/
class nsIFrameDebug {
public:
NS_DECLARE_FRAME_ACCESSOR(nsIFrameDebug)
NS_IMETHOD List(FILE* out, PRInt32 aIndent) const = 0;
/**
* lists the frames beginning from the root frame
* - calls root frame's List(...)
*/
static void RootFrameList(nsPresContext* aPresContext, FILE* out, PRInt32 aIndent);
static void DumpFrameTree(nsIFrame* aFrame);
/**
* Get a printable from of the name of the frame type.
* XXX This should be eliminated and we use GetType() instead...
*/
NS_IMETHOD GetFrameName(nsAString& aResult) const = 0;
/**
* Return the state bits that are relevant to regression tests (that is, those bits which indicate a real difference when they differ
*/
NS_IMETHOD_(nsFrameState) GetDebugStateBits() const = 0;
/**
* Called to dump out regression data that describes the layout
* of the frame and its children, and so on. The format of the
* data is dictated to be XML (using a specific DTD); the
* specific kind of data dumped is up to the frame itself, with
* the caveat that some base types are defined.
* For more information, see XXX.
*/
NS_IMETHOD DumpRegressionData(nsPresContext* aPresContext, FILE* out, PRInt32 aIndent) = 0;
/**
* See if style tree verification is enabled. To enable style tree
* verification add "styleverifytree:1" to your NSPR_LOG_MODULES
* environment variable (any non-zero debug level will work). Or,
* call SetVerifyStyleTreeEnable with PR_TRUE.
*/
static PRBool GetVerifyStyleTreeEnable();
/**
* Set the verify-style-tree enable flag.
*/
static void SetVerifyStyleTreeEnable(PRBool aEnabled);
/**
* The frame class and related classes share an nspr log module
* for logging frame activity.
*
* Note: the log module is created during library initialization which
* means that you cannot perform logging before then.
*/
static PRLogModuleInfo* GetLogModuleInfo();
// Show frame borders when rendering
static void ShowFrameBorders(PRBool aEnable);
static PRBool GetShowFrameBorders();
// Show frame border of event target
static void ShowEventTargetFrameBorder(PRBool aEnable);
static PRBool GetShowEventTargetFrameBorder();
static void PrintDisplayList(nsDisplayListBuilder* aBuilder, const nsDisplayList& aList);
};
#endif /* nsIFrameDebug_h___ */

Просмотреть файл

@ -137,7 +137,6 @@ nsLineBox::Cleanup()
static void
ListFloats(FILE* out, PRInt32 aIndent, const nsFloatCacheList& aFloats)
{
nsAutoString frameName;
nsFloatCache* fc = aFloats.Head();
while (fc) {
nsFrame::IndentBy(out, aIndent);
@ -146,12 +145,10 @@ ListFloats(FILE* out, PRInt32 aIndent, const nsFloatCacheList& aFloats)
fprintf(out, "placeholder@%p ", static_cast<void*>(ph));
nsIFrame* frame = ph->GetOutOfFlowFrame();
if (frame) {
nsIFrameDebug* frameDebug = do_QueryFrame(frame);
if (frameDebug) {
frameDebug->GetFrameName(frameName);
nsAutoString frameName;
frame->GetFrameName(frameName);
fputs(NS_LossyConvertUTF16toASCII(frameName).get(), out);
}
}
if (!frame) {
fputs("\n###!!! NULL out-of-flow frame", out);
@ -222,10 +219,7 @@ nsLineBox::List(FILE* out, PRInt32 aIndent) const
nsIFrame* frame = mFirstChild;
PRInt32 n = GetChildCount();
while (--n >= 0) {
nsIFrameDebug* frameDebug = do_QueryFrame(frame);
if (frameDebug) {
frameDebug->List(out, aIndent + 1);
}
frame->List(out, aIndent + 1);
frame = frame->GetNextSibling();
}

Просмотреть файл

@ -106,7 +106,6 @@ public:
nsIComboboxControlFrame_id,
nsIFormControlFrame_id,
nsIFrame_id,
nsIFrameDebug_id,
nsIFrameFrame_id,
nsIImageFrame_id,
nsIListControlFrame_id,

Просмотреть файл

@ -81,9 +81,6 @@ nsVideoFrame::~nsVideoFrame()
NS_QUERYFRAME_HEAD(nsVideoFrame)
NS_QUERYFRAME_ENTRY(nsIAnonymousContentCreator)
#ifdef DEBUG
NS_QUERYFRAME_ENTRY(nsIFrameDebug)
#endif
NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)
nsresult

Просмотреть файл

@ -340,9 +340,7 @@ ListMathMLTree(nsIFrame* atLeast)
break;
}
if (!f) f = atLeast;
nsIFrameDebug* fdbg;
CallQueryInterface(f, &fdbg);
fdbg->List(stdout, 0);
f->List(stdout, 0);
}
#endif

Просмотреть файл

@ -143,7 +143,6 @@ static const char kPrintingPromptService[] = "@mozilla.org/embedcomp/printingpro
#include "nsIWebBrowserChrome.h"
#include "nsIDocShell.h"
#include "nsIBaseWindow.h"
#include "nsIFrameDebug.h"
#include "nsILayoutHistoryState.h"
#include "nsFrameManager.h"
#include "nsIParser.h"
@ -2176,10 +2175,7 @@ nsPrintEngine::DoPrint(nsPrintObject * aPO)
#ifdef NS_DEBUG
// output the regression test
nsIFrame* root = poPresShell->FrameManager()->GetRootFrame();
nsIFrameDebug* fdbg = do_QueryFrame(root);
if (fdbg) {
fdbg->DumpRegressionData(poPresContext, mPrt->mDebugFilePtr, 0);
}
root->DumpRegressionData(poPresContext, mPrt->mDebugFilePtr, 0);
fclose(mPrt->mDebugFilePtr);
SetIsPrinting(PR_FALSE);
#endif
@ -3338,9 +3334,7 @@ static void RootFrameList(nsPresContext* aPresContext, FILE* out, PRInt32 aInden
if (shell) {
nsIFrame* frame = shell->FrameManager()->GetRootFrame();
if (frame) {
nsIFrameDebug* debugFrame = do_QueryFrame(frame);
if (debugFrame)
debugFrame->List(aPresContext, out, aIndent);
frame->List(aPresContext, out, aIndent);
}
}
}
@ -3365,11 +3359,7 @@ static void DumpFrames(FILE* out,
fprintf(out, " ");
}
nsAutoString tmp;
nsIFrameDebug* frameDebug = do_QueryFrame(child);
if (frameDebug) {
frameDebug->GetFrameName(tmp);
}
child->GetFrameName(tmp);
fputs(NS_LossyConvertUTF16toASCII(tmp).get(), out);
PRBool isSelected;
if (NS_SUCCEEDED(child->IsVisibleForPainting(aPresContext, *aRendContext, PR_TRUE, &isSelected))) {

Просмотреть файл

@ -71,7 +71,6 @@ public:
PRInt32 aModType);
#ifdef DEBUG
// nsIFrameDebug interface:
NS_IMETHOD GetFrameName(nsAString& aResult) const
{
return MakeFrameName(NS_LITERAL_STRING("SVGGradient"), aResult);
@ -168,7 +167,6 @@ public:
PRInt32 aModType);
#ifdef DEBUG
// nsIFrameDebug interface:
NS_IMETHOD GetFrameName(nsAString& aResult) const
{
return MakeFrameName(NS_LITERAL_STRING("SVGLinearGradient"), aResult);
@ -209,7 +207,6 @@ public:
PRInt32 aModType);
#ifdef DEBUG
// nsIFrameDebug interface:
NS_IMETHOD GetFrameName(nsAString& aResult) const
{
return MakeFrameName(NS_LITERAL_STRING("SVGRadialGradient"), aResult);

Просмотреть файл

@ -99,7 +99,6 @@ public:
virtual nsIAtom* GetType() const;
#ifdef DEBUG
// nsIFrameDebug interface:
NS_IMETHOD GetFrameName(nsAString& aResult) const
{
return MakeFrameName(NS_LITERAL_STRING("SVGPattern"), aResult);

Просмотреть файл

@ -82,7 +82,6 @@ public:
}
#ifdef DEBUG
// nsIFrameDebug interface:
NS_IMETHOD GetFrameName(nsAString& aResult) const
{
return MakeFrameName(NS_LITERAL_STRING("SVGStop"), aResult);

Просмотреть файл

@ -366,10 +366,7 @@ nsPopupSetFrame::List(FILE* out, PRInt32 aIndent) const
NS_ASSERTION(kid->GetParent() == (nsIFrame*)this, "bad parent frame pointer");
// Have the child frame list
nsIFrameDebug* frameDebug = do_QueryFrame(kid);
if (frameDebug) {
frameDebug->List(out, aIndent + 1);
}
kid->List(out, aIndent + 1);
kid = kid->GetNextSibling();
}
IndentBy(out, aIndent);
@ -393,10 +390,7 @@ nsPopupSetFrame::List(FILE* out, PRInt32 aIndent) const
fputs(" <\n", out);
++aIndent;
for (nsPopupFrameList* l = mPopupList; l; l = l->mNextPopup) {
nsIFrameDebug* frameDebug = do_QueryFrame(l->mPopupFrame);
if (frameDebug) {
frameDebug->List(out, aIndent);
}
l->mPopupFrame->List(out, aIndent);
}
--aIndent;
IndentBy(out, aIndent);