From ec50403f3b23714473d91efb694cd2efe2c3cdda Mon Sep 17 00:00:00 2001 From: "troy%netscape.com" Date: Wed, 26 Jan 2000 03:44:36 +0000 Subject: [PATCH] b=22677. Fix for the part of the bug where the second table taht is relatively positioned flashes when the window is resized git-svn-id: svn://10.0.0.236/trunk@58724 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsBlockReflowContext.cpp | 14 ++++++++++---- .../layout/html/base/src/nsBlockReflowContext.cpp | 14 ++++++++++---- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/mozilla/layout/generic/nsBlockReflowContext.cpp b/mozilla/layout/generic/nsBlockReflowContext.cpp index 0d26c81ee5f..a8be73dcb81 100644 --- a/mozilla/layout/generic/nsBlockReflowContext.cpp +++ b/mozilla/layout/generic/nsBlockReflowContext.cpp @@ -354,19 +354,25 @@ nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame, aFrame->GetSize(size); align.mXOffset = x; AlignBlockHorizontally(size.width, align); - // XXX Don't reset "mX". because PlaceBlock() will recompute the + // Don't reset "mX". because PlaceBlock() will recompute the // x-offset and expects "mX" to be at the left margin edge x = align.mXOffset; } } + // If the element is relatively positioned, then adjust x and y accordingly + if (NS_STYLE_POSITION_RELATIVE == reflowState.mStylePosition->mPosition) { + x += reflowState.mComputedOffsets.left; + y += reflowState.mComputedOffsets.top; + } + // Let frame know that we are reflowing it aFrame->WillReflow(mPresContext); // Position it and its view (if it has one) - // Note: Use "x" and not "mX". "x" more accurately represents where we think - // it will be placed - aFrame->MoveTo(mPresContext, x, mY); + // Note: Use "x" and "y" and not "mX" and "mY" because they more accurately + // represents where we think the block will be placed + aFrame->MoveTo(mPresContext, x, y); nsIView* view; aFrame->GetView(mPresContext, &view); if (view) { diff --git a/mozilla/layout/html/base/src/nsBlockReflowContext.cpp b/mozilla/layout/html/base/src/nsBlockReflowContext.cpp index 0d26c81ee5f..a8be73dcb81 100644 --- a/mozilla/layout/html/base/src/nsBlockReflowContext.cpp +++ b/mozilla/layout/html/base/src/nsBlockReflowContext.cpp @@ -354,19 +354,25 @@ nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame, aFrame->GetSize(size); align.mXOffset = x; AlignBlockHorizontally(size.width, align); - // XXX Don't reset "mX". because PlaceBlock() will recompute the + // Don't reset "mX". because PlaceBlock() will recompute the // x-offset and expects "mX" to be at the left margin edge x = align.mXOffset; } } + // If the element is relatively positioned, then adjust x and y accordingly + if (NS_STYLE_POSITION_RELATIVE == reflowState.mStylePosition->mPosition) { + x += reflowState.mComputedOffsets.left; + y += reflowState.mComputedOffsets.top; + } + // Let frame know that we are reflowing it aFrame->WillReflow(mPresContext); // Position it and its view (if it has one) - // Note: Use "x" and not "mX". "x" more accurately represents where we think - // it will be placed - aFrame->MoveTo(mPresContext, x, mY); + // Note: Use "x" and "y" and not "mX" and "mY" because they more accurately + // represents where we think the block will be placed + aFrame->MoveTo(mPresContext, x, y); nsIView* view; aFrame->GetView(mPresContext, &view); if (view) {