mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
Moved a bunch of stuff out to a nsIFrameDebug interface
This commit is contained in:
parent
45efd8fe95
commit
1585a751fb
@ -819,8 +819,12 @@ DumpContext(nsIFrame* aFrame, nsIStyleContext* aContext)
|
||||
if (aFrame) {
|
||||
fputs("frame: ", stdout);
|
||||
nsAutoString name;
|
||||
aFrame->GetFrameName(name);
|
||||
fputs(name, stdout);
|
||||
nsIFrameDebug* frameDebug;
|
||||
|
||||
if (NS_SUCCEEDED(aFrame->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) {
|
||||
frameDebug->GetFrameName(name);
|
||||
fputs(name, stdout);
|
||||
}
|
||||
fprintf(stdout, " (%p)", aFrame);
|
||||
}
|
||||
if (aContext) {
|
||||
|
@ -18,9 +18,11 @@
|
||||
*/
|
||||
#include "nsILayoutDebugger.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsIFrameDebug.h"
|
||||
|
||||
static NS_DEFINE_IID(kILayoutDebuggerIID, NS_ILAYOUT_DEBUGGER_IID);
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
class nsLayoutDebugger : public nsILayoutDebugger {
|
||||
public:
|
||||
nsLayoutDebugger();
|
||||
@ -71,14 +73,14 @@ NS_IMPL_ISUPPORTS(nsLayoutDebugger, kILayoutDebuggerIID);
|
||||
NS_IMETHODIMP
|
||||
nsLayoutDebugger::SetShowFrameBorders(PRBool aEnable)
|
||||
{
|
||||
nsIFrame::ShowFrameBorders(aEnable);
|
||||
nsIFrameDebug::ShowFrameBorders(aEnable);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLayoutDebugger::GetShowFrameBorders(PRBool* aResult)
|
||||
{
|
||||
*aResult = nsIFrame::GetShowFrameBorders();
|
||||
*aResult = nsIFrameDebug::GetShowFrameBorders();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -105,3 +107,4 @@ nsLayoutDebugger::GetStyleSize(nsIPresShell* aPresentation,
|
||||
*aSizeInBytesResult = 0;
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
#endif
|
||||
|
@ -69,6 +69,9 @@
|
||||
#ifdef MOZ_PERF_METRICS
|
||||
#include "nsITimeRecorder.h"
|
||||
#endif
|
||||
#ifdef NS_DEBUG
|
||||
#include "nsIFrameDebug.h"
|
||||
#endif
|
||||
|
||||
// Drag & Drop, Clipboard
|
||||
#include "nsWidgetsCID.h"
|
||||
@ -326,8 +329,9 @@ protected:
|
||||
|
||||
PRBool mCaretEnabled;
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
nsresult CloneStyleSet(nsIStyleSet* aSet, nsIStyleSet** aResult);
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
PRBool VerifyIncrementalReflow();
|
||||
PRBool mInVerifyReflow;
|
||||
#endif
|
||||
@ -380,7 +384,7 @@ private:
|
||||
static void
|
||||
VerifyStyleTree(nsIFrameManager* aFrameManager)
|
||||
{
|
||||
if (aFrameManager && nsIFrame::GetVerifyStyleTreeEnable()) {
|
||||
if (aFrameManager && nsIFrameDebug::GetVerifyStyleTreeEnable()) {
|
||||
nsIFrame* rootFrame;
|
||||
|
||||
aFrameManager->GetRootFrame(&rootFrame);
|
||||
@ -927,8 +931,12 @@ PresShell::InitialReflow(nscoord aWidth, nscoord aHeight)
|
||||
NS_FRAME_LOG(NS_FRAME_TRACE_CALLS,
|
||||
("enter nsPresShell::InitialReflow: %d,%d", aWidth, aHeight));
|
||||
#ifdef NS_DEBUG
|
||||
if (nsIFrame::GetVerifyTreeEnable()) {
|
||||
rootFrame->VerifyTree();
|
||||
if (nsIFrameDebug::GetVerifyTreeEnable()) {
|
||||
nsIFrameDebug* frameDebug;
|
||||
|
||||
if (NS_SUCCEEDED(rootFrame->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) {
|
||||
frameDebug->VerifyTree();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#ifdef DEBUG_kipp
|
||||
@ -951,8 +959,12 @@ PresShell::InitialReflow(nscoord aWidth, nscoord aHeight)
|
||||
mPresContext->SetVisibleArea(nsRect(0,0,desiredSize.width,desiredSize.height));
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
if (nsIFrame::GetVerifyTreeEnable()) {
|
||||
rootFrame->VerifyTree();
|
||||
if (nsIFrameDebug::GetVerifyTreeEnable()) {
|
||||
nsIFrameDebug* frameDebug;
|
||||
|
||||
if (NS_SUCCEEDED(rootFrame->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) {
|
||||
frameDebug->VerifyTree();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
VERIFY_STYLE_TREE;
|
||||
@ -1004,8 +1016,12 @@ PresShell::ResizeReflow(nscoord aWidth, nscoord aHeight)
|
||||
NS_FRAME_LOG(NS_FRAME_TRACE_CALLS,
|
||||
("enter nsPresShell::ResizeReflow: %d,%d", aWidth, aHeight));
|
||||
#ifdef NS_DEBUG
|
||||
if (nsIFrame::GetVerifyTreeEnable()) {
|
||||
rootFrame->VerifyTree();
|
||||
if (nsIFrameDebug::GetVerifyTreeEnable()) {
|
||||
nsIFrameDebug* frameDebug;
|
||||
|
||||
if (NS_SUCCEEDED(rootFrame->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) {
|
||||
frameDebug->VerifyTree();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#ifdef DEBUG_kipp
|
||||
@ -1026,8 +1042,12 @@ PresShell::ResizeReflow(nscoord aWidth, nscoord aHeight)
|
||||
rootFrame->Reflow(*mPresContext, desiredSize, reflowState, status);
|
||||
rootFrame->SizeTo(mPresContext, desiredSize.width, desiredSize.height);
|
||||
#ifdef NS_DEBUG
|
||||
if (nsIFrame::GetVerifyTreeEnable()) {
|
||||
rootFrame->VerifyTree();
|
||||
if (nsIFrameDebug::GetVerifyTreeEnable()) {
|
||||
nsIFrameDebug* frameDebug;
|
||||
|
||||
if (NS_SUCCEEDED(rootFrame->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) {
|
||||
frameDebug->VerifyTree();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
VERIFY_STYLE_TREE;
|
||||
@ -1183,8 +1203,12 @@ PresShell::StyleChangeReflow()
|
||||
NS_FRAME_LOG(NS_FRAME_TRACE_CALLS,
|
||||
("enter nsPresShell::StyleChangeReflow"));
|
||||
#ifdef NS_DEBUG
|
||||
if (nsIFrame::GetVerifyTreeEnable()) {
|
||||
rootFrame->VerifyTree();
|
||||
if (nsIFrameDebug::GetVerifyTreeEnable()) {
|
||||
nsIFrameDebug* frameDebug;
|
||||
|
||||
if (NS_SUCCEEDED(rootFrame->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) {
|
||||
frameDebug->VerifyTree();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
nsRect bounds;
|
||||
@ -1203,8 +1227,12 @@ PresShell::StyleChangeReflow()
|
||||
rootFrame->Reflow(*mPresContext, desiredSize, reflowState, status);
|
||||
rootFrame->SizeTo(mPresContext, desiredSize.width, desiredSize.height);
|
||||
#ifdef NS_DEBUG
|
||||
if (nsIFrame::GetVerifyTreeEnable()) {
|
||||
rootFrame->VerifyTree();
|
||||
if (nsIFrameDebug::GetVerifyTreeEnable()) {
|
||||
nsIFrameDebug* frameDebug;
|
||||
|
||||
if (NS_SUCCEEDED(rootFrame->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) {
|
||||
frameDebug->VerifyTree();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
VERIFY_STYLE_TREE;
|
||||
@ -1431,8 +1459,12 @@ PresShell::ProcessReflowCommands()
|
||||
NS_IF_RELEASE(rcx);
|
||||
|
||||
#ifdef DEBUG
|
||||
if (nsIFrame::GetVerifyTreeEnable()) {
|
||||
rootFrame->VerifyTree();
|
||||
if (nsIFrameDebug::GetVerifyTreeEnable()) {
|
||||
nsIFrameDebug* frameDebug;
|
||||
|
||||
if (NS_SUCCEEDED(rootFrame->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) {
|
||||
frameDebug->VerifyTree();
|
||||
}
|
||||
}
|
||||
if (GetVerifyReflowEnable()) {
|
||||
// First synchronously render what we have so far so that we can
|
||||
@ -2085,7 +2117,7 @@ PresShell::Paint(nsIView *aView,
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
// Draw a border around the frame
|
||||
if (nsIFrame::GetShowFrameBorders()) {
|
||||
if (nsIFrameDebug::GetShowFrameBorders()) {
|
||||
nsRect r;
|
||||
frame->GetRect(r);
|
||||
aRenderingContext.SetColor(NS_RGB(0,0,255));
|
||||
@ -2273,7 +2305,11 @@ LogVerifyMessage(nsIFrame* k1, nsIFrame* k2, const char* aMsg)
|
||||
printf("verifyreflow: ");
|
||||
nsAutoString name;
|
||||
if (nsnull != k1) {
|
||||
k1->GetFrameName(name);
|
||||
nsIFrameDebug* frameDebug;
|
||||
|
||||
if (NS_SUCCEEDED(k1->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) {
|
||||
frameDebug->GetFrameName(name);
|
||||
}
|
||||
}
|
||||
else {
|
||||
name = "(null)";
|
||||
@ -2283,7 +2319,11 @@ LogVerifyMessage(nsIFrame* k1, nsIFrame* k2, const char* aMsg)
|
||||
printf(" != ");
|
||||
|
||||
if (nsnull != k2) {
|
||||
k2->GetFrameName(name);
|
||||
nsIFrameDebug* frameDebug;
|
||||
|
||||
if (NS_SUCCEEDED(k2->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) {
|
||||
frameDebug->GetFrameName(name);
|
||||
}
|
||||
}
|
||||
else {
|
||||
name = "(null)";
|
||||
@ -2299,14 +2339,20 @@ LogVerifyMessage(nsIFrame* k1, nsIFrame* k2, const char* aMsg,
|
||||
{
|
||||
printf("verifyreflow: ");
|
||||
nsAutoString name;
|
||||
k1->GetFrameName(name);
|
||||
fputs(name, stdout);
|
||||
nsIFrameDebug* frameDebug;
|
||||
|
||||
if (NS_SUCCEEDED(k1->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) {
|
||||
frameDebug->GetFrameName(name);
|
||||
fputs(name, stdout);
|
||||
}
|
||||
printf("{%d, %d, %d, %d}", r1.x, r1.y, r1.width, r1.height);
|
||||
|
||||
printf(" != ");
|
||||
|
||||
k2->GetFrameName(name);
|
||||
fputs(name, stdout);
|
||||
if (NS_SUCCEEDED(k2->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) {
|
||||
frameDebug->GetFrameName(name);
|
||||
fputs(name, stdout);
|
||||
}
|
||||
printf("{%d, %d, %d, %d}", r2.x, r2.y, r2.width, r2.height);
|
||||
|
||||
printf(" %s\n", aMsg);
|
||||
@ -2445,6 +2491,7 @@ CompareTrees(nsIPresContext* aPresContext, nsIFrame* aA, nsIFrame* aB)
|
||||
|
||||
return ok;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
static nsIFrame*
|
||||
@ -2522,6 +2569,7 @@ PresShell::CloneStyleSet(nsIStyleSet* aSet, nsIStyleSet** aResult)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
// After an incremental reflow, we verify the correctness by doing a
|
||||
// full reflow into a fresh frame tree.
|
||||
PRBool
|
||||
@ -2640,9 +2688,15 @@ PresShell::VerifyIncrementalReflow()
|
||||
PRBool ok = CompareTrees(mPresContext, root1, root2);
|
||||
if (!ok && (VERIFY_REFLOW_NOISY & gVerifyReflowFlags)) {
|
||||
printf("Verify reflow failed, primary tree:\n");
|
||||
root1->List(mPresContext, stdout, 0);
|
||||
nsIFrameDebug* frameDebug;
|
||||
|
||||
if (NS_SUCCEEDED(root1->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) {
|
||||
frameDebug->List(mPresContext, stdout, 0);
|
||||
}
|
||||
printf("Verification tree:\n");
|
||||
root2->List(mPresContext, stdout, 0);
|
||||
if (NS_SUCCEEDED(root2->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) {
|
||||
frameDebug->List(mPresContext, stdout, 0);
|
||||
}
|
||||
}
|
||||
|
||||
// printf("Incremental reflow doomed view tree:\n");
|
||||
|
@ -14,6 +14,7 @@ nsIDocumentObserver.h
|
||||
nsIDocumentViewer.h
|
||||
nsIFocusTracker.h
|
||||
nsIFrame.h
|
||||
nsIFrameDebug.h
|
||||
nsIFrameSelection.h
|
||||
nsIFrameUtil.h
|
||||
nsIFrameImageLoader.h
|
||||
|
@ -38,6 +38,7 @@ nsIDocumentObserver.h \
|
||||
nsIDocumentViewer.h \
|
||||
nsIFocusTracker.h \
|
||||
nsIFrame.h \
|
||||
nsIFrameDebug.h \
|
||||
nsIFrameImageLoader.h \
|
||||
nsIFrameManager.h \
|
||||
nsILayoutDebugger.h \
|
||||
|
@ -31,6 +31,7 @@ EXPORTS = \
|
||||
nsIDocumentViewer.h \
|
||||
nsIFocusTracker.h \
|
||||
nsIFrame.h \
|
||||
nsIFrameDebug.h \
|
||||
nsIFrameImageLoader.h \
|
||||
nsIFrameManager.h \
|
||||
nsISelectionControler.h \
|
||||
|
@ -121,7 +121,9 @@ public:
|
||||
|
||||
void VerifyParent(nsIFrame* aParent) const;
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
void List(nsIPresContext* aPresContext, FILE* out) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
nsIFrame* mFirstChild;
|
||||
|
@ -862,42 +862,7 @@ public:
|
||||
*/
|
||||
NS_IMETHOD Scrolled(nsIView *aView) = 0;
|
||||
|
||||
// Debugging
|
||||
NS_IMETHOD List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const = 0;
|
||||
|
||||
/**
|
||||
* Get a printable from of the name of the frame type.
|
||||
*/
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const = 0;
|
||||
|
||||
/**
|
||||
* Called to dump out regression data that describes the layout
|
||||
* of the frame and it's 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(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) = 0;
|
||||
|
||||
/**
|
||||
* Get the size of the frame object. The size value should include
|
||||
* all subordinate data referenced by the frame that is not
|
||||
* accounted for by child frames. However, this value should not
|
||||
* include the content objects, style contexts, views or other data
|
||||
* that lies logically outside the frame system.
|
||||
*
|
||||
* If the implementation so chooses, instead of returning the total
|
||||
* subordinate data it may instead use the sizeof handler to store
|
||||
* away subordinate data under its own key so that the subordinate
|
||||
* data may be tabulated independently of the frame itself.
|
||||
*
|
||||
* The caller is responsible for recursing over all child-lists that
|
||||
* the frame supports.
|
||||
*/
|
||||
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const = 0;
|
||||
|
||||
NS_IMETHOD VerifyTree() const = 0;
|
||||
|
||||
/** Selection related calls
|
||||
*/
|
||||
@ -928,45 +893,6 @@ public:
|
||||
*/
|
||||
NS_IMETHOD PeekOffset(nsIPresContext* aPresContext, nsPeekOffsetStruct *aPos) = 0;
|
||||
|
||||
/**
|
||||
* See if tree verification is enabled. To enable tree verification add
|
||||
* "frameverifytree:1" to your NSPR_LOG_MODULES environment variable
|
||||
* (any non-zero debug level will work). Or, call SetVerifyTreeEnable
|
||||
* with PR_TRUE.
|
||||
*/
|
||||
static NS_LAYOUT PRBool GetVerifyTreeEnable();
|
||||
|
||||
/**
|
||||
* Set the verify-tree enable flag.
|
||||
*/
|
||||
static NS_LAYOUT void SetVerifyTreeEnable(PRBool aEnabled);
|
||||
|
||||
/**
|
||||
* 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 NS_LAYOUT PRBool GetVerifyStyleTreeEnable();
|
||||
|
||||
/**
|
||||
* Set the verify-style-tree enable flag.
|
||||
*/
|
||||
static NS_LAYOUT 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 NS_LAYOUT PRLogModuleInfo* GetLogModuleInfo();
|
||||
|
||||
// Show frame borders when rendering
|
||||
static NS_LAYOUT void ShowFrameBorders(PRBool aEnable);
|
||||
static NS_LAYOUT PRBool GetShowFrameBorders();
|
||||
|
||||
private:
|
||||
NS_IMETHOD_(nsrefcnt) AddRef(void) = 0;
|
||||
NS_IMETHOD_(nsrefcnt) Release(void) = 0;
|
||||
|
119
layout/base/public/nsIFrameDebug.h
Normal file
119
layout/base/public/nsIFrameDebug.h
Normal file
@ -0,0 +1,119 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#ifndef nsIFrameDebug_h___
|
||||
#define nsIFrameDebug_h___
|
||||
|
||||
#include "nslayout.h"
|
||||
#include "nsISupports.h"
|
||||
|
||||
class nsIFrame;
|
||||
class nsIPresContext;
|
||||
|
||||
// IID for the nsIFrameDebug interface {a6cf9069-15b3-11d2-932e-00805f8add32}
|
||||
#define NS_IFRAMEDEBUG_IID \
|
||||
{ 0xa6cf9069, 0x15b3, 0x11d2, \
|
||||
{0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}}
|
||||
|
||||
/**
|
||||
* Debug related functions
|
||||
*/
|
||||
class nsIFrameDebug : public nsISupports {
|
||||
public:
|
||||
static const nsIID& GetIID() { static nsIID iid = NS_IFRAMEDEBUG_IID; return iid; }
|
||||
|
||||
NS_IMETHOD List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const = 0;
|
||||
|
||||
/**
|
||||
* Get a printable from of the name of the frame type.
|
||||
* XXX This should be eliminated and we use GetFrameType() instead...
|
||||
*/
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const = 0;
|
||||
/**
|
||||
* Called to dump out regression data that describes the layout
|
||||
* of the frame and it's 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(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) = 0;
|
||||
|
||||
/**
|
||||
* Get the size of the frame object. The size value should include
|
||||
* all subordinate data referenced by the frame that is not
|
||||
* accounted for by child frames. However, this value should not
|
||||
* include the content objects, style contexts, views or other data
|
||||
* that lies logically outside the frame system.
|
||||
*
|
||||
* If the implementation so chooses, instead of returning the total
|
||||
* subordinate data it may instead use the sizeof handler to store
|
||||
* away subordinate data under its own key so that the subordinate
|
||||
* data may be tabulated independently of the frame itself.
|
||||
*
|
||||
* The caller is responsible for recursing over all child-lists that
|
||||
* the frame supports.
|
||||
*/
|
||||
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const = 0;
|
||||
|
||||
NS_IMETHOD VerifyTree() const = 0;
|
||||
|
||||
/**
|
||||
* See if tree verification is enabled. To enable tree verification add
|
||||
* "frameverifytree:1" to your NSPR_LOG_MODULES environment variable
|
||||
* (any non-zero debug level will work). Or, call SetVerifyTreeEnable
|
||||
* with PR_TRUE.
|
||||
*/
|
||||
static NS_LAYOUT PRBool GetVerifyTreeEnable();
|
||||
|
||||
/**
|
||||
* Set the verify-tree enable flag.
|
||||
*/
|
||||
static NS_LAYOUT void SetVerifyTreeEnable(PRBool aEnabled);
|
||||
|
||||
/**
|
||||
* 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 NS_LAYOUT PRBool GetVerifyStyleTreeEnable();
|
||||
|
||||
/**
|
||||
* Set the verify-style-tree enable flag.
|
||||
*/
|
||||
static NS_LAYOUT 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 NS_LAYOUT PRLogModuleInfo* GetLogModuleInfo();
|
||||
|
||||
// Show frame borders when rendering
|
||||
static NS_LAYOUT void ShowFrameBorders(PRBool aEnable);
|
||||
static NS_LAYOUT PRBool GetShowFrameBorders();
|
||||
|
||||
private:
|
||||
NS_IMETHOD_(nsrefcnt) AddRef(void) = 0;
|
||||
NS_IMETHOD_(nsrefcnt) Release(void) = 0;
|
||||
};
|
||||
|
||||
#endif /* nsIFrameDebug_h___ */
|
@ -184,12 +184,12 @@ public:
|
||||
*/
|
||||
NS_IMETHOD ClearRegions() = 0;
|
||||
|
||||
#ifdef DEBUG
|
||||
/**
|
||||
* Dump the state of the spacemanager out to a file
|
||||
*/
|
||||
NS_IMETHOD List(FILE* out) = 0;
|
||||
|
||||
#ifdef DEBUG
|
||||
virtual void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const = 0;
|
||||
#endif
|
||||
};
|
||||
|
@ -17,6 +17,9 @@
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsFrameList.h"
|
||||
#ifdef NS_DEBUG
|
||||
#include "nsIFrameDebug.h"
|
||||
#endif
|
||||
|
||||
void
|
||||
nsFrameList::DestroyFrames(nsIPresContext& aPresContext)
|
||||
@ -345,14 +348,20 @@ nsFrameList::VerifyParent(nsIFrame* aParent) const
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
void
|
||||
nsFrameList::List(nsIPresContext* aPresContext, FILE* out) const
|
||||
{
|
||||
fputs("<\n", out);
|
||||
nsIFrame* frame = mFirstChild;
|
||||
while (nsnull != frame) {
|
||||
frame->List(aPresContext, out, 1);
|
||||
nsIFrameDebug* frameDebug;
|
||||
|
||||
if (NS_SUCCEEDED(frame->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) {
|
||||
frameDebug->List(aPresContext, out, 1);
|
||||
}
|
||||
frame->GetNextSibling(&frame);
|
||||
}
|
||||
fputs(">\n", out);
|
||||
}
|
||||
#endif
|
||||
|
@ -26,6 +26,7 @@
|
||||
|
||||
static NS_DEFINE_IID(kIFrameUtilIID, NS_IFRAME_UTIL_IID);
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
class nsFrameUtil : public nsIFrameUtil {
|
||||
public:
|
||||
nsFrameUtil();
|
||||
@ -630,3 +631,4 @@ nsFrameUtil::DumpRegressionData(FILE* aInputFile, FILE* aOutputFile)
|
||||
}
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
#endif
|
||||
|
@ -18,9 +18,11 @@
|
||||
*/
|
||||
#include "nsILayoutDebugger.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsIFrameDebug.h"
|
||||
|
||||
static NS_DEFINE_IID(kILayoutDebuggerIID, NS_ILAYOUT_DEBUGGER_IID);
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
class nsLayoutDebugger : public nsILayoutDebugger {
|
||||
public:
|
||||
nsLayoutDebugger();
|
||||
@ -71,14 +73,14 @@ NS_IMPL_ISUPPORTS(nsLayoutDebugger, kILayoutDebuggerIID);
|
||||
NS_IMETHODIMP
|
||||
nsLayoutDebugger::SetShowFrameBorders(PRBool aEnable)
|
||||
{
|
||||
nsIFrame::ShowFrameBorders(aEnable);
|
||||
nsIFrameDebug::ShowFrameBorders(aEnable);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLayoutDebugger::GetShowFrameBorders(PRBool* aResult)
|
||||
{
|
||||
*aResult = nsIFrame::GetShowFrameBorders();
|
||||
*aResult = nsIFrameDebug::GetShowFrameBorders();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -105,3 +107,4 @@ nsLayoutDebugger::GetStyleSize(nsIPresShell* aPresentation,
|
||||
*aSizeInBytesResult = 0;
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
#endif
|
||||
|
@ -23,7 +23,9 @@
|
||||
#include "nsVoidArray.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsString.h"
|
||||
|
||||
#ifdef DEBUG
|
||||
#include "nsIFrameDebug.h"
|
||||
#endif
|
||||
static NS_DEFINE_IID(kISpaceManagerIID, NS_ISPACEMANAGER_IID);
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
@ -904,18 +906,22 @@ nsSpaceManager::ClearRegions()
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHODIMP
|
||||
nsSpaceManager::List(FILE* out)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
nsAutoString tmp;
|
||||
|
||||
fprintf(out, "SpaceManager@%p", this);
|
||||
if (mFrame) {
|
||||
mFrame->GetFrameName(tmp);
|
||||
fprintf(out, " frame=");
|
||||
fputs(tmp, out);
|
||||
fprintf(out, "@%p", mFrame);
|
||||
nsIFrameDebug* frameDebug;
|
||||
|
||||
if (NS_SUCCEEDED(mFrame->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) {
|
||||
frameDebug->GetFrameName(tmp);
|
||||
fprintf(out, " frame=");
|
||||
fputs(tmp, out);
|
||||
fprintf(out, "@%p", mFrame);
|
||||
}
|
||||
}
|
||||
fprintf(out, " xy=%d,%d <\n", mX, mY);
|
||||
if (mBandList.IsEmpty()) {
|
||||
@ -928,10 +934,14 @@ nsSpaceManager::List(FILE* out)
|
||||
band->mLeft, band->mTop, band->mRight, band->mBottom,
|
||||
band->mNumFrames);
|
||||
if (1 == band->mNumFrames) {
|
||||
band->mFrame->GetFrameName(tmp);
|
||||
fprintf(out, " frame=");
|
||||
fputs(tmp, out);
|
||||
fprintf(out, "@%p", band->mFrame);
|
||||
nsIFrameDebug* frameDebug;
|
||||
|
||||
if (NS_SUCCEEDED(band->mFrame->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) {
|
||||
frameDebug->GetFrameName(tmp);
|
||||
fprintf(out, " frame=");
|
||||
fputs(tmp, out);
|
||||
fprintf(out, "@%p", band->mFrame);
|
||||
}
|
||||
}
|
||||
else if (1 < band->mNumFrames) {
|
||||
fprintf(out, "\n ");
|
||||
@ -940,9 +950,13 @@ nsSpaceManager::List(FILE* out)
|
||||
for (i = 0; i < n; i++) {
|
||||
nsIFrame* frame = (nsIFrame*) a->ElementAt(i);
|
||||
if (frame) {
|
||||
frame->GetFrameName(tmp);
|
||||
fputs(tmp, out);
|
||||
fprintf(out, "@%p ", frame);
|
||||
nsIFrameDebug* frameDebug;
|
||||
|
||||
if (NS_SUCCEEDED(frame->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) {
|
||||
frameDebug->GetFrameName(tmp);
|
||||
fputs(tmp, out);
|
||||
fprintf(out, "@%p ", frame);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -951,9 +965,9 @@ nsSpaceManager::List(FILE* out)
|
||||
} while (band != mBandList.Head());
|
||||
}
|
||||
fprintf(out, ">\n");
|
||||
#endif
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
nsSpaceManager::FrameInfo*
|
||||
nsSpaceManager::GetFrameInfoFor(nsIFrame* aFrame)
|
||||
|
@ -53,10 +53,10 @@ public:
|
||||
NS_IMETHOD RemoveRegion(nsIFrame* aFrame);
|
||||
|
||||
NS_IMETHOD ClearRegions();
|
||||
NS_IMETHOD List(FILE* out);
|
||||
|
||||
#ifdef DEBUG
|
||||
void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
|
||||
NS_IMETHOD List(FILE* out);
|
||||
void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
@ -87,10 +87,12 @@ extern nsresult NS_NewRangeList(nsIFrameSelection** aResult);
|
||||
extern nsresult NS_NewRange(nsIDOMRange** aResult);
|
||||
extern nsresult NS_NewContentIterator(nsIContentIterator** aResult);
|
||||
extern nsresult NS_NewContentSubtreeIterator(nsIContentIterator** aResult);
|
||||
extern nsresult NS_NewFrameUtil(nsIFrameUtil** aResult);
|
||||
|
||||
extern nsresult NS_NewLayoutDocumentLoaderFactory(nsIDocumentLoaderFactory** aResult);
|
||||
#ifdef NS_DEBUG
|
||||
extern nsresult NS_NewFrameUtil(nsIFrameUtil** aResult);
|
||||
extern nsresult NS_NewLayoutDebugger(nsILayoutDebugger** aResult);
|
||||
#endif
|
||||
extern nsresult NS_NewHTMLElementFactory(nsIHTMLElementFactory** aResult);
|
||||
extern nsresult NS_NewHTMLEncoder(nsIDocumentEncoder** aResult);
|
||||
extern nsresult NS_NewTextEncoder(nsIDocumentEncoder** aResult);
|
||||
@ -263,13 +265,6 @@ nsLayoutFactory::CreateInstance(nsISupports *aOuter,
|
||||
return res;
|
||||
}
|
||||
}
|
||||
else if (mClassID.Equals(kFrameUtilCID)) {
|
||||
res = NS_NewFrameUtil((nsIFrameUtil**) &inst);
|
||||
if (NS_FAILED(res)) {
|
||||
LOG_NEW_FAILURE("NS_NewFrameUtil", res);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
else if (mClassID.Equals(kEventListenerManagerCID)) {
|
||||
res = NS_NewEventListenerManager((nsIEventListenerManager**) &inst);
|
||||
if (NS_FAILED(res)) {
|
||||
@ -291,6 +286,14 @@ nsLayoutFactory::CreateInstance(nsISupports *aOuter,
|
||||
return res;
|
||||
}
|
||||
}
|
||||
#ifdef DEBUG
|
||||
else if (mClassID.Equals(kFrameUtilCID)) {
|
||||
res = NS_NewFrameUtil((nsIFrameUtil**) &inst);
|
||||
if (NS_FAILED(res)) {
|
||||
LOG_NEW_FAILURE("NS_NewFrameUtil", res);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
else if (mClassID.Equals(kLayoutDebuggerCID)) {
|
||||
res = NS_NewLayoutDebugger((nsILayoutDebugger**) &inst);
|
||||
if (NS_FAILED(res)) {
|
||||
@ -298,6 +301,7 @@ nsLayoutFactory::CreateInstance(nsISupports *aOuter,
|
||||
return res;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
else if (mClassID.Equals(kHTMLElementFactoryCID)) {
|
||||
res = NS_NewHTMLElementFactory((nsIHTMLElementFactory**) &inst);
|
||||
if (NS_FAILED(res)) {
|
||||
|
@ -886,12 +886,14 @@ nsComboboxControlFrame::GetFrameForPoint(nsIPresContext* aPresContext,
|
||||
|
||||
|
||||
//--------------------------------------------------------------
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
NS_IMETHODIMP
|
||||
nsComboboxControlFrame::GetFrameName(nsString& aResult) const
|
||||
{
|
||||
return MakeFrameName("ComboboxControl", aResult);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
@ -79,7 +79,9 @@ public:
|
||||
nsGUIEvent* aEvent,
|
||||
nsEventStatus& aEventStatus);
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
#endif
|
||||
NS_IMETHOD Destroy(nsIPresContext& aPresContext);
|
||||
NS_IMETHOD FirstChild(nsIAtom* aListName, nsIFrame** aFirstChild) const;
|
||||
NS_IMETHOD SetInitialChildList(nsIPresContext& aPresContext,
|
||||
|
@ -74,9 +74,11 @@ public:
|
||||
const nsRect& aDirtyRect,
|
||||
nsFramePaintLayer aWhichLayer);
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const {
|
||||
return MakeFrameName("FieldSet", aResult);
|
||||
}
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
||||
@ -269,6 +271,7 @@ nsFieldSetFrame::Paint(nsIPresContext& aPresContext,
|
||||
|
||||
PaintChildren(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
|
||||
|
||||
#ifdef DEBUG
|
||||
if ((NS_FRAME_PAINT_LAYER_DEBUG == aWhichLayer) && GetShowFrameBorders()) {
|
||||
nsIView* view;
|
||||
GetView(&aPresContext, &view);
|
||||
@ -280,6 +283,7 @@ nsFieldSetFrame::Paint(nsIPresContext& aPresContext,
|
||||
}
|
||||
aRenderingContext.DrawRect(0, 0, mRect.width, mRect.height);
|
||||
}
|
||||
#endif
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -427,11 +427,13 @@ nsFileControlFrame::GetFrameForPoint(nsIPresContext* aPresContext,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
NS_IMETHODIMP
|
||||
nsFileControlFrame::GetFrameName(nsString& aResult) const
|
||||
{
|
||||
return MakeFrameName("FileControl", aResult);
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsFileControlFrame::GetFormContent(nsIContent*& aContent) const
|
||||
|
@ -71,7 +71,9 @@ public:
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
#endif
|
||||
NS_IMETHOD SetSuggestedSize(nscoord aWidth, nscoord aHeight) { return NS_OK; };
|
||||
NS_IMETHOD GetFrameForPoint(nsIPresContext* aPresContext, const nsPoint& aPoint, nsIFrame** aFrame);
|
||||
NS_IMETHOD AttributeChanged(nsIPresContext* aPresContext,
|
||||
|
@ -135,13 +135,13 @@ nsGfxButtonControlFrame::GetCID()
|
||||
return kButtonCID;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHODIMP
|
||||
nsGfxButtonControlFrame::GetFrameName(nsString& aResult) const
|
||||
{
|
||||
return MakeFrameName("ButtonControl", aResult);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsGfxButtonControlFrame::AddComputedBorderPaddingToDesiredSize(nsHTMLReflowMetrics& aDesiredSize,
|
||||
|
@ -46,7 +46,9 @@ public:
|
||||
|
||||
// nsFormControlFrame
|
||||
NS_IMETHOD SetSuggestedSize(nscoord aWidth, nscoord aHeight);
|
||||
#ifdef DEBUG
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
#endif
|
||||
PRBool IsSuccessful(nsIFormControlFrame* aSubmitter);
|
||||
virtual PRInt32 GetMaxNumValues();
|
||||
virtual PRBool GetNamesValues(PRInt32 aMaxNumValues, PRInt32& aNumValues,
|
||||
|
@ -28,9 +28,11 @@ private:
|
||||
public:
|
||||
nsGfxCheckboxControlFrame();
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const {
|
||||
return MakeFrameName("CheckboxControl", aResult);
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
|
@ -92,10 +92,11 @@ public:
|
||||
NS_IMETHOD SetAdditionalStyleContext(PRInt32 aIndex,
|
||||
nsIStyleContext* aStyleContext);
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const {
|
||||
return MakeFrameName("ButtonControl", aResult);
|
||||
}
|
||||
#endif
|
||||
|
||||
virtual nsresult RequiresWidget(PRBool &aRequiresWidget);
|
||||
|
||||
|
@ -74,9 +74,11 @@ public:
|
||||
nsGUIEvent* aEvent,
|
||||
nsEventStatus& aEventStatus);
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const {
|
||||
return MakeFrameName("ImageControl", aResult);
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHOD GetCursor(nsIPresContext& aPresContext,
|
||||
nsPoint& aPoint,
|
||||
|
@ -90,8 +90,10 @@ PRInt32 nsLegendFrame::GetAlign()
|
||||
return intValue;
|
||||
}
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
NS_IMETHODIMP
|
||||
nsLegendFrame::GetFrameName(nsString& aResult) const
|
||||
{
|
||||
return MakeFrameName("Legend", aResult);
|
||||
}
|
||||
#endif
|
||||
|
@ -37,7 +37,9 @@ public:
|
||||
|
||||
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
#endif
|
||||
|
||||
PRInt32 GetAlign();
|
||||
};
|
||||
|
@ -328,12 +328,13 @@ nsTextControlFrame::GetCursor(nsIPresContext& aPresContext, nsPoint& aPoint, PRI
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHODIMP
|
||||
nsTextControlFrame::GetFrameName(nsString& aResult) const
|
||||
{
|
||||
return MakeFrameName("TextControl", aResult);
|
||||
}
|
||||
#endif
|
||||
|
||||
//---------------------------------------------------------
|
||||
NS_IMETHODIMP
|
||||
|
@ -39,7 +39,9 @@ public:
|
||||
|
||||
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
#endif
|
||||
|
||||
virtual nscoord GetVerticalBorderWidth(float aPixToTwip) const;
|
||||
virtual nscoord GetHorizontalBorderWidth(float aPixToTwip) const;
|
||||
|
@ -378,13 +378,13 @@ nsAreaFrame::DidReflow(nsIPresContext& aPresContext,
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Diagnostics
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
NS_IMETHODIMP
|
||||
nsAreaFrame::GetFrameName(nsString& aResult) const
|
||||
{
|
||||
return MakeFrameName("Area", aResult);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHODIMP
|
||||
nsAreaFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
|
||||
{
|
||||
|
@ -88,9 +88,8 @@ public:
|
||||
*/
|
||||
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
|
||||
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
|
||||
#endif
|
||||
|
||||
|
@ -30,10 +30,12 @@
|
||||
class BRFrame : public nsFrame {
|
||||
public:
|
||||
// nsIFrame
|
||||
#ifdef NS_DEBUG
|
||||
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect,
|
||||
nsFramePaintLayer aWhichLayer);
|
||||
#endif
|
||||
|
||||
// nsIHTMLReflow
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
@ -70,6 +72,7 @@ BRFrame::~BRFrame()
|
||||
{
|
||||
}
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
NS_IMETHODIMP
|
||||
BRFrame::Paint(nsIPresContext& aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
@ -85,6 +88,7 @@ BRFrame::Paint(nsIPresContext& aPresContext,
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
BRFrame::Reflow(nsIPresContext& aPresContext,
|
||||
|
@ -1158,6 +1158,7 @@ nsBlockFrame::IsSplittable(nsSplittableType& aIsSplittable) const
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
static void
|
||||
ListTextRuns(FILE* out, PRInt32 aIndent, nsTextRun* aRuns)
|
||||
{
|
||||
@ -1170,7 +1171,6 @@ ListTextRuns(FILE* out, PRInt32 aIndent, nsTextRun* aRuns)
|
||||
NS_METHOD
|
||||
nsBlockFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const
|
||||
{
|
||||
#ifdef DEBUG
|
||||
IndentBy(out, aIndent);
|
||||
ListTag(out);
|
||||
nsIView* view;
|
||||
@ -1242,7 +1242,11 @@ nsBlockFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) con
|
||||
}
|
||||
fputs("<\n", out);
|
||||
while (nsnull != kid) {
|
||||
kid->List(aPresContext, out, aIndent + 1);
|
||||
nsIFrameDebug* frameDebug;
|
||||
|
||||
if (NS_SUCCEEDED(kid->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) {
|
||||
frameDebug->List(aPresContext, out, aIndent + 1);
|
||||
}
|
||||
kid->GetNextSibling(&kid);
|
||||
}
|
||||
IndentBy(out, aIndent);
|
||||
@ -1266,7 +1270,6 @@ nsBlockFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) con
|
||||
IndentBy(out, aIndent);
|
||||
fputs(">\n", out);
|
||||
|
||||
#endif
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -1275,6 +1278,7 @@ nsBlockFrame::GetFrameName(nsString& aResult) const
|
||||
{
|
||||
return MakeFrameName("Block", aResult);
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::GetFrameType(nsIAtom** aType) const
|
||||
@ -5682,7 +5686,6 @@ nsBlockFrame::IsChild(nsIFrame* aFrame)
|
||||
}
|
||||
return PR_FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::VerifyTree() const
|
||||
@ -5691,7 +5694,6 @@ nsBlockFrame::VerifyTree() const
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
|
||||
{
|
||||
|
@ -90,13 +90,13 @@ public:
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect,
|
||||
nsFramePaintLayer aWhichLayer);
|
||||
NS_IMETHOD List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const;
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
|
||||
#ifdef DEBUG
|
||||
NS_IMETHOD List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const;
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
|
||||
#endif
|
||||
NS_IMETHOD VerifyTree() const;
|
||||
#endif
|
||||
NS_IMETHOD GetFrameForPoint(nsIPresContext* aPresContext, const nsPoint& aPoint, nsIFrame** aFrame);
|
||||
NS_IMETHOD HandleEvent(nsIPresContext& aPresContext,
|
||||
nsGUIEvent* aEvent,
|
||||
|
@ -1158,6 +1158,7 @@ nsBlockFrame::IsSplittable(nsSplittableType& aIsSplittable) const
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
static void
|
||||
ListTextRuns(FILE* out, PRInt32 aIndent, nsTextRun* aRuns)
|
||||
{
|
||||
@ -1170,7 +1171,6 @@ ListTextRuns(FILE* out, PRInt32 aIndent, nsTextRun* aRuns)
|
||||
NS_METHOD
|
||||
nsBlockFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const
|
||||
{
|
||||
#ifdef DEBUG
|
||||
IndentBy(out, aIndent);
|
||||
ListTag(out);
|
||||
nsIView* view;
|
||||
@ -1242,7 +1242,11 @@ nsBlockFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) con
|
||||
}
|
||||
fputs("<\n", out);
|
||||
while (nsnull != kid) {
|
||||
kid->List(aPresContext, out, aIndent + 1);
|
||||
nsIFrameDebug* frameDebug;
|
||||
|
||||
if (NS_SUCCEEDED(kid->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) {
|
||||
frameDebug->List(aPresContext, out, aIndent + 1);
|
||||
}
|
||||
kid->GetNextSibling(&kid);
|
||||
}
|
||||
IndentBy(out, aIndent);
|
||||
@ -1266,7 +1270,6 @@ nsBlockFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) con
|
||||
IndentBy(out, aIndent);
|
||||
fputs(">\n", out);
|
||||
|
||||
#endif
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -1275,6 +1278,7 @@ nsBlockFrame::GetFrameName(nsString& aResult) const
|
||||
{
|
||||
return MakeFrameName("Block", aResult);
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::GetFrameType(nsIAtom** aType) const
|
||||
@ -5682,7 +5686,6 @@ nsBlockFrame::IsChild(nsIFrame* aFrame)
|
||||
}
|
||||
return PR_FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::VerifyTree() const
|
||||
@ -5691,7 +5694,6 @@ nsBlockFrame::VerifyTree() const
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
|
||||
{
|
||||
|
@ -1158,6 +1158,7 @@ nsBlockFrame::IsSplittable(nsSplittableType& aIsSplittable) const
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
static void
|
||||
ListTextRuns(FILE* out, PRInt32 aIndent, nsTextRun* aRuns)
|
||||
{
|
||||
@ -1170,7 +1171,6 @@ ListTextRuns(FILE* out, PRInt32 aIndent, nsTextRun* aRuns)
|
||||
NS_METHOD
|
||||
nsBlockFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const
|
||||
{
|
||||
#ifdef DEBUG
|
||||
IndentBy(out, aIndent);
|
||||
ListTag(out);
|
||||
nsIView* view;
|
||||
@ -1242,7 +1242,11 @@ nsBlockFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) con
|
||||
}
|
||||
fputs("<\n", out);
|
||||
while (nsnull != kid) {
|
||||
kid->List(aPresContext, out, aIndent + 1);
|
||||
nsIFrameDebug* frameDebug;
|
||||
|
||||
if (NS_SUCCEEDED(kid->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) {
|
||||
frameDebug->List(aPresContext, out, aIndent + 1);
|
||||
}
|
||||
kid->GetNextSibling(&kid);
|
||||
}
|
||||
IndentBy(out, aIndent);
|
||||
@ -1266,7 +1270,6 @@ nsBlockFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) con
|
||||
IndentBy(out, aIndent);
|
||||
fputs(">\n", out);
|
||||
|
||||
#endif
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -1275,6 +1278,7 @@ nsBlockFrame::GetFrameName(nsString& aResult) const
|
||||
{
|
||||
return MakeFrameName("Block", aResult);
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::GetFrameType(nsIAtom** aType) const
|
||||
@ -5682,7 +5686,6 @@ nsBlockFrame::IsChild(nsIFrame* aFrame)
|
||||
}
|
||||
return PR_FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::VerifyTree() const
|
||||
@ -5691,7 +5694,6 @@ nsBlockFrame::VerifyTree() const
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
|
||||
{
|
||||
|
@ -86,11 +86,13 @@ nsBulletFrame::Init(nsIPresContext& aPresContext,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
NS_IMETHODIMP
|
||||
nsBulletFrame::GetFrameName(nsString& aResult) const
|
||||
{
|
||||
return MakeFrameName("Bullet", aResult);
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBulletFrame::GetFrameType(nsIAtom** aType) const
|
||||
|
@ -44,7 +44,9 @@ public:
|
||||
const nsRect& aDirtyRect,
|
||||
nsFramePaintLayer aWhichLayer);
|
||||
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
|
||||
#ifdef NS_DEBUG
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
#endif
|
||||
|
||||
// nsIHTMLReflow
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
|
@ -248,7 +248,7 @@ nsContainerFrame::PaintChild(nsIPresContext& aPresContext,
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
// Draw a border around the child
|
||||
if (nsIFrame::GetShowFrameBorders() && !kidRect.IsEmpty()) {
|
||||
if (nsIFrameDebug::GetShowFrameBorders() && !kidRect.IsEmpty()) {
|
||||
aRenderingContext.SetColor(NS_RGB(255,0,0));
|
||||
aRenderingContext.DrawRect(kidRect);
|
||||
}
|
||||
@ -605,6 +605,7 @@ nsContainerFrame::MoveOverflowToChildList(nsIPresContext* aPresContext)
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Debugging
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
NS_IMETHODIMP
|
||||
nsContainerFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const
|
||||
{
|
||||
@ -649,7 +650,11 @@ nsContainerFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent)
|
||||
}
|
||||
fputs("<\n", out);
|
||||
while (nsnull != kid) {
|
||||
kid->List(aPresContext, out, aIndent + 1);
|
||||
nsIFrameDebug* frameDebug;
|
||||
|
||||
if (NS_SUCCEEDED(kid->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) {
|
||||
frameDebug->List(aPresContext, out, aIndent + 1);
|
||||
}
|
||||
kid->GetNextSibling(&kid);
|
||||
}
|
||||
IndentBy(out, aIndent);
|
||||
@ -666,7 +671,6 @@ nsContainerFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHODIMP
|
||||
nsContainerFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
|
||||
{
|
||||
|
@ -45,8 +45,8 @@ public:
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aOldFrame,
|
||||
nsIFrame* aNewFrame);
|
||||
NS_IMETHOD List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const;
|
||||
#ifdef DEBUG
|
||||
NS_IMETHOD List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const;
|
||||
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
|
||||
#endif
|
||||
|
||||
|
@ -41,7 +41,9 @@ public:
|
||||
NS_IMETHOD SetInitialChildList(nsIPresContext& aPresContext,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aChildList);
|
||||
#ifdef NS_DEBUG
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
#endif
|
||||
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
@ -74,11 +76,13 @@ nsFirstLetterFrame::nsFirstLetterFrame()
|
||||
{
|
||||
}
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
NS_IMETHODIMP
|
||||
nsFirstLetterFrame::GetFrameName(nsString& aResult) const
|
||||
{
|
||||
return MakeFrameName("Letter", aResult);
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsFirstLetterFrame::GetFrameType(nsIAtom** aType) const
|
||||
|
@ -88,14 +88,15 @@ static void RefreshContentFrames(nsIPresContext& aPresContext, nsIContent * aSta
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
static PRBool gShowFrameBorders = PR_FALSE;
|
||||
|
||||
NS_LAYOUT void nsIFrame::ShowFrameBorders(PRBool aEnable)
|
||||
NS_LAYOUT void nsIFrameDebug::ShowFrameBorders(PRBool aEnable)
|
||||
{
|
||||
gShowFrameBorders = aEnable;
|
||||
}
|
||||
|
||||
NS_LAYOUT PRBool nsIFrame::GetShowFrameBorders()
|
||||
NS_LAYOUT PRBool nsIFrameDebug::GetShowFrameBorders()
|
||||
{
|
||||
return gShowFrameBorders;
|
||||
}
|
||||
@ -106,16 +107,13 @@ NS_LAYOUT PRBool nsIFrame::GetShowFrameBorders()
|
||||
*/
|
||||
static PRLogModuleInfo* gLogModule;
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
static PRLogModuleInfo* gFrameVerifyTreeLogModuleInfo;
|
||||
#endif
|
||||
|
||||
static PRBool gFrameVerifyTreeEnable = PRBool(0x55);
|
||||
|
||||
NS_LAYOUT PRBool
|
||||
nsIFrame::GetVerifyTreeEnable()
|
||||
nsIFrameDebug::GetVerifyTreeEnable()
|
||||
{
|
||||
#ifdef NS_DEBUG
|
||||
if (gFrameVerifyTreeEnable == PRBool(0x55)) {
|
||||
if (nsnull == gFrameVerifyTreeLogModuleInfo) {
|
||||
gFrameVerifyTreeLogModuleInfo = PR_NewLogModule("frameverifytree");
|
||||
@ -124,26 +122,22 @@ nsIFrame::GetVerifyTreeEnable()
|
||||
gFrameVerifyTreeEnable ? "en" : "dis");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return gFrameVerifyTreeEnable;
|
||||
}
|
||||
|
||||
NS_LAYOUT void
|
||||
nsIFrame::SetVerifyTreeEnable(PRBool aEnabled)
|
||||
nsIFrameDebug::SetVerifyTreeEnable(PRBool aEnabled)
|
||||
{
|
||||
gFrameVerifyTreeEnable = aEnabled;
|
||||
}
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
static PRLogModuleInfo* gStyleVerifyTreeLogModuleInfo;
|
||||
#endif
|
||||
|
||||
static PRBool gStyleVerifyTreeEnable = PRBool(0x55);
|
||||
|
||||
NS_LAYOUT PRBool
|
||||
nsIFrame::GetVerifyStyleTreeEnable()
|
||||
nsIFrameDebug::GetVerifyStyleTreeEnable()
|
||||
{
|
||||
#ifdef NS_DEBUG
|
||||
if (gStyleVerifyTreeEnable == PRBool(0x55)) {
|
||||
if (nsnull == gStyleVerifyTreeLogModuleInfo) {
|
||||
gStyleVerifyTreeLogModuleInfo = PR_NewLogModule("styleverifytree");
|
||||
@ -152,24 +146,24 @@ nsIFrame::GetVerifyStyleTreeEnable()
|
||||
gStyleVerifyTreeEnable ? "en" : "dis");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return gStyleVerifyTreeEnable;
|
||||
}
|
||||
|
||||
NS_LAYOUT void
|
||||
nsIFrame::SetVerifyStyleTreeEnable(PRBool aEnabled)
|
||||
nsIFrameDebug::SetVerifyStyleTreeEnable(PRBool aEnabled)
|
||||
{
|
||||
gStyleVerifyTreeEnable = aEnabled;
|
||||
}
|
||||
|
||||
NS_LAYOUT PRLogModuleInfo*
|
||||
nsIFrame::GetLogModuleInfo()
|
||||
nsIFrameDebug::GetLogModuleInfo()
|
||||
{
|
||||
if (nsnull == gLogModule) {
|
||||
gLogModule = PR_NewLogModule("frame");
|
||||
}
|
||||
return gLogModule;
|
||||
}
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
@ -1697,6 +1691,7 @@ PRInt32 nsFrame::ContentIndexInContainer(const nsIFrame* aFrame)
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
// Debugging
|
||||
NS_IMETHODIMP
|
||||
nsFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const
|
||||
@ -1744,6 +1739,7 @@ nsFrame::MakeFrameName(const char* aType, nsString& aResult) const
|
||||
aResult.Append(buf);
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
nsFrame::XMLQuote(nsString& aString)
|
||||
@ -1794,6 +1790,7 @@ nsFrame::ParentDisablesSelection() const
|
||||
*/
|
||||
}
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
NS_IMETHODIMP
|
||||
nsFrame::DumpRegressionData(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent)
|
||||
{
|
||||
@ -1861,7 +1858,11 @@ nsFrame::DumpBaseRegressionData(nsIPresContext* aPresContext, FILE* out, PRInt32
|
||||
}
|
||||
aIndent++;
|
||||
while (nsnull != kid) {
|
||||
kid->DumpRegressionData(aPresContext, out, aIndent);
|
||||
nsIFrameDebug* frameDebug;
|
||||
|
||||
if (NS_SUCCEEDED(kid->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) {
|
||||
frameDebug->DumpRegressionData(aPresContext, out, aIndent);
|
||||
}
|
||||
kid->GetNextSibling(&kid);
|
||||
}
|
||||
aIndent--;
|
||||
@ -1893,6 +1894,7 @@ nsFrame::VerifyTree() const
|
||||
NS_ASSERTION(0 == (mState & NS_FRAME_IN_REFLOW), "frame is in reflow");
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*this method may.. invalidate if the state was changed or if aForceRedraw is PR_TRUE
|
||||
it will not update immediately.*/
|
||||
|
@ -22,6 +22,9 @@
|
||||
#include "nsRect.h"
|
||||
#include "nsString.h"
|
||||
#include "prlog.h"
|
||||
#ifdef NS_DEBUG
|
||||
#include "nsIFrameDebug.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* nsFrame logging constants. We redefine the nspr
|
||||
@ -39,7 +42,7 @@
|
||||
#ifdef NS_DEBUG
|
||||
#define NS_FRAME_LOG(_bit,_args) \
|
||||
PR_BEGIN_MACRO \
|
||||
if (NS_FRAME_LOG_TEST(nsIFrame::GetLogModuleInfo(),_bit)) { \
|
||||
if (NS_FRAME_LOG_TEST(nsIFrameDebug::GetLogModuleInfo(),_bit)) { \
|
||||
PR_LogPrint _args; \
|
||||
} \
|
||||
PR_END_MACRO
|
||||
@ -56,14 +59,14 @@
|
||||
// XXX remove me
|
||||
#define NS_FRAME_TRACE_MSG(_bit,_args) \
|
||||
PR_BEGIN_MACRO \
|
||||
if (NS_FRAME_LOG_TEST(nsIFrame::GetLogModuleInfo(),_bit)) { \
|
||||
if (NS_FRAME_LOG_TEST(nsIFrameDebug::GetLogModuleInfo(),_bit)) { \
|
||||
TraceMsg _args; \
|
||||
} \
|
||||
PR_END_MACRO
|
||||
|
||||
#define NS_FRAME_TRACE(_bit,_args) \
|
||||
PR_BEGIN_MACRO \
|
||||
if (NS_FRAME_LOG_TEST(nsIFrame::GetLogModuleInfo(),_bit)) { \
|
||||
if (NS_FRAME_LOG_TEST(nsIFrameDebug::GetLogModuleInfo(),_bit)) { \
|
||||
TraceMsg _args; \
|
||||
} \
|
||||
PR_END_MACRO
|
||||
@ -93,6 +96,9 @@
|
||||
* behavior is to keep the frame and view position and size in sync.
|
||||
*/
|
||||
class nsFrame : public nsIFrame
|
||||
#ifdef NS_DEBUG
|
||||
, public nsIFrameDebug
|
||||
#endif
|
||||
{
|
||||
public:
|
||||
/**
|
||||
@ -215,11 +221,13 @@ public:
|
||||
NS_IMETHOD GetNextSibling(nsIFrame** aNextSibling) const;
|
||||
NS_IMETHOD SetNextSibling(nsIFrame* aNextSibling);
|
||||
NS_IMETHOD Scrolled(nsIView *aView);
|
||||
#ifdef NS_DEBUG
|
||||
NS_IMETHOD List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const;
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
NS_IMETHOD DumpRegressionData(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent);
|
||||
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
|
||||
NS_IMETHOD VerifyTree() const;
|
||||
#endif
|
||||
NS_IMETHOD SetSelected(nsIPresContext* aPresContext, nsIDOMRange *aRange,PRBool aSelected, nsSpread aSpread);
|
||||
NS_IMETHOD GetSelected(PRBool *aSelected) const;
|
||||
NS_IMETHOD PeekOffset(nsIPresContext* aPresContext, nsPeekOffsetStruct *aPos) ;
|
||||
@ -307,15 +315,18 @@ public:
|
||||
// Helper function that verifies that each frame in the list has the
|
||||
// NS_FRAME_IS_DIRTY bit set
|
||||
static void VerifyDirtyBitSet(nsIFrame* aFrameList);
|
||||
#endif
|
||||
|
||||
void ListTag(FILE* out) const {
|
||||
ListTag(out, this);
|
||||
ListTag(out, (nsIFrame*)this);
|
||||
}
|
||||
|
||||
static void ListTag(FILE* out, const nsIFrame* aFrame) {
|
||||
static void ListTag(FILE* out, nsIFrame* aFrame) {
|
||||
nsAutoString tmp;
|
||||
aFrame->GetFrameName(tmp);
|
||||
nsIFrameDebug* frameDebug;
|
||||
|
||||
if (NS_SUCCEEDED(aFrame->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) {
|
||||
frameDebug->GetFrameName(tmp);
|
||||
}
|
||||
fputs(tmp, out);
|
||||
fprintf(out, "@%p", aFrame);
|
||||
}
|
||||
@ -323,6 +334,20 @@ public:
|
||||
static void IndentBy(FILE* out, PRInt32 aIndent) {
|
||||
while (--aIndent >= 0) fputs(" ", out);
|
||||
}
|
||||
|
||||
/**
|
||||
* Dump out the "base classes" regression data. This should dump
|
||||
* out the interior data, not the "frame" XML container. And it
|
||||
* should call the base classes same named method before doing
|
||||
* anything specific in a derived class. This means that derived
|
||||
* classes need not override DumpRegressionData unless they need
|
||||
* some custom behavior that requires changing how the outer "frame"
|
||||
* XML container is dumped.
|
||||
*/
|
||||
virtual void DumpBaseRegressionData(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent);
|
||||
|
||||
nsresult MakeFrameName(const char* aKind, nsString& aResult) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
// Protected constructor and destructor
|
||||
@ -343,19 +368,6 @@ protected:
|
||||
static void GetLastLeaf(nsIFrame **aFrame);
|
||||
static void GetFirstLeaf(nsIFrame **aFrame);
|
||||
|
||||
/**
|
||||
* Dump out the "base classes" regression data. This should dump
|
||||
* out the interior data, not the "frame" XML container. And it
|
||||
* should call the base classes same named method before doing
|
||||
* anything specific in a derived class. This means that derived
|
||||
* classes need not override DumpRegressionData unless they need
|
||||
* some custom behavior that requires changing how the outer "frame"
|
||||
* XML container is dumped.
|
||||
*/
|
||||
virtual void DumpBaseRegressionData(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent);
|
||||
|
||||
nsresult MakeFrameName(const char* aKind, nsString& aResult) const;
|
||||
|
||||
static void XMLQuote(nsString& aString);
|
||||
|
||||
virtual PRBool ParentDisablesSelection() const;
|
||||
|
@ -88,7 +88,9 @@ class nsHTMLFrameOuterFrame : public nsHTMLFrameOuterFrameSuper {
|
||||
public:
|
||||
nsHTMLFrameOuterFrame();
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
#endif
|
||||
|
||||
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
|
||||
|
||||
@ -135,7 +137,9 @@ public:
|
||||
|
||||
nsHTMLFrameInnerFrame();
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
#endif
|
||||
|
||||
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
|
||||
|
||||
@ -286,10 +290,12 @@ nsHTMLFrameOuterFrame::Paint(nsIPresContext& aPresContext,
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHODIMP nsHTMLFrameOuterFrame::GetFrameName(nsString& aResult) const
|
||||
{
|
||||
return MakeFrameName("FrameOuter", aResult);
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFrameOuterFrame::GetFrameType(nsIAtom** aType) const
|
||||
@ -566,10 +572,12 @@ PRInt32 nsHTMLFrameInnerFrame::GetMarginHeight(nsIPresContext* aPresContext, nsI
|
||||
return marginHeight;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHODIMP nsHTMLFrameInnerFrame::GetFrameName(nsString& aResult) const
|
||||
{
|
||||
return MakeFrameName("FrameInner", aResult);
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFrameInnerFrame::GetFrameType(nsIAtom** aType) const
|
||||
|
@ -17,6 +17,9 @@
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsFrameList.h"
|
||||
#ifdef NS_DEBUG
|
||||
#include "nsIFrameDebug.h"
|
||||
#endif
|
||||
|
||||
void
|
||||
nsFrameList::DestroyFrames(nsIPresContext& aPresContext)
|
||||
@ -345,14 +348,20 @@ nsFrameList::VerifyParent(nsIFrame* aParent) const
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
void
|
||||
nsFrameList::List(nsIPresContext* aPresContext, FILE* out) const
|
||||
{
|
||||
fputs("<\n", out);
|
||||
nsIFrame* frame = mFirstChild;
|
||||
while (nsnull != frame) {
|
||||
frame->List(aPresContext, out, 1);
|
||||
nsIFrameDebug* frameDebug;
|
||||
|
||||
if (NS_SUCCEEDED(frame->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) {
|
||||
frameDebug->List(aPresContext, out, 1);
|
||||
}
|
||||
frame->GetNextSibling(&frame);
|
||||
}
|
||||
fputs(">\n", out);
|
||||
}
|
||||
#endif
|
||||
|
@ -121,7 +121,9 @@ public:
|
||||
|
||||
void VerifyParent(nsIFrame* aParent) const;
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
void List(nsIPresContext* aPresContext, FILE* out) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
nsIFrame* mFirstChild;
|
||||
|
@ -102,7 +102,9 @@ void nsFramesetDrag::UnSet()
|
||||
class nsHTMLFramesetBorderFrame : public nsLeafFrame {
|
||||
|
||||
public:
|
||||
#ifdef DEBUG
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
#endif
|
||||
|
||||
NS_IMETHOD HandleEvent(nsIPresContext& aPresContext,
|
||||
nsGUIEvent* aEvent,
|
||||
@ -153,7 +155,9 @@ protected:
|
||||
class nsHTMLFramesetBlankFrame : public nsLeafFrame {
|
||||
|
||||
public:
|
||||
#ifdef DEBUG
|
||||
NS_IMETHOD List(nsIPresContext* aPresContext, FILE* out = stdout, PRInt32 aIndent = 0) const;
|
||||
#endif
|
||||
|
||||
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
@ -1713,10 +1717,12 @@ nsHTMLFramesetBorderFrame::GetCursor(nsIPresContext& aPresContext,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHODIMP nsHTMLFramesetBorderFrame::GetFrameName(nsString& aResult) const
|
||||
{
|
||||
return MakeFrameName("FramesetBorder", aResult);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
* nsHTMLFramesetBlankFrame
|
||||
@ -1780,7 +1786,7 @@ nsHTMLFramesetBlankFrame::Paint(nsIPresContext& aPresContext,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHODIMP nsHTMLFramesetBlankFrame::List(nsIPresContext* aPresContext,
|
||||
FILE* out,
|
||||
PRInt32 aIndent) const
|
||||
@ -1789,4 +1795,4 @@ NS_IMETHODIMP nsHTMLFramesetBlankFrame::List(nsIPresContext* aPresContext,
|
||||
fprintf(out, "%p BLANK \n", this);
|
||||
return nsLeafFrame::List(aPresContext, out, aIndent);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -26,6 +26,7 @@
|
||||
|
||||
static NS_DEFINE_IID(kIFrameUtilIID, NS_IFRAME_UTIL_IID);
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
class nsFrameUtil : public nsIFrameUtil {
|
||||
public:
|
||||
nsFrameUtil();
|
||||
@ -630,3 +631,4 @@ nsFrameUtil::DumpRegressionData(FILE* aInputFile, FILE* aOutputFile)
|
||||
}
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
#endif
|
||||
|
@ -611,11 +611,13 @@ nsGfxScrollFrame::GetFrameType(nsIAtom** aType) const
|
||||
return nsHTMLContainerFrame::GetFrameType(aType);
|
||||
}
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
NS_IMETHODIMP
|
||||
nsGfxScrollFrame::GetFrameName(nsString& aResult) const
|
||||
{
|
||||
return MakeFrameName("GfxScroll", aResult);
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsGfxScrollFrame::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
|
@ -107,7 +107,9 @@ public:
|
||||
*/
|
||||
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
nsGfxScrollFrame(nsIDocument* aDocument);
|
||||
|
@ -88,8 +88,8 @@ public:
|
||||
*/
|
||||
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
|
||||
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
#ifdef DEBUG
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
|
||||
#endif
|
||||
|
||||
@ -445,13 +445,13 @@ RootFrame::GetFrameType(nsIAtom** aType) const
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHODIMP
|
||||
RootFrame::GetFrameName(nsString& aResult) const
|
||||
{
|
||||
return MakeFrameName("Root", aResult);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHODIMP
|
||||
RootFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
|
||||
{
|
||||
|
@ -862,42 +862,7 @@ public:
|
||||
*/
|
||||
NS_IMETHOD Scrolled(nsIView *aView) = 0;
|
||||
|
||||
// Debugging
|
||||
NS_IMETHOD List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const = 0;
|
||||
|
||||
/**
|
||||
* Get a printable from of the name of the frame type.
|
||||
*/
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const = 0;
|
||||
|
||||
/**
|
||||
* Called to dump out regression data that describes the layout
|
||||
* of the frame and it's 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(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) = 0;
|
||||
|
||||
/**
|
||||
* Get the size of the frame object. The size value should include
|
||||
* all subordinate data referenced by the frame that is not
|
||||
* accounted for by child frames. However, this value should not
|
||||
* include the content objects, style contexts, views or other data
|
||||
* that lies logically outside the frame system.
|
||||
*
|
||||
* If the implementation so chooses, instead of returning the total
|
||||
* subordinate data it may instead use the sizeof handler to store
|
||||
* away subordinate data under its own key so that the subordinate
|
||||
* data may be tabulated independently of the frame itself.
|
||||
*
|
||||
* The caller is responsible for recursing over all child-lists that
|
||||
* the frame supports.
|
||||
*/
|
||||
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const = 0;
|
||||
|
||||
NS_IMETHOD VerifyTree() const = 0;
|
||||
|
||||
/** Selection related calls
|
||||
*/
|
||||
@ -928,45 +893,6 @@ public:
|
||||
*/
|
||||
NS_IMETHOD PeekOffset(nsIPresContext* aPresContext, nsPeekOffsetStruct *aPos) = 0;
|
||||
|
||||
/**
|
||||
* See if tree verification is enabled. To enable tree verification add
|
||||
* "frameverifytree:1" to your NSPR_LOG_MODULES environment variable
|
||||
* (any non-zero debug level will work). Or, call SetVerifyTreeEnable
|
||||
* with PR_TRUE.
|
||||
*/
|
||||
static NS_LAYOUT PRBool GetVerifyTreeEnable();
|
||||
|
||||
/**
|
||||
* Set the verify-tree enable flag.
|
||||
*/
|
||||
static NS_LAYOUT void SetVerifyTreeEnable(PRBool aEnabled);
|
||||
|
||||
/**
|
||||
* 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 NS_LAYOUT PRBool GetVerifyStyleTreeEnable();
|
||||
|
||||
/**
|
||||
* Set the verify-style-tree enable flag.
|
||||
*/
|
||||
static NS_LAYOUT 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 NS_LAYOUT PRLogModuleInfo* GetLogModuleInfo();
|
||||
|
||||
// Show frame borders when rendering
|
||||
static NS_LAYOUT void ShowFrameBorders(PRBool aEnable);
|
||||
static NS_LAYOUT PRBool GetShowFrameBorders();
|
||||
|
||||
private:
|
||||
NS_IMETHOD_(nsrefcnt) AddRef(void) = 0;
|
||||
NS_IMETHOD_(nsrefcnt) Release(void) = 0;
|
||||
|
119
layout/generic/nsIFrameDebug.h
Normal file
119
layout/generic/nsIFrameDebug.h
Normal file
@ -0,0 +1,119 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#ifndef nsIFrameDebug_h___
|
||||
#define nsIFrameDebug_h___
|
||||
|
||||
#include "nslayout.h"
|
||||
#include "nsISupports.h"
|
||||
|
||||
class nsIFrame;
|
||||
class nsIPresContext;
|
||||
|
||||
// IID for the nsIFrameDebug interface {a6cf9069-15b3-11d2-932e-00805f8add32}
|
||||
#define NS_IFRAMEDEBUG_IID \
|
||||
{ 0xa6cf9069, 0x15b3, 0x11d2, \
|
||||
{0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}}
|
||||
|
||||
/**
|
||||
* Debug related functions
|
||||
*/
|
||||
class nsIFrameDebug : public nsISupports {
|
||||
public:
|
||||
static const nsIID& GetIID() { static nsIID iid = NS_IFRAMEDEBUG_IID; return iid; }
|
||||
|
||||
NS_IMETHOD List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const = 0;
|
||||
|
||||
/**
|
||||
* Get a printable from of the name of the frame type.
|
||||
* XXX This should be eliminated and we use GetFrameType() instead...
|
||||
*/
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const = 0;
|
||||
/**
|
||||
* Called to dump out regression data that describes the layout
|
||||
* of the frame and it's 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(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) = 0;
|
||||
|
||||
/**
|
||||
* Get the size of the frame object. The size value should include
|
||||
* all subordinate data referenced by the frame that is not
|
||||
* accounted for by child frames. However, this value should not
|
||||
* include the content objects, style contexts, views or other data
|
||||
* that lies logically outside the frame system.
|
||||
*
|
||||
* If the implementation so chooses, instead of returning the total
|
||||
* subordinate data it may instead use the sizeof handler to store
|
||||
* away subordinate data under its own key so that the subordinate
|
||||
* data may be tabulated independently of the frame itself.
|
||||
*
|
||||
* The caller is responsible for recursing over all child-lists that
|
||||
* the frame supports.
|
||||
*/
|
||||
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const = 0;
|
||||
|
||||
NS_IMETHOD VerifyTree() const = 0;
|
||||
|
||||
/**
|
||||
* See if tree verification is enabled. To enable tree verification add
|
||||
* "frameverifytree:1" to your NSPR_LOG_MODULES environment variable
|
||||
* (any non-zero debug level will work). Or, call SetVerifyTreeEnable
|
||||
* with PR_TRUE.
|
||||
*/
|
||||
static NS_LAYOUT PRBool GetVerifyTreeEnable();
|
||||
|
||||
/**
|
||||
* Set the verify-tree enable flag.
|
||||
*/
|
||||
static NS_LAYOUT void SetVerifyTreeEnable(PRBool aEnabled);
|
||||
|
||||
/**
|
||||
* 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 NS_LAYOUT PRBool GetVerifyStyleTreeEnable();
|
||||
|
||||
/**
|
||||
* Set the verify-style-tree enable flag.
|
||||
*/
|
||||
static NS_LAYOUT 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 NS_LAYOUT PRLogModuleInfo* GetLogModuleInfo();
|
||||
|
||||
// Show frame borders when rendering
|
||||
static NS_LAYOUT void ShowFrameBorders(PRBool aEnable);
|
||||
static NS_LAYOUT PRBool GetShowFrameBorders();
|
||||
|
||||
private:
|
||||
NS_IMETHOD_(nsrefcnt) AddRef(void) = 0;
|
||||
NS_IMETHOD_(nsrefcnt) Release(void) = 0;
|
||||
};
|
||||
|
||||
#endif /* nsIFrameDebug_h___ */
|
@ -517,6 +517,7 @@ nsImageFrame::Paint(nsIPresContext& aPresContext,
|
||||
aRenderingContext.DrawImage(image, inner);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
if ((NS_FRAME_PAINT_LAYER_DEBUG == aWhichLayer) &&
|
||||
GetShowFrameBorders()) {
|
||||
nsImageMap* map = GetImageMap();
|
||||
@ -531,6 +532,7 @@ nsImageFrame::Paint(nsIPresContext& aPresContext,
|
||||
aRenderingContext.PopState(clipState);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow) {
|
||||
|
@ -70,11 +70,13 @@ nsInlineFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
return nsInlineFrameSuper::QueryInterface(aIID, aInstancePtr);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHODIMP
|
||||
nsInlineFrame::GetFrameName(nsString& aResult) const
|
||||
{
|
||||
return MakeFrameName("Inline", aResult);
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsInlineFrame::GetFrameType(nsIAtom** aType) const
|
||||
@ -660,11 +662,13 @@ nsFirstLineFrame::nsFirstLineFrame()
|
||||
{
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHODIMP
|
||||
nsFirstLineFrame::GetFrameName(nsString& aResult) const
|
||||
{
|
||||
return MakeFrameName("Line", aResult);
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsFirstLineFrame::GetFrameType(nsIAtom** aType) const
|
||||
|
@ -63,7 +63,9 @@ public:
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aOldFrame,
|
||||
nsIFrame* aNewFrame);
|
||||
#ifdef DEBUG
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
#endif
|
||||
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
|
||||
|
||||
// nsIHTMLReflow overrides
|
||||
|
@ -92,6 +92,7 @@ nsLineBox::Reset(nsIFrame* aFrame, PRInt32 aCount, PRBool aIsBlock)
|
||||
mFlags.mBlock = aIsBlock;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
static void
|
||||
ListFloaters(FILE* out, PRInt32 aIndent, const nsFloaterCacheList& aFloaters)
|
||||
{
|
||||
@ -104,8 +105,12 @@ ListFloaters(FILE* out, PRInt32 aIndent, const nsFloaterCacheList& aFloaters)
|
||||
fprintf(out, "placeholder@%p ", ph);
|
||||
nsIFrame* frame = ph->GetOutOfFlowFrame();
|
||||
if (nsnull != frame) {
|
||||
frame->GetFrameName(frameName);
|
||||
fputs(frameName, out);
|
||||
nsIFrameDebug* frameDebug;
|
||||
|
||||
if (NS_SUCCEEDED(frame->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) {
|
||||
frameDebug->GetFrameName(frameName);
|
||||
fputs(frameName, out);
|
||||
}
|
||||
}
|
||||
fprintf(out, " %s region={%d,%d,%d,%d} combinedArea={%d,%d,%d,%d}",
|
||||
fc->mIsCurrentLineFloater ? "cl" : "bcl",
|
||||
@ -119,6 +124,7 @@ ListFloaters(FILE* out, PRInt32 aIndent, const nsFloaterCacheList& aFloaters)
|
||||
fc = fc->Next();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
char*
|
||||
nsLineBox::StateToString(char* aBuf, PRInt32 aBufSize) const
|
||||
@ -132,6 +138,7 @@ nsLineBox::StateToString(char* aBuf, PRInt32 aBufSize) const
|
||||
return aBuf;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
void
|
||||
nsLineBox::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const
|
||||
{
|
||||
@ -159,7 +166,11 @@ nsLineBox::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const
|
||||
nsIFrame* frame = mFirstChild;
|
||||
PRInt32 n = GetChildCount();
|
||||
while (--n >= 0) {
|
||||
frame->List(aPresContext, out, aIndent + 1);
|
||||
nsIFrameDebug* frameDebug;
|
||||
|
||||
if (NS_SUCCEEDED(frame->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) {
|
||||
frameDebug->List(aPresContext, out, aIndent + 1);
|
||||
}
|
||||
frame->GetNextSibling(&frame);
|
||||
}
|
||||
|
||||
@ -171,6 +182,7 @@ nsLineBox::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const
|
||||
}
|
||||
fputs(">\n", out);
|
||||
}
|
||||
#endif
|
||||
|
||||
nsIFrame*
|
||||
nsLineBox::LastChild() const
|
||||
|
@ -261,7 +261,9 @@ public:
|
||||
static nsLineBox* FindLineContaining(nsLineBox* aLine, nsIFrame* aFrame,
|
||||
PRInt32* aFrameIndexInLine);
|
||||
|
||||
#ifdef DEBUG
|
||||
void List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const;
|
||||
#endif
|
||||
|
||||
nsIFrame* LastChild() const;
|
||||
|
||||
|
@ -62,6 +62,7 @@ nsTextRun::~nsTextRun()
|
||||
MOZ_COUNT_DTOR(nsTextRun);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
void
|
||||
nsTextRun::List(FILE* out, PRInt32 aIndent)
|
||||
{
|
||||
@ -72,12 +73,17 @@ nsTextRun::List(FILE* out, PRInt32 aIndent)
|
||||
for (i = 0; i < n; i++) {
|
||||
nsIFrame* text = (nsIFrame*) mArray.ElementAt(i);
|
||||
nsAutoString tmp;
|
||||
text->GetFrameName(tmp);
|
||||
fputs(tmp, out);
|
||||
nsIFrameDebug* frameDebug;
|
||||
|
||||
if (NS_SUCCEEDED(text->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) {
|
||||
frameDebug->GetFrameName(tmp);
|
||||
fputs(tmp, out);
|
||||
}
|
||||
printf("@%p ", text);
|
||||
}
|
||||
fputs(">\n", out);
|
||||
}
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
@ -1827,11 +1833,13 @@ nsLineLayout::VerticalAlignFrames(PerSpanData* psd)
|
||||
const nsStyleText* textStyle;
|
||||
frame->GetStyleData(eStyleStruct_Text, (const nsStyleStruct*&)textStyle);
|
||||
nsStyleUnit verticalAlignUnit = textStyle->mVerticalAlign.GetUnit();
|
||||
#ifdef DEBUG
|
||||
if (eStyleUnit_Inherit == verticalAlignUnit) {
|
||||
printf("XXX: vertical-align: inherit not implemented for ");
|
||||
nsFrame::ListTag(stdout, frame);
|
||||
printf("\n");
|
||||
}
|
||||
#endif
|
||||
#ifdef NOISY_VERTICAL_ALIGN
|
||||
printf(" ");
|
||||
nsFrame::ListTag(stdout, frame);
|
||||
|
@ -200,7 +200,9 @@ public:
|
||||
|
||||
NS_IMETHOD Scrolled(nsIView *aView);
|
||||
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
|
||||
#ifdef DEBUG
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
#endif
|
||||
|
||||
NS_IMETHOD ContentChanged(nsIPresContext* aPresContext,
|
||||
nsIContent* aChild,
|
||||
@ -402,11 +404,13 @@ nsObjectFrame::GetFrameType(nsIAtom** aType) const
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHODIMP
|
||||
nsObjectFrame::GetFrameName(nsString& aResult) const
|
||||
{
|
||||
return MakeFrameName("ObjectFrame", aResult);
|
||||
}
|
||||
#endif
|
||||
|
||||
nsresult
|
||||
nsObjectFrame::CreateWidget(nsIPresContext* aPresContext,
|
||||
|
@ -157,11 +157,13 @@ nsPageFrame::GetFrameType(nsIAtom** aType) const
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHODIMP
|
||||
nsPageFrame::GetFrameName(nsString& aResult) const
|
||||
{
|
||||
return MakeFrameName("Page", aResult);
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPageFrame::IsPercentageBase(PRBool& aBase) const
|
||||
|
@ -38,8 +38,10 @@ public:
|
||||
*/
|
||||
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
|
||||
|
||||
#ifdef DEBUG
|
||||
// Debugging
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
nsPageFrame();
|
||||
|
@ -58,6 +58,16 @@ nsPlaceholderFrame::Reflow(nsIPresContext& aPresContext,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPlaceholderFrame::GetFrameType(nsIAtom** aType) const
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aType, "null OUT parameter pointer");
|
||||
*aType = nsLayoutAtoms::placeholderFrame;
|
||||
NS_ADDREF(*aType);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHODIMP
|
||||
nsPlaceholderFrame::Paint(nsIPresContext& aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
@ -78,16 +88,6 @@ nsPlaceholderFrame::Paint(nsIPresContext& aPresContext,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPlaceholderFrame::GetFrameType(nsIAtom** aType) const
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aType, "null OUT parameter pointer");
|
||||
*aType = nsLayoutAtoms::placeholderFrame;
|
||||
NS_ADDREF(*aType);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPlaceholderFrame::GetFrameName(nsString& aResult) const
|
||||
{
|
||||
@ -116,7 +116,6 @@ nsPlaceholderFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aInden
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHODIMP
|
||||
nsPlaceholderFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
|
||||
{
|
||||
|
@ -42,11 +42,13 @@ public:
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
// nsIFrame overrides
|
||||
#ifdef DEBUG
|
||||
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect,
|
||||
nsFramePaintLayer aWhichLayer);
|
||||
NS_IMETHOD List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Get the "type" of the frame
|
||||
@ -55,9 +57,9 @@ public:
|
||||
*/
|
||||
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
|
||||
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
#ifdef DEBUG
|
||||
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
@ -279,11 +279,13 @@ nsSimplePageSequenceFrame::Reflow(nsIPresContext& aPresContext,
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHODIMP
|
||||
nsSimplePageSequenceFrame::GetFrameName(nsString& aResult) const
|
||||
{
|
||||
return MakeFrameName("SimplePageSequence", aResult);
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSimplePageSequenceFrame::Paint(nsIPresContext& aPresContext,
|
||||
|
@ -47,8 +47,10 @@ public:
|
||||
const nsPrintOptions& aPrintOptions,
|
||||
nsIPrintStatusCallback* aStatusCallback);
|
||||
|
||||
#ifdef DEBUG
|
||||
// Debugging
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
nsSimplePageSequenceFrame();
|
||||
|
@ -23,7 +23,9 @@
|
||||
#include "nsVoidArray.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsString.h"
|
||||
|
||||
#ifdef DEBUG
|
||||
#include "nsIFrameDebug.h"
|
||||
#endif
|
||||
static NS_DEFINE_IID(kISpaceManagerIID, NS_ISPACEMANAGER_IID);
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
@ -904,18 +906,22 @@ nsSpaceManager::ClearRegions()
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHODIMP
|
||||
nsSpaceManager::List(FILE* out)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
nsAutoString tmp;
|
||||
|
||||
fprintf(out, "SpaceManager@%p", this);
|
||||
if (mFrame) {
|
||||
mFrame->GetFrameName(tmp);
|
||||
fprintf(out, " frame=");
|
||||
fputs(tmp, out);
|
||||
fprintf(out, "@%p", mFrame);
|
||||
nsIFrameDebug* frameDebug;
|
||||
|
||||
if (NS_SUCCEEDED(mFrame->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) {
|
||||
frameDebug->GetFrameName(tmp);
|
||||
fprintf(out, " frame=");
|
||||
fputs(tmp, out);
|
||||
fprintf(out, "@%p", mFrame);
|
||||
}
|
||||
}
|
||||
fprintf(out, " xy=%d,%d <\n", mX, mY);
|
||||
if (mBandList.IsEmpty()) {
|
||||
@ -928,10 +934,14 @@ nsSpaceManager::List(FILE* out)
|
||||
band->mLeft, band->mTop, band->mRight, band->mBottom,
|
||||
band->mNumFrames);
|
||||
if (1 == band->mNumFrames) {
|
||||
band->mFrame->GetFrameName(tmp);
|
||||
fprintf(out, " frame=");
|
||||
fputs(tmp, out);
|
||||
fprintf(out, "@%p", band->mFrame);
|
||||
nsIFrameDebug* frameDebug;
|
||||
|
||||
if (NS_SUCCEEDED(band->mFrame->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) {
|
||||
frameDebug->GetFrameName(tmp);
|
||||
fprintf(out, " frame=");
|
||||
fputs(tmp, out);
|
||||
fprintf(out, "@%p", band->mFrame);
|
||||
}
|
||||
}
|
||||
else if (1 < band->mNumFrames) {
|
||||
fprintf(out, "\n ");
|
||||
@ -940,9 +950,13 @@ nsSpaceManager::List(FILE* out)
|
||||
for (i = 0; i < n; i++) {
|
||||
nsIFrame* frame = (nsIFrame*) a->ElementAt(i);
|
||||
if (frame) {
|
||||
frame->GetFrameName(tmp);
|
||||
fputs(tmp, out);
|
||||
fprintf(out, "@%p ", frame);
|
||||
nsIFrameDebug* frameDebug;
|
||||
|
||||
if (NS_SUCCEEDED(frame->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) {
|
||||
frameDebug->GetFrameName(tmp);
|
||||
fputs(tmp, out);
|
||||
fprintf(out, "@%p ", frame);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -951,9 +965,9 @@ nsSpaceManager::List(FILE* out)
|
||||
} while (band != mBandList.Head());
|
||||
}
|
||||
fprintf(out, ">\n");
|
||||
#endif
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
nsSpaceManager::FrameInfo*
|
||||
nsSpaceManager::GetFrameInfoFor(nsIFrame* aFrame)
|
||||
|
@ -53,10 +53,10 @@ public:
|
||||
NS_IMETHOD RemoveRegion(nsIFrame* aFrame);
|
||||
|
||||
NS_IMETHOD ClearRegions();
|
||||
NS_IMETHOD List(FILE* out);
|
||||
|
||||
#ifdef DEBUG
|
||||
void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
|
||||
NS_IMETHOD List(FILE* out);
|
||||
void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
@ -154,6 +154,7 @@ nsIFrame * nsSplittableFrame::GetNextInFlow()
|
||||
return mNextInFlow;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
void
|
||||
nsSplittableFrame::DumpBaseRegressionData(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent)
|
||||
{
|
||||
@ -169,7 +170,6 @@ nsSplittableFrame::DumpBaseRegressionData(nsIPresContext* aPresContext, FILE* ou
|
||||
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHODIMP
|
||||
nsSplittableFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
|
||||
{
|
||||
|
@ -62,7 +62,9 @@ public:
|
||||
nsIFrame* GetNextInFlow();
|
||||
|
||||
protected:
|
||||
#ifdef DEBUG
|
||||
virtual void DumpBaseRegressionData(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent);
|
||||
#endif
|
||||
|
||||
nsIFrame* mPrevInFlow;
|
||||
nsIFrame* mNextInFlow;
|
||||
|
@ -313,8 +313,6 @@ public:
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHOD List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const;
|
||||
|
||||
/**
|
||||
* Get the "type" of the frame
|
||||
*
|
||||
@ -322,10 +320,10 @@ public:
|
||||
*/
|
||||
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
|
||||
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHOD List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const;
|
||||
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
#endif
|
||||
|
||||
NS_IMETHOD GetPosition(nsIPresContext& aCX,
|
||||
@ -3424,7 +3422,6 @@ nsTextFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
|
||||
*aResult = sizeof(*this);
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsTextFrame::GetFrameName(nsString& aResult) const
|
||||
@ -3487,3 +3484,5 @@ nsTextFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) cons
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -82,8 +82,8 @@ public:
|
||||
*/
|
||||
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
|
||||
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
#ifdef DEBUG
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
|
||||
#endif
|
||||
|
||||
@ -563,13 +563,13 @@ ViewportFrame::GetFrameType(nsIAtom** aType) const
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHODIMP
|
||||
ViewportFrame::GetFrameName(nsString& aResult) const
|
||||
{
|
||||
return MakeFrameName("Viewport", aResult);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHODIMP
|
||||
ViewportFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
|
||||
{
|
||||
|
@ -378,13 +378,13 @@ nsAreaFrame::DidReflow(nsIPresContext& aPresContext,
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Diagnostics
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
NS_IMETHODIMP
|
||||
nsAreaFrame::GetFrameName(nsString& aResult) const
|
||||
{
|
||||
return MakeFrameName("Area", aResult);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHODIMP
|
||||
nsAreaFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
|
||||
{
|
||||
|
@ -88,9 +88,8 @@ public:
|
||||
*/
|
||||
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
|
||||
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
|
||||
#endif
|
||||
|
||||
|
@ -30,10 +30,12 @@
|
||||
class BRFrame : public nsFrame {
|
||||
public:
|
||||
// nsIFrame
|
||||
#ifdef NS_DEBUG
|
||||
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect,
|
||||
nsFramePaintLayer aWhichLayer);
|
||||
#endif
|
||||
|
||||
// nsIHTMLReflow
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
@ -70,6 +72,7 @@ BRFrame::~BRFrame()
|
||||
{
|
||||
}
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
NS_IMETHODIMP
|
||||
BRFrame::Paint(nsIPresContext& aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
@ -85,6 +88,7 @@ BRFrame::Paint(nsIPresContext& aPresContext,
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
BRFrame::Reflow(nsIPresContext& aPresContext,
|
||||
|
@ -1158,6 +1158,7 @@ nsBlockFrame::IsSplittable(nsSplittableType& aIsSplittable) const
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
static void
|
||||
ListTextRuns(FILE* out, PRInt32 aIndent, nsTextRun* aRuns)
|
||||
{
|
||||
@ -1170,7 +1171,6 @@ ListTextRuns(FILE* out, PRInt32 aIndent, nsTextRun* aRuns)
|
||||
NS_METHOD
|
||||
nsBlockFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const
|
||||
{
|
||||
#ifdef DEBUG
|
||||
IndentBy(out, aIndent);
|
||||
ListTag(out);
|
||||
nsIView* view;
|
||||
@ -1242,7 +1242,11 @@ nsBlockFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) con
|
||||
}
|
||||
fputs("<\n", out);
|
||||
while (nsnull != kid) {
|
||||
kid->List(aPresContext, out, aIndent + 1);
|
||||
nsIFrameDebug* frameDebug;
|
||||
|
||||
if (NS_SUCCEEDED(kid->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) {
|
||||
frameDebug->List(aPresContext, out, aIndent + 1);
|
||||
}
|
||||
kid->GetNextSibling(&kid);
|
||||
}
|
||||
IndentBy(out, aIndent);
|
||||
@ -1266,7 +1270,6 @@ nsBlockFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) con
|
||||
IndentBy(out, aIndent);
|
||||
fputs(">\n", out);
|
||||
|
||||
#endif
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -1275,6 +1278,7 @@ nsBlockFrame::GetFrameName(nsString& aResult) const
|
||||
{
|
||||
return MakeFrameName("Block", aResult);
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::GetFrameType(nsIAtom** aType) const
|
||||
@ -5682,7 +5686,6 @@ nsBlockFrame::IsChild(nsIFrame* aFrame)
|
||||
}
|
||||
return PR_FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::VerifyTree() const
|
||||
@ -5691,7 +5694,6 @@ nsBlockFrame::VerifyTree() const
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
|
||||
{
|
||||
|
@ -90,13 +90,13 @@ public:
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect,
|
||||
nsFramePaintLayer aWhichLayer);
|
||||
NS_IMETHOD List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const;
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
|
||||
#ifdef DEBUG
|
||||
NS_IMETHOD List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const;
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
|
||||
#endif
|
||||
NS_IMETHOD VerifyTree() const;
|
||||
#endif
|
||||
NS_IMETHOD GetFrameForPoint(nsIPresContext* aPresContext, const nsPoint& aPoint, nsIFrame** aFrame);
|
||||
NS_IMETHOD HandleEvent(nsIPresContext& aPresContext,
|
||||
nsGUIEvent* aEvent,
|
||||
|
@ -1158,6 +1158,7 @@ nsBlockFrame::IsSplittable(nsSplittableType& aIsSplittable) const
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
static void
|
||||
ListTextRuns(FILE* out, PRInt32 aIndent, nsTextRun* aRuns)
|
||||
{
|
||||
@ -1170,7 +1171,6 @@ ListTextRuns(FILE* out, PRInt32 aIndent, nsTextRun* aRuns)
|
||||
NS_METHOD
|
||||
nsBlockFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const
|
||||
{
|
||||
#ifdef DEBUG
|
||||
IndentBy(out, aIndent);
|
||||
ListTag(out);
|
||||
nsIView* view;
|
||||
@ -1242,7 +1242,11 @@ nsBlockFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) con
|
||||
}
|
||||
fputs("<\n", out);
|
||||
while (nsnull != kid) {
|
||||
kid->List(aPresContext, out, aIndent + 1);
|
||||
nsIFrameDebug* frameDebug;
|
||||
|
||||
if (NS_SUCCEEDED(kid->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) {
|
||||
frameDebug->List(aPresContext, out, aIndent + 1);
|
||||
}
|
||||
kid->GetNextSibling(&kid);
|
||||
}
|
||||
IndentBy(out, aIndent);
|
||||
@ -1266,7 +1270,6 @@ nsBlockFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) con
|
||||
IndentBy(out, aIndent);
|
||||
fputs(">\n", out);
|
||||
|
||||
#endif
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -1275,6 +1278,7 @@ nsBlockFrame::GetFrameName(nsString& aResult) const
|
||||
{
|
||||
return MakeFrameName("Block", aResult);
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::GetFrameType(nsIAtom** aType) const
|
||||
@ -5682,7 +5686,6 @@ nsBlockFrame::IsChild(nsIFrame* aFrame)
|
||||
}
|
||||
return PR_FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::VerifyTree() const
|
||||
@ -5691,7 +5694,6 @@ nsBlockFrame::VerifyTree() const
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
|
||||
{
|
||||
|
@ -1158,6 +1158,7 @@ nsBlockFrame::IsSplittable(nsSplittableType& aIsSplittable) const
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
static void
|
||||
ListTextRuns(FILE* out, PRInt32 aIndent, nsTextRun* aRuns)
|
||||
{
|
||||
@ -1170,7 +1171,6 @@ ListTextRuns(FILE* out, PRInt32 aIndent, nsTextRun* aRuns)
|
||||
NS_METHOD
|
||||
nsBlockFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const
|
||||
{
|
||||
#ifdef DEBUG
|
||||
IndentBy(out, aIndent);
|
||||
ListTag(out);
|
||||
nsIView* view;
|
||||
@ -1242,7 +1242,11 @@ nsBlockFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) con
|
||||
}
|
||||
fputs("<\n", out);
|
||||
while (nsnull != kid) {
|
||||
kid->List(aPresContext, out, aIndent + 1);
|
||||
nsIFrameDebug* frameDebug;
|
||||
|
||||
if (NS_SUCCEEDED(kid->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) {
|
||||
frameDebug->List(aPresContext, out, aIndent + 1);
|
||||
}
|
||||
kid->GetNextSibling(&kid);
|
||||
}
|
||||
IndentBy(out, aIndent);
|
||||
@ -1266,7 +1270,6 @@ nsBlockFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) con
|
||||
IndentBy(out, aIndent);
|
||||
fputs(">\n", out);
|
||||
|
||||
#endif
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -1275,6 +1278,7 @@ nsBlockFrame::GetFrameName(nsString& aResult) const
|
||||
{
|
||||
return MakeFrameName("Block", aResult);
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::GetFrameType(nsIAtom** aType) const
|
||||
@ -5682,7 +5686,6 @@ nsBlockFrame::IsChild(nsIFrame* aFrame)
|
||||
}
|
||||
return PR_FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::VerifyTree() const
|
||||
@ -5691,7 +5694,6 @@ nsBlockFrame::VerifyTree() const
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
|
||||
{
|
||||
|
@ -86,11 +86,13 @@ nsBulletFrame::Init(nsIPresContext& aPresContext,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
NS_IMETHODIMP
|
||||
nsBulletFrame::GetFrameName(nsString& aResult) const
|
||||
{
|
||||
return MakeFrameName("Bullet", aResult);
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBulletFrame::GetFrameType(nsIAtom** aType) const
|
||||
|
@ -44,7 +44,9 @@ public:
|
||||
const nsRect& aDirtyRect,
|
||||
nsFramePaintLayer aWhichLayer);
|
||||
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
|
||||
#ifdef NS_DEBUG
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
#endif
|
||||
|
||||
// nsIHTMLReflow
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
|
@ -248,7 +248,7 @@ nsContainerFrame::PaintChild(nsIPresContext& aPresContext,
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
// Draw a border around the child
|
||||
if (nsIFrame::GetShowFrameBorders() && !kidRect.IsEmpty()) {
|
||||
if (nsIFrameDebug::GetShowFrameBorders() && !kidRect.IsEmpty()) {
|
||||
aRenderingContext.SetColor(NS_RGB(255,0,0));
|
||||
aRenderingContext.DrawRect(kidRect);
|
||||
}
|
||||
@ -605,6 +605,7 @@ nsContainerFrame::MoveOverflowToChildList(nsIPresContext* aPresContext)
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Debugging
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
NS_IMETHODIMP
|
||||
nsContainerFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const
|
||||
{
|
||||
@ -649,7 +650,11 @@ nsContainerFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent)
|
||||
}
|
||||
fputs("<\n", out);
|
||||
while (nsnull != kid) {
|
||||
kid->List(aPresContext, out, aIndent + 1);
|
||||
nsIFrameDebug* frameDebug;
|
||||
|
||||
if (NS_SUCCEEDED(kid->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) {
|
||||
frameDebug->List(aPresContext, out, aIndent + 1);
|
||||
}
|
||||
kid->GetNextSibling(&kid);
|
||||
}
|
||||
IndentBy(out, aIndent);
|
||||
@ -666,7 +671,6 @@ nsContainerFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHODIMP
|
||||
nsContainerFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
|
||||
{
|
||||
|
@ -45,8 +45,8 @@ public:
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aOldFrame,
|
||||
nsIFrame* aNewFrame);
|
||||
NS_IMETHOD List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const;
|
||||
#ifdef DEBUG
|
||||
NS_IMETHOD List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const;
|
||||
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
|
||||
#endif
|
||||
|
||||
|
@ -41,7 +41,9 @@ public:
|
||||
NS_IMETHOD SetInitialChildList(nsIPresContext& aPresContext,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aChildList);
|
||||
#ifdef NS_DEBUG
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
#endif
|
||||
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
@ -74,11 +76,13 @@ nsFirstLetterFrame::nsFirstLetterFrame()
|
||||
{
|
||||
}
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
NS_IMETHODIMP
|
||||
nsFirstLetterFrame::GetFrameName(nsString& aResult) const
|
||||
{
|
||||
return MakeFrameName("Letter", aResult);
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsFirstLetterFrame::GetFrameType(nsIAtom** aType) const
|
||||
|
@ -88,14 +88,15 @@ static void RefreshContentFrames(nsIPresContext& aPresContext, nsIContent * aSta
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
static PRBool gShowFrameBorders = PR_FALSE;
|
||||
|
||||
NS_LAYOUT void nsIFrame::ShowFrameBorders(PRBool aEnable)
|
||||
NS_LAYOUT void nsIFrameDebug::ShowFrameBorders(PRBool aEnable)
|
||||
{
|
||||
gShowFrameBorders = aEnable;
|
||||
}
|
||||
|
||||
NS_LAYOUT PRBool nsIFrame::GetShowFrameBorders()
|
||||
NS_LAYOUT PRBool nsIFrameDebug::GetShowFrameBorders()
|
||||
{
|
||||
return gShowFrameBorders;
|
||||
}
|
||||
@ -106,16 +107,13 @@ NS_LAYOUT PRBool nsIFrame::GetShowFrameBorders()
|
||||
*/
|
||||
static PRLogModuleInfo* gLogModule;
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
static PRLogModuleInfo* gFrameVerifyTreeLogModuleInfo;
|
||||
#endif
|
||||
|
||||
static PRBool gFrameVerifyTreeEnable = PRBool(0x55);
|
||||
|
||||
NS_LAYOUT PRBool
|
||||
nsIFrame::GetVerifyTreeEnable()
|
||||
nsIFrameDebug::GetVerifyTreeEnable()
|
||||
{
|
||||
#ifdef NS_DEBUG
|
||||
if (gFrameVerifyTreeEnable == PRBool(0x55)) {
|
||||
if (nsnull == gFrameVerifyTreeLogModuleInfo) {
|
||||
gFrameVerifyTreeLogModuleInfo = PR_NewLogModule("frameverifytree");
|
||||
@ -124,26 +122,22 @@ nsIFrame::GetVerifyTreeEnable()
|
||||
gFrameVerifyTreeEnable ? "en" : "dis");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return gFrameVerifyTreeEnable;
|
||||
}
|
||||
|
||||
NS_LAYOUT void
|
||||
nsIFrame::SetVerifyTreeEnable(PRBool aEnabled)
|
||||
nsIFrameDebug::SetVerifyTreeEnable(PRBool aEnabled)
|
||||
{
|
||||
gFrameVerifyTreeEnable = aEnabled;
|
||||
}
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
static PRLogModuleInfo* gStyleVerifyTreeLogModuleInfo;
|
||||
#endif
|
||||
|
||||
static PRBool gStyleVerifyTreeEnable = PRBool(0x55);
|
||||
|
||||
NS_LAYOUT PRBool
|
||||
nsIFrame::GetVerifyStyleTreeEnable()
|
||||
nsIFrameDebug::GetVerifyStyleTreeEnable()
|
||||
{
|
||||
#ifdef NS_DEBUG
|
||||
if (gStyleVerifyTreeEnable == PRBool(0x55)) {
|
||||
if (nsnull == gStyleVerifyTreeLogModuleInfo) {
|
||||
gStyleVerifyTreeLogModuleInfo = PR_NewLogModule("styleverifytree");
|
||||
@ -152,24 +146,24 @@ nsIFrame::GetVerifyStyleTreeEnable()
|
||||
gStyleVerifyTreeEnable ? "en" : "dis");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return gStyleVerifyTreeEnable;
|
||||
}
|
||||
|
||||
NS_LAYOUT void
|
||||
nsIFrame::SetVerifyStyleTreeEnable(PRBool aEnabled)
|
||||
nsIFrameDebug::SetVerifyStyleTreeEnable(PRBool aEnabled)
|
||||
{
|
||||
gStyleVerifyTreeEnable = aEnabled;
|
||||
}
|
||||
|
||||
NS_LAYOUT PRLogModuleInfo*
|
||||
nsIFrame::GetLogModuleInfo()
|
||||
nsIFrameDebug::GetLogModuleInfo()
|
||||
{
|
||||
if (nsnull == gLogModule) {
|
||||
gLogModule = PR_NewLogModule("frame");
|
||||
}
|
||||
return gLogModule;
|
||||
}
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
@ -1697,6 +1691,7 @@ PRInt32 nsFrame::ContentIndexInContainer(const nsIFrame* aFrame)
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
// Debugging
|
||||
NS_IMETHODIMP
|
||||
nsFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const
|
||||
@ -1744,6 +1739,7 @@ nsFrame::MakeFrameName(const char* aType, nsString& aResult) const
|
||||
aResult.Append(buf);
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
nsFrame::XMLQuote(nsString& aString)
|
||||
@ -1794,6 +1790,7 @@ nsFrame::ParentDisablesSelection() const
|
||||
*/
|
||||
}
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
NS_IMETHODIMP
|
||||
nsFrame::DumpRegressionData(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent)
|
||||
{
|
||||
@ -1861,7 +1858,11 @@ nsFrame::DumpBaseRegressionData(nsIPresContext* aPresContext, FILE* out, PRInt32
|
||||
}
|
||||
aIndent++;
|
||||
while (nsnull != kid) {
|
||||
kid->DumpRegressionData(aPresContext, out, aIndent);
|
||||
nsIFrameDebug* frameDebug;
|
||||
|
||||
if (NS_SUCCEEDED(kid->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) {
|
||||
frameDebug->DumpRegressionData(aPresContext, out, aIndent);
|
||||
}
|
||||
kid->GetNextSibling(&kid);
|
||||
}
|
||||
aIndent--;
|
||||
@ -1893,6 +1894,7 @@ nsFrame::VerifyTree() const
|
||||
NS_ASSERTION(0 == (mState & NS_FRAME_IN_REFLOW), "frame is in reflow");
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*this method may.. invalidate if the state was changed or if aForceRedraw is PR_TRUE
|
||||
it will not update immediately.*/
|
||||
|
@ -22,6 +22,9 @@
|
||||
#include "nsRect.h"
|
||||
#include "nsString.h"
|
||||
#include "prlog.h"
|
||||
#ifdef NS_DEBUG
|
||||
#include "nsIFrameDebug.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* nsFrame logging constants. We redefine the nspr
|
||||
@ -39,7 +42,7 @@
|
||||
#ifdef NS_DEBUG
|
||||
#define NS_FRAME_LOG(_bit,_args) \
|
||||
PR_BEGIN_MACRO \
|
||||
if (NS_FRAME_LOG_TEST(nsIFrame::GetLogModuleInfo(),_bit)) { \
|
||||
if (NS_FRAME_LOG_TEST(nsIFrameDebug::GetLogModuleInfo(),_bit)) { \
|
||||
PR_LogPrint _args; \
|
||||
} \
|
||||
PR_END_MACRO
|
||||
@ -56,14 +59,14 @@
|
||||
// XXX remove me
|
||||
#define NS_FRAME_TRACE_MSG(_bit,_args) \
|
||||
PR_BEGIN_MACRO \
|
||||
if (NS_FRAME_LOG_TEST(nsIFrame::GetLogModuleInfo(),_bit)) { \
|
||||
if (NS_FRAME_LOG_TEST(nsIFrameDebug::GetLogModuleInfo(),_bit)) { \
|
||||
TraceMsg _args; \
|
||||
} \
|
||||
PR_END_MACRO
|
||||
|
||||
#define NS_FRAME_TRACE(_bit,_args) \
|
||||
PR_BEGIN_MACRO \
|
||||
if (NS_FRAME_LOG_TEST(nsIFrame::GetLogModuleInfo(),_bit)) { \
|
||||
if (NS_FRAME_LOG_TEST(nsIFrameDebug::GetLogModuleInfo(),_bit)) { \
|
||||
TraceMsg _args; \
|
||||
} \
|
||||
PR_END_MACRO
|
||||
@ -93,6 +96,9 @@
|
||||
* behavior is to keep the frame and view position and size in sync.
|
||||
*/
|
||||
class nsFrame : public nsIFrame
|
||||
#ifdef NS_DEBUG
|
||||
, public nsIFrameDebug
|
||||
#endif
|
||||
{
|
||||
public:
|
||||
/**
|
||||
@ -215,11 +221,13 @@ public:
|
||||
NS_IMETHOD GetNextSibling(nsIFrame** aNextSibling) const;
|
||||
NS_IMETHOD SetNextSibling(nsIFrame* aNextSibling);
|
||||
NS_IMETHOD Scrolled(nsIView *aView);
|
||||
#ifdef NS_DEBUG
|
||||
NS_IMETHOD List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const;
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
NS_IMETHOD DumpRegressionData(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent);
|
||||
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
|
||||
NS_IMETHOD VerifyTree() const;
|
||||
#endif
|
||||
NS_IMETHOD SetSelected(nsIPresContext* aPresContext, nsIDOMRange *aRange,PRBool aSelected, nsSpread aSpread);
|
||||
NS_IMETHOD GetSelected(PRBool *aSelected) const;
|
||||
NS_IMETHOD PeekOffset(nsIPresContext* aPresContext, nsPeekOffsetStruct *aPos) ;
|
||||
@ -307,15 +315,18 @@ public:
|
||||
// Helper function that verifies that each frame in the list has the
|
||||
// NS_FRAME_IS_DIRTY bit set
|
||||
static void VerifyDirtyBitSet(nsIFrame* aFrameList);
|
||||
#endif
|
||||
|
||||
void ListTag(FILE* out) const {
|
||||
ListTag(out, this);
|
||||
ListTag(out, (nsIFrame*)this);
|
||||
}
|
||||
|
||||
static void ListTag(FILE* out, const nsIFrame* aFrame) {
|
||||
static void ListTag(FILE* out, nsIFrame* aFrame) {
|
||||
nsAutoString tmp;
|
||||
aFrame->GetFrameName(tmp);
|
||||
nsIFrameDebug* frameDebug;
|
||||
|
||||
if (NS_SUCCEEDED(aFrame->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) {
|
||||
frameDebug->GetFrameName(tmp);
|
||||
}
|
||||
fputs(tmp, out);
|
||||
fprintf(out, "@%p", aFrame);
|
||||
}
|
||||
@ -323,6 +334,20 @@ public:
|
||||
static void IndentBy(FILE* out, PRInt32 aIndent) {
|
||||
while (--aIndent >= 0) fputs(" ", out);
|
||||
}
|
||||
|
||||
/**
|
||||
* Dump out the "base classes" regression data. This should dump
|
||||
* out the interior data, not the "frame" XML container. And it
|
||||
* should call the base classes same named method before doing
|
||||
* anything specific in a derived class. This means that derived
|
||||
* classes need not override DumpRegressionData unless they need
|
||||
* some custom behavior that requires changing how the outer "frame"
|
||||
* XML container is dumped.
|
||||
*/
|
||||
virtual void DumpBaseRegressionData(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent);
|
||||
|
||||
nsresult MakeFrameName(const char* aKind, nsString& aResult) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
// Protected constructor and destructor
|
||||
@ -343,19 +368,6 @@ protected:
|
||||
static void GetLastLeaf(nsIFrame **aFrame);
|
||||
static void GetFirstLeaf(nsIFrame **aFrame);
|
||||
|
||||
/**
|
||||
* Dump out the "base classes" regression data. This should dump
|
||||
* out the interior data, not the "frame" XML container. And it
|
||||
* should call the base classes same named method before doing
|
||||
* anything specific in a derived class. This means that derived
|
||||
* classes need not override DumpRegressionData unless they need
|
||||
* some custom behavior that requires changing how the outer "frame"
|
||||
* XML container is dumped.
|
||||
*/
|
||||
virtual void DumpBaseRegressionData(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent);
|
||||
|
||||
nsresult MakeFrameName(const char* aKind, nsString& aResult) const;
|
||||
|
||||
static void XMLQuote(nsString& aString);
|
||||
|
||||
virtual PRBool ParentDisablesSelection() const;
|
||||
|
@ -819,8 +819,12 @@ DumpContext(nsIFrame* aFrame, nsIStyleContext* aContext)
|
||||
if (aFrame) {
|
||||
fputs("frame: ", stdout);
|
||||
nsAutoString name;
|
||||
aFrame->GetFrameName(name);
|
||||
fputs(name, stdout);
|
||||
nsIFrameDebug* frameDebug;
|
||||
|
||||
if (NS_SUCCEEDED(aFrame->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) {
|
||||
frameDebug->GetFrameName(name);
|
||||
fputs(name, stdout);
|
||||
}
|
||||
fprintf(stdout, " (%p)", aFrame);
|
||||
}
|
||||
if (aContext) {
|
||||
|
@ -611,11 +611,13 @@ nsGfxScrollFrame::GetFrameType(nsIAtom** aType) const
|
||||
return nsHTMLContainerFrame::GetFrameType(aType);
|
||||
}
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
NS_IMETHODIMP
|
||||
nsGfxScrollFrame::GetFrameName(nsString& aResult) const
|
||||
{
|
||||
return MakeFrameName("GfxScroll", aResult);
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsGfxScrollFrame::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
|
@ -107,7 +107,9 @@ public:
|
||||
*/
|
||||
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
nsGfxScrollFrame(nsIDocument* aDocument);
|
||||
|
@ -88,8 +88,8 @@ public:
|
||||
*/
|
||||
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
|
||||
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
#ifdef DEBUG
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
|
||||
#endif
|
||||
|
||||
@ -445,13 +445,13 @@ RootFrame::GetFrameType(nsIAtom** aType) const
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHODIMP
|
||||
RootFrame::GetFrameName(nsString& aResult) const
|
||||
{
|
||||
return MakeFrameName("Root", aResult);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHODIMP
|
||||
RootFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
|
||||
{
|
||||
|
@ -517,6 +517,7 @@ nsImageFrame::Paint(nsIPresContext& aPresContext,
|
||||
aRenderingContext.DrawImage(image, inner);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
if ((NS_FRAME_PAINT_LAYER_DEBUG == aWhichLayer) &&
|
||||
GetShowFrameBorders()) {
|
||||
nsImageMap* map = GetImageMap();
|
||||
@ -531,6 +532,7 @@ nsImageFrame::Paint(nsIPresContext& aPresContext,
|
||||
aRenderingContext.PopState(clipState);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow) {
|
||||
|
@ -70,11 +70,13 @@ nsInlineFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
return nsInlineFrameSuper::QueryInterface(aIID, aInstancePtr);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHODIMP
|
||||
nsInlineFrame::GetFrameName(nsString& aResult) const
|
||||
{
|
||||
return MakeFrameName("Inline", aResult);
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsInlineFrame::GetFrameType(nsIAtom** aType) const
|
||||
@ -660,11 +662,13 @@ nsFirstLineFrame::nsFirstLineFrame()
|
||||
{
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHODIMP
|
||||
nsFirstLineFrame::GetFrameName(nsString& aResult) const
|
||||
{
|
||||
return MakeFrameName("Line", aResult);
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsFirstLineFrame::GetFrameType(nsIAtom** aType) const
|
||||
|
@ -63,7 +63,9 @@ public:
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aOldFrame,
|
||||
nsIFrame* aNewFrame);
|
||||
#ifdef DEBUG
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
#endif
|
||||
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
|
||||
|
||||
// nsIHTMLReflow overrides
|
||||
|
@ -92,6 +92,7 @@ nsLineBox::Reset(nsIFrame* aFrame, PRInt32 aCount, PRBool aIsBlock)
|
||||
mFlags.mBlock = aIsBlock;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
static void
|
||||
ListFloaters(FILE* out, PRInt32 aIndent, const nsFloaterCacheList& aFloaters)
|
||||
{
|
||||
@ -104,8 +105,12 @@ ListFloaters(FILE* out, PRInt32 aIndent, const nsFloaterCacheList& aFloaters)
|
||||
fprintf(out, "placeholder@%p ", ph);
|
||||
nsIFrame* frame = ph->GetOutOfFlowFrame();
|
||||
if (nsnull != frame) {
|
||||
frame->GetFrameName(frameName);
|
||||
fputs(frameName, out);
|
||||
nsIFrameDebug* frameDebug;
|
||||
|
||||
if (NS_SUCCEEDED(frame->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) {
|
||||
frameDebug->GetFrameName(frameName);
|
||||
fputs(frameName, out);
|
||||
}
|
||||
}
|
||||
fprintf(out, " %s region={%d,%d,%d,%d} combinedArea={%d,%d,%d,%d}",
|
||||
fc->mIsCurrentLineFloater ? "cl" : "bcl",
|
||||
@ -119,6 +124,7 @@ ListFloaters(FILE* out, PRInt32 aIndent, const nsFloaterCacheList& aFloaters)
|
||||
fc = fc->Next();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
char*
|
||||
nsLineBox::StateToString(char* aBuf, PRInt32 aBufSize) const
|
||||
@ -132,6 +138,7 @@ nsLineBox::StateToString(char* aBuf, PRInt32 aBufSize) const
|
||||
return aBuf;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
void
|
||||
nsLineBox::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const
|
||||
{
|
||||
@ -159,7 +166,11 @@ nsLineBox::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const
|
||||
nsIFrame* frame = mFirstChild;
|
||||
PRInt32 n = GetChildCount();
|
||||
while (--n >= 0) {
|
||||
frame->List(aPresContext, out, aIndent + 1);
|
||||
nsIFrameDebug* frameDebug;
|
||||
|
||||
if (NS_SUCCEEDED(frame->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) {
|
||||
frameDebug->List(aPresContext, out, aIndent + 1);
|
||||
}
|
||||
frame->GetNextSibling(&frame);
|
||||
}
|
||||
|
||||
@ -171,6 +182,7 @@ nsLineBox::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const
|
||||
}
|
||||
fputs(">\n", out);
|
||||
}
|
||||
#endif
|
||||
|
||||
nsIFrame*
|
||||
nsLineBox::LastChild() const
|
||||
|
@ -261,7 +261,9 @@ public:
|
||||
static nsLineBox* FindLineContaining(nsLineBox* aLine, nsIFrame* aFrame,
|
||||
PRInt32* aFrameIndexInLine);
|
||||
|
||||
#ifdef DEBUG
|
||||
void List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const;
|
||||
#endif
|
||||
|
||||
nsIFrame* LastChild() const;
|
||||
|
||||
|
@ -62,6 +62,7 @@ nsTextRun::~nsTextRun()
|
||||
MOZ_COUNT_DTOR(nsTextRun);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
void
|
||||
nsTextRun::List(FILE* out, PRInt32 aIndent)
|
||||
{
|
||||
@ -72,12 +73,17 @@ nsTextRun::List(FILE* out, PRInt32 aIndent)
|
||||
for (i = 0; i < n; i++) {
|
||||
nsIFrame* text = (nsIFrame*) mArray.ElementAt(i);
|
||||
nsAutoString tmp;
|
||||
text->GetFrameName(tmp);
|
||||
fputs(tmp, out);
|
||||
nsIFrameDebug* frameDebug;
|
||||
|
||||
if (NS_SUCCEEDED(text->QueryInterface(nsIFrameDebug::GetIID(), (void**)&frameDebug))) {
|
||||
frameDebug->GetFrameName(tmp);
|
||||
fputs(tmp, out);
|
||||
}
|
||||
printf("@%p ", text);
|
||||
}
|
||||
fputs(">\n", out);
|
||||
}
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
@ -1827,11 +1833,13 @@ nsLineLayout::VerticalAlignFrames(PerSpanData* psd)
|
||||
const nsStyleText* textStyle;
|
||||
frame->GetStyleData(eStyleStruct_Text, (const nsStyleStruct*&)textStyle);
|
||||
nsStyleUnit verticalAlignUnit = textStyle->mVerticalAlign.GetUnit();
|
||||
#ifdef DEBUG
|
||||
if (eStyleUnit_Inherit == verticalAlignUnit) {
|
||||
printf("XXX: vertical-align: inherit not implemented for ");
|
||||
nsFrame::ListTag(stdout, frame);
|
||||
printf("\n");
|
||||
}
|
||||
#endif
|
||||
#ifdef NOISY_VERTICAL_ALIGN
|
||||
printf(" ");
|
||||
nsFrame::ListTag(stdout, frame);
|
||||
|
@ -200,7 +200,9 @@ public:
|
||||
|
||||
NS_IMETHOD Scrolled(nsIView *aView);
|
||||
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
|
||||
#ifdef DEBUG
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
#endif
|
||||
|
||||
NS_IMETHOD ContentChanged(nsIPresContext* aPresContext,
|
||||
nsIContent* aChild,
|
||||
@ -402,11 +404,13 @@ nsObjectFrame::GetFrameType(nsIAtom** aType) const
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHODIMP
|
||||
nsObjectFrame::GetFrameName(nsString& aResult) const
|
||||
{
|
||||
return MakeFrameName("ObjectFrame", aResult);
|
||||
}
|
||||
#endif
|
||||
|
||||
nsresult
|
||||
nsObjectFrame::CreateWidget(nsIPresContext* aPresContext,
|
||||
|
@ -157,11 +157,13 @@ nsPageFrame::GetFrameType(nsIAtom** aType) const
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHODIMP
|
||||
nsPageFrame::GetFrameName(nsString& aResult) const
|
||||
{
|
||||
return MakeFrameName("Page", aResult);
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPageFrame::IsPercentageBase(PRBool& aBase) const
|
||||
|
@ -38,8 +38,10 @@ public:
|
||||
*/
|
||||
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
|
||||
|
||||
#ifdef DEBUG
|
||||
// Debugging
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
nsPageFrame();
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user