Moved hacked call to floater adds out of nsPlaceholderFrame and into nsLineLayout

This commit is contained in:
kipp%netscape.com 1999-04-23 15:15:53 +00:00
parent a570e5b6c0
commit 3ecd939521
4 changed files with 34 additions and 18 deletions

View File

@ -26,6 +26,7 @@
#include "nsIPresContext.h"
#include "nsIFontMetrics.h"
#include "nsIRenderingContext.h"
#include "nsLayoutAtoms.h"
#ifdef DEBUG
#undef NOISY_HORIZONTAL_ALIGN
@ -834,6 +835,22 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
nscoord ty = y - psd->mReflowState->mComputedBorderPadding.top;
mSpaceManager->Translate(tx, ty);
htmlReflow->Reflow(mPresContext, metrics, reflowState, aReflowStatus);
// XXX
nsIAtom* frameType;
aFrame->GetFrameType(&frameType);
if (frameType) {
if (frameType == nsLayoutAtoms::placeholderFrame) {
if (eReflowReason_Incremental == reason) {
InitFloater((nsPlaceholderFrame*)aFrame);
}
else {
AddFloater((nsPlaceholderFrame*)aFrame);
}
}
NS_RELEASE(frameType);
}
mSpaceManager->Translate(-tx, -ty);
#ifdef DEBUG

View File

@ -45,15 +45,6 @@ nsPlaceholderFrame::Reflow(nsIPresContext& aPresContext,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
if (nsnull != aReflowState.lineLayout) {
if (eReflowReason_Initial == aReflowState.reason) {
aReflowState.lineLayout->InitFloater(this);
}
else {
aReflowState.lineLayout->AddFloater(this);
}
}
aDesiredSize.width = 0;
aDesiredSize.height = 0;
aDesiredSize.ascent = 0;

View File

@ -26,6 +26,7 @@
#include "nsIPresContext.h"
#include "nsIFontMetrics.h"
#include "nsIRenderingContext.h"
#include "nsLayoutAtoms.h"
#ifdef DEBUG
#undef NOISY_HORIZONTAL_ALIGN
@ -834,6 +835,22 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
nscoord ty = y - psd->mReflowState->mComputedBorderPadding.top;
mSpaceManager->Translate(tx, ty);
htmlReflow->Reflow(mPresContext, metrics, reflowState, aReflowStatus);
// XXX
nsIAtom* frameType;
aFrame->GetFrameType(&frameType);
if (frameType) {
if (frameType == nsLayoutAtoms::placeholderFrame) {
if (eReflowReason_Incremental == reason) {
InitFloater((nsPlaceholderFrame*)aFrame);
}
else {
AddFloater((nsPlaceholderFrame*)aFrame);
}
}
NS_RELEASE(frameType);
}
mSpaceManager->Translate(-tx, -ty);
#ifdef DEBUG

View File

@ -45,15 +45,6 @@ nsPlaceholderFrame::Reflow(nsIPresContext& aPresContext,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
if (nsnull != aReflowState.lineLayout) {
if (eReflowReason_Initial == aReflowState.reason) {
aReflowState.lineLayout->InitFloater(this);
}
else {
aReflowState.lineLayout->AddFloater(this);
}
}
aDesiredSize.width = 0;
aDesiredSize.height = 0;
aDesiredSize.ascent = 0;