Added some spacemanager debugging noise

git-svn-id: svn://10.0.0.236/trunk@47473 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
kipp%netscape.com
1999-09-15 00:25:51 +00:00
parent 77658d2447
commit b4aafbf17d
4 changed files with 78 additions and 12 deletions

View File

@@ -31,8 +31,7 @@
#include "nsLayoutAtoms.h"
#undef NOISY_MAX_ELEMENT_SIZE
static NS_DEFINE_IID(kAreaFrameIID, NS_IAREAFRAME_IID);
#undef NOISY_SPACEMANAGER
nsresult
NS_NewAreaFrame(nsIFrame** aNewFrame, PRUint32 aFlags)
@@ -68,7 +67,7 @@ nsAreaFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
if (NULL == aInstancePtr) {
return NS_ERROR_NULL_POINTER;
}
if (aIID.Equals(kAreaFrameIID)) {
if (aIID.Equals(kIAreaFrameIID)) {
nsIAreaFrame* tmp = (nsIAreaFrame*)this;
*aInstancePtr = (void*)tmp;
return NS_OK;
@@ -210,7 +209,7 @@ nsAreaFrame::FirstChild(nsIAtom* aListName, nsIFrame** aFirstChild) const
return nsBlockFrame::FirstChild(aListName, aFirstChild);
}
#ifdef NS_DEBUG
#ifdef DEBUG
NS_IMETHODIMP
nsAreaFrame::Paint(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext,
@@ -294,6 +293,18 @@ nsAreaFrame::GetPositionedInfo(nscoord& aXMost, nscoord& aYMost) const
return rv;
}
NS_IMETHODIMP
nsAreaFrame::GetSpaceManager(nsISpaceManager** aSpaceManagerResult)
{
if (!aSpaceManagerResult) {
NS_WARNING("null ptr");
return NS_ERROR_NULL_POINTER;
}
*aSpaceManagerResult = mSpaceManager;
NS_IF_ADDREF(mSpaceManager);
return NS_OK;
}
NS_IMETHODIMP
nsAreaFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
@@ -336,13 +347,33 @@ nsAreaFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowState& reflowState = (nsHTMLReflowState&)aReflowState;
reflowState.mSpaceManager = mSpaceManager;
// Clear the spacemanager's regions.
// Clear the spacemanager's regions
mSpaceManager->ClearRegions();
}
#ifdef NOISY_SPACEMANAGER
if (eReflowReason_Incremental == aReflowState.reason) {
if (mSpaceManager) {
ListTag(stdout);
printf(": space-manager before reflow\n");
mSpaceManager->List(stdout);
}
}
#endif
// Let the block frame do its reflow first
rv = nsBlockFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
#ifdef NOISY_SPACEMANAGER
if (eReflowReason_Incremental == aReflowState.reason) {
if (mSpaceManager) {
ListTag(stdout);
printf(": space-manager after reflow\n");
mSpaceManager->List(stdout);
}
}
#endif
// Let the absolutely positioned container reflow any absolutely positioned
// child frames that need to be reflowed, e.g., elements with a percentage
// based width/height

View File

@@ -88,7 +88,7 @@ public:
NS_IMETHOD DidReflow(nsIPresContext& aPresContext,
nsDidReflowStatus aStatus);
#ifdef NS_DEBUG
#ifdef DEBUG
NS_IMETHOD Paint(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
@@ -111,6 +111,8 @@ public:
// nsIAreaFrame
NS_IMETHOD GetPositionedInfo(nscoord& aXMost, nscoord& aYMost) const;
NS_IMETHOD GetSpaceManager(nsISpaceManager** aSpaceManagerResult);
protected:
nsAreaFrame();
virtual ~nsAreaFrame();

View File

@@ -31,8 +31,7 @@
#include "nsLayoutAtoms.h"
#undef NOISY_MAX_ELEMENT_SIZE
static NS_DEFINE_IID(kAreaFrameIID, NS_IAREAFRAME_IID);
#undef NOISY_SPACEMANAGER
nsresult
NS_NewAreaFrame(nsIFrame** aNewFrame, PRUint32 aFlags)
@@ -68,7 +67,7 @@ nsAreaFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
if (NULL == aInstancePtr) {
return NS_ERROR_NULL_POINTER;
}
if (aIID.Equals(kAreaFrameIID)) {
if (aIID.Equals(kIAreaFrameIID)) {
nsIAreaFrame* tmp = (nsIAreaFrame*)this;
*aInstancePtr = (void*)tmp;
return NS_OK;
@@ -210,7 +209,7 @@ nsAreaFrame::FirstChild(nsIAtom* aListName, nsIFrame** aFirstChild) const
return nsBlockFrame::FirstChild(aListName, aFirstChild);
}
#ifdef NS_DEBUG
#ifdef DEBUG
NS_IMETHODIMP
nsAreaFrame::Paint(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext,
@@ -294,6 +293,18 @@ nsAreaFrame::GetPositionedInfo(nscoord& aXMost, nscoord& aYMost) const
return rv;
}
NS_IMETHODIMP
nsAreaFrame::GetSpaceManager(nsISpaceManager** aSpaceManagerResult)
{
if (!aSpaceManagerResult) {
NS_WARNING("null ptr");
return NS_ERROR_NULL_POINTER;
}
*aSpaceManagerResult = mSpaceManager;
NS_IF_ADDREF(mSpaceManager);
return NS_OK;
}
NS_IMETHODIMP
nsAreaFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
@@ -336,13 +347,33 @@ nsAreaFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowState& reflowState = (nsHTMLReflowState&)aReflowState;
reflowState.mSpaceManager = mSpaceManager;
// Clear the spacemanager's regions.
// Clear the spacemanager's regions
mSpaceManager->ClearRegions();
}
#ifdef NOISY_SPACEMANAGER
if (eReflowReason_Incremental == aReflowState.reason) {
if (mSpaceManager) {
ListTag(stdout);
printf(": space-manager before reflow\n");
mSpaceManager->List(stdout);
}
}
#endif
// Let the block frame do its reflow first
rv = nsBlockFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
#ifdef NOISY_SPACEMANAGER
if (eReflowReason_Incremental == aReflowState.reason) {
if (mSpaceManager) {
ListTag(stdout);
printf(": space-manager after reflow\n");
mSpaceManager->List(stdout);
}
}
#endif
// Let the absolutely positioned container reflow any absolutely positioned
// child frames that need to be reflowed, e.g., elements with a percentage
// based width/height

View File

@@ -88,7 +88,7 @@ public:
NS_IMETHOD DidReflow(nsIPresContext& aPresContext,
nsDidReflowStatus aStatus);
#ifdef NS_DEBUG
#ifdef DEBUG
NS_IMETHOD Paint(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
@@ -111,6 +111,8 @@ public:
// nsIAreaFrame
NS_IMETHOD GetPositionedInfo(nscoord& aXMost, nscoord& aYMost) const;
NS_IMETHOD GetSpaceManager(nsISpaceManager** aSpaceManagerResult);
protected:
nsAreaFrame();
virtual ~nsAreaFrame();