Use CRAZY macros for debug noise
This commit is contained in:
@@ -51,8 +51,6 @@ static NS_DEFINE_IID(kITextContentIID, NS_ITEXT_CONTENT_IID);/* XXX */
|
|||||||
// XXX for IsEmptyLine
|
// XXX for IsEmptyLine
|
||||||
#include "nsTextFragment.h"
|
#include "nsTextFragment.h"
|
||||||
|
|
||||||
// XXX TODO:
|
|
||||||
|
|
||||||
// XXX get rid of the need for this
|
// XXX get rid of the need for this
|
||||||
#define SLOW_INCREMENTAL_REFLOW
|
#define SLOW_INCREMENTAL_REFLOW
|
||||||
|
|
||||||
@@ -384,23 +382,16 @@ nsBlockReflowState::~nsBlockReflowState()
|
|||||||
void
|
void
|
||||||
nsBlockReflowState::GetAvailableSpace()
|
nsBlockReflowState::GetAvailableSpace()
|
||||||
{
|
{
|
||||||
nsISpaceManager* sm = mSpaceManager;
|
|
||||||
|
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
// Verify that the caller setup the coordinate system properly
|
// Verify that the caller setup the coordinate system properly
|
||||||
nscoord wx, wy;
|
nscoord wx, wy;
|
||||||
sm->GetTranslation(wx, wy);
|
mSpaceManager->GetTranslation(wx, wy);
|
||||||
NS_ASSERTION((wx == mSpaceManagerX) && (wy == mSpaceManagerY),
|
NS_ASSERTION((wx == mSpaceManagerX) && (wy == mSpaceManagerY),
|
||||||
"bad coord system");
|
"bad coord system");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mCurrentBand.GetAvailableSpace(mY - BorderPadding().top, mAvailSpaceRect);
|
mCurrentBand.GetAvailableSpace(mY - BorderPadding().top, mAvailSpaceRect);
|
||||||
|
|
||||||
NS_FRAME_LOG(NS_FRAME_TRACE_CALLS,
|
|
||||||
("nsBlockReflowState::GetAvailableSpace: band={%d,%d,%d,%d} count=%d",
|
|
||||||
mAvailSpaceRect.x, mAvailSpaceRect.y,
|
|
||||||
mAvailSpaceRect.width, mAvailSpaceRect.height,
|
|
||||||
mCurrentBand.GetTrapezoidCount()));
|
|
||||||
#ifdef NOISY_INCREMENTAL_REFLOW
|
#ifdef NOISY_INCREMENTAL_REFLOW
|
||||||
if (mReflowState.reason == eReflowReason_Incremental) {
|
if (mReflowState.reason == eReflowReason_Incremental) {
|
||||||
nsFrame::IndentBy(stdout, gNoiseIndent);
|
nsFrame::IndentBy(stdout, gNoiseIndent);
|
||||||
@@ -1148,9 +1139,11 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState,
|
|||||||
aMetrics.mCarriedOutBottomMargin = aState.mPrevBottomMargin;
|
aMetrics.mCarriedOutBottomMargin = aState.mPrevBottomMargin;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_kipp
|
#ifdef DEBUG
|
||||||
NS_ASSERTION((aMetrics.width > -200000) && (aMetrics.width < 200000) &&
|
if (CRAZY_WIDTH(aMetrics.width) || CRAZY_HEIGHT(aMetrics.height)) {
|
||||||
(aMetrics.height > -200000) && (aMetrics.height < 200000), "?");
|
ListTag(stdout);
|
||||||
|
printf(": WARNING: desired:%d,%d\n", aMetrics.width, aMetrics.height);
|
||||||
|
}
|
||||||
if (aState.mComputeMaxElementSize &&
|
if (aState.mComputeMaxElementSize &&
|
||||||
((maxWidth > aMetrics.width) || (maxHeight > aMetrics.height))) {
|
((maxWidth > aMetrics.width) || (maxHeight > aMetrics.height))) {
|
||||||
ListTag(stdout);
|
ListTag(stdout);
|
||||||
@@ -1181,10 +1174,18 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState,
|
|||||||
nscoord y = line->mCombinedArea.y;
|
nscoord y = line->mCombinedArea.y;
|
||||||
nscoord xmost = x + line->mCombinedArea.width;
|
nscoord xmost = x + line->mCombinedArea.width;
|
||||||
nscoord ymost = y + line->mCombinedArea.height;
|
nscoord ymost = y + line->mCombinedArea.height;
|
||||||
if (x < x0) x0 = x;
|
if (x < x0) {
|
||||||
if (xmost > x1) x1 = xmost;
|
x0 = x;
|
||||||
if (y < y0) y0 = y;
|
}
|
||||||
if (ymost > y1) y1 = ymost;
|
if (xmost > x1) {
|
||||||
|
x1 = xmost;
|
||||||
|
}
|
||||||
|
if (y < y0) {
|
||||||
|
y0 = y;
|
||||||
|
}
|
||||||
|
if (ymost > y1) {
|
||||||
|
y1 = ymost;
|
||||||
|
}
|
||||||
|
|
||||||
// If the line has floaters, factor those in as well
|
// If the line has floaters, factor those in as well
|
||||||
nsVoidArray* floaters = line->mFloaters;
|
nsVoidArray* floaters = line->mFloaters;
|
||||||
@@ -1201,10 +1202,18 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState,
|
|||||||
y = r.y;
|
y = r.y;
|
||||||
xmost = x + r.width;
|
xmost = x + r.width;
|
||||||
ymost = y + r.height;
|
ymost = y + r.height;
|
||||||
if (x < x0) x0 = x;
|
if (x < x0) {
|
||||||
if (xmost > x1) x1 = xmost;
|
x0 = x;
|
||||||
if (y < y0) y0 = y;
|
}
|
||||||
if (ymost > y1) y1 = ymost;
|
if (xmost > x1) {
|
||||||
|
x1 = xmost;
|
||||||
|
}
|
||||||
|
if (y < y0) {
|
||||||
|
y0 = y;
|
||||||
|
}
|
||||||
|
if (ymost > y1) {
|
||||||
|
y1 = ymost;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
line = line->mNext;
|
line = line->mNext;
|
||||||
@@ -1404,8 +1413,11 @@ nsBlockFrame::RecoverStateFrom(nsBlockReflowState& aState,
|
|||||||
// Recover xmost
|
// Recover xmost
|
||||||
nscoord xmost = aLine->mBounds.XMost();
|
nscoord xmost = aLine->mBounds.XMost();
|
||||||
if (xmost > aState.mKidXMost) {
|
if (xmost > aState.mKidXMost) {
|
||||||
#ifdef DEBUG_kipp
|
#ifdef DEBUG
|
||||||
NS_ASSERTION((xmost > -200000) && (xmost < 200000), "oy");
|
if (CRAZY_WIDTH(xmost)) {
|
||||||
|
ListTag(stdout);
|
||||||
|
printf(": WARNING: xmost:%d\n", xmost);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
aState.mKidXMost = xmost;
|
aState.mKidXMost = xmost;
|
||||||
}
|
}
|
||||||
@@ -2837,8 +2849,8 @@ nsBlockFrame::ShouldJustifyLine(nsBlockReflowState& aState, nsLineBox* aLine)
|
|||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
nsBlockFrame::PlaceLine(nsBlockReflowState& aState,
|
nsBlockFrame::PlaceLine(nsBlockReflowState& aState,
|
||||||
nsLineBox* aLine,
|
nsLineBox* aLine,
|
||||||
PRBool* aKeepReflowGoing)
|
PRBool* aKeepReflowGoing)
|
||||||
{
|
{
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
|
|
||||||
@@ -2868,8 +2880,12 @@ nsBlockFrame::PlaceLine(nsBlockReflowState& aState,
|
|||||||
}
|
}
|
||||||
nsSize maxElementSize;
|
nsSize maxElementSize;
|
||||||
lineLayout->VerticalAlignFrames(aLine->mBounds, maxElementSize);
|
lineLayout->VerticalAlignFrames(aLine->mBounds, maxElementSize);
|
||||||
#ifdef DEBUG_kipp
|
#ifdef DEBUG
|
||||||
NS_ASSERTION((aLine->mBounds.YMost()) < 200000 && (aLine->mBounds.y > -200000), "oy");
|
if (CRAZY_HEIGHT(aLine->mBounds.y)) {
|
||||||
|
nsFrame::ListTag(stdout);
|
||||||
|
printf(": line=%p y=%d line.bounds.height=%d\n",
|
||||||
|
aLine, aLine->mBounds.y, aLine->mBounds.height);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Only block frames horizontally align their children because
|
// Only block frames horizontally align their children because
|
||||||
@@ -3073,8 +3089,11 @@ nsBlockFrame::PostPlaceLine(nsBlockReflowState& aState,
|
|||||||
// Update xmost
|
// Update xmost
|
||||||
nscoord xmost = aLine->mBounds.XMost();
|
nscoord xmost = aLine->mBounds.XMost();
|
||||||
if (xmost > aState.mKidXMost) {
|
if (xmost > aState.mKidXMost) {
|
||||||
#ifdef DEBUG_kipp
|
#ifdef DEBUG
|
||||||
NS_ASSERTION((xmost > -200000) && (xmost < 200000), "oy");
|
if (CRAZY_WIDTH(xmost)) {
|
||||||
|
ListTag(stdout);
|
||||||
|
printf(": line=%p xmost=%d\n", aLine, xmost);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
aState.mKidXMost = xmost;
|
aState.mKidXMost = xmost;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,8 +51,6 @@ static NS_DEFINE_IID(kITextContentIID, NS_ITEXT_CONTENT_IID);/* XXX */
|
|||||||
// XXX for IsEmptyLine
|
// XXX for IsEmptyLine
|
||||||
#include "nsTextFragment.h"
|
#include "nsTextFragment.h"
|
||||||
|
|
||||||
// XXX TODO:
|
|
||||||
|
|
||||||
// XXX get rid of the need for this
|
// XXX get rid of the need for this
|
||||||
#define SLOW_INCREMENTAL_REFLOW
|
#define SLOW_INCREMENTAL_REFLOW
|
||||||
|
|
||||||
@@ -384,23 +382,16 @@ nsBlockReflowState::~nsBlockReflowState()
|
|||||||
void
|
void
|
||||||
nsBlockReflowState::GetAvailableSpace()
|
nsBlockReflowState::GetAvailableSpace()
|
||||||
{
|
{
|
||||||
nsISpaceManager* sm = mSpaceManager;
|
|
||||||
|
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
// Verify that the caller setup the coordinate system properly
|
// Verify that the caller setup the coordinate system properly
|
||||||
nscoord wx, wy;
|
nscoord wx, wy;
|
||||||
sm->GetTranslation(wx, wy);
|
mSpaceManager->GetTranslation(wx, wy);
|
||||||
NS_ASSERTION((wx == mSpaceManagerX) && (wy == mSpaceManagerY),
|
NS_ASSERTION((wx == mSpaceManagerX) && (wy == mSpaceManagerY),
|
||||||
"bad coord system");
|
"bad coord system");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mCurrentBand.GetAvailableSpace(mY - BorderPadding().top, mAvailSpaceRect);
|
mCurrentBand.GetAvailableSpace(mY - BorderPadding().top, mAvailSpaceRect);
|
||||||
|
|
||||||
NS_FRAME_LOG(NS_FRAME_TRACE_CALLS,
|
|
||||||
("nsBlockReflowState::GetAvailableSpace: band={%d,%d,%d,%d} count=%d",
|
|
||||||
mAvailSpaceRect.x, mAvailSpaceRect.y,
|
|
||||||
mAvailSpaceRect.width, mAvailSpaceRect.height,
|
|
||||||
mCurrentBand.GetTrapezoidCount()));
|
|
||||||
#ifdef NOISY_INCREMENTAL_REFLOW
|
#ifdef NOISY_INCREMENTAL_REFLOW
|
||||||
if (mReflowState.reason == eReflowReason_Incremental) {
|
if (mReflowState.reason == eReflowReason_Incremental) {
|
||||||
nsFrame::IndentBy(stdout, gNoiseIndent);
|
nsFrame::IndentBy(stdout, gNoiseIndent);
|
||||||
@@ -1148,9 +1139,11 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState,
|
|||||||
aMetrics.mCarriedOutBottomMargin = aState.mPrevBottomMargin;
|
aMetrics.mCarriedOutBottomMargin = aState.mPrevBottomMargin;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_kipp
|
#ifdef DEBUG
|
||||||
NS_ASSERTION((aMetrics.width > -200000) && (aMetrics.width < 200000) &&
|
if (CRAZY_WIDTH(aMetrics.width) || CRAZY_HEIGHT(aMetrics.height)) {
|
||||||
(aMetrics.height > -200000) && (aMetrics.height < 200000), "?");
|
ListTag(stdout);
|
||||||
|
printf(": WARNING: desired:%d,%d\n", aMetrics.width, aMetrics.height);
|
||||||
|
}
|
||||||
if (aState.mComputeMaxElementSize &&
|
if (aState.mComputeMaxElementSize &&
|
||||||
((maxWidth > aMetrics.width) || (maxHeight > aMetrics.height))) {
|
((maxWidth > aMetrics.width) || (maxHeight > aMetrics.height))) {
|
||||||
ListTag(stdout);
|
ListTag(stdout);
|
||||||
@@ -1181,10 +1174,18 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState,
|
|||||||
nscoord y = line->mCombinedArea.y;
|
nscoord y = line->mCombinedArea.y;
|
||||||
nscoord xmost = x + line->mCombinedArea.width;
|
nscoord xmost = x + line->mCombinedArea.width;
|
||||||
nscoord ymost = y + line->mCombinedArea.height;
|
nscoord ymost = y + line->mCombinedArea.height;
|
||||||
if (x < x0) x0 = x;
|
if (x < x0) {
|
||||||
if (xmost > x1) x1 = xmost;
|
x0 = x;
|
||||||
if (y < y0) y0 = y;
|
}
|
||||||
if (ymost > y1) y1 = ymost;
|
if (xmost > x1) {
|
||||||
|
x1 = xmost;
|
||||||
|
}
|
||||||
|
if (y < y0) {
|
||||||
|
y0 = y;
|
||||||
|
}
|
||||||
|
if (ymost > y1) {
|
||||||
|
y1 = ymost;
|
||||||
|
}
|
||||||
|
|
||||||
// If the line has floaters, factor those in as well
|
// If the line has floaters, factor those in as well
|
||||||
nsVoidArray* floaters = line->mFloaters;
|
nsVoidArray* floaters = line->mFloaters;
|
||||||
@@ -1201,10 +1202,18 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState,
|
|||||||
y = r.y;
|
y = r.y;
|
||||||
xmost = x + r.width;
|
xmost = x + r.width;
|
||||||
ymost = y + r.height;
|
ymost = y + r.height;
|
||||||
if (x < x0) x0 = x;
|
if (x < x0) {
|
||||||
if (xmost > x1) x1 = xmost;
|
x0 = x;
|
||||||
if (y < y0) y0 = y;
|
}
|
||||||
if (ymost > y1) y1 = ymost;
|
if (xmost > x1) {
|
||||||
|
x1 = xmost;
|
||||||
|
}
|
||||||
|
if (y < y0) {
|
||||||
|
y0 = y;
|
||||||
|
}
|
||||||
|
if (ymost > y1) {
|
||||||
|
y1 = ymost;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
line = line->mNext;
|
line = line->mNext;
|
||||||
@@ -1404,8 +1413,11 @@ nsBlockFrame::RecoverStateFrom(nsBlockReflowState& aState,
|
|||||||
// Recover xmost
|
// Recover xmost
|
||||||
nscoord xmost = aLine->mBounds.XMost();
|
nscoord xmost = aLine->mBounds.XMost();
|
||||||
if (xmost > aState.mKidXMost) {
|
if (xmost > aState.mKidXMost) {
|
||||||
#ifdef DEBUG_kipp
|
#ifdef DEBUG
|
||||||
NS_ASSERTION((xmost > -200000) && (xmost < 200000), "oy");
|
if (CRAZY_WIDTH(xmost)) {
|
||||||
|
ListTag(stdout);
|
||||||
|
printf(": WARNING: xmost:%d\n", xmost);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
aState.mKidXMost = xmost;
|
aState.mKidXMost = xmost;
|
||||||
}
|
}
|
||||||
@@ -2837,8 +2849,8 @@ nsBlockFrame::ShouldJustifyLine(nsBlockReflowState& aState, nsLineBox* aLine)
|
|||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
nsBlockFrame::PlaceLine(nsBlockReflowState& aState,
|
nsBlockFrame::PlaceLine(nsBlockReflowState& aState,
|
||||||
nsLineBox* aLine,
|
nsLineBox* aLine,
|
||||||
PRBool* aKeepReflowGoing)
|
PRBool* aKeepReflowGoing)
|
||||||
{
|
{
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
|
|
||||||
@@ -2868,8 +2880,12 @@ nsBlockFrame::PlaceLine(nsBlockReflowState& aState,
|
|||||||
}
|
}
|
||||||
nsSize maxElementSize;
|
nsSize maxElementSize;
|
||||||
lineLayout->VerticalAlignFrames(aLine->mBounds, maxElementSize);
|
lineLayout->VerticalAlignFrames(aLine->mBounds, maxElementSize);
|
||||||
#ifdef DEBUG_kipp
|
#ifdef DEBUG
|
||||||
NS_ASSERTION((aLine->mBounds.YMost()) < 200000 && (aLine->mBounds.y > -200000), "oy");
|
if (CRAZY_HEIGHT(aLine->mBounds.y)) {
|
||||||
|
nsFrame::ListTag(stdout);
|
||||||
|
printf(": line=%p y=%d line.bounds.height=%d\n",
|
||||||
|
aLine, aLine->mBounds.y, aLine->mBounds.height);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Only block frames horizontally align their children because
|
// Only block frames horizontally align their children because
|
||||||
@@ -3073,8 +3089,11 @@ nsBlockFrame::PostPlaceLine(nsBlockReflowState& aState,
|
|||||||
// Update xmost
|
// Update xmost
|
||||||
nscoord xmost = aLine->mBounds.XMost();
|
nscoord xmost = aLine->mBounds.XMost();
|
||||||
if (xmost > aState.mKidXMost) {
|
if (xmost > aState.mKidXMost) {
|
||||||
#ifdef DEBUG_kipp
|
#ifdef DEBUG
|
||||||
NS_ASSERTION((xmost > -200000) && (xmost < 200000), "oy");
|
if (CRAZY_WIDTH(xmost)) {
|
||||||
|
ListTag(stdout);
|
||||||
|
printf(": line=%p xmost=%d\n", aLine, xmost);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
aState.mKidXMost = xmost;
|
aState.mKidXMost = xmost;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,8 +51,6 @@ static NS_DEFINE_IID(kITextContentIID, NS_ITEXT_CONTENT_IID);/* XXX */
|
|||||||
// XXX for IsEmptyLine
|
// XXX for IsEmptyLine
|
||||||
#include "nsTextFragment.h"
|
#include "nsTextFragment.h"
|
||||||
|
|
||||||
// XXX TODO:
|
|
||||||
|
|
||||||
// XXX get rid of the need for this
|
// XXX get rid of the need for this
|
||||||
#define SLOW_INCREMENTAL_REFLOW
|
#define SLOW_INCREMENTAL_REFLOW
|
||||||
|
|
||||||
@@ -384,23 +382,16 @@ nsBlockReflowState::~nsBlockReflowState()
|
|||||||
void
|
void
|
||||||
nsBlockReflowState::GetAvailableSpace()
|
nsBlockReflowState::GetAvailableSpace()
|
||||||
{
|
{
|
||||||
nsISpaceManager* sm = mSpaceManager;
|
|
||||||
|
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
// Verify that the caller setup the coordinate system properly
|
// Verify that the caller setup the coordinate system properly
|
||||||
nscoord wx, wy;
|
nscoord wx, wy;
|
||||||
sm->GetTranslation(wx, wy);
|
mSpaceManager->GetTranslation(wx, wy);
|
||||||
NS_ASSERTION((wx == mSpaceManagerX) && (wy == mSpaceManagerY),
|
NS_ASSERTION((wx == mSpaceManagerX) && (wy == mSpaceManagerY),
|
||||||
"bad coord system");
|
"bad coord system");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mCurrentBand.GetAvailableSpace(mY - BorderPadding().top, mAvailSpaceRect);
|
mCurrentBand.GetAvailableSpace(mY - BorderPadding().top, mAvailSpaceRect);
|
||||||
|
|
||||||
NS_FRAME_LOG(NS_FRAME_TRACE_CALLS,
|
|
||||||
("nsBlockReflowState::GetAvailableSpace: band={%d,%d,%d,%d} count=%d",
|
|
||||||
mAvailSpaceRect.x, mAvailSpaceRect.y,
|
|
||||||
mAvailSpaceRect.width, mAvailSpaceRect.height,
|
|
||||||
mCurrentBand.GetTrapezoidCount()));
|
|
||||||
#ifdef NOISY_INCREMENTAL_REFLOW
|
#ifdef NOISY_INCREMENTAL_REFLOW
|
||||||
if (mReflowState.reason == eReflowReason_Incremental) {
|
if (mReflowState.reason == eReflowReason_Incremental) {
|
||||||
nsFrame::IndentBy(stdout, gNoiseIndent);
|
nsFrame::IndentBy(stdout, gNoiseIndent);
|
||||||
@@ -1148,9 +1139,11 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState,
|
|||||||
aMetrics.mCarriedOutBottomMargin = aState.mPrevBottomMargin;
|
aMetrics.mCarriedOutBottomMargin = aState.mPrevBottomMargin;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_kipp
|
#ifdef DEBUG
|
||||||
NS_ASSERTION((aMetrics.width > -200000) && (aMetrics.width < 200000) &&
|
if (CRAZY_WIDTH(aMetrics.width) || CRAZY_HEIGHT(aMetrics.height)) {
|
||||||
(aMetrics.height > -200000) && (aMetrics.height < 200000), "?");
|
ListTag(stdout);
|
||||||
|
printf(": WARNING: desired:%d,%d\n", aMetrics.width, aMetrics.height);
|
||||||
|
}
|
||||||
if (aState.mComputeMaxElementSize &&
|
if (aState.mComputeMaxElementSize &&
|
||||||
((maxWidth > aMetrics.width) || (maxHeight > aMetrics.height))) {
|
((maxWidth > aMetrics.width) || (maxHeight > aMetrics.height))) {
|
||||||
ListTag(stdout);
|
ListTag(stdout);
|
||||||
@@ -1181,10 +1174,18 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState,
|
|||||||
nscoord y = line->mCombinedArea.y;
|
nscoord y = line->mCombinedArea.y;
|
||||||
nscoord xmost = x + line->mCombinedArea.width;
|
nscoord xmost = x + line->mCombinedArea.width;
|
||||||
nscoord ymost = y + line->mCombinedArea.height;
|
nscoord ymost = y + line->mCombinedArea.height;
|
||||||
if (x < x0) x0 = x;
|
if (x < x0) {
|
||||||
if (xmost > x1) x1 = xmost;
|
x0 = x;
|
||||||
if (y < y0) y0 = y;
|
}
|
||||||
if (ymost > y1) y1 = ymost;
|
if (xmost > x1) {
|
||||||
|
x1 = xmost;
|
||||||
|
}
|
||||||
|
if (y < y0) {
|
||||||
|
y0 = y;
|
||||||
|
}
|
||||||
|
if (ymost > y1) {
|
||||||
|
y1 = ymost;
|
||||||
|
}
|
||||||
|
|
||||||
// If the line has floaters, factor those in as well
|
// If the line has floaters, factor those in as well
|
||||||
nsVoidArray* floaters = line->mFloaters;
|
nsVoidArray* floaters = line->mFloaters;
|
||||||
@@ -1201,10 +1202,18 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState,
|
|||||||
y = r.y;
|
y = r.y;
|
||||||
xmost = x + r.width;
|
xmost = x + r.width;
|
||||||
ymost = y + r.height;
|
ymost = y + r.height;
|
||||||
if (x < x0) x0 = x;
|
if (x < x0) {
|
||||||
if (xmost > x1) x1 = xmost;
|
x0 = x;
|
||||||
if (y < y0) y0 = y;
|
}
|
||||||
if (ymost > y1) y1 = ymost;
|
if (xmost > x1) {
|
||||||
|
x1 = xmost;
|
||||||
|
}
|
||||||
|
if (y < y0) {
|
||||||
|
y0 = y;
|
||||||
|
}
|
||||||
|
if (ymost > y1) {
|
||||||
|
y1 = ymost;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
line = line->mNext;
|
line = line->mNext;
|
||||||
@@ -1404,8 +1413,11 @@ nsBlockFrame::RecoverStateFrom(nsBlockReflowState& aState,
|
|||||||
// Recover xmost
|
// Recover xmost
|
||||||
nscoord xmost = aLine->mBounds.XMost();
|
nscoord xmost = aLine->mBounds.XMost();
|
||||||
if (xmost > aState.mKidXMost) {
|
if (xmost > aState.mKidXMost) {
|
||||||
#ifdef DEBUG_kipp
|
#ifdef DEBUG
|
||||||
NS_ASSERTION((xmost > -200000) && (xmost < 200000), "oy");
|
if (CRAZY_WIDTH(xmost)) {
|
||||||
|
ListTag(stdout);
|
||||||
|
printf(": WARNING: xmost:%d\n", xmost);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
aState.mKidXMost = xmost;
|
aState.mKidXMost = xmost;
|
||||||
}
|
}
|
||||||
@@ -2837,8 +2849,8 @@ nsBlockFrame::ShouldJustifyLine(nsBlockReflowState& aState, nsLineBox* aLine)
|
|||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
nsBlockFrame::PlaceLine(nsBlockReflowState& aState,
|
nsBlockFrame::PlaceLine(nsBlockReflowState& aState,
|
||||||
nsLineBox* aLine,
|
nsLineBox* aLine,
|
||||||
PRBool* aKeepReflowGoing)
|
PRBool* aKeepReflowGoing)
|
||||||
{
|
{
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
|
|
||||||
@@ -2868,8 +2880,12 @@ nsBlockFrame::PlaceLine(nsBlockReflowState& aState,
|
|||||||
}
|
}
|
||||||
nsSize maxElementSize;
|
nsSize maxElementSize;
|
||||||
lineLayout->VerticalAlignFrames(aLine->mBounds, maxElementSize);
|
lineLayout->VerticalAlignFrames(aLine->mBounds, maxElementSize);
|
||||||
#ifdef DEBUG_kipp
|
#ifdef DEBUG
|
||||||
NS_ASSERTION((aLine->mBounds.YMost()) < 200000 && (aLine->mBounds.y > -200000), "oy");
|
if (CRAZY_HEIGHT(aLine->mBounds.y)) {
|
||||||
|
nsFrame::ListTag(stdout);
|
||||||
|
printf(": line=%p y=%d line.bounds.height=%d\n",
|
||||||
|
aLine, aLine->mBounds.y, aLine->mBounds.height);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Only block frames horizontally align their children because
|
// Only block frames horizontally align their children because
|
||||||
@@ -3073,8 +3089,11 @@ nsBlockFrame::PostPlaceLine(nsBlockReflowState& aState,
|
|||||||
// Update xmost
|
// Update xmost
|
||||||
nscoord xmost = aLine->mBounds.XMost();
|
nscoord xmost = aLine->mBounds.XMost();
|
||||||
if (xmost > aState.mKidXMost) {
|
if (xmost > aState.mKidXMost) {
|
||||||
#ifdef DEBUG_kipp
|
#ifdef DEBUG
|
||||||
NS_ASSERTION((xmost > -200000) && (xmost < 200000), "oy");
|
if (CRAZY_WIDTH(xmost)) {
|
||||||
|
ListTag(stdout);
|
||||||
|
printf(": line=%p xmost=%d\n", aLine, xmost);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
aState.mKidXMost = xmost;
|
aState.mKidXMost = xmost;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,8 +51,6 @@ static NS_DEFINE_IID(kITextContentIID, NS_ITEXT_CONTENT_IID);/* XXX */
|
|||||||
// XXX for IsEmptyLine
|
// XXX for IsEmptyLine
|
||||||
#include "nsTextFragment.h"
|
#include "nsTextFragment.h"
|
||||||
|
|
||||||
// XXX TODO:
|
|
||||||
|
|
||||||
// XXX get rid of the need for this
|
// XXX get rid of the need for this
|
||||||
#define SLOW_INCREMENTAL_REFLOW
|
#define SLOW_INCREMENTAL_REFLOW
|
||||||
|
|
||||||
@@ -384,23 +382,16 @@ nsBlockReflowState::~nsBlockReflowState()
|
|||||||
void
|
void
|
||||||
nsBlockReflowState::GetAvailableSpace()
|
nsBlockReflowState::GetAvailableSpace()
|
||||||
{
|
{
|
||||||
nsISpaceManager* sm = mSpaceManager;
|
|
||||||
|
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
// Verify that the caller setup the coordinate system properly
|
// Verify that the caller setup the coordinate system properly
|
||||||
nscoord wx, wy;
|
nscoord wx, wy;
|
||||||
sm->GetTranslation(wx, wy);
|
mSpaceManager->GetTranslation(wx, wy);
|
||||||
NS_ASSERTION((wx == mSpaceManagerX) && (wy == mSpaceManagerY),
|
NS_ASSERTION((wx == mSpaceManagerX) && (wy == mSpaceManagerY),
|
||||||
"bad coord system");
|
"bad coord system");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mCurrentBand.GetAvailableSpace(mY - BorderPadding().top, mAvailSpaceRect);
|
mCurrentBand.GetAvailableSpace(mY - BorderPadding().top, mAvailSpaceRect);
|
||||||
|
|
||||||
NS_FRAME_LOG(NS_FRAME_TRACE_CALLS,
|
|
||||||
("nsBlockReflowState::GetAvailableSpace: band={%d,%d,%d,%d} count=%d",
|
|
||||||
mAvailSpaceRect.x, mAvailSpaceRect.y,
|
|
||||||
mAvailSpaceRect.width, mAvailSpaceRect.height,
|
|
||||||
mCurrentBand.GetTrapezoidCount()));
|
|
||||||
#ifdef NOISY_INCREMENTAL_REFLOW
|
#ifdef NOISY_INCREMENTAL_REFLOW
|
||||||
if (mReflowState.reason == eReflowReason_Incremental) {
|
if (mReflowState.reason == eReflowReason_Incremental) {
|
||||||
nsFrame::IndentBy(stdout, gNoiseIndent);
|
nsFrame::IndentBy(stdout, gNoiseIndent);
|
||||||
@@ -1148,9 +1139,11 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState,
|
|||||||
aMetrics.mCarriedOutBottomMargin = aState.mPrevBottomMargin;
|
aMetrics.mCarriedOutBottomMargin = aState.mPrevBottomMargin;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_kipp
|
#ifdef DEBUG
|
||||||
NS_ASSERTION((aMetrics.width > -200000) && (aMetrics.width < 200000) &&
|
if (CRAZY_WIDTH(aMetrics.width) || CRAZY_HEIGHT(aMetrics.height)) {
|
||||||
(aMetrics.height > -200000) && (aMetrics.height < 200000), "?");
|
ListTag(stdout);
|
||||||
|
printf(": WARNING: desired:%d,%d\n", aMetrics.width, aMetrics.height);
|
||||||
|
}
|
||||||
if (aState.mComputeMaxElementSize &&
|
if (aState.mComputeMaxElementSize &&
|
||||||
((maxWidth > aMetrics.width) || (maxHeight > aMetrics.height))) {
|
((maxWidth > aMetrics.width) || (maxHeight > aMetrics.height))) {
|
||||||
ListTag(stdout);
|
ListTag(stdout);
|
||||||
@@ -1181,10 +1174,18 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState,
|
|||||||
nscoord y = line->mCombinedArea.y;
|
nscoord y = line->mCombinedArea.y;
|
||||||
nscoord xmost = x + line->mCombinedArea.width;
|
nscoord xmost = x + line->mCombinedArea.width;
|
||||||
nscoord ymost = y + line->mCombinedArea.height;
|
nscoord ymost = y + line->mCombinedArea.height;
|
||||||
if (x < x0) x0 = x;
|
if (x < x0) {
|
||||||
if (xmost > x1) x1 = xmost;
|
x0 = x;
|
||||||
if (y < y0) y0 = y;
|
}
|
||||||
if (ymost > y1) y1 = ymost;
|
if (xmost > x1) {
|
||||||
|
x1 = xmost;
|
||||||
|
}
|
||||||
|
if (y < y0) {
|
||||||
|
y0 = y;
|
||||||
|
}
|
||||||
|
if (ymost > y1) {
|
||||||
|
y1 = ymost;
|
||||||
|
}
|
||||||
|
|
||||||
// If the line has floaters, factor those in as well
|
// If the line has floaters, factor those in as well
|
||||||
nsVoidArray* floaters = line->mFloaters;
|
nsVoidArray* floaters = line->mFloaters;
|
||||||
@@ -1201,10 +1202,18 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState,
|
|||||||
y = r.y;
|
y = r.y;
|
||||||
xmost = x + r.width;
|
xmost = x + r.width;
|
||||||
ymost = y + r.height;
|
ymost = y + r.height;
|
||||||
if (x < x0) x0 = x;
|
if (x < x0) {
|
||||||
if (xmost > x1) x1 = xmost;
|
x0 = x;
|
||||||
if (y < y0) y0 = y;
|
}
|
||||||
if (ymost > y1) y1 = ymost;
|
if (xmost > x1) {
|
||||||
|
x1 = xmost;
|
||||||
|
}
|
||||||
|
if (y < y0) {
|
||||||
|
y0 = y;
|
||||||
|
}
|
||||||
|
if (ymost > y1) {
|
||||||
|
y1 = ymost;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
line = line->mNext;
|
line = line->mNext;
|
||||||
@@ -1404,8 +1413,11 @@ nsBlockFrame::RecoverStateFrom(nsBlockReflowState& aState,
|
|||||||
// Recover xmost
|
// Recover xmost
|
||||||
nscoord xmost = aLine->mBounds.XMost();
|
nscoord xmost = aLine->mBounds.XMost();
|
||||||
if (xmost > aState.mKidXMost) {
|
if (xmost > aState.mKidXMost) {
|
||||||
#ifdef DEBUG_kipp
|
#ifdef DEBUG
|
||||||
NS_ASSERTION((xmost > -200000) && (xmost < 200000), "oy");
|
if (CRAZY_WIDTH(xmost)) {
|
||||||
|
ListTag(stdout);
|
||||||
|
printf(": WARNING: xmost:%d\n", xmost);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
aState.mKidXMost = xmost;
|
aState.mKidXMost = xmost;
|
||||||
}
|
}
|
||||||
@@ -2837,8 +2849,8 @@ nsBlockFrame::ShouldJustifyLine(nsBlockReflowState& aState, nsLineBox* aLine)
|
|||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
nsBlockFrame::PlaceLine(nsBlockReflowState& aState,
|
nsBlockFrame::PlaceLine(nsBlockReflowState& aState,
|
||||||
nsLineBox* aLine,
|
nsLineBox* aLine,
|
||||||
PRBool* aKeepReflowGoing)
|
PRBool* aKeepReflowGoing)
|
||||||
{
|
{
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
|
|
||||||
@@ -2868,8 +2880,12 @@ nsBlockFrame::PlaceLine(nsBlockReflowState& aState,
|
|||||||
}
|
}
|
||||||
nsSize maxElementSize;
|
nsSize maxElementSize;
|
||||||
lineLayout->VerticalAlignFrames(aLine->mBounds, maxElementSize);
|
lineLayout->VerticalAlignFrames(aLine->mBounds, maxElementSize);
|
||||||
#ifdef DEBUG_kipp
|
#ifdef DEBUG
|
||||||
NS_ASSERTION((aLine->mBounds.YMost()) < 200000 && (aLine->mBounds.y > -200000), "oy");
|
if (CRAZY_HEIGHT(aLine->mBounds.y)) {
|
||||||
|
nsFrame::ListTag(stdout);
|
||||||
|
printf(": line=%p y=%d line.bounds.height=%d\n",
|
||||||
|
aLine, aLine->mBounds.y, aLine->mBounds.height);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Only block frames horizontally align their children because
|
// Only block frames horizontally align their children because
|
||||||
@@ -3073,8 +3089,11 @@ nsBlockFrame::PostPlaceLine(nsBlockReflowState& aState,
|
|||||||
// Update xmost
|
// Update xmost
|
||||||
nscoord xmost = aLine->mBounds.XMost();
|
nscoord xmost = aLine->mBounds.XMost();
|
||||||
if (xmost > aState.mKidXMost) {
|
if (xmost > aState.mKidXMost) {
|
||||||
#ifdef DEBUG_kipp
|
#ifdef DEBUG
|
||||||
NS_ASSERTION((xmost > -200000) && (xmost < 200000), "oy");
|
if (CRAZY_WIDTH(xmost)) {
|
||||||
|
ListTag(stdout);
|
||||||
|
printf(": line=%p xmost=%d\n", aLine, xmost);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
aState.mKidXMost = xmost;
|
aState.mKidXMost = xmost;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,8 +51,6 @@ static NS_DEFINE_IID(kITextContentIID, NS_ITEXT_CONTENT_IID);/* XXX */
|
|||||||
// XXX for IsEmptyLine
|
// XXX for IsEmptyLine
|
||||||
#include "nsTextFragment.h"
|
#include "nsTextFragment.h"
|
||||||
|
|
||||||
// XXX TODO:
|
|
||||||
|
|
||||||
// XXX get rid of the need for this
|
// XXX get rid of the need for this
|
||||||
#define SLOW_INCREMENTAL_REFLOW
|
#define SLOW_INCREMENTAL_REFLOW
|
||||||
|
|
||||||
@@ -384,23 +382,16 @@ nsBlockReflowState::~nsBlockReflowState()
|
|||||||
void
|
void
|
||||||
nsBlockReflowState::GetAvailableSpace()
|
nsBlockReflowState::GetAvailableSpace()
|
||||||
{
|
{
|
||||||
nsISpaceManager* sm = mSpaceManager;
|
|
||||||
|
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
// Verify that the caller setup the coordinate system properly
|
// Verify that the caller setup the coordinate system properly
|
||||||
nscoord wx, wy;
|
nscoord wx, wy;
|
||||||
sm->GetTranslation(wx, wy);
|
mSpaceManager->GetTranslation(wx, wy);
|
||||||
NS_ASSERTION((wx == mSpaceManagerX) && (wy == mSpaceManagerY),
|
NS_ASSERTION((wx == mSpaceManagerX) && (wy == mSpaceManagerY),
|
||||||
"bad coord system");
|
"bad coord system");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mCurrentBand.GetAvailableSpace(mY - BorderPadding().top, mAvailSpaceRect);
|
mCurrentBand.GetAvailableSpace(mY - BorderPadding().top, mAvailSpaceRect);
|
||||||
|
|
||||||
NS_FRAME_LOG(NS_FRAME_TRACE_CALLS,
|
|
||||||
("nsBlockReflowState::GetAvailableSpace: band={%d,%d,%d,%d} count=%d",
|
|
||||||
mAvailSpaceRect.x, mAvailSpaceRect.y,
|
|
||||||
mAvailSpaceRect.width, mAvailSpaceRect.height,
|
|
||||||
mCurrentBand.GetTrapezoidCount()));
|
|
||||||
#ifdef NOISY_INCREMENTAL_REFLOW
|
#ifdef NOISY_INCREMENTAL_REFLOW
|
||||||
if (mReflowState.reason == eReflowReason_Incremental) {
|
if (mReflowState.reason == eReflowReason_Incremental) {
|
||||||
nsFrame::IndentBy(stdout, gNoiseIndent);
|
nsFrame::IndentBy(stdout, gNoiseIndent);
|
||||||
@@ -1148,9 +1139,11 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState,
|
|||||||
aMetrics.mCarriedOutBottomMargin = aState.mPrevBottomMargin;
|
aMetrics.mCarriedOutBottomMargin = aState.mPrevBottomMargin;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_kipp
|
#ifdef DEBUG
|
||||||
NS_ASSERTION((aMetrics.width > -200000) && (aMetrics.width < 200000) &&
|
if (CRAZY_WIDTH(aMetrics.width) || CRAZY_HEIGHT(aMetrics.height)) {
|
||||||
(aMetrics.height > -200000) && (aMetrics.height < 200000), "?");
|
ListTag(stdout);
|
||||||
|
printf(": WARNING: desired:%d,%d\n", aMetrics.width, aMetrics.height);
|
||||||
|
}
|
||||||
if (aState.mComputeMaxElementSize &&
|
if (aState.mComputeMaxElementSize &&
|
||||||
((maxWidth > aMetrics.width) || (maxHeight > aMetrics.height))) {
|
((maxWidth > aMetrics.width) || (maxHeight > aMetrics.height))) {
|
||||||
ListTag(stdout);
|
ListTag(stdout);
|
||||||
@@ -1181,10 +1174,18 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState,
|
|||||||
nscoord y = line->mCombinedArea.y;
|
nscoord y = line->mCombinedArea.y;
|
||||||
nscoord xmost = x + line->mCombinedArea.width;
|
nscoord xmost = x + line->mCombinedArea.width;
|
||||||
nscoord ymost = y + line->mCombinedArea.height;
|
nscoord ymost = y + line->mCombinedArea.height;
|
||||||
if (x < x0) x0 = x;
|
if (x < x0) {
|
||||||
if (xmost > x1) x1 = xmost;
|
x0 = x;
|
||||||
if (y < y0) y0 = y;
|
}
|
||||||
if (ymost > y1) y1 = ymost;
|
if (xmost > x1) {
|
||||||
|
x1 = xmost;
|
||||||
|
}
|
||||||
|
if (y < y0) {
|
||||||
|
y0 = y;
|
||||||
|
}
|
||||||
|
if (ymost > y1) {
|
||||||
|
y1 = ymost;
|
||||||
|
}
|
||||||
|
|
||||||
// If the line has floaters, factor those in as well
|
// If the line has floaters, factor those in as well
|
||||||
nsVoidArray* floaters = line->mFloaters;
|
nsVoidArray* floaters = line->mFloaters;
|
||||||
@@ -1201,10 +1202,18 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState,
|
|||||||
y = r.y;
|
y = r.y;
|
||||||
xmost = x + r.width;
|
xmost = x + r.width;
|
||||||
ymost = y + r.height;
|
ymost = y + r.height;
|
||||||
if (x < x0) x0 = x;
|
if (x < x0) {
|
||||||
if (xmost > x1) x1 = xmost;
|
x0 = x;
|
||||||
if (y < y0) y0 = y;
|
}
|
||||||
if (ymost > y1) y1 = ymost;
|
if (xmost > x1) {
|
||||||
|
x1 = xmost;
|
||||||
|
}
|
||||||
|
if (y < y0) {
|
||||||
|
y0 = y;
|
||||||
|
}
|
||||||
|
if (ymost > y1) {
|
||||||
|
y1 = ymost;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
line = line->mNext;
|
line = line->mNext;
|
||||||
@@ -1404,8 +1413,11 @@ nsBlockFrame::RecoverStateFrom(nsBlockReflowState& aState,
|
|||||||
// Recover xmost
|
// Recover xmost
|
||||||
nscoord xmost = aLine->mBounds.XMost();
|
nscoord xmost = aLine->mBounds.XMost();
|
||||||
if (xmost > aState.mKidXMost) {
|
if (xmost > aState.mKidXMost) {
|
||||||
#ifdef DEBUG_kipp
|
#ifdef DEBUG
|
||||||
NS_ASSERTION((xmost > -200000) && (xmost < 200000), "oy");
|
if (CRAZY_WIDTH(xmost)) {
|
||||||
|
ListTag(stdout);
|
||||||
|
printf(": WARNING: xmost:%d\n", xmost);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
aState.mKidXMost = xmost;
|
aState.mKidXMost = xmost;
|
||||||
}
|
}
|
||||||
@@ -2837,8 +2849,8 @@ nsBlockFrame::ShouldJustifyLine(nsBlockReflowState& aState, nsLineBox* aLine)
|
|||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
nsBlockFrame::PlaceLine(nsBlockReflowState& aState,
|
nsBlockFrame::PlaceLine(nsBlockReflowState& aState,
|
||||||
nsLineBox* aLine,
|
nsLineBox* aLine,
|
||||||
PRBool* aKeepReflowGoing)
|
PRBool* aKeepReflowGoing)
|
||||||
{
|
{
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
|
|
||||||
@@ -2868,8 +2880,12 @@ nsBlockFrame::PlaceLine(nsBlockReflowState& aState,
|
|||||||
}
|
}
|
||||||
nsSize maxElementSize;
|
nsSize maxElementSize;
|
||||||
lineLayout->VerticalAlignFrames(aLine->mBounds, maxElementSize);
|
lineLayout->VerticalAlignFrames(aLine->mBounds, maxElementSize);
|
||||||
#ifdef DEBUG_kipp
|
#ifdef DEBUG
|
||||||
NS_ASSERTION((aLine->mBounds.YMost()) < 200000 && (aLine->mBounds.y > -200000), "oy");
|
if (CRAZY_HEIGHT(aLine->mBounds.y)) {
|
||||||
|
nsFrame::ListTag(stdout);
|
||||||
|
printf(": line=%p y=%d line.bounds.height=%d\n",
|
||||||
|
aLine, aLine->mBounds.y, aLine->mBounds.height);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Only block frames horizontally align their children because
|
// Only block frames horizontally align their children because
|
||||||
@@ -3073,8 +3089,11 @@ nsBlockFrame::PostPlaceLine(nsBlockReflowState& aState,
|
|||||||
// Update xmost
|
// Update xmost
|
||||||
nscoord xmost = aLine->mBounds.XMost();
|
nscoord xmost = aLine->mBounds.XMost();
|
||||||
if (xmost > aState.mKidXMost) {
|
if (xmost > aState.mKidXMost) {
|
||||||
#ifdef DEBUG_kipp
|
#ifdef DEBUG
|
||||||
NS_ASSERTION((xmost > -200000) && (xmost < 200000), "oy");
|
if (CRAZY_WIDTH(xmost)) {
|
||||||
|
ListTag(stdout);
|
||||||
|
printf(": line=%p xmost=%d\n", aLine, xmost);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
aState.mKidXMost = xmost;
|
aState.mKidXMost = xmost;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,8 +51,6 @@ static NS_DEFINE_IID(kITextContentIID, NS_ITEXT_CONTENT_IID);/* XXX */
|
|||||||
// XXX for IsEmptyLine
|
// XXX for IsEmptyLine
|
||||||
#include "nsTextFragment.h"
|
#include "nsTextFragment.h"
|
||||||
|
|
||||||
// XXX TODO:
|
|
||||||
|
|
||||||
// XXX get rid of the need for this
|
// XXX get rid of the need for this
|
||||||
#define SLOW_INCREMENTAL_REFLOW
|
#define SLOW_INCREMENTAL_REFLOW
|
||||||
|
|
||||||
@@ -384,23 +382,16 @@ nsBlockReflowState::~nsBlockReflowState()
|
|||||||
void
|
void
|
||||||
nsBlockReflowState::GetAvailableSpace()
|
nsBlockReflowState::GetAvailableSpace()
|
||||||
{
|
{
|
||||||
nsISpaceManager* sm = mSpaceManager;
|
|
||||||
|
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
// Verify that the caller setup the coordinate system properly
|
// Verify that the caller setup the coordinate system properly
|
||||||
nscoord wx, wy;
|
nscoord wx, wy;
|
||||||
sm->GetTranslation(wx, wy);
|
mSpaceManager->GetTranslation(wx, wy);
|
||||||
NS_ASSERTION((wx == mSpaceManagerX) && (wy == mSpaceManagerY),
|
NS_ASSERTION((wx == mSpaceManagerX) && (wy == mSpaceManagerY),
|
||||||
"bad coord system");
|
"bad coord system");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mCurrentBand.GetAvailableSpace(mY - BorderPadding().top, mAvailSpaceRect);
|
mCurrentBand.GetAvailableSpace(mY - BorderPadding().top, mAvailSpaceRect);
|
||||||
|
|
||||||
NS_FRAME_LOG(NS_FRAME_TRACE_CALLS,
|
|
||||||
("nsBlockReflowState::GetAvailableSpace: band={%d,%d,%d,%d} count=%d",
|
|
||||||
mAvailSpaceRect.x, mAvailSpaceRect.y,
|
|
||||||
mAvailSpaceRect.width, mAvailSpaceRect.height,
|
|
||||||
mCurrentBand.GetTrapezoidCount()));
|
|
||||||
#ifdef NOISY_INCREMENTAL_REFLOW
|
#ifdef NOISY_INCREMENTAL_REFLOW
|
||||||
if (mReflowState.reason == eReflowReason_Incremental) {
|
if (mReflowState.reason == eReflowReason_Incremental) {
|
||||||
nsFrame::IndentBy(stdout, gNoiseIndent);
|
nsFrame::IndentBy(stdout, gNoiseIndent);
|
||||||
@@ -1148,9 +1139,11 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState,
|
|||||||
aMetrics.mCarriedOutBottomMargin = aState.mPrevBottomMargin;
|
aMetrics.mCarriedOutBottomMargin = aState.mPrevBottomMargin;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_kipp
|
#ifdef DEBUG
|
||||||
NS_ASSERTION((aMetrics.width > -200000) && (aMetrics.width < 200000) &&
|
if (CRAZY_WIDTH(aMetrics.width) || CRAZY_HEIGHT(aMetrics.height)) {
|
||||||
(aMetrics.height > -200000) && (aMetrics.height < 200000), "?");
|
ListTag(stdout);
|
||||||
|
printf(": WARNING: desired:%d,%d\n", aMetrics.width, aMetrics.height);
|
||||||
|
}
|
||||||
if (aState.mComputeMaxElementSize &&
|
if (aState.mComputeMaxElementSize &&
|
||||||
((maxWidth > aMetrics.width) || (maxHeight > aMetrics.height))) {
|
((maxWidth > aMetrics.width) || (maxHeight > aMetrics.height))) {
|
||||||
ListTag(stdout);
|
ListTag(stdout);
|
||||||
@@ -1181,10 +1174,18 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState,
|
|||||||
nscoord y = line->mCombinedArea.y;
|
nscoord y = line->mCombinedArea.y;
|
||||||
nscoord xmost = x + line->mCombinedArea.width;
|
nscoord xmost = x + line->mCombinedArea.width;
|
||||||
nscoord ymost = y + line->mCombinedArea.height;
|
nscoord ymost = y + line->mCombinedArea.height;
|
||||||
if (x < x0) x0 = x;
|
if (x < x0) {
|
||||||
if (xmost > x1) x1 = xmost;
|
x0 = x;
|
||||||
if (y < y0) y0 = y;
|
}
|
||||||
if (ymost > y1) y1 = ymost;
|
if (xmost > x1) {
|
||||||
|
x1 = xmost;
|
||||||
|
}
|
||||||
|
if (y < y0) {
|
||||||
|
y0 = y;
|
||||||
|
}
|
||||||
|
if (ymost > y1) {
|
||||||
|
y1 = ymost;
|
||||||
|
}
|
||||||
|
|
||||||
// If the line has floaters, factor those in as well
|
// If the line has floaters, factor those in as well
|
||||||
nsVoidArray* floaters = line->mFloaters;
|
nsVoidArray* floaters = line->mFloaters;
|
||||||
@@ -1201,10 +1202,18 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState,
|
|||||||
y = r.y;
|
y = r.y;
|
||||||
xmost = x + r.width;
|
xmost = x + r.width;
|
||||||
ymost = y + r.height;
|
ymost = y + r.height;
|
||||||
if (x < x0) x0 = x;
|
if (x < x0) {
|
||||||
if (xmost > x1) x1 = xmost;
|
x0 = x;
|
||||||
if (y < y0) y0 = y;
|
}
|
||||||
if (ymost > y1) y1 = ymost;
|
if (xmost > x1) {
|
||||||
|
x1 = xmost;
|
||||||
|
}
|
||||||
|
if (y < y0) {
|
||||||
|
y0 = y;
|
||||||
|
}
|
||||||
|
if (ymost > y1) {
|
||||||
|
y1 = ymost;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
line = line->mNext;
|
line = line->mNext;
|
||||||
@@ -1404,8 +1413,11 @@ nsBlockFrame::RecoverStateFrom(nsBlockReflowState& aState,
|
|||||||
// Recover xmost
|
// Recover xmost
|
||||||
nscoord xmost = aLine->mBounds.XMost();
|
nscoord xmost = aLine->mBounds.XMost();
|
||||||
if (xmost > aState.mKidXMost) {
|
if (xmost > aState.mKidXMost) {
|
||||||
#ifdef DEBUG_kipp
|
#ifdef DEBUG
|
||||||
NS_ASSERTION((xmost > -200000) && (xmost < 200000), "oy");
|
if (CRAZY_WIDTH(xmost)) {
|
||||||
|
ListTag(stdout);
|
||||||
|
printf(": WARNING: xmost:%d\n", xmost);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
aState.mKidXMost = xmost;
|
aState.mKidXMost = xmost;
|
||||||
}
|
}
|
||||||
@@ -2837,8 +2849,8 @@ nsBlockFrame::ShouldJustifyLine(nsBlockReflowState& aState, nsLineBox* aLine)
|
|||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
nsBlockFrame::PlaceLine(nsBlockReflowState& aState,
|
nsBlockFrame::PlaceLine(nsBlockReflowState& aState,
|
||||||
nsLineBox* aLine,
|
nsLineBox* aLine,
|
||||||
PRBool* aKeepReflowGoing)
|
PRBool* aKeepReflowGoing)
|
||||||
{
|
{
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
|
|
||||||
@@ -2868,8 +2880,12 @@ nsBlockFrame::PlaceLine(nsBlockReflowState& aState,
|
|||||||
}
|
}
|
||||||
nsSize maxElementSize;
|
nsSize maxElementSize;
|
||||||
lineLayout->VerticalAlignFrames(aLine->mBounds, maxElementSize);
|
lineLayout->VerticalAlignFrames(aLine->mBounds, maxElementSize);
|
||||||
#ifdef DEBUG_kipp
|
#ifdef DEBUG
|
||||||
NS_ASSERTION((aLine->mBounds.YMost()) < 200000 && (aLine->mBounds.y > -200000), "oy");
|
if (CRAZY_HEIGHT(aLine->mBounds.y)) {
|
||||||
|
nsFrame::ListTag(stdout);
|
||||||
|
printf(": line=%p y=%d line.bounds.height=%d\n",
|
||||||
|
aLine, aLine->mBounds.y, aLine->mBounds.height);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Only block frames horizontally align their children because
|
// Only block frames horizontally align their children because
|
||||||
@@ -3073,8 +3089,11 @@ nsBlockFrame::PostPlaceLine(nsBlockReflowState& aState,
|
|||||||
// Update xmost
|
// Update xmost
|
||||||
nscoord xmost = aLine->mBounds.XMost();
|
nscoord xmost = aLine->mBounds.XMost();
|
||||||
if (xmost > aState.mKidXMost) {
|
if (xmost > aState.mKidXMost) {
|
||||||
#ifdef DEBUG_kipp
|
#ifdef DEBUG
|
||||||
NS_ASSERTION((xmost > -200000) && (xmost < 200000), "oy");
|
if (CRAZY_WIDTH(xmost)) {
|
||||||
|
ListTag(stdout);
|
||||||
|
printf(": line=%p xmost=%d\n", aLine, xmost);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
aState.mKidXMost = xmost;
|
aState.mKidXMost = xmost;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user