mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
bug 154979 - use gNoisyMaxElementSize instead of NOISY_MAX_ELEMENTSIZE r=karnaze sr=waterson
This commit is contained in:
parent
4bb20f5f7a
commit
7054f14c18
@ -1112,12 +1112,13 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext,
|
||||
delta, perLineDelta, numLines, ectc - ctc);
|
||||
printf("%s\n", buf);
|
||||
}
|
||||
#endif
|
||||
#ifdef NOISY_MAX_ELEMENT_SIZE
|
||||
if (aMetrics.maxElementSize) {
|
||||
printf("block %p returning with maxElementSize=%d,%d\n", this,
|
||||
aMetrics.maxElementSize->width,
|
||||
aMetrics.maxElementSize->height);
|
||||
if (gNoisyMaxElementSize) {
|
||||
if (aMetrics.maxElementSize) {
|
||||
IndentBy(stdout, gNoiseIndent);
|
||||
printf("block %p returning with maxElementSize=%d,%d\n", this,
|
||||
aMetrics.maxElementSize->width,
|
||||
aMetrics.maxElementSize->height);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1424,9 +1425,12 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState,
|
||||
// Store away the final value
|
||||
aMetrics.maxElementSize->width = maxWidth;
|
||||
aMetrics.maxElementSize->height = maxHeight;
|
||||
#ifdef NOISY_MAX_ELEMENT_SIZE
|
||||
printf ("nsBlockFrame::CFS: %p returning MES %d\n",
|
||||
this, aMetrics.maxElementSize->width);
|
||||
#ifdef DEBUG
|
||||
if (gNoisyMaxElementSize) {
|
||||
IndentBy(stdout, gNoiseIndent);
|
||||
printf ("nsBlockFrame::CFS: %p returning MES %d\n",
|
||||
this, aMetrics.maxElementSize->width);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -1454,17 +1458,19 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState,
|
||||
aState.mReflowState.availableHeight);
|
||||
}
|
||||
#endif
|
||||
#ifdef NOISY_MAX_ELEMENT_SIZE
|
||||
if (aState.GetFlag(BRS_COMPUTEMAXELEMENTSIZE)) {
|
||||
IndentBy(stdout, GetDepth());
|
||||
if (NS_UNCONSTRAINEDSIZE == aState.mReflowState.availableWidth) {
|
||||
printf("PASS1 ");
|
||||
#ifdef DEBUG
|
||||
if (gNoisyMaxElementSize) {
|
||||
if (aState.GetFlag(BRS_COMPUTEMAXELEMENTSIZE)) {
|
||||
IndentBy(stdout, gNoiseIndent);
|
||||
if (NS_UNCONSTRAINEDSIZE == aState.mReflowState.availableWidth) {
|
||||
printf("PASS1 ");
|
||||
}
|
||||
ListTag(stdout);
|
||||
printf(": max-element-size:%d,%d desired:%d,%d maxSize:%d,%d\n",
|
||||
maxWidth, maxHeight, aMetrics.width, aMetrics.height,
|
||||
aState.mReflowState.availableWidth,
|
||||
aState.mReflowState.availableHeight);
|
||||
}
|
||||
ListTag(stdout);
|
||||
printf(": max-element-size:%d,%d desired:%d,%d maxSize:%d,%d\n",
|
||||
maxWidth, maxHeight, aMetrics.width, aMetrics.height,
|
||||
aState.mReflowState.availableWidth,
|
||||
aState.mReflowState.availableHeight);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -2619,9 +2625,12 @@ nsBlockFrame::ReflowLine(nsBlockReflowState& aState,
|
||||
}
|
||||
if (aState.GetFlag(BRS_COMPUTEMAXELEMENTSIZE))
|
||||
{
|
||||
#ifdef NOISY_MAX_ELEMENT_SIZE
|
||||
printf("nsBlockFrame::ReflowLine block %p line %p setting aLine.mMaxElementWidth to %d\n",
|
||||
this, aLine, aLine->mMaxElementWidth);
|
||||
#ifdef DEBUG
|
||||
if (gNoisyMaxElementSize) {
|
||||
IndentBy(stdout, gNoiseIndent);
|
||||
printf("nsBlockFrame::ReflowLine block %p line %p setting aLine.mMaxElementWidth to %d\n",
|
||||
this, aLine, aLine->mMaxElementWidth);
|
||||
}
|
||||
#endif
|
||||
aState.UpdateMaxElementSize(nsSize(aLine->mMaxElementWidth, aLine->mBounds.height));
|
||||
}
|
||||
@ -4237,16 +4246,18 @@ nsBlockFrame::PlaceLine(nsBlockReflowState& aState,
|
||||
|
||||
aState.mY = newY;
|
||||
if (aState.GetFlag(BRS_COMPUTEMAXELEMENTSIZE)) {
|
||||
#ifdef NOISY_MAX_ELEMENT_SIZE
|
||||
IndentBy(stdout, GetDepth());
|
||||
if (NS_UNCONSTRAINEDSIZE == aState.mReflowState.availableWidth) {
|
||||
printf("PASS1 ");
|
||||
#ifdef DEBUG
|
||||
if (gNoisyMaxElementSize) {
|
||||
IndentBy(stdout, gNoiseIndent);
|
||||
if (NS_UNCONSTRAINEDSIZE == aState.mReflowState.availableWidth) {
|
||||
printf("PASS1 ");
|
||||
}
|
||||
ListTag(stdout);
|
||||
printf(": line.floaters=%s band.floaterCount=%d\n",
|
||||
//aLine->mFloaters.NotEmpty() ? "yes" : "no",
|
||||
aState.mHaveRightFloaters ? "(have right floaters)" : "",
|
||||
aState.mBand.GetFloaterCount());
|
||||
}
|
||||
ListTag(stdout);
|
||||
printf(": line.floaters=%s band.floaterCount=%d\n",
|
||||
//aLine->mFloaters.NotEmpty() ? "yes" : "no",
|
||||
aState.mHaveRightFloaters ? "(have right floaters)" : "",
|
||||
aState.mBand.GetFloaterCount());
|
||||
#endif
|
||||
if (0 != aState.mBand.GetFloaterCount()) {
|
||||
// Add in floater impacts to the lines max-element-size
|
||||
@ -4265,9 +4276,12 @@ nsBlockFrame::PlaceLine(nsBlockReflowState& aState,
|
||||
// We also cache the max element width in the line. This is needed for
|
||||
// incremental reflow
|
||||
aLine->mMaxElementWidth = maxElementSize.width;
|
||||
#ifdef NOISY_MAX_ELEMENT_SIZE
|
||||
printf ("nsBlockFrame::PlaceLine: %p setting MES for line %p to %d\n",
|
||||
this, aLine, maxElementSize.width);
|
||||
#ifdef DEBUG
|
||||
if (gNoisyMaxElementSize) {
|
||||
IndentBy(stdout, gNoiseIndent);
|
||||
printf ("nsBlockFrame::PlaceLine: %p setting MES for line %p to %d\n",
|
||||
this, aLine, maxElementSize.width);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -4374,13 +4388,15 @@ nsBlockFrame::ComputeLineMaxElementSize(nsBlockReflowState& aState,
|
||||
{
|
||||
nscoord maxWidth, maxHeight;
|
||||
aState.mBand.GetMaxElementSize(aState.mPresContext, &maxWidth, &maxHeight);
|
||||
#ifdef NOISY_MAX_ELEMENT_SIZE
|
||||
IndentBy(stdout, GetDepth());
|
||||
if (NS_UNCONSTRAINEDSIZE == aState.mReflowState.availableWidth) {
|
||||
printf("PASS1 ");
|
||||
#ifdef DEBUG
|
||||
if (gNoisyMaxElementSize) {
|
||||
IndentBy(stdout, gNoiseIndent);
|
||||
if (NS_UNCONSTRAINEDSIZE == aState.mReflowState.availableWidth) {
|
||||
printf("PASS1 ");
|
||||
}
|
||||
ListTag(stdout);
|
||||
printf(": maxFloaterSize=%d,%d\n", maxWidth, maxHeight);
|
||||
}
|
||||
ListTag(stdout);
|
||||
printf(": maxFloaterSize=%d,%d\n", maxWidth, maxHeight);
|
||||
#endif
|
||||
|
||||
// To ensure that we always place some content next to a floater,
|
||||
@ -4397,9 +4413,12 @@ nsBlockFrame::ComputeLineMaxElementSize(nsBlockReflowState& aState,
|
||||
aMaxElementSize->height = maxHeight;
|
||||
}
|
||||
}
|
||||
#ifdef NOISY_MAX_ELEMENT_SIZE
|
||||
printf ("nsBlockFrame::ComputeLineMaxElementSize: %p returning MES %d\n",
|
||||
this, aMaxElementSize->width);
|
||||
#ifdef DEBUG
|
||||
if (gNoisyMaxElementSize) {
|
||||
IndentBy(stdout, gNoiseIndent);
|
||||
printf ("nsBlockFrame::ComputeLineMaxElementSize: %p returning MES %d\n",
|
||||
this, aMaxElementSize->width);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -4426,9 +4445,12 @@ nsBlockFrame::PostPlaceLine(nsBlockReflowState& aState,
|
||||
// We also cache the max element width in the line. This is needed for
|
||||
// incremental reflow
|
||||
aLine->mMaxElementWidth = aMaxElementSize.width;
|
||||
#ifdef NOISY_MAX_ELEMENT_SIZE
|
||||
printf ("nsBlockFrame::PostPlaceLine: %p setting line %p MES %d\n",
|
||||
this, aLine, aMaxElementSize.width);
|
||||
#ifdef DEBUG
|
||||
if (gNoisyMaxElementSize) {
|
||||
IndentBy(stdout, gNoiseIndent);
|
||||
printf ("nsBlockFrame::PostPlaceLine: %p setting line %p MES %d\n",
|
||||
this, aLine, aMaxElementSize.width);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -612,15 +612,18 @@ nsBlockReflowContext::DoReflowBlock(nsHTMLReflowState &aReflowState,
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#ifdef NOISY_MAX_ELEMENT_SIZE
|
||||
if (!NS_INLINE_IS_BREAK_BEFORE(aFrameReflowStatus)) {
|
||||
if (nsnull != mMetrics.maxElementSize) {
|
||||
printf(" ");
|
||||
nsFrame::ListTag(stdout, aFrame);
|
||||
printf(": maxElementSize=%d,%d wh=%d,%d\n",
|
||||
mMetrics.maxElementSize->width,
|
||||
mMetrics.maxElementSize->height,
|
||||
mMetrics.width, mMetrics.height);
|
||||
#ifdef DEBUG
|
||||
if (nsBlockFrame::gNoisyMaxElementSize) {
|
||||
nsFrame::IndentBy(stdout, nsBlockFrame::gNoiseIndent);
|
||||
if (!NS_INLINE_IS_BREAK_BEFORE(aFrameReflowStatus)) {
|
||||
if (nsnull != mMetrics.maxElementSize) {
|
||||
printf(" ");
|
||||
nsFrame::ListTag(stdout, aFrame);
|
||||
printf(": maxElementSize=%d,%d wh=%d,%d\n",
|
||||
mMetrics.maxElementSize->width,
|
||||
mMetrics.maxElementSize->height,
|
||||
mMetrics.width, mMetrics.height);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -165,8 +165,11 @@ nsBlockReflowState::nsBlockReflowState(const nsHTMLReflowState& aReflowState,
|
||||
}
|
||||
|
||||
SetFlag(BRS_COMPUTEMAXELEMENTSIZE, (nsnull != aMetrics.maxElementSize));
|
||||
#ifdef NOISY_MAX_ELEMENT_SIZE
|
||||
printf("BRS: setting compute-MES to %d\n", (nsnull != aMetrics.maxElementSize));
|
||||
#ifdef DEBUG
|
||||
if (nsBlockFrame::gNoisyMaxElementSize) {
|
||||
nsFrame::IndentBy(stdout, nsBlockFrame::gNoiseIndent);
|
||||
printf("BRS: setting compute-MES to %d\n", (nsnull != aMetrics.maxElementSize));
|
||||
}
|
||||
#endif
|
||||
mMaxElementSize.SizeTo(0, 0);
|
||||
SetFlag(BRS_COMPUTEMAXWIDTH,
|
||||
@ -572,8 +575,11 @@ nsBlockReflowState::RecoverStateFrom(nsLineList::iterator aLine,
|
||||
mKidXMost = xmost;
|
||||
}
|
||||
if (GetFlag(BRS_COMPUTEMAXELEMENTSIZE)) {
|
||||
#ifdef NOISY_MAX_ELEMENT_SIZE
|
||||
printf("nsBlockReflowState::RecoverStateFrom block %p caching max width %d\n", mBlock, aLine->mMaxElementWidth);
|
||||
#ifdef DEBUG
|
||||
if (nsBlockFrame::gNoisyMaxElementSize) {
|
||||
nsFrame::IndentBy(stdout, nsBlockFrame::gNoiseIndent);
|
||||
printf("nsBlockReflowState::RecoverStateFrom block %p caching max width %d\n", mBlock, aLine->mMaxElementWidth);
|
||||
}
|
||||
#endif
|
||||
UpdateMaxElementSize(nsSize(aLine->mMaxElementWidth, aLine->mBounds.height));
|
||||
}
|
||||
@ -697,7 +703,7 @@ nsBlockReflowState::AddFloater(nsLineLayout& aLineLayout,
|
||||
void
|
||||
nsBlockReflowState::UpdateMaxElementSize(const nsSize& aMaxElementSize)
|
||||
{
|
||||
#ifdef NOISY_MAX_ELEMENT_SIZE
|
||||
#ifdef DEBUG
|
||||
nsSize oldSize = mMaxElementSize;
|
||||
#endif
|
||||
if (aMaxElementSize.width > mMaxElementSize.width) {
|
||||
@ -706,17 +712,19 @@ nsBlockReflowState::UpdateMaxElementSize(const nsSize& aMaxElementSize)
|
||||
if (aMaxElementSize.height > mMaxElementSize.height) {
|
||||
mMaxElementSize.height = aMaxElementSize.height;
|
||||
}
|
||||
#ifdef NOISY_MAX_ELEMENT_SIZE
|
||||
if ((mMaxElementSize.width != oldSize.width) ||
|
||||
(mMaxElementSize.height != oldSize.height)) {
|
||||
nsFrame::IndentBy(stdout, mBlock->GetDepth());
|
||||
if (NS_UNCONSTRAINEDSIZE == mReflowState.availableWidth) {
|
||||
printf("PASS1 ");
|
||||
#ifdef DEBUG
|
||||
if (nsBlockFrame::gNoisyMaxElementSize) {
|
||||
if ((mMaxElementSize.width != oldSize.width) ||
|
||||
(mMaxElementSize.height != oldSize.height)) {
|
||||
nsFrame::IndentBy(stdout, nsBlockFrame::gNoiseIndent);
|
||||
if (NS_UNCONSTRAINEDSIZE == mReflowState.availableWidth) {
|
||||
printf("PASS1 ");
|
||||
}
|
||||
nsFrame::ListTag(stdout, mBlock);
|
||||
printf(": old max-element-size=%d,%d new=%d,%d\n",
|
||||
oldSize.width, oldSize.height,
|
||||
mMaxElementSize.width, mMaxElementSize.height);
|
||||
}
|
||||
nsFrame::ListTag(stdout, mBlock);
|
||||
printf(": old max-element-size=%d,%d new=%d,%d\n",
|
||||
oldSize.width, oldSize.height,
|
||||
mMaxElementSize.width, mMaxElementSize.height);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -1259,15 +1259,18 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#ifdef NOISY_MAX_ELEMENT_SIZE
|
||||
if (!NS_INLINE_IS_BREAK_BEFORE(aReflowStatus)) {
|
||||
if (mComputeMaxElementSize) {
|
||||
printf(" ");
|
||||
nsFrame::ListTag(stdout, aFrame);
|
||||
printf(": maxElementSize=%d,%d wh=%d,%d,\n",
|
||||
metrics.maxElementSize->width,
|
||||
metrics.maxElementSize->height,
|
||||
metrics.width, metrics.height);
|
||||
#ifdef DEBUG
|
||||
if (nsBlockFrame::gNoisyMaxElementSize) {
|
||||
nsFrame::IndentBy(stdout, nsBlockFrame::gNoiseIndent);
|
||||
if (!NS_INLINE_IS_BREAK_BEFORE(aReflowStatus)) {
|
||||
if (mComputeMaxElementSize) {
|
||||
printf(" ");
|
||||
nsFrame::ListTag(stdout, aFrame);
|
||||
printf(": maxElementSize=%d,%d wh=%d,%d,\n",
|
||||
metrics.maxElementSize->width,
|
||||
metrics.maxElementSize->height,
|
||||
metrics.width, metrics.height);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -1937,7 +1940,7 @@ nsLineLayout::VerticalAlignLine(nsLineBox* aLineBox,
|
||||
PRBool strictMode = InStrictMode();
|
||||
PRBool inUnconstrainedTable = InUnconstrainedTableCell(*mBlockReflowState);
|
||||
#endif
|
||||
#ifdef NOISY_MAX_ELEMENT_SIZE
|
||||
#ifdef DEBUG
|
||||
int frameCount = 0;
|
||||
#endif
|
||||
|
||||
@ -1961,7 +1964,8 @@ nsLineLayout::VerticalAlignLine(nsLineBox* aLineBox,
|
||||
|
||||
#ifdef HACK_MEW
|
||||
|
||||
#ifdef NOISY_MAX_ELEMENT_SIZE
|
||||
#ifdef DEBUG
|
||||
if (nsBlockFrame::gNoisyMaxElementSize)
|
||||
frameCount++;
|
||||
#endif
|
||||
// if in Quirks mode and in a table cell with an unconstrained width, then emulate an IE
|
||||
@ -1988,9 +1992,12 @@ nsLineLayout::VerticalAlignLine(nsLineBox* aLineBox,
|
||||
// now update the prevFrame
|
||||
prevFrameAccumulates = curFrameAccumulates;
|
||||
|
||||
#ifdef NOISY_MAX_ELEMENT_SIZE
|
||||
printf("(%d) last frame's MEW=%d | Accumulated MEW=%d\n", frameCount, mw, accumulatedWidth);
|
||||
#endif // NOISY_MAX_ELEMENT_SIZE
|
||||
#ifdef DEBUG
|
||||
if (nsBlockFrame::gNoisyMaxElementSize) {
|
||||
nsFrame::IndentBy(stdout, nsBlockFrame::gNoiseIndent);
|
||||
printf("(%d) last frame's MEW=%d | Accumulated MEW=%d\n", frameCount, mw, accumulatedWidth);
|
||||
}
|
||||
#endif
|
||||
|
||||
mw = accumulatedWidth;
|
||||
}
|
||||
|
@ -1112,12 +1112,13 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext,
|
||||
delta, perLineDelta, numLines, ectc - ctc);
|
||||
printf("%s\n", buf);
|
||||
}
|
||||
#endif
|
||||
#ifdef NOISY_MAX_ELEMENT_SIZE
|
||||
if (aMetrics.maxElementSize) {
|
||||
printf("block %p returning with maxElementSize=%d,%d\n", this,
|
||||
aMetrics.maxElementSize->width,
|
||||
aMetrics.maxElementSize->height);
|
||||
if (gNoisyMaxElementSize) {
|
||||
if (aMetrics.maxElementSize) {
|
||||
IndentBy(stdout, gNoiseIndent);
|
||||
printf("block %p returning with maxElementSize=%d,%d\n", this,
|
||||
aMetrics.maxElementSize->width,
|
||||
aMetrics.maxElementSize->height);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1424,9 +1425,12 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState,
|
||||
// Store away the final value
|
||||
aMetrics.maxElementSize->width = maxWidth;
|
||||
aMetrics.maxElementSize->height = maxHeight;
|
||||
#ifdef NOISY_MAX_ELEMENT_SIZE
|
||||
printf ("nsBlockFrame::CFS: %p returning MES %d\n",
|
||||
this, aMetrics.maxElementSize->width);
|
||||
#ifdef DEBUG
|
||||
if (gNoisyMaxElementSize) {
|
||||
IndentBy(stdout, gNoiseIndent);
|
||||
printf ("nsBlockFrame::CFS: %p returning MES %d\n",
|
||||
this, aMetrics.maxElementSize->width);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -1454,17 +1458,19 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState,
|
||||
aState.mReflowState.availableHeight);
|
||||
}
|
||||
#endif
|
||||
#ifdef NOISY_MAX_ELEMENT_SIZE
|
||||
if (aState.GetFlag(BRS_COMPUTEMAXELEMENTSIZE)) {
|
||||
IndentBy(stdout, GetDepth());
|
||||
if (NS_UNCONSTRAINEDSIZE == aState.mReflowState.availableWidth) {
|
||||
printf("PASS1 ");
|
||||
#ifdef DEBUG
|
||||
if (gNoisyMaxElementSize) {
|
||||
if (aState.GetFlag(BRS_COMPUTEMAXELEMENTSIZE)) {
|
||||
IndentBy(stdout, gNoiseIndent);
|
||||
if (NS_UNCONSTRAINEDSIZE == aState.mReflowState.availableWidth) {
|
||||
printf("PASS1 ");
|
||||
}
|
||||
ListTag(stdout);
|
||||
printf(": max-element-size:%d,%d desired:%d,%d maxSize:%d,%d\n",
|
||||
maxWidth, maxHeight, aMetrics.width, aMetrics.height,
|
||||
aState.mReflowState.availableWidth,
|
||||
aState.mReflowState.availableHeight);
|
||||
}
|
||||
ListTag(stdout);
|
||||
printf(": max-element-size:%d,%d desired:%d,%d maxSize:%d,%d\n",
|
||||
maxWidth, maxHeight, aMetrics.width, aMetrics.height,
|
||||
aState.mReflowState.availableWidth,
|
||||
aState.mReflowState.availableHeight);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -2619,9 +2625,12 @@ nsBlockFrame::ReflowLine(nsBlockReflowState& aState,
|
||||
}
|
||||
if (aState.GetFlag(BRS_COMPUTEMAXELEMENTSIZE))
|
||||
{
|
||||
#ifdef NOISY_MAX_ELEMENT_SIZE
|
||||
printf("nsBlockFrame::ReflowLine block %p line %p setting aLine.mMaxElementWidth to %d\n",
|
||||
this, aLine, aLine->mMaxElementWidth);
|
||||
#ifdef DEBUG
|
||||
if (gNoisyMaxElementSize) {
|
||||
IndentBy(stdout, gNoiseIndent);
|
||||
printf("nsBlockFrame::ReflowLine block %p line %p setting aLine.mMaxElementWidth to %d\n",
|
||||
this, aLine, aLine->mMaxElementWidth);
|
||||
}
|
||||
#endif
|
||||
aState.UpdateMaxElementSize(nsSize(aLine->mMaxElementWidth, aLine->mBounds.height));
|
||||
}
|
||||
@ -4237,16 +4246,18 @@ nsBlockFrame::PlaceLine(nsBlockReflowState& aState,
|
||||
|
||||
aState.mY = newY;
|
||||
if (aState.GetFlag(BRS_COMPUTEMAXELEMENTSIZE)) {
|
||||
#ifdef NOISY_MAX_ELEMENT_SIZE
|
||||
IndentBy(stdout, GetDepth());
|
||||
if (NS_UNCONSTRAINEDSIZE == aState.mReflowState.availableWidth) {
|
||||
printf("PASS1 ");
|
||||
#ifdef DEBUG
|
||||
if (gNoisyMaxElementSize) {
|
||||
IndentBy(stdout, gNoiseIndent);
|
||||
if (NS_UNCONSTRAINEDSIZE == aState.mReflowState.availableWidth) {
|
||||
printf("PASS1 ");
|
||||
}
|
||||
ListTag(stdout);
|
||||
printf(": line.floaters=%s band.floaterCount=%d\n",
|
||||
//aLine->mFloaters.NotEmpty() ? "yes" : "no",
|
||||
aState.mHaveRightFloaters ? "(have right floaters)" : "",
|
||||
aState.mBand.GetFloaterCount());
|
||||
}
|
||||
ListTag(stdout);
|
||||
printf(": line.floaters=%s band.floaterCount=%d\n",
|
||||
//aLine->mFloaters.NotEmpty() ? "yes" : "no",
|
||||
aState.mHaveRightFloaters ? "(have right floaters)" : "",
|
||||
aState.mBand.GetFloaterCount());
|
||||
#endif
|
||||
if (0 != aState.mBand.GetFloaterCount()) {
|
||||
// Add in floater impacts to the lines max-element-size
|
||||
@ -4265,9 +4276,12 @@ nsBlockFrame::PlaceLine(nsBlockReflowState& aState,
|
||||
// We also cache the max element width in the line. This is needed for
|
||||
// incremental reflow
|
||||
aLine->mMaxElementWidth = maxElementSize.width;
|
||||
#ifdef NOISY_MAX_ELEMENT_SIZE
|
||||
printf ("nsBlockFrame::PlaceLine: %p setting MES for line %p to %d\n",
|
||||
this, aLine, maxElementSize.width);
|
||||
#ifdef DEBUG
|
||||
if (gNoisyMaxElementSize) {
|
||||
IndentBy(stdout, gNoiseIndent);
|
||||
printf ("nsBlockFrame::PlaceLine: %p setting MES for line %p to %d\n",
|
||||
this, aLine, maxElementSize.width);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -4374,13 +4388,15 @@ nsBlockFrame::ComputeLineMaxElementSize(nsBlockReflowState& aState,
|
||||
{
|
||||
nscoord maxWidth, maxHeight;
|
||||
aState.mBand.GetMaxElementSize(aState.mPresContext, &maxWidth, &maxHeight);
|
||||
#ifdef NOISY_MAX_ELEMENT_SIZE
|
||||
IndentBy(stdout, GetDepth());
|
||||
if (NS_UNCONSTRAINEDSIZE == aState.mReflowState.availableWidth) {
|
||||
printf("PASS1 ");
|
||||
#ifdef DEBUG
|
||||
if (gNoisyMaxElementSize) {
|
||||
IndentBy(stdout, gNoiseIndent);
|
||||
if (NS_UNCONSTRAINEDSIZE == aState.mReflowState.availableWidth) {
|
||||
printf("PASS1 ");
|
||||
}
|
||||
ListTag(stdout);
|
||||
printf(": maxFloaterSize=%d,%d\n", maxWidth, maxHeight);
|
||||
}
|
||||
ListTag(stdout);
|
||||
printf(": maxFloaterSize=%d,%d\n", maxWidth, maxHeight);
|
||||
#endif
|
||||
|
||||
// To ensure that we always place some content next to a floater,
|
||||
@ -4397,9 +4413,12 @@ nsBlockFrame::ComputeLineMaxElementSize(nsBlockReflowState& aState,
|
||||
aMaxElementSize->height = maxHeight;
|
||||
}
|
||||
}
|
||||
#ifdef NOISY_MAX_ELEMENT_SIZE
|
||||
printf ("nsBlockFrame::ComputeLineMaxElementSize: %p returning MES %d\n",
|
||||
this, aMaxElementSize->width);
|
||||
#ifdef DEBUG
|
||||
if (gNoisyMaxElementSize) {
|
||||
IndentBy(stdout, gNoiseIndent);
|
||||
printf ("nsBlockFrame::ComputeLineMaxElementSize: %p returning MES %d\n",
|
||||
this, aMaxElementSize->width);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -4426,9 +4445,12 @@ nsBlockFrame::PostPlaceLine(nsBlockReflowState& aState,
|
||||
// We also cache the max element width in the line. This is needed for
|
||||
// incremental reflow
|
||||
aLine->mMaxElementWidth = aMaxElementSize.width;
|
||||
#ifdef NOISY_MAX_ELEMENT_SIZE
|
||||
printf ("nsBlockFrame::PostPlaceLine: %p setting line %p MES %d\n",
|
||||
this, aLine, aMaxElementSize.width);
|
||||
#ifdef DEBUG
|
||||
if (gNoisyMaxElementSize) {
|
||||
IndentBy(stdout, gNoiseIndent);
|
||||
printf ("nsBlockFrame::PostPlaceLine: %p setting line %p MES %d\n",
|
||||
this, aLine, aMaxElementSize.width);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -612,15 +612,18 @@ nsBlockReflowContext::DoReflowBlock(nsHTMLReflowState &aReflowState,
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#ifdef NOISY_MAX_ELEMENT_SIZE
|
||||
if (!NS_INLINE_IS_BREAK_BEFORE(aFrameReflowStatus)) {
|
||||
if (nsnull != mMetrics.maxElementSize) {
|
||||
printf(" ");
|
||||
nsFrame::ListTag(stdout, aFrame);
|
||||
printf(": maxElementSize=%d,%d wh=%d,%d\n",
|
||||
mMetrics.maxElementSize->width,
|
||||
mMetrics.maxElementSize->height,
|
||||
mMetrics.width, mMetrics.height);
|
||||
#ifdef DEBUG
|
||||
if (nsBlockFrame::gNoisyMaxElementSize) {
|
||||
nsFrame::IndentBy(stdout, nsBlockFrame::gNoiseIndent);
|
||||
if (!NS_INLINE_IS_BREAK_BEFORE(aFrameReflowStatus)) {
|
||||
if (nsnull != mMetrics.maxElementSize) {
|
||||
printf(" ");
|
||||
nsFrame::ListTag(stdout, aFrame);
|
||||
printf(": maxElementSize=%d,%d wh=%d,%d\n",
|
||||
mMetrics.maxElementSize->width,
|
||||
mMetrics.maxElementSize->height,
|
||||
mMetrics.width, mMetrics.height);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -165,8 +165,11 @@ nsBlockReflowState::nsBlockReflowState(const nsHTMLReflowState& aReflowState,
|
||||
}
|
||||
|
||||
SetFlag(BRS_COMPUTEMAXELEMENTSIZE, (nsnull != aMetrics.maxElementSize));
|
||||
#ifdef NOISY_MAX_ELEMENT_SIZE
|
||||
printf("BRS: setting compute-MES to %d\n", (nsnull != aMetrics.maxElementSize));
|
||||
#ifdef DEBUG
|
||||
if (nsBlockFrame::gNoisyMaxElementSize) {
|
||||
nsFrame::IndentBy(stdout, nsBlockFrame::gNoiseIndent);
|
||||
printf("BRS: setting compute-MES to %d\n", (nsnull != aMetrics.maxElementSize));
|
||||
}
|
||||
#endif
|
||||
mMaxElementSize.SizeTo(0, 0);
|
||||
SetFlag(BRS_COMPUTEMAXWIDTH,
|
||||
@ -572,8 +575,11 @@ nsBlockReflowState::RecoverStateFrom(nsLineList::iterator aLine,
|
||||
mKidXMost = xmost;
|
||||
}
|
||||
if (GetFlag(BRS_COMPUTEMAXELEMENTSIZE)) {
|
||||
#ifdef NOISY_MAX_ELEMENT_SIZE
|
||||
printf("nsBlockReflowState::RecoverStateFrom block %p caching max width %d\n", mBlock, aLine->mMaxElementWidth);
|
||||
#ifdef DEBUG
|
||||
if (nsBlockFrame::gNoisyMaxElementSize) {
|
||||
nsFrame::IndentBy(stdout, nsBlockFrame::gNoiseIndent);
|
||||
printf("nsBlockReflowState::RecoverStateFrom block %p caching max width %d\n", mBlock, aLine->mMaxElementWidth);
|
||||
}
|
||||
#endif
|
||||
UpdateMaxElementSize(nsSize(aLine->mMaxElementWidth, aLine->mBounds.height));
|
||||
}
|
||||
@ -697,7 +703,7 @@ nsBlockReflowState::AddFloater(nsLineLayout& aLineLayout,
|
||||
void
|
||||
nsBlockReflowState::UpdateMaxElementSize(const nsSize& aMaxElementSize)
|
||||
{
|
||||
#ifdef NOISY_MAX_ELEMENT_SIZE
|
||||
#ifdef DEBUG
|
||||
nsSize oldSize = mMaxElementSize;
|
||||
#endif
|
||||
if (aMaxElementSize.width > mMaxElementSize.width) {
|
||||
@ -706,17 +712,19 @@ nsBlockReflowState::UpdateMaxElementSize(const nsSize& aMaxElementSize)
|
||||
if (aMaxElementSize.height > mMaxElementSize.height) {
|
||||
mMaxElementSize.height = aMaxElementSize.height;
|
||||
}
|
||||
#ifdef NOISY_MAX_ELEMENT_SIZE
|
||||
if ((mMaxElementSize.width != oldSize.width) ||
|
||||
(mMaxElementSize.height != oldSize.height)) {
|
||||
nsFrame::IndentBy(stdout, mBlock->GetDepth());
|
||||
if (NS_UNCONSTRAINEDSIZE == mReflowState.availableWidth) {
|
||||
printf("PASS1 ");
|
||||
#ifdef DEBUG
|
||||
if (nsBlockFrame::gNoisyMaxElementSize) {
|
||||
if ((mMaxElementSize.width != oldSize.width) ||
|
||||
(mMaxElementSize.height != oldSize.height)) {
|
||||
nsFrame::IndentBy(stdout, nsBlockFrame::gNoiseIndent);
|
||||
if (NS_UNCONSTRAINEDSIZE == mReflowState.availableWidth) {
|
||||
printf("PASS1 ");
|
||||
}
|
||||
nsFrame::ListTag(stdout, mBlock);
|
||||
printf(": old max-element-size=%d,%d new=%d,%d\n",
|
||||
oldSize.width, oldSize.height,
|
||||
mMaxElementSize.width, mMaxElementSize.height);
|
||||
}
|
||||
nsFrame::ListTag(stdout, mBlock);
|
||||
printf(": old max-element-size=%d,%d new=%d,%d\n",
|
||||
oldSize.width, oldSize.height,
|
||||
mMaxElementSize.width, mMaxElementSize.height);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -1259,15 +1259,18 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#ifdef NOISY_MAX_ELEMENT_SIZE
|
||||
if (!NS_INLINE_IS_BREAK_BEFORE(aReflowStatus)) {
|
||||
if (mComputeMaxElementSize) {
|
||||
printf(" ");
|
||||
nsFrame::ListTag(stdout, aFrame);
|
||||
printf(": maxElementSize=%d,%d wh=%d,%d,\n",
|
||||
metrics.maxElementSize->width,
|
||||
metrics.maxElementSize->height,
|
||||
metrics.width, metrics.height);
|
||||
#ifdef DEBUG
|
||||
if (nsBlockFrame::gNoisyMaxElementSize) {
|
||||
nsFrame::IndentBy(stdout, nsBlockFrame::gNoiseIndent);
|
||||
if (!NS_INLINE_IS_BREAK_BEFORE(aReflowStatus)) {
|
||||
if (mComputeMaxElementSize) {
|
||||
printf(" ");
|
||||
nsFrame::ListTag(stdout, aFrame);
|
||||
printf(": maxElementSize=%d,%d wh=%d,%d,\n",
|
||||
metrics.maxElementSize->width,
|
||||
metrics.maxElementSize->height,
|
||||
metrics.width, metrics.height);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -1937,7 +1940,7 @@ nsLineLayout::VerticalAlignLine(nsLineBox* aLineBox,
|
||||
PRBool strictMode = InStrictMode();
|
||||
PRBool inUnconstrainedTable = InUnconstrainedTableCell(*mBlockReflowState);
|
||||
#endif
|
||||
#ifdef NOISY_MAX_ELEMENT_SIZE
|
||||
#ifdef DEBUG
|
||||
int frameCount = 0;
|
||||
#endif
|
||||
|
||||
@ -1961,7 +1964,8 @@ nsLineLayout::VerticalAlignLine(nsLineBox* aLineBox,
|
||||
|
||||
#ifdef HACK_MEW
|
||||
|
||||
#ifdef NOISY_MAX_ELEMENT_SIZE
|
||||
#ifdef DEBUG
|
||||
if (nsBlockFrame::gNoisyMaxElementSize)
|
||||
frameCount++;
|
||||
#endif
|
||||
// if in Quirks mode and in a table cell with an unconstrained width, then emulate an IE
|
||||
@ -1988,9 +1992,12 @@ nsLineLayout::VerticalAlignLine(nsLineBox* aLineBox,
|
||||
// now update the prevFrame
|
||||
prevFrameAccumulates = curFrameAccumulates;
|
||||
|
||||
#ifdef NOISY_MAX_ELEMENT_SIZE
|
||||
printf("(%d) last frame's MEW=%d | Accumulated MEW=%d\n", frameCount, mw, accumulatedWidth);
|
||||
#endif // NOISY_MAX_ELEMENT_SIZE
|
||||
#ifdef DEBUG
|
||||
if (nsBlockFrame::gNoisyMaxElementSize) {
|
||||
nsFrame::IndentBy(stdout, nsBlockFrame::gNoiseIndent);
|
||||
printf("(%d) last frame's MEW=%d | Accumulated MEW=%d\n", frameCount, mw, accumulatedWidth);
|
||||
}
|
||||
#endif
|
||||
|
||||
mw = accumulatedWidth;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user