Eliminated nsIRunaround interface, and folded space manager parameter into

nsHTMLReflowState structure
This commit is contained in:
troy@netscape.com
1998-10-02 04:10:00 +00:00
parent abcf5a7342
commit ee0a3c543f
129 changed files with 1131 additions and 1245 deletions

View File

@@ -20,7 +20,7 @@
#include "nsStyleConsts.h"
#include "nsIContent.h"
#include "nsIFrame.h"
#include "nsIFrameReflow.h"
#include "nsIHTMLReflow.h"
#include "nsIFontMetrics.h"
#include "nsIPresContext.h"
#include "nsRect.h"
@@ -126,7 +126,7 @@ nsCSSLayout::RelativePositionChildren(nsIPresContext* aCX,
// XXX check against other possible values and update
static PRBool
GetStyleDimension(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
const nsStylePosition* aStylePos,
const nsStyleCoord& aCoord,
nscoord& aResult)
@@ -185,7 +185,7 @@ GetStyleDimension(nsIPresContext* aPresContext,
PRIntn
nsCSSLayout::GetStyleSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsSize& aStyleSize)
{
// XXX if display == row || rowspan ignore width

View File

@@ -506,7 +506,7 @@ PresShell::InitialReflow(nscoord aWidth, nscoord aHeight)
CreateRenderingContext(mRootFrame, rcx);
nsReflowState reflowState(mRootFrame, eReflowReason_Initial, maxSize, rcx);
nsHTMLReflowState reflowState(mRootFrame, eReflowReason_Initial, maxSize, rcx);
if (NS_OK == mRootFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
htmlReflow->Reflow(*mPresContext, desiredSize, reflowState, status);
@@ -557,7 +557,7 @@ PresShell::ResizeReflow(nscoord aWidth, nscoord aHeight)
CreateRenderingContext(mRootFrame, rcx);
nsReflowState reflowState(mRootFrame, eReflowReason_Resize, maxSize, rcx);
nsHTMLReflowState reflowState(mRootFrame, eReflowReason_Resize, maxSize, rcx);
if (NS_OK == mRootFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
htmlReflow->Reflow(*mPresContext, desiredSize, reflowState, status);

View File

@@ -31,7 +31,6 @@ EXPORTS = \
nsIPresContext.h \
nsIPresShell.h \
nsIReflowCommand.h \
nsIRunaround.h \
nsISelection.h \
nsISpaceManager.h \
nsStyleCoord.h \

View File

@@ -29,7 +29,6 @@ EXPORTS = \
nsIPresContext.h \
nsIPresShell.h \
nsIReflowCommand.h \
nsIRunaround.h \
nsISelection.h \
nsISpaceManager.h \
nsStyleCoord.h \

View File

@@ -37,14 +37,20 @@ class nsIReflowCommand;
* @see #GetReflowMetrics()
*/
struct nsReflowMetrics {
nscoord width, height; // desired width and height
nscoord ascent, descent;
nscoord width, height; // [OUT] desired width and height
nscoord ascent, descent; // [OUT] ascent and descent information
// Set this to null if you don't need to compute the max element size
nsSize* maxElementSize;
nsReflowMetrics(nsSize* aMaxElementSize) {
maxElementSize = aMaxElementSize;
// XXX These are OUT parameters and so they shouldn't have to be
// initialized, but there are some bad frame classes that aren't
// properly setting them when returning from Reflow()...
width = height = 0;
ascent = descent = 0;
}
};

View File

@@ -1,78 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsIRunaround_h___
#define nsIRunaround_h___
#include "nsIFrame.h"
#include "nsIFrameReflow.h"
struct nsHTMLReflowMetrics;
// IID for the nsIRunaround interface {3C6ABCF0-C028-11d1-853F-00A02468FAB6}
#define NS_IRUNAROUND_IID \
{ 0x3c6abcf0, 0xc028, 0x11d1, \
{0x85, 0x3f, 0x0, 0xa0, 0x24, 0x68, 0xfa, 0xb6}}
/**
* An interface for handling reflow that allows direct access to the space
* manager. Note that this interface is not an nsISupports interface, and
* therefore you cannot QueryInterface() back
*/
class nsIRunaround
{
public:
/**
* Reflow. The frame is given a maximum size and asked for its desired
* rect. The space manager should be used to do runaround of anchored
* items.
*
* @param aSpaceManager the space manager to use. The caller has translated
* the coordinate system so the frame has its own local coordinate
* space with an origin of (0, 0). If you translate the coordinate
* space you must restore it before returning.
* @param aMaxSize the available space in which to lay out. Each dimension
* can either be constrained or unconstrained (a value of
* NS_UNCONSTRAINEDSIZE). If constrained you should choose a value
* that's less than or equal to the constrained size. If unconstrained
* you can choose as large a value as you like.
*
* It's okay to return a desired size that exceeds the max size if
* that's the smallest you can be, i.e. it's your minimum size.
*
* @param aDesiredRect <i>out</i> parameter where you should return the desired
* origin and size. You should include any space you want for border
* and padding in the desired size.
*
* The origin of the desired rect is relative to the upper-left of the
* local coordinate space.
*
* @param aMaxElementSize an optional parameter for returning your maximum
* element size. If may be null in which case you don't have to compute
* a maximum element size
*
* @see nsISpaceManager#Translate()
*/
NS_IMETHOD ReflowAround(nsIPresContext& aPresContext,
nsISpaceManager* aSpaceManager,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsRect& aDesiredRect, // XXX FIX ME
nsReflowStatus& aStatus) = 0;
};
#endif /* nsIRunaround_h___ */

View File

@@ -185,7 +185,7 @@ void SetType(nsIHTMLContent* aElement, nsString& aValue)
NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
PRInt32 numChildren = LengthOf(mFirstChild);
@@ -225,7 +225,7 @@ NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext& aPresContext,
childFrame = mFirstChild;
nsPoint offset(0,0);
while (nsnull != childFrame) { // reflow, place, size the children
nsReflowState reflowState(childFrame, aReflowState, maxSize);
nsHTMLReflowState reflowState(childFrame, aReflowState, maxSize);
nsIHTMLReflow* htmlReflow;
if (NS_OK == childFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {

View File

@@ -36,7 +36,7 @@ public:
NS_IMETHOD Reflow(nsIPresContext& aCX,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
virtual void MouseClicked(nsIPresContext* aPresContext);

View File

@@ -163,7 +163,7 @@ nsFormControlFrame::Paint(nsIPresContext& aPresContext,
void
nsFormControlFrame::GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredLayoutSize,
nsSize& aDesiredWidgetSize)
{
@@ -182,7 +182,7 @@ nsFormControlFrame::GetDesiredSize(nsIPresContext* aPresContext,
void
nsFormControlFrame::GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredSize)
{
nsSize ignore;
@@ -210,7 +210,7 @@ nsFormControlFrame::DidReflow(nsIPresContext& aPresContext,
NS_METHOD
nsFormControlFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
nsIView* view = nsnull;
@@ -552,7 +552,7 @@ NS_METHOD nsFormControlFrame::HandleEvent(nsIPresContext& aPresContext,
}
void nsFormControlFrame::GetStyleSize(nsIPresContext& aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsSize& aSize)
{
PRIntn ss = nsCSSLayout::GetStyleSize(&aPresContext, aReflowState, aSize);

View File

@@ -120,7 +120,7 @@ public:
*/
NS_IMETHOD Reflow(nsIPresContext& aCX,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
// new behavior
@@ -218,11 +218,11 @@ protected:
* @param aMaxSize the maximum size available for this frame
*/
virtual void GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredSize);
virtual void GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredLayoutSize,
nsSize& aDesiredWidgetSize);
@@ -235,7 +235,7 @@ protected:
* for aSize.width or aSize.height indicate unset values.
*/
void GetStyleSize(nsIPresContext& aContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsSize& aSize);
//nscoord GetStyleDim(nsIPresContext& aPresContext, nscoord aMaxDim,

View File

@@ -169,7 +169,7 @@ nsTextControlFrame::EnterPressed(nsIPresContext& aPresContext)
void
nsTextControlFrame::GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredLayoutSize,
nsSize& aDesiredWidgetSize)
{

View File

@@ -58,7 +58,7 @@ protected:
virtual ~nsTextControlFrame();
virtual void GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredLayoutSize,
nsSize& aDesiredWidgetSize);
};

View File

@@ -44,7 +44,7 @@ public:
nsIReflowCommand* aReflowCommand);
NS_IMETHOD InlineReflow(nsLineLayout& aLineLayout,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState);
const nsHTMLReflowState& aReflowState);
protected:
virtual ~BRFrame();
@@ -111,7 +111,7 @@ BRFrame::FindTextRuns(nsLineLayout& aLineLayout,
NS_IMETHODIMP
BRFrame::InlineReflow(nsLineLayout& aLineLayout,
nsHTMLReflowMetrics& aMetrics,
const nsReflowState& aReflowState)
const nsHTMLReflowState& aReflowState)
{
if (nsnull != aMetrics.maxElementSize) {
aMetrics.maxElementSize->width = 0;

View File

@@ -32,7 +32,6 @@
#include "nsIPresContext.h"
#include "nsIPresShell.h"
#include "nsIReflowCommand.h"
#include "nsIRunaround.h"
#include "nsISpaceManager.h"
#include "nsIStyleContext.h"
#include "nsIView.h"
@@ -125,9 +124,8 @@ class nsBlockFrame;
struct nsBlockReflowState : public nsFrameReflowState {
nsBlockReflowState(nsIPresContext& aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowMetrics& aMetrics,
nsISpaceManager* aSpaceManager);
const nsHTMLReflowState& aReflowState,
const nsHTMLReflowMetrics& aMetrics);
~nsBlockReflowState();
@@ -218,7 +216,6 @@ nsLineLayout::AddFloater(nsPlaceholderFrame* aFrame)
#define nsBlockFrameSuper nsHTMLContainerFrame
class nsBlockFrame : public nsBlockFrameSuper,
public nsIRunaround,
public nsIFloaterContainer
{
public:
@@ -248,17 +245,15 @@ public:
NS_IMETHOD ListTag(FILE* out) const;
NS_IMETHOD VerifyTree() const;
// nsIRunaround
NS_IMETHOD ReflowAround(nsIPresContext& aPresContext,
nsISpaceManager* aSpaceManager,
// nsIHTMLReflow
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsRect& aDesiredRect,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
// nsIFloaterContainer
virtual PRBool AddFloater(nsIPresContext* aPresContext,
const nsReflowState& aPlaceholderReflowState,
const nsHTMLReflowState& aPlaceholderReflowState,
nsIFrame* aFloater,
nsPlaceholderFrame* aPlaceholder);
@@ -313,8 +308,7 @@ public:
nsresult ResizeReflow(nsBlockReflowState& aState);
void ComputeFinalSize(nsBlockReflowState& aState,
nsHTMLReflowMetrics& aMetrics,
nsRect& aDesiredRect);
nsHTMLReflowMetrics& aMetrics);
nsresult ReflowLinesAt(nsBlockReflowState& aState, LineData* aLine);
@@ -328,7 +322,7 @@ public:
void FindFloaters(LineData* aLine);
void PrepareInlineReflow(nsBlockReflowState& aState, nsIFrame* aFrame);
void PrepareInlineReflow(nsBlockReflowState& aState, nsIFrame* aFrame, PRBool aIsBlock);
PRBool ReflowInlineFrame(nsBlockReflowState& aState,
LineData* aLine,
@@ -413,12 +407,12 @@ public:
nsIReflowCommand* aReflowCommand);
NS_IMETHOD InlineReflow(nsLineLayout& aLineLayout,
nsHTMLReflowMetrics& aMetrics,
const nsReflowState& aReflowState);
const nsHTMLReflowState& aReflowState);
void SetListItemOrdinal(nsBlockReflowState& aBlockState);
void GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aMetrics);
void GetListItemText(nsIPresContext& aCX,
@@ -748,7 +742,7 @@ UpdateBulletCB(nsIPresContext& aPresContext, nsIFrame* aFrame, PRIntn aStatus)
void
BulletFrame::GetDesiredSize(nsIPresContext* aCX,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aMetrics)
{
const nsStyleList* myList =
@@ -833,7 +827,7 @@ BulletFrame::GetDesiredSize(nsIPresContext* aCX,
NS_IMETHODIMP
BulletFrame::InlineReflow(nsLineLayout& aLineLayout,
nsHTMLReflowMetrics& aMetrics,
const nsReflowState& aReflowState)
const nsHTMLReflowState& aReflowState)
{
// Get the base size
GetDesiredSize(&aLineLayout.mPresContext, aReflowState, aMetrics);
@@ -1272,7 +1266,7 @@ nsBlockReflowState::BlockBandData::ComputeAvailSpaceRect()
//----------------------------------------------------------------------
static nscoord
GetParentLeftPadding(const nsReflowState* aReflowState)
GetParentLeftPadding(const nsHTMLReflowState* aReflowState)
{
nscoord leftPadding = 0;
while (nsnull != aReflowState) {
@@ -1289,22 +1283,21 @@ GetParentLeftPadding(const nsReflowState* aReflowState)
leftPadding = padding.left;
break;
}
aReflowState = aReflowState->parentReflowState;
aReflowState = (nsHTMLReflowState*)aReflowState->parentReflowState;
}
return leftPadding;
}
nsBlockReflowState::nsBlockReflowState(nsIPresContext& aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowMetrics& aMetrics,
nsISpaceManager* aSpaceManager)
const nsHTMLReflowState& aReflowState,
const nsHTMLReflowMetrics& aMetrics)
: nsFrameReflowState(aPresContext, aReflowState, aMetrics),
mLineLayout(aPresContext, aSpaceManager)
mLineLayout(aPresContext, aReflowState.spaceManager)
{
mInlineReflow = nsnull;
mLineLayout.Init(this);
mSpaceManager = aSpaceManager;
mSpaceManager = aReflowState.spaceManager;
// Translate into our content area and then save the
// coordinate system origin for later.
@@ -1463,10 +1456,6 @@ nsBlockFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
*aInstancePtr = (void*) (this);
return NS_OK;
}
if (aIID.Equals(kIRunaroundIID)) {
*aInstancePtr = (void*) ((nsIRunaround*) this);
return NS_OK;
}
if (aIID.Equals(kIFloaterContainerIID)) {
*aInstancePtr = (void*) ((nsIFloaterContainer*) this);
return NS_OK;
@@ -1690,11 +1679,9 @@ nsBlockFrame::FirstChild(nsIFrame*& aFirstChild) const
// Reflow methods
NS_IMETHODIMP
nsBlockFrame::ReflowAround(nsIPresContext& aPresContext,
nsISpaceManager* aSpaceManager,
nsBlockFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aMetrics,
const nsReflowState& aReflowState,
nsRect& aDesiredRect,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
@@ -1714,8 +1701,7 @@ nsBlockFrame::ReflowAround(nsIPresContext& aPresContext,
// Replace parent provided reflow state with our own significantly
// more extensive version.
nsBlockReflowState state(aPresContext, aReflowState, aMetrics,
aSpaceManager);
nsBlockReflowState state(aPresContext, aReflowState, aMetrics);
// Prepare inline-reflow engine
nsInlineReflow inlineReflow(state.mLineLayout, state, this);
@@ -1781,7 +1767,7 @@ nsBlockFrame::ReflowAround(nsIPresContext& aPresContext,
}
// Compute our final size
ComputeFinalSize(state, aMetrics, aDesiredRect);
ComputeFinalSize(state, aMetrics);
#ifdef NS_DEBUG
if (GetVerifyTreeEnable()) {
@@ -1853,17 +1839,13 @@ nsBlockFrame::RenumberLists(nsBlockReflowState& aState)
void
nsBlockFrame::ComputeFinalSize(nsBlockReflowState& aState,
nsHTMLReflowMetrics& aMetrics,
nsRect& aDesiredRect)
nsHTMLReflowMetrics& aMetrics)
{
aDesiredRect.x = 0;
aDesiredRect.y = 0;
// Compute final width
PRIntn ss = aState.mStyleSizeFlags;
if (NS_SIZE_HAS_WIDTH & ss) {
// Use style defined width
aDesiredRect.width = aState.mBorderPadding.left +
aMetrics.width = aState.mBorderPadding.left +
aState.mStyleSize.width + aState.mBorderPadding.right;
}
else {
@@ -1877,13 +1859,13 @@ nsBlockFrame::ComputeFinalSize(nsBlockReflowState& aState,
contentWidth = aState.maxSize.width;
}
}
aDesiredRect.width = contentWidth;
aMetrics.width = contentWidth;
}
// Compute final height
if (NS_SIZE_HAS_HEIGHT & ss) {
// Use style defined height
aDesiredRect.height = aState.mBorderPadding.top +
aMetrics.height = aState.mBorderPadding.top +
aState.mStyleSize.height + aState.mBorderPadding.bottom;
}
else {
@@ -1895,7 +1877,7 @@ nsBlockFrame::ComputeFinalSize(nsBlockReflowState& aState,
else {
aMetrics.mCarriedOutBottomMargin = aState.mRunningMargin;
}
aDesiredRect.height = aState.mY;
aMetrics.height = aState.mY;
}
// Special check for zero sized content: If our content is zero
@@ -1903,14 +1885,12 @@ nsBlockFrame::ComputeFinalSize(nsBlockReflowState& aState,
if ((NS_SIZE_HAS_BOTH != ss) &&
((0 == aState.mKidXMost - aState.mBorderPadding.left) ||
(0 == aState.mY - aState.mBorderPadding.top))) {
aDesiredRect.width = 0;
aDesiredRect.height = 0;
aMetrics.width = 0;
aMetrics.height = 0;
aMetrics.mCarriedOutBottomMargin = 0;
}
aMetrics.width = aDesiredRect.width;
aMetrics.height = aDesiredRect.height;
aMetrics.ascent = aDesiredRect.height;
aMetrics.ascent = aMetrics.height;
aMetrics.descent = 0;
// XXX this needs reworking I suppose
@@ -2723,12 +2703,15 @@ done:;
// XXX inline frames need this too when they wrap up blocks, right??
// Otherwise blocks in inlines won't interact with floaters properly.
void
nsBlockFrame::PrepareInlineReflow(nsBlockReflowState& aState, nsIFrame* aFrame)
nsBlockFrame::PrepareInlineReflow(nsBlockReflowState& aState,
nsIFrame* aFrame,
PRBool aIsBlock)
{
// Setup initial coordinate system for reflowing the frame into
nscoord x, availWidth, availHeight;
nsIRunaround* runAround;
if (NS_OK == aFrame->QueryInterface(kIRunaroundIID, (void**)&runAround)) {
// XXX KIPP I'm not sure what you want to do here...
if (aIsBlock) {
// XXX Child needs to apply OUR border-padding and IT's left
// margin and right margin! How should this be done?
x = aState.mBorderPadding.left;
@@ -2776,7 +2759,7 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState,
nsInlineReflow& ir = *aState.mInlineReflow;
// Prepare the inline reflow engine
PrepareInlineReflow(aState, aFrame);
PrepareInlineReflow(aState, aFrame, PR_TRUE);
ir.SetIsFirstChild((aLine == mLines) &&
(aFrame == aLine->mFirstChild));
@@ -2913,7 +2896,7 @@ nsBlockFrame::ReflowInlineFrame(nsBlockReflowState& aState,
nsIFrame* nextInFlow;
if (!aState.mInlineReflowPrepared) {
PrepareInlineReflow(aState, aFrame);
PrepareInlineReflow(aState, aFrame, PR_FALSE);
}
PRBool isFirstChild = (aLine == mLines) &&
@@ -3190,7 +3173,7 @@ nsBlockFrame::PlaceLine(nsBlockReflowState& aState,
nsSize availSize;
availSize.width = NS_UNCONSTRAINEDSIZE;
availSize.height = NS_UNCONSTRAINEDSIZE;
nsReflowState reflowState(mBullet, aState, availSize);
nsHTMLReflowState reflowState(mBullet, aState, availSize);
nsHTMLReflowMetrics metrics(nsnull);
nsIInlineReflow* iir;
if (NS_OK == mBullet->QueryInterface(kIInlineReflowIID, (void**) &iir)) {
@@ -3682,7 +3665,7 @@ nsBlockFrame::ReflowFloater(nsIPresContext& aPresContext,
// it's maxSize will be 0,0 until we compute it (we need the reflowState
// for nsLayout::GetStyleSize so we have to do this first)
nsSize kidAvailSize(0, 0);
nsReflowState reflowState(aFloaterFrame, aState, kidAvailSize,
nsHTMLReflowState reflowState(aFloaterFrame, aState, kidAvailSize,
eReflowReason_Initial);
// Compute the available space for the floater. Use the default
@@ -3737,7 +3720,7 @@ nsBlockFrame::ReflowFloater(nsIPresContext& aPresContext,
PRBool
nsBlockFrame::AddFloater(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsIFrame* aFloater,
nsPlaceholderFrame* aPlaceholder)
{

View File

@@ -32,7 +32,6 @@
#include "nsIPresContext.h"
#include "nsIPresShell.h"
#include "nsIReflowCommand.h"
#include "nsIRunaround.h"
#include "nsISpaceManager.h"
#include "nsIStyleContext.h"
#include "nsIView.h"
@@ -125,9 +124,8 @@ class nsBlockFrame;
struct nsBlockReflowState : public nsFrameReflowState {
nsBlockReflowState(nsIPresContext& aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowMetrics& aMetrics,
nsISpaceManager* aSpaceManager);
const nsHTMLReflowState& aReflowState,
const nsHTMLReflowMetrics& aMetrics);
~nsBlockReflowState();
@@ -218,7 +216,6 @@ nsLineLayout::AddFloater(nsPlaceholderFrame* aFrame)
#define nsBlockFrameSuper nsHTMLContainerFrame
class nsBlockFrame : public nsBlockFrameSuper,
public nsIRunaround,
public nsIFloaterContainer
{
public:
@@ -248,17 +245,15 @@ public:
NS_IMETHOD ListTag(FILE* out) const;
NS_IMETHOD VerifyTree() const;
// nsIRunaround
NS_IMETHOD ReflowAround(nsIPresContext& aPresContext,
nsISpaceManager* aSpaceManager,
// nsIHTMLReflow
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsRect& aDesiredRect,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
// nsIFloaterContainer
virtual PRBool AddFloater(nsIPresContext* aPresContext,
const nsReflowState& aPlaceholderReflowState,
const nsHTMLReflowState& aPlaceholderReflowState,
nsIFrame* aFloater,
nsPlaceholderFrame* aPlaceholder);
@@ -313,8 +308,7 @@ public:
nsresult ResizeReflow(nsBlockReflowState& aState);
void ComputeFinalSize(nsBlockReflowState& aState,
nsHTMLReflowMetrics& aMetrics,
nsRect& aDesiredRect);
nsHTMLReflowMetrics& aMetrics);
nsresult ReflowLinesAt(nsBlockReflowState& aState, LineData* aLine);
@@ -328,7 +322,7 @@ public:
void FindFloaters(LineData* aLine);
void PrepareInlineReflow(nsBlockReflowState& aState, nsIFrame* aFrame);
void PrepareInlineReflow(nsBlockReflowState& aState, nsIFrame* aFrame, PRBool aIsBlock);
PRBool ReflowInlineFrame(nsBlockReflowState& aState,
LineData* aLine,
@@ -413,12 +407,12 @@ public:
nsIReflowCommand* aReflowCommand);
NS_IMETHOD InlineReflow(nsLineLayout& aLineLayout,
nsHTMLReflowMetrics& aMetrics,
const nsReflowState& aReflowState);
const nsHTMLReflowState& aReflowState);
void SetListItemOrdinal(nsBlockReflowState& aBlockState);
void GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aMetrics);
void GetListItemText(nsIPresContext& aCX,
@@ -748,7 +742,7 @@ UpdateBulletCB(nsIPresContext& aPresContext, nsIFrame* aFrame, PRIntn aStatus)
void
BulletFrame::GetDesiredSize(nsIPresContext* aCX,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aMetrics)
{
const nsStyleList* myList =
@@ -833,7 +827,7 @@ BulletFrame::GetDesiredSize(nsIPresContext* aCX,
NS_IMETHODIMP
BulletFrame::InlineReflow(nsLineLayout& aLineLayout,
nsHTMLReflowMetrics& aMetrics,
const nsReflowState& aReflowState)
const nsHTMLReflowState& aReflowState)
{
// Get the base size
GetDesiredSize(&aLineLayout.mPresContext, aReflowState, aMetrics);
@@ -1272,7 +1266,7 @@ nsBlockReflowState::BlockBandData::ComputeAvailSpaceRect()
//----------------------------------------------------------------------
static nscoord
GetParentLeftPadding(const nsReflowState* aReflowState)
GetParentLeftPadding(const nsHTMLReflowState* aReflowState)
{
nscoord leftPadding = 0;
while (nsnull != aReflowState) {
@@ -1289,22 +1283,21 @@ GetParentLeftPadding(const nsReflowState* aReflowState)
leftPadding = padding.left;
break;
}
aReflowState = aReflowState->parentReflowState;
aReflowState = (nsHTMLReflowState*)aReflowState->parentReflowState;
}
return leftPadding;
}
nsBlockReflowState::nsBlockReflowState(nsIPresContext& aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowMetrics& aMetrics,
nsISpaceManager* aSpaceManager)
const nsHTMLReflowState& aReflowState,
const nsHTMLReflowMetrics& aMetrics)
: nsFrameReflowState(aPresContext, aReflowState, aMetrics),
mLineLayout(aPresContext, aSpaceManager)
mLineLayout(aPresContext, aReflowState.spaceManager)
{
mInlineReflow = nsnull;
mLineLayout.Init(this);
mSpaceManager = aSpaceManager;
mSpaceManager = aReflowState.spaceManager;
// Translate into our content area and then save the
// coordinate system origin for later.
@@ -1463,10 +1456,6 @@ nsBlockFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
*aInstancePtr = (void*) (this);
return NS_OK;
}
if (aIID.Equals(kIRunaroundIID)) {
*aInstancePtr = (void*) ((nsIRunaround*) this);
return NS_OK;
}
if (aIID.Equals(kIFloaterContainerIID)) {
*aInstancePtr = (void*) ((nsIFloaterContainer*) this);
return NS_OK;
@@ -1690,11 +1679,9 @@ nsBlockFrame::FirstChild(nsIFrame*& aFirstChild) const
// Reflow methods
NS_IMETHODIMP
nsBlockFrame::ReflowAround(nsIPresContext& aPresContext,
nsISpaceManager* aSpaceManager,
nsBlockFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aMetrics,
const nsReflowState& aReflowState,
nsRect& aDesiredRect,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
@@ -1714,8 +1701,7 @@ nsBlockFrame::ReflowAround(nsIPresContext& aPresContext,
// Replace parent provided reflow state with our own significantly
// more extensive version.
nsBlockReflowState state(aPresContext, aReflowState, aMetrics,
aSpaceManager);
nsBlockReflowState state(aPresContext, aReflowState, aMetrics);
// Prepare inline-reflow engine
nsInlineReflow inlineReflow(state.mLineLayout, state, this);
@@ -1781,7 +1767,7 @@ nsBlockFrame::ReflowAround(nsIPresContext& aPresContext,
}
// Compute our final size
ComputeFinalSize(state, aMetrics, aDesiredRect);
ComputeFinalSize(state, aMetrics);
#ifdef NS_DEBUG
if (GetVerifyTreeEnable()) {
@@ -1853,17 +1839,13 @@ nsBlockFrame::RenumberLists(nsBlockReflowState& aState)
void
nsBlockFrame::ComputeFinalSize(nsBlockReflowState& aState,
nsHTMLReflowMetrics& aMetrics,
nsRect& aDesiredRect)
nsHTMLReflowMetrics& aMetrics)
{
aDesiredRect.x = 0;
aDesiredRect.y = 0;
// Compute final width
PRIntn ss = aState.mStyleSizeFlags;
if (NS_SIZE_HAS_WIDTH & ss) {
// Use style defined width
aDesiredRect.width = aState.mBorderPadding.left +
aMetrics.width = aState.mBorderPadding.left +
aState.mStyleSize.width + aState.mBorderPadding.right;
}
else {
@@ -1877,13 +1859,13 @@ nsBlockFrame::ComputeFinalSize(nsBlockReflowState& aState,
contentWidth = aState.maxSize.width;
}
}
aDesiredRect.width = contentWidth;
aMetrics.width = contentWidth;
}
// Compute final height
if (NS_SIZE_HAS_HEIGHT & ss) {
// Use style defined height
aDesiredRect.height = aState.mBorderPadding.top +
aMetrics.height = aState.mBorderPadding.top +
aState.mStyleSize.height + aState.mBorderPadding.bottom;
}
else {
@@ -1895,7 +1877,7 @@ nsBlockFrame::ComputeFinalSize(nsBlockReflowState& aState,
else {
aMetrics.mCarriedOutBottomMargin = aState.mRunningMargin;
}
aDesiredRect.height = aState.mY;
aMetrics.height = aState.mY;
}
// Special check for zero sized content: If our content is zero
@@ -1903,14 +1885,12 @@ nsBlockFrame::ComputeFinalSize(nsBlockReflowState& aState,
if ((NS_SIZE_HAS_BOTH != ss) &&
((0 == aState.mKidXMost - aState.mBorderPadding.left) ||
(0 == aState.mY - aState.mBorderPadding.top))) {
aDesiredRect.width = 0;
aDesiredRect.height = 0;
aMetrics.width = 0;
aMetrics.height = 0;
aMetrics.mCarriedOutBottomMargin = 0;
}
aMetrics.width = aDesiredRect.width;
aMetrics.height = aDesiredRect.height;
aMetrics.ascent = aDesiredRect.height;
aMetrics.ascent = aMetrics.height;
aMetrics.descent = 0;
// XXX this needs reworking I suppose
@@ -2723,12 +2703,15 @@ done:;
// XXX inline frames need this too when they wrap up blocks, right??
// Otherwise blocks in inlines won't interact with floaters properly.
void
nsBlockFrame::PrepareInlineReflow(nsBlockReflowState& aState, nsIFrame* aFrame)
nsBlockFrame::PrepareInlineReflow(nsBlockReflowState& aState,
nsIFrame* aFrame,
PRBool aIsBlock)
{
// Setup initial coordinate system for reflowing the frame into
nscoord x, availWidth, availHeight;
nsIRunaround* runAround;
if (NS_OK == aFrame->QueryInterface(kIRunaroundIID, (void**)&runAround)) {
// XXX KIPP I'm not sure what you want to do here...
if (aIsBlock) {
// XXX Child needs to apply OUR border-padding and IT's left
// margin and right margin! How should this be done?
x = aState.mBorderPadding.left;
@@ -2776,7 +2759,7 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState,
nsInlineReflow& ir = *aState.mInlineReflow;
// Prepare the inline reflow engine
PrepareInlineReflow(aState, aFrame);
PrepareInlineReflow(aState, aFrame, PR_TRUE);
ir.SetIsFirstChild((aLine == mLines) &&
(aFrame == aLine->mFirstChild));
@@ -2913,7 +2896,7 @@ nsBlockFrame::ReflowInlineFrame(nsBlockReflowState& aState,
nsIFrame* nextInFlow;
if (!aState.mInlineReflowPrepared) {
PrepareInlineReflow(aState, aFrame);
PrepareInlineReflow(aState, aFrame, PR_FALSE);
}
PRBool isFirstChild = (aLine == mLines) &&
@@ -3190,7 +3173,7 @@ nsBlockFrame::PlaceLine(nsBlockReflowState& aState,
nsSize availSize;
availSize.width = NS_UNCONSTRAINEDSIZE;
availSize.height = NS_UNCONSTRAINEDSIZE;
nsReflowState reflowState(mBullet, aState, availSize);
nsHTMLReflowState reflowState(mBullet, aState, availSize);
nsHTMLReflowMetrics metrics(nsnull);
nsIInlineReflow* iir;
if (NS_OK == mBullet->QueryInterface(kIInlineReflowIID, (void**) &iir)) {
@@ -3682,7 +3665,7 @@ nsBlockFrame::ReflowFloater(nsIPresContext& aPresContext,
// it's maxSize will be 0,0 until we compute it (we need the reflowState
// for nsLayout::GetStyleSize so we have to do this first)
nsSize kidAvailSize(0, 0);
nsReflowState reflowState(aFloaterFrame, aState, kidAvailSize,
nsHTMLReflowState reflowState(aFloaterFrame, aState, kidAvailSize,
eReflowReason_Initial);
// Compute the available space for the floater. Use the default
@@ -3737,7 +3720,7 @@ nsBlockFrame::ReflowFloater(nsIPresContext& aPresContext,
PRBool
nsBlockFrame::AddFloater(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsIFrame* aFloater,
nsPlaceholderFrame* aPlaceholder)
{

View File

@@ -32,7 +32,6 @@
#include "nsIPresContext.h"
#include "nsIPresShell.h"
#include "nsIReflowCommand.h"
#include "nsIRunaround.h"
#include "nsISpaceManager.h"
#include "nsIStyleContext.h"
#include "nsIView.h"
@@ -125,9 +124,8 @@ class nsBlockFrame;
struct nsBlockReflowState : public nsFrameReflowState {
nsBlockReflowState(nsIPresContext& aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowMetrics& aMetrics,
nsISpaceManager* aSpaceManager);
const nsHTMLReflowState& aReflowState,
const nsHTMLReflowMetrics& aMetrics);
~nsBlockReflowState();
@@ -218,7 +216,6 @@ nsLineLayout::AddFloater(nsPlaceholderFrame* aFrame)
#define nsBlockFrameSuper nsHTMLContainerFrame
class nsBlockFrame : public nsBlockFrameSuper,
public nsIRunaround,
public nsIFloaterContainer
{
public:
@@ -248,17 +245,15 @@ public:
NS_IMETHOD ListTag(FILE* out) const;
NS_IMETHOD VerifyTree() const;
// nsIRunaround
NS_IMETHOD ReflowAround(nsIPresContext& aPresContext,
nsISpaceManager* aSpaceManager,
// nsIHTMLReflow
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsRect& aDesiredRect,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
// nsIFloaterContainer
virtual PRBool AddFloater(nsIPresContext* aPresContext,
const nsReflowState& aPlaceholderReflowState,
const nsHTMLReflowState& aPlaceholderReflowState,
nsIFrame* aFloater,
nsPlaceholderFrame* aPlaceholder);
@@ -313,8 +308,7 @@ public:
nsresult ResizeReflow(nsBlockReflowState& aState);
void ComputeFinalSize(nsBlockReflowState& aState,
nsHTMLReflowMetrics& aMetrics,
nsRect& aDesiredRect);
nsHTMLReflowMetrics& aMetrics);
nsresult ReflowLinesAt(nsBlockReflowState& aState, LineData* aLine);
@@ -328,7 +322,7 @@ public:
void FindFloaters(LineData* aLine);
void PrepareInlineReflow(nsBlockReflowState& aState, nsIFrame* aFrame);
void PrepareInlineReflow(nsBlockReflowState& aState, nsIFrame* aFrame, PRBool aIsBlock);
PRBool ReflowInlineFrame(nsBlockReflowState& aState,
LineData* aLine,
@@ -413,12 +407,12 @@ public:
nsIReflowCommand* aReflowCommand);
NS_IMETHOD InlineReflow(nsLineLayout& aLineLayout,
nsHTMLReflowMetrics& aMetrics,
const nsReflowState& aReflowState);
const nsHTMLReflowState& aReflowState);
void SetListItemOrdinal(nsBlockReflowState& aBlockState);
void GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aMetrics);
void GetListItemText(nsIPresContext& aCX,
@@ -748,7 +742,7 @@ UpdateBulletCB(nsIPresContext& aPresContext, nsIFrame* aFrame, PRIntn aStatus)
void
BulletFrame::GetDesiredSize(nsIPresContext* aCX,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aMetrics)
{
const nsStyleList* myList =
@@ -833,7 +827,7 @@ BulletFrame::GetDesiredSize(nsIPresContext* aCX,
NS_IMETHODIMP
BulletFrame::InlineReflow(nsLineLayout& aLineLayout,
nsHTMLReflowMetrics& aMetrics,
const nsReflowState& aReflowState)
const nsHTMLReflowState& aReflowState)
{
// Get the base size
GetDesiredSize(&aLineLayout.mPresContext, aReflowState, aMetrics);
@@ -1272,7 +1266,7 @@ nsBlockReflowState::BlockBandData::ComputeAvailSpaceRect()
//----------------------------------------------------------------------
static nscoord
GetParentLeftPadding(const nsReflowState* aReflowState)
GetParentLeftPadding(const nsHTMLReflowState* aReflowState)
{
nscoord leftPadding = 0;
while (nsnull != aReflowState) {
@@ -1289,22 +1283,21 @@ GetParentLeftPadding(const nsReflowState* aReflowState)
leftPadding = padding.left;
break;
}
aReflowState = aReflowState->parentReflowState;
aReflowState = (nsHTMLReflowState*)aReflowState->parentReflowState;
}
return leftPadding;
}
nsBlockReflowState::nsBlockReflowState(nsIPresContext& aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowMetrics& aMetrics,
nsISpaceManager* aSpaceManager)
const nsHTMLReflowState& aReflowState,
const nsHTMLReflowMetrics& aMetrics)
: nsFrameReflowState(aPresContext, aReflowState, aMetrics),
mLineLayout(aPresContext, aSpaceManager)
mLineLayout(aPresContext, aReflowState.spaceManager)
{
mInlineReflow = nsnull;
mLineLayout.Init(this);
mSpaceManager = aSpaceManager;
mSpaceManager = aReflowState.spaceManager;
// Translate into our content area and then save the
// coordinate system origin for later.
@@ -1463,10 +1456,6 @@ nsBlockFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
*aInstancePtr = (void*) (this);
return NS_OK;
}
if (aIID.Equals(kIRunaroundIID)) {
*aInstancePtr = (void*) ((nsIRunaround*) this);
return NS_OK;
}
if (aIID.Equals(kIFloaterContainerIID)) {
*aInstancePtr = (void*) ((nsIFloaterContainer*) this);
return NS_OK;
@@ -1690,11 +1679,9 @@ nsBlockFrame::FirstChild(nsIFrame*& aFirstChild) const
// Reflow methods
NS_IMETHODIMP
nsBlockFrame::ReflowAround(nsIPresContext& aPresContext,
nsISpaceManager* aSpaceManager,
nsBlockFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aMetrics,
const nsReflowState& aReflowState,
nsRect& aDesiredRect,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
@@ -1714,8 +1701,7 @@ nsBlockFrame::ReflowAround(nsIPresContext& aPresContext,
// Replace parent provided reflow state with our own significantly
// more extensive version.
nsBlockReflowState state(aPresContext, aReflowState, aMetrics,
aSpaceManager);
nsBlockReflowState state(aPresContext, aReflowState, aMetrics);
// Prepare inline-reflow engine
nsInlineReflow inlineReflow(state.mLineLayout, state, this);
@@ -1781,7 +1767,7 @@ nsBlockFrame::ReflowAround(nsIPresContext& aPresContext,
}
// Compute our final size
ComputeFinalSize(state, aMetrics, aDesiredRect);
ComputeFinalSize(state, aMetrics);
#ifdef NS_DEBUG
if (GetVerifyTreeEnable()) {
@@ -1853,17 +1839,13 @@ nsBlockFrame::RenumberLists(nsBlockReflowState& aState)
void
nsBlockFrame::ComputeFinalSize(nsBlockReflowState& aState,
nsHTMLReflowMetrics& aMetrics,
nsRect& aDesiredRect)
nsHTMLReflowMetrics& aMetrics)
{
aDesiredRect.x = 0;
aDesiredRect.y = 0;
// Compute final width
PRIntn ss = aState.mStyleSizeFlags;
if (NS_SIZE_HAS_WIDTH & ss) {
// Use style defined width
aDesiredRect.width = aState.mBorderPadding.left +
aMetrics.width = aState.mBorderPadding.left +
aState.mStyleSize.width + aState.mBorderPadding.right;
}
else {
@@ -1877,13 +1859,13 @@ nsBlockFrame::ComputeFinalSize(nsBlockReflowState& aState,
contentWidth = aState.maxSize.width;
}
}
aDesiredRect.width = contentWidth;
aMetrics.width = contentWidth;
}
// Compute final height
if (NS_SIZE_HAS_HEIGHT & ss) {
// Use style defined height
aDesiredRect.height = aState.mBorderPadding.top +
aMetrics.height = aState.mBorderPadding.top +
aState.mStyleSize.height + aState.mBorderPadding.bottom;
}
else {
@@ -1895,7 +1877,7 @@ nsBlockFrame::ComputeFinalSize(nsBlockReflowState& aState,
else {
aMetrics.mCarriedOutBottomMargin = aState.mRunningMargin;
}
aDesiredRect.height = aState.mY;
aMetrics.height = aState.mY;
}
// Special check for zero sized content: If our content is zero
@@ -1903,14 +1885,12 @@ nsBlockFrame::ComputeFinalSize(nsBlockReflowState& aState,
if ((NS_SIZE_HAS_BOTH != ss) &&
((0 == aState.mKidXMost - aState.mBorderPadding.left) ||
(0 == aState.mY - aState.mBorderPadding.top))) {
aDesiredRect.width = 0;
aDesiredRect.height = 0;
aMetrics.width = 0;
aMetrics.height = 0;
aMetrics.mCarriedOutBottomMargin = 0;
}
aMetrics.width = aDesiredRect.width;
aMetrics.height = aDesiredRect.height;
aMetrics.ascent = aDesiredRect.height;
aMetrics.ascent = aMetrics.height;
aMetrics.descent = 0;
// XXX this needs reworking I suppose
@@ -2723,12 +2703,15 @@ done:;
// XXX inline frames need this too when they wrap up blocks, right??
// Otherwise blocks in inlines won't interact with floaters properly.
void
nsBlockFrame::PrepareInlineReflow(nsBlockReflowState& aState, nsIFrame* aFrame)
nsBlockFrame::PrepareInlineReflow(nsBlockReflowState& aState,
nsIFrame* aFrame,
PRBool aIsBlock)
{
// Setup initial coordinate system for reflowing the frame into
nscoord x, availWidth, availHeight;
nsIRunaround* runAround;
if (NS_OK == aFrame->QueryInterface(kIRunaroundIID, (void**)&runAround)) {
// XXX KIPP I'm not sure what you want to do here...
if (aIsBlock) {
// XXX Child needs to apply OUR border-padding and IT's left
// margin and right margin! How should this be done?
x = aState.mBorderPadding.left;
@@ -2776,7 +2759,7 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState,
nsInlineReflow& ir = *aState.mInlineReflow;
// Prepare the inline reflow engine
PrepareInlineReflow(aState, aFrame);
PrepareInlineReflow(aState, aFrame, PR_TRUE);
ir.SetIsFirstChild((aLine == mLines) &&
(aFrame == aLine->mFirstChild));
@@ -2913,7 +2896,7 @@ nsBlockFrame::ReflowInlineFrame(nsBlockReflowState& aState,
nsIFrame* nextInFlow;
if (!aState.mInlineReflowPrepared) {
PrepareInlineReflow(aState, aFrame);
PrepareInlineReflow(aState, aFrame, PR_FALSE);
}
PRBool isFirstChild = (aLine == mLines) &&
@@ -3190,7 +3173,7 @@ nsBlockFrame::PlaceLine(nsBlockReflowState& aState,
nsSize availSize;
availSize.width = NS_UNCONSTRAINEDSIZE;
availSize.height = NS_UNCONSTRAINEDSIZE;
nsReflowState reflowState(mBullet, aState, availSize);
nsHTMLReflowState reflowState(mBullet, aState, availSize);
nsHTMLReflowMetrics metrics(nsnull);
nsIInlineReflow* iir;
if (NS_OK == mBullet->QueryInterface(kIInlineReflowIID, (void**) &iir)) {
@@ -3682,7 +3665,7 @@ nsBlockFrame::ReflowFloater(nsIPresContext& aPresContext,
// it's maxSize will be 0,0 until we compute it (we need the reflowState
// for nsLayout::GetStyleSize so we have to do this first)
nsSize kidAvailSize(0, 0);
nsReflowState reflowState(aFloaterFrame, aState, kidAvailSize,
nsHTMLReflowState reflowState(aFloaterFrame, aState, kidAvailSize,
eReflowReason_Initial);
// Compute the available space for the floater. Use the default
@@ -3737,7 +3720,7 @@ nsBlockFrame::ReflowFloater(nsIPresContext& aPresContext,
PRBool
nsBlockFrame::AddFloater(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsIFrame* aFloater,
nsPlaceholderFrame* aPlaceholder)
{

View File

@@ -19,7 +19,6 @@
#include "nsIContent.h"
#include "nsIPresContext.h"
#include "nsIRenderingContext.h"
#include "nsIRunaround.h"
#include "nsISpaceManager.h"
#include "nsIStyleContext.h"
#include "nsRect.h"
@@ -293,7 +292,7 @@ NS_METHOD nsContainerFrame::GetCursorAndContentAt(nsIPresContext& aPresContext,
nsReflowStatus nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
nsIPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState)
const nsHTMLReflowState& aReflowState)
{
nsReflowStatus status;

View File

@@ -116,7 +116,7 @@ protected:
nsReflowStatus ReflowChild(nsIFrame* aKidFrame,
nsIPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState);
const nsHTMLReflowState& aReflowState);
/**
* Moves any frames on both the prev-in-flow's overflow list and the receiver's

View File

@@ -1147,7 +1147,7 @@ nsFrame::DidReflow(nsIPresContext& aPresContext,
NS_METHOD nsFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
aDesiredSize.width = 0;

View File

@@ -182,7 +182,7 @@ public:
NS_IMETHOD WillReflow(nsIPresContext& aPresContext);
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD DidReflow(nsIPresContext& aPresContext,
nsDidReflowStatus aStatus);

View File

@@ -114,7 +114,7 @@ public:
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD VerifyTree() const;
nscoord GetBorderWidth(nsIPresContext& aPresContext);
@@ -123,7 +123,7 @@ public:
protected:
virtual ~nsHTMLFrameOuterFrame();
virtual void GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredSize);
virtual PRIntn GetSkipSides() const;
PRBool *mIsInline;
@@ -152,7 +152,7 @@ public:
*/
NS_IMETHOD Reflow(nsIPresContext& aCX,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD MoveTo(nscoord aX, nscoord aY);
@@ -171,7 +171,7 @@ protected:
virtual ~nsHTMLFrameInnerFrame();
virtual void GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredSize);
nsIWebShell* mWebShell;
@@ -223,7 +223,7 @@ nsHTMLFrameOuterFrame::GetSkipSides() const
void
nsHTMLFrameOuterFrame::GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredSize)
{
// <frame> processing does not use this routine, only <iframe>
@@ -287,7 +287,7 @@ NS_IMETHODIMP nsHTMLFrameOuterFrame::ListTag(FILE* out) const
NS_IMETHODIMP
nsHTMLFrameOuterFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
//printf("OuterFrame::Reflow %X (%d,%d) \n", this, aReflowState.maxSize.width, aReflowState.maxSize.height);
@@ -317,7 +317,7 @@ nsHTMLFrameOuterFrame::Reflow(nsIPresContext& aPresContext,
// Reflow the child and get its desired size
nsHTMLReflowMetrics kidMetrics(aDesiredSize.maxElementSize);
nsReflowState kidReflowState(mFirstChild, aReflowState, innerSize);
nsHTMLReflowState kidReflowState(mFirstChild, aReflowState, innerSize);
nsIHTMLReflow* htmlReflow;
if (NS_OK == mFirstChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
@@ -693,7 +693,7 @@ nsHTMLFrameInnerFrame::CreateWebShell(nsIPresContext& aPresContext,
NS_IMETHODIMP
nsHTMLFrameInnerFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
//printf("InnerFrame::Reflow %X (%d,%d) \n", this, aReflowState.maxSize.width, aReflowState.maxSize.height);
@@ -757,7 +757,7 @@ nsHTMLFrameInnerFrame::Reflow(nsIPresContext& aPresContext,
void
nsHTMLFrameInnerFrame::GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredSize)
{
// it must be defined, but not called

View File

@@ -75,7 +75,7 @@ public:
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
PRBool GetVisibility() { return mVisibility; }
@@ -87,7 +87,7 @@ protected:
PRInt32 aWidth, PRBool aVertical, PRBool aVisible);
virtual ~nsHTMLFramesetBorderFrame();
virtual void GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredSize);
PRInt32 mWidth;
PRBool mVertical;
@@ -114,14 +114,14 @@ public:
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
protected:
nsHTMLFramesetBlankFrame(nsIContent* aContent, nsIFrame* aParentFrame);
virtual ~nsHTMLFramesetBlankFrame();
virtual void GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredSize);
friend class nsHTMLFramesetFrame;
friend class nsHTMLFrameset;
@@ -361,7 +361,7 @@ nsHTMLFramesetFrame::GetSkipSides() const
void
nsHTMLFramesetFrame::GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredSize)
{
nsHTMLFramesetFrame* framesetParent = GetFramesetParent(this);
@@ -607,7 +607,7 @@ nsHTMLFramesetFrame::ParseRowColSpec(nsString& aSpec, PRInt32 aMaxNumValues,
void
nsHTMLFramesetFrame::ReflowPlaceChild(nsIFrame* aChild,
nsIPresContext& aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsPoint& aOffset,
nsSize& aSize,
nsFramesetDrag* aDrag,
@@ -670,7 +670,7 @@ nsHTMLFramesetFrame::ReflowPlaceChild(nsIFrame* aChild,
}
}
nsReflowState reflowState(aChild, aReflowState, aSize);
nsHTMLReflowState reflowState(aChild, aReflowState, aSize);
nsIHTMLReflow* htmlReflow;
if (NS_OK == aChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
@@ -822,7 +822,7 @@ nscolor nsHTMLFramesetFrame::GetBorderColor(nsIContent* aContent)
NS_IMETHODIMP
nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
//printf("FramesetFrame::Reflow %X (%d,%d) \n", this, aReflowState.maxSize.width, aReflowState.maxSize.height);
@@ -837,7 +837,7 @@ NS_IMETHODIMP
nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
nsFramesetDrag* aDrag,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
//printf("FramesetFrame2::Reflow %X (%d,%d) \n", this, aReflowState.maxSize.width, aReflowState.maxSize.height);
@@ -1401,7 +1401,7 @@ nsHTMLFramesetFrame::MouseDrag(nsIPresContext& aPresContext, nsGUIEvent* aEvent)
shell = aPresContext.GetShell();
shell->CreateRenderingContext(this, acx);
NS_RELEASE(shell);
nsReflowState state(this, eReflowReason_Initial, size, acx);
nsHTMLReflowState state(this, eReflowReason_Initial, size, acx);
state.reason = eReflowReason_Incremental;
nsReflowStatus status;
nsDidReflowStatus didStatus;
@@ -1463,7 +1463,7 @@ printf("nsHTMLFramesetBorderFrame destructor %X \n", this);
}
void nsHTMLFramesetBorderFrame::GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredSize)
{
aDesiredSize.width = aReflowState.maxSize.width;
@@ -1486,7 +1486,7 @@ void nsHTMLFramesetBorderFrame::SetColor(nscolor aColor)
NS_IMETHODIMP
nsHTMLFramesetBorderFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
//printf("BorderFrame::Reflow %X (%d,%d) \n", this, aReflowState.maxSize.width, aReflowState.maxSize.height);
@@ -1632,7 +1632,7 @@ nsHTMLFramesetBlankFrame::~nsHTMLFramesetBlankFrame()
}
void nsHTMLFramesetBlankFrame::GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredSize)
{
aDesiredSize.width = aReflowState.maxSize.width;
@@ -1644,7 +1644,7 @@ void nsHTMLFramesetBlankFrame::GetDesiredSize(nsIPresContext* aPresContext,
NS_IMETHODIMP
nsHTMLFramesetBlankFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
GetDesiredSize(&aPresContext, aReflowState, aDesiredSize);

View File

@@ -27,7 +27,7 @@ class nsIFrame;
class nsIPresContext;
class nsIRenderingContext;
struct nsRect;
struct nsReflowState;
struct nsHTMLReflowState;
struct nsSize;
class nsIAtom;
class nsIWebShell;
@@ -118,13 +118,13 @@ public:
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsFramesetDrag* aDrag,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD VerifyTree() const;
@@ -142,7 +142,7 @@ protected:
nsFramesetSpec* aSpecs, nscoord* aValues);
virtual void GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredSize);
PRInt32 GetBorderWidth(nsIPresContext* aPresContext);
@@ -166,7 +166,7 @@ protected:
void ReflowPlaceChild(nsIFrame* aChild,
nsIPresContext& aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsPoint& aOffset,
nsSize& aSize,
nsFramesetDrag* aDrag = 0,

View File

@@ -44,7 +44,7 @@ public:
NS_IMETHOD Init(nsIPresContext& aPresContext, nsIFrame* aChildList);
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD HandleEvent(nsIPresContext& aPresContext,
nsGUIEvent* aEvent,
@@ -62,7 +62,7 @@ public:
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD Paint(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext,
@@ -120,7 +120,7 @@ RootFrame::Init(nsIPresContext& aPresContext, nsIFrame* aChildList)
NS_IMETHODIMP
RootFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
NS_FRAME_TRACE_REFLOW_IN("RootFrame::Reflow");
@@ -147,7 +147,7 @@ RootFrame::Reflow(nsIPresContext& aPresContext,
// wants
if (nsnull != mFirstChild) {
nsHTMLReflowMetrics desiredSize(nsnull);
nsReflowState kidReflowState(mFirstChild, aReflowState, aReflowState.maxSize);
nsHTMLReflowState kidReflowState(mFirstChild, aReflowState, aReflowState.maxSize);
nsIHTMLReflow* htmlReflow;
if (NS_OK == mFirstChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
@@ -296,7 +296,7 @@ RootContentFrame::ComputeChildMargins(nsMargin& aMargin)
NS_IMETHODIMP
RootContentFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
NS_FRAME_TRACE_REFLOW_IN("RootContentFrame::Reflow");
@@ -362,7 +362,7 @@ RootContentFrame::Reflow(nsIPresContext& aPresContext,
NS_ASSERTION(next == mFirstChild, "unexpected next reflow command frame");
nsSize maxSize(availWidth, NS_UNCONSTRAINEDSIZE);
nsReflowState kidReflowState(next, aReflowState, maxSize);
nsHTMLReflowState kidReflowState(next, aReflowState, maxSize);
nsIHTMLReflow* htmlReflow;
// Dispatch the reflow command to our child frame. Allow it to be as high
@@ -413,7 +413,7 @@ RootContentFrame::Reflow(nsIPresContext& aPresContext,
// Tile the pages vertically
for (nsIFrame* kidFrame = mFirstChild; nsnull != kidFrame; ) {
// Reflow the page
nsReflowState kidReflowState(kidFrame, aReflowState, pageSize,
nsHTMLReflowState kidReflowState(kidFrame, aReflowState, pageSize,
reflowReason);
nsIHTMLReflow* htmlReflow;
nsReflowStatus status;
@@ -474,7 +474,7 @@ RootContentFrame::Reflow(nsIPresContext& aPresContext,
} else {
nsSize maxSize(availWidth, NS_UNCONSTRAINEDSIZE);
nsReflowState kidReflowState(mFirstChild, aReflowState, maxSize,
nsHTMLReflowState kidReflowState(mFirstChild, aReflowState, maxSize,
reflowReason);
nsIHTMLReflow* htmlReflow;

View File

@@ -156,7 +156,7 @@ NS_IMETHODIMP nsHTMLReflowCommand::Dispatch(nsIPresContext& aPresContext,
if (nsnull != root) {
mPath.RemoveElementAt(mPath.Count() - 1);
nsReflowState reflowState(root, *this, aMaxSize, &aRendContext);
nsHTMLReflowState reflowState(root, *this, aMaxSize, &aRendContext);
nsIHTMLReflow* htmlReflow;
nsReflowStatus status;

View File

@@ -81,7 +81,7 @@ protected:
void SizeOfWithoutThis(nsISizeOfHandler* aHandler) const;
virtual void GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredSize);
nsIImageMap* GetImageMap();
@@ -266,7 +266,7 @@ nsHTMLImageLoader::StartLoadImage(nsIPresContext* aPresContext,
void
nsHTMLImageLoader::GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsIFrame* aTargetFrame,
nsFrameImageLoaderCB aCallBack,
nsHTMLReflowMetrics& aDesiredSize)
@@ -418,7 +418,7 @@ UpdateImageFrame(nsIPresContext& aPresContext, nsIFrame* aFrame,
void
ImageFrame::GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredSize)
{
if (mSizeFrozen) {

View File

@@ -31,7 +31,7 @@
struct nsInlineReflowState : nsFrameReflowState {
nsInlineReflowState(nsIPresContext& aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
const nsHTMLReflowMetrics& aMetrics);
~nsInlineReflowState();
@@ -40,7 +40,7 @@ struct nsInlineReflowState : nsFrameReflowState {
};
nsInlineReflowState::nsInlineReflowState(nsIPresContext& aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
const nsHTMLReflowMetrics& aMetrics)
: nsFrameReflowState(aPresContext, aReflowState, aMetrics)
{
@@ -76,7 +76,7 @@ public:
nsIReflowCommand* aReflowCommand);
NS_IMETHOD InlineReflow(nsLineLayout& aLineLayout,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState);
const nsHTMLReflowState& aReflowState);
virtual PRIntn GetSkipSides() const;
@@ -311,7 +311,7 @@ nsInlineFrame::InsertNewFrame(nsIPresContext& aPresContext,
NS_IMETHODIMP
nsInlineFrame::InlineReflow(nsLineLayout& aLineLayout,
nsHTMLReflowMetrics& aMetrics,
const nsReflowState& aReflowState)
const nsHTMLReflowState& aReflowState)
{
//XXX ListTag(stdout); printf(": enter (runningMargin=%d)\n", aMetrics.mCarriedInTopMargin);
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,

View File

@@ -57,7 +57,7 @@ NS_METHOD nsLeafFrame::Paint(nsIPresContext& aPresContext,
NS_METHOD nsLeafFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
NS_PRECONDITION(mState & NS_FRAME_IN_REFLOW, "frame is not in reflow");

View File

@@ -35,7 +35,7 @@ public:
const nsRect& aDirtyRect);
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD ContentChanged(nsIPresContext* aPresContext,
nsIContent* aChild,
@@ -52,7 +52,7 @@ protected:
* and the descent will be set to zero.
*/
virtual void GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredSize) = 0;
/**

View File

@@ -146,7 +146,7 @@ public:
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD DidReflow(nsIPresContext& aPresContext,
nsDidReflowStatus aStatus);
@@ -163,7 +163,7 @@ protected:
virtual ~nsObjectFrame();
virtual void GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredSize);
@@ -297,7 +297,7 @@ exit:
void
nsObjectFrame::GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aMetrics)
{
// Determine our size stylistically
@@ -340,7 +340,7 @@ nsObjectFrame::GetDesiredSize(nsIPresContext* aPresContext,
NS_IMETHODIMP
nsObjectFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aMetrics,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
// Get our desired size

View File

@@ -66,7 +66,7 @@ void nsPageFrame::CreateFirstChild(nsIPresContext* aPresContext)
NS_METHOD nsPageFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
aStatus = NS_FRAME_COMPLETE; // initialize out parameter
@@ -90,7 +90,7 @@ NS_METHOD nsPageFrame::Reflow(nsIPresContext& aPresContext,
// Dispatch the reflow command to our content child. Allow it to be as high
// as it wants
nsSize maxSize(aReflowState.maxSize.width, NS_UNCONSTRAINEDSIZE);
nsReflowState kidReflowState(mFirstChild, aReflowState, maxSize);
nsHTMLReflowState kidReflowState(mFirstChild, aReflowState, maxSize);
aStatus = ReflowChild(mFirstChild, &aPresContext, aDesiredSize, kidReflowState);
@@ -126,7 +126,7 @@ NS_METHOD nsPageFrame::Reflow(nsIPresContext& aPresContext,
// Resize our frame allowing it only to be as big as we are
// XXX Pay attention to the page's border and padding...
if (nsnull != mFirstChild) {
nsReflowState kidReflowState(mFirstChild, aReflowState, aReflowState.maxSize);
nsHTMLReflowState kidReflowState(mFirstChild, aReflowState, aReflowState.maxSize);
nsIHTMLReflow* htmlReflow;
if (NS_OK == mFirstChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {

View File

@@ -27,7 +27,7 @@ public:
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aMaxSize,
const nsHTMLReflowState& aMaxSize,
nsReflowStatus& aStatus);
NS_IMETHOD CreateContinuingFrame(nsIPresContext& aCX,

View File

@@ -82,7 +82,7 @@ nsPlaceholderFrame::FindTextRuns(nsLineLayout& aLineLayout,
NS_IMETHODIMP
nsPlaceholderFrame::InlineReflow(nsLineLayout& aLineLayout,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState)
const nsHTMLReflowState& aReflowState)
{
nsIPresContext& presContext = aLineLayout.mPresContext;

View File

@@ -45,7 +45,7 @@ public:
nsIReflowCommand* aReflowCommand);
NS_IMETHOD InlineReflow(nsLineLayout& aLineLayout,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState);
const nsHTMLReflowState& aReflowState);
NS_IMETHOD Paint(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect);

View File

@@ -45,7 +45,7 @@ public:
nsIReflowCommand* aReflowCommand);
NS_IMETHOD InlineReflow(nsLineLayout& aLineLayout,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState);
const nsHTMLReflowState& aReflowState);
PRUint8 GetType();
@@ -92,7 +92,7 @@ SpacerFrame::QueryInterface(REFNSIID aIID, void** aInstancePtrResult)
NS_IMETHODIMP
SpacerFrame::InlineReflow(nsLineLayout& aLineLayout,
nsHTMLReflowMetrics& aMetrics,
const nsReflowState& aReflowState)
const nsHTMLReflowState& aReflowState)
{
nsresult rv = NS_FRAME_COMPLETE;

View File

@@ -154,7 +154,7 @@ public:
NS_IMETHOD InlineReflow(nsLineLayout& aLineLayout,
nsHTMLReflowMetrics& aMetrics,
const nsReflowState& aReflowState);
const nsHTMLReflowState& aReflowState);
// TextFrame methods
struct SelectionInfo {
@@ -198,13 +198,13 @@ public:
nsInlineReflowStatus ReflowPre(nsLineLayout& aLineLayout,
nsHTMLReflowMetrics& aMetrics,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
const nsStyleFont& aFont,
PRInt32 aStartingOffset);
nsInlineReflowStatus ReflowNormal(nsLineLayout& aLineLayout,
nsHTMLReflowMetrics& aMetrics,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
const nsStyleFont& aFontStyle,
const nsStyleText& aTextStyle,
PRInt32 aStartingOffset);
@@ -1304,7 +1304,7 @@ TextFrame::GetPosition(nsIPresContext& aCX,
NS_IMETHODIMP
TextFrame::InlineReflow(nsLineLayout& aLineLayout,
nsHTMLReflowMetrics& aMetrics,
const nsReflowState& aReflowState)
const nsHTMLReflowState& aReflowState)
{
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
("enter TextFrame::Reflow: aMaxSize=%d,%d",
@@ -1357,7 +1357,7 @@ TextFrame::InlineReflow(nsLineLayout& aLineLayout,
nsInlineReflowStatus
TextFrame::ReflowNormal(nsLineLayout& aLineLayout,
nsHTMLReflowMetrics& aMetrics,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
const nsStyleFont& aFont,
const nsStyleText& aTextStyle,
PRInt32 aStartingOffset)
@@ -1532,7 +1532,7 @@ TextFrame::ReflowNormal(nsLineLayout& aLineLayout,
nsInlineReflowStatus
TextFrame::ReflowPre(nsLineLayout& aLineLayout,
nsHTMLReflowMetrics& aMetrics,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
const nsStyleFont& aFont,
PRInt32 aStartingOffset)
{

View File

@@ -54,7 +54,7 @@ nsAbsoluteFrame::~nsAbsoluteFrame()
NS_IMETHODIMP nsAbsoluteFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
if (eReflowReason_Initial == aReflowState.reason) {

View File

@@ -39,12 +39,13 @@ public:
nsIFrame* GetAbsoluteFrame() const {return mFrame;}
void SetAbsoluteFrame(nsIFrame* aAbsoluteFrame) {mFrame = aAbsoluteFrame;}
// nsIFrame overrides
// nsIHTMLReflow overrides
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
// nsIFrame overrides
NS_IMETHOD ContentChanged(nsIPresContext* aPresContext,
nsIContent* aChild,
nsISupports* aSubContent);

View File

@@ -44,7 +44,7 @@ public:
nsIReflowCommand* aReflowCommand);
NS_IMETHOD InlineReflow(nsLineLayout& aLineLayout,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState);
const nsHTMLReflowState& aReflowState);
protected:
virtual ~BRFrame();
@@ -111,7 +111,7 @@ BRFrame::FindTextRuns(nsLineLayout& aLineLayout,
NS_IMETHODIMP
BRFrame::InlineReflow(nsLineLayout& aLineLayout,
nsHTMLReflowMetrics& aMetrics,
const nsReflowState& aReflowState)
const nsHTMLReflowState& aReflowState)
{
if (nsnull != aMetrics.maxElementSize) {
aMetrics.maxElementSize->width = 0;

View File

@@ -32,7 +32,6 @@
#include "nsIPresContext.h"
#include "nsIPresShell.h"
#include "nsIReflowCommand.h"
#include "nsIRunaround.h"
#include "nsISpaceManager.h"
#include "nsIStyleContext.h"
#include "nsIView.h"
@@ -125,9 +124,8 @@ class nsBlockFrame;
struct nsBlockReflowState : public nsFrameReflowState {
nsBlockReflowState(nsIPresContext& aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowMetrics& aMetrics,
nsISpaceManager* aSpaceManager);
const nsHTMLReflowState& aReflowState,
const nsHTMLReflowMetrics& aMetrics);
~nsBlockReflowState();
@@ -218,7 +216,6 @@ nsLineLayout::AddFloater(nsPlaceholderFrame* aFrame)
#define nsBlockFrameSuper nsHTMLContainerFrame
class nsBlockFrame : public nsBlockFrameSuper,
public nsIRunaround,
public nsIFloaterContainer
{
public:
@@ -248,17 +245,15 @@ public:
NS_IMETHOD ListTag(FILE* out) const;
NS_IMETHOD VerifyTree() const;
// nsIRunaround
NS_IMETHOD ReflowAround(nsIPresContext& aPresContext,
nsISpaceManager* aSpaceManager,
// nsIHTMLReflow
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsRect& aDesiredRect,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
// nsIFloaterContainer
virtual PRBool AddFloater(nsIPresContext* aPresContext,
const nsReflowState& aPlaceholderReflowState,
const nsHTMLReflowState& aPlaceholderReflowState,
nsIFrame* aFloater,
nsPlaceholderFrame* aPlaceholder);
@@ -313,8 +308,7 @@ public:
nsresult ResizeReflow(nsBlockReflowState& aState);
void ComputeFinalSize(nsBlockReflowState& aState,
nsHTMLReflowMetrics& aMetrics,
nsRect& aDesiredRect);
nsHTMLReflowMetrics& aMetrics);
nsresult ReflowLinesAt(nsBlockReflowState& aState, LineData* aLine);
@@ -328,7 +322,7 @@ public:
void FindFloaters(LineData* aLine);
void PrepareInlineReflow(nsBlockReflowState& aState, nsIFrame* aFrame);
void PrepareInlineReflow(nsBlockReflowState& aState, nsIFrame* aFrame, PRBool aIsBlock);
PRBool ReflowInlineFrame(nsBlockReflowState& aState,
LineData* aLine,
@@ -413,12 +407,12 @@ public:
nsIReflowCommand* aReflowCommand);
NS_IMETHOD InlineReflow(nsLineLayout& aLineLayout,
nsHTMLReflowMetrics& aMetrics,
const nsReflowState& aReflowState);
const nsHTMLReflowState& aReflowState);
void SetListItemOrdinal(nsBlockReflowState& aBlockState);
void GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aMetrics);
void GetListItemText(nsIPresContext& aCX,
@@ -748,7 +742,7 @@ UpdateBulletCB(nsIPresContext& aPresContext, nsIFrame* aFrame, PRIntn aStatus)
void
BulletFrame::GetDesiredSize(nsIPresContext* aCX,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aMetrics)
{
const nsStyleList* myList =
@@ -833,7 +827,7 @@ BulletFrame::GetDesiredSize(nsIPresContext* aCX,
NS_IMETHODIMP
BulletFrame::InlineReflow(nsLineLayout& aLineLayout,
nsHTMLReflowMetrics& aMetrics,
const nsReflowState& aReflowState)
const nsHTMLReflowState& aReflowState)
{
// Get the base size
GetDesiredSize(&aLineLayout.mPresContext, aReflowState, aMetrics);
@@ -1272,7 +1266,7 @@ nsBlockReflowState::BlockBandData::ComputeAvailSpaceRect()
//----------------------------------------------------------------------
static nscoord
GetParentLeftPadding(const nsReflowState* aReflowState)
GetParentLeftPadding(const nsHTMLReflowState* aReflowState)
{
nscoord leftPadding = 0;
while (nsnull != aReflowState) {
@@ -1289,22 +1283,21 @@ GetParentLeftPadding(const nsReflowState* aReflowState)
leftPadding = padding.left;
break;
}
aReflowState = aReflowState->parentReflowState;
aReflowState = (nsHTMLReflowState*)aReflowState->parentReflowState;
}
return leftPadding;
}
nsBlockReflowState::nsBlockReflowState(nsIPresContext& aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowMetrics& aMetrics,
nsISpaceManager* aSpaceManager)
const nsHTMLReflowState& aReflowState,
const nsHTMLReflowMetrics& aMetrics)
: nsFrameReflowState(aPresContext, aReflowState, aMetrics),
mLineLayout(aPresContext, aSpaceManager)
mLineLayout(aPresContext, aReflowState.spaceManager)
{
mInlineReflow = nsnull;
mLineLayout.Init(this);
mSpaceManager = aSpaceManager;
mSpaceManager = aReflowState.spaceManager;
// Translate into our content area and then save the
// coordinate system origin for later.
@@ -1463,10 +1456,6 @@ nsBlockFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
*aInstancePtr = (void*) (this);
return NS_OK;
}
if (aIID.Equals(kIRunaroundIID)) {
*aInstancePtr = (void*) ((nsIRunaround*) this);
return NS_OK;
}
if (aIID.Equals(kIFloaterContainerIID)) {
*aInstancePtr = (void*) ((nsIFloaterContainer*) this);
return NS_OK;
@@ -1690,11 +1679,9 @@ nsBlockFrame::FirstChild(nsIFrame*& aFirstChild) const
// Reflow methods
NS_IMETHODIMP
nsBlockFrame::ReflowAround(nsIPresContext& aPresContext,
nsISpaceManager* aSpaceManager,
nsBlockFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aMetrics,
const nsReflowState& aReflowState,
nsRect& aDesiredRect,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
@@ -1714,8 +1701,7 @@ nsBlockFrame::ReflowAround(nsIPresContext& aPresContext,
// Replace parent provided reflow state with our own significantly
// more extensive version.
nsBlockReflowState state(aPresContext, aReflowState, aMetrics,
aSpaceManager);
nsBlockReflowState state(aPresContext, aReflowState, aMetrics);
// Prepare inline-reflow engine
nsInlineReflow inlineReflow(state.mLineLayout, state, this);
@@ -1781,7 +1767,7 @@ nsBlockFrame::ReflowAround(nsIPresContext& aPresContext,
}
// Compute our final size
ComputeFinalSize(state, aMetrics, aDesiredRect);
ComputeFinalSize(state, aMetrics);
#ifdef NS_DEBUG
if (GetVerifyTreeEnable()) {
@@ -1853,17 +1839,13 @@ nsBlockFrame::RenumberLists(nsBlockReflowState& aState)
void
nsBlockFrame::ComputeFinalSize(nsBlockReflowState& aState,
nsHTMLReflowMetrics& aMetrics,
nsRect& aDesiredRect)
nsHTMLReflowMetrics& aMetrics)
{
aDesiredRect.x = 0;
aDesiredRect.y = 0;
// Compute final width
PRIntn ss = aState.mStyleSizeFlags;
if (NS_SIZE_HAS_WIDTH & ss) {
// Use style defined width
aDesiredRect.width = aState.mBorderPadding.left +
aMetrics.width = aState.mBorderPadding.left +
aState.mStyleSize.width + aState.mBorderPadding.right;
}
else {
@@ -1877,13 +1859,13 @@ nsBlockFrame::ComputeFinalSize(nsBlockReflowState& aState,
contentWidth = aState.maxSize.width;
}
}
aDesiredRect.width = contentWidth;
aMetrics.width = contentWidth;
}
// Compute final height
if (NS_SIZE_HAS_HEIGHT & ss) {
// Use style defined height
aDesiredRect.height = aState.mBorderPadding.top +
aMetrics.height = aState.mBorderPadding.top +
aState.mStyleSize.height + aState.mBorderPadding.bottom;
}
else {
@@ -1895,7 +1877,7 @@ nsBlockFrame::ComputeFinalSize(nsBlockReflowState& aState,
else {
aMetrics.mCarriedOutBottomMargin = aState.mRunningMargin;
}
aDesiredRect.height = aState.mY;
aMetrics.height = aState.mY;
}
// Special check for zero sized content: If our content is zero
@@ -1903,14 +1885,12 @@ nsBlockFrame::ComputeFinalSize(nsBlockReflowState& aState,
if ((NS_SIZE_HAS_BOTH != ss) &&
((0 == aState.mKidXMost - aState.mBorderPadding.left) ||
(0 == aState.mY - aState.mBorderPadding.top))) {
aDesiredRect.width = 0;
aDesiredRect.height = 0;
aMetrics.width = 0;
aMetrics.height = 0;
aMetrics.mCarriedOutBottomMargin = 0;
}
aMetrics.width = aDesiredRect.width;
aMetrics.height = aDesiredRect.height;
aMetrics.ascent = aDesiredRect.height;
aMetrics.ascent = aMetrics.height;
aMetrics.descent = 0;
// XXX this needs reworking I suppose
@@ -2723,12 +2703,15 @@ done:;
// XXX inline frames need this too when they wrap up blocks, right??
// Otherwise blocks in inlines won't interact with floaters properly.
void
nsBlockFrame::PrepareInlineReflow(nsBlockReflowState& aState, nsIFrame* aFrame)
nsBlockFrame::PrepareInlineReflow(nsBlockReflowState& aState,
nsIFrame* aFrame,
PRBool aIsBlock)
{
// Setup initial coordinate system for reflowing the frame into
nscoord x, availWidth, availHeight;
nsIRunaround* runAround;
if (NS_OK == aFrame->QueryInterface(kIRunaroundIID, (void**)&runAround)) {
// XXX KIPP I'm not sure what you want to do here...
if (aIsBlock) {
// XXX Child needs to apply OUR border-padding and IT's left
// margin and right margin! How should this be done?
x = aState.mBorderPadding.left;
@@ -2776,7 +2759,7 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState,
nsInlineReflow& ir = *aState.mInlineReflow;
// Prepare the inline reflow engine
PrepareInlineReflow(aState, aFrame);
PrepareInlineReflow(aState, aFrame, PR_TRUE);
ir.SetIsFirstChild((aLine == mLines) &&
(aFrame == aLine->mFirstChild));
@@ -2913,7 +2896,7 @@ nsBlockFrame::ReflowInlineFrame(nsBlockReflowState& aState,
nsIFrame* nextInFlow;
if (!aState.mInlineReflowPrepared) {
PrepareInlineReflow(aState, aFrame);
PrepareInlineReflow(aState, aFrame, PR_FALSE);
}
PRBool isFirstChild = (aLine == mLines) &&
@@ -3190,7 +3173,7 @@ nsBlockFrame::PlaceLine(nsBlockReflowState& aState,
nsSize availSize;
availSize.width = NS_UNCONSTRAINEDSIZE;
availSize.height = NS_UNCONSTRAINEDSIZE;
nsReflowState reflowState(mBullet, aState, availSize);
nsHTMLReflowState reflowState(mBullet, aState, availSize);
nsHTMLReflowMetrics metrics(nsnull);
nsIInlineReflow* iir;
if (NS_OK == mBullet->QueryInterface(kIInlineReflowIID, (void**) &iir)) {
@@ -3682,7 +3665,7 @@ nsBlockFrame::ReflowFloater(nsIPresContext& aPresContext,
// it's maxSize will be 0,0 until we compute it (we need the reflowState
// for nsLayout::GetStyleSize so we have to do this first)
nsSize kidAvailSize(0, 0);
nsReflowState reflowState(aFloaterFrame, aState, kidAvailSize,
nsHTMLReflowState reflowState(aFloaterFrame, aState, kidAvailSize,
eReflowReason_Initial);
// Compute the available space for the floater. Use the default
@@ -3737,7 +3720,7 @@ nsBlockFrame::ReflowFloater(nsIPresContext& aPresContext,
PRBool
nsBlockFrame::AddFloater(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsIFrame* aFloater,
nsPlaceholderFrame* aPlaceholder)
{

View File

@@ -32,7 +32,6 @@
#include "nsIPresContext.h"
#include "nsIPresShell.h"
#include "nsIReflowCommand.h"
#include "nsIRunaround.h"
#include "nsISpaceManager.h"
#include "nsIStyleContext.h"
#include "nsIView.h"
@@ -125,9 +124,8 @@ class nsBlockFrame;
struct nsBlockReflowState : public nsFrameReflowState {
nsBlockReflowState(nsIPresContext& aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowMetrics& aMetrics,
nsISpaceManager* aSpaceManager);
const nsHTMLReflowState& aReflowState,
const nsHTMLReflowMetrics& aMetrics);
~nsBlockReflowState();
@@ -218,7 +216,6 @@ nsLineLayout::AddFloater(nsPlaceholderFrame* aFrame)
#define nsBlockFrameSuper nsHTMLContainerFrame
class nsBlockFrame : public nsBlockFrameSuper,
public nsIRunaround,
public nsIFloaterContainer
{
public:
@@ -248,17 +245,15 @@ public:
NS_IMETHOD ListTag(FILE* out) const;
NS_IMETHOD VerifyTree() const;
// nsIRunaround
NS_IMETHOD ReflowAround(nsIPresContext& aPresContext,
nsISpaceManager* aSpaceManager,
// nsIHTMLReflow
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsRect& aDesiredRect,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
// nsIFloaterContainer
virtual PRBool AddFloater(nsIPresContext* aPresContext,
const nsReflowState& aPlaceholderReflowState,
const nsHTMLReflowState& aPlaceholderReflowState,
nsIFrame* aFloater,
nsPlaceholderFrame* aPlaceholder);
@@ -313,8 +308,7 @@ public:
nsresult ResizeReflow(nsBlockReflowState& aState);
void ComputeFinalSize(nsBlockReflowState& aState,
nsHTMLReflowMetrics& aMetrics,
nsRect& aDesiredRect);
nsHTMLReflowMetrics& aMetrics);
nsresult ReflowLinesAt(nsBlockReflowState& aState, LineData* aLine);
@@ -328,7 +322,7 @@ public:
void FindFloaters(LineData* aLine);
void PrepareInlineReflow(nsBlockReflowState& aState, nsIFrame* aFrame);
void PrepareInlineReflow(nsBlockReflowState& aState, nsIFrame* aFrame, PRBool aIsBlock);
PRBool ReflowInlineFrame(nsBlockReflowState& aState,
LineData* aLine,
@@ -413,12 +407,12 @@ public:
nsIReflowCommand* aReflowCommand);
NS_IMETHOD InlineReflow(nsLineLayout& aLineLayout,
nsHTMLReflowMetrics& aMetrics,
const nsReflowState& aReflowState);
const nsHTMLReflowState& aReflowState);
void SetListItemOrdinal(nsBlockReflowState& aBlockState);
void GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aMetrics);
void GetListItemText(nsIPresContext& aCX,
@@ -748,7 +742,7 @@ UpdateBulletCB(nsIPresContext& aPresContext, nsIFrame* aFrame, PRIntn aStatus)
void
BulletFrame::GetDesiredSize(nsIPresContext* aCX,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aMetrics)
{
const nsStyleList* myList =
@@ -833,7 +827,7 @@ BulletFrame::GetDesiredSize(nsIPresContext* aCX,
NS_IMETHODIMP
BulletFrame::InlineReflow(nsLineLayout& aLineLayout,
nsHTMLReflowMetrics& aMetrics,
const nsReflowState& aReflowState)
const nsHTMLReflowState& aReflowState)
{
// Get the base size
GetDesiredSize(&aLineLayout.mPresContext, aReflowState, aMetrics);
@@ -1272,7 +1266,7 @@ nsBlockReflowState::BlockBandData::ComputeAvailSpaceRect()
//----------------------------------------------------------------------
static nscoord
GetParentLeftPadding(const nsReflowState* aReflowState)
GetParentLeftPadding(const nsHTMLReflowState* aReflowState)
{
nscoord leftPadding = 0;
while (nsnull != aReflowState) {
@@ -1289,22 +1283,21 @@ GetParentLeftPadding(const nsReflowState* aReflowState)
leftPadding = padding.left;
break;
}
aReflowState = aReflowState->parentReflowState;
aReflowState = (nsHTMLReflowState*)aReflowState->parentReflowState;
}
return leftPadding;
}
nsBlockReflowState::nsBlockReflowState(nsIPresContext& aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowMetrics& aMetrics,
nsISpaceManager* aSpaceManager)
const nsHTMLReflowState& aReflowState,
const nsHTMLReflowMetrics& aMetrics)
: nsFrameReflowState(aPresContext, aReflowState, aMetrics),
mLineLayout(aPresContext, aSpaceManager)
mLineLayout(aPresContext, aReflowState.spaceManager)
{
mInlineReflow = nsnull;
mLineLayout.Init(this);
mSpaceManager = aSpaceManager;
mSpaceManager = aReflowState.spaceManager;
// Translate into our content area and then save the
// coordinate system origin for later.
@@ -1463,10 +1456,6 @@ nsBlockFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
*aInstancePtr = (void*) (this);
return NS_OK;
}
if (aIID.Equals(kIRunaroundIID)) {
*aInstancePtr = (void*) ((nsIRunaround*) this);
return NS_OK;
}
if (aIID.Equals(kIFloaterContainerIID)) {
*aInstancePtr = (void*) ((nsIFloaterContainer*) this);
return NS_OK;
@@ -1690,11 +1679,9 @@ nsBlockFrame::FirstChild(nsIFrame*& aFirstChild) const
// Reflow methods
NS_IMETHODIMP
nsBlockFrame::ReflowAround(nsIPresContext& aPresContext,
nsISpaceManager* aSpaceManager,
nsBlockFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aMetrics,
const nsReflowState& aReflowState,
nsRect& aDesiredRect,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
@@ -1714,8 +1701,7 @@ nsBlockFrame::ReflowAround(nsIPresContext& aPresContext,
// Replace parent provided reflow state with our own significantly
// more extensive version.
nsBlockReflowState state(aPresContext, aReflowState, aMetrics,
aSpaceManager);
nsBlockReflowState state(aPresContext, aReflowState, aMetrics);
// Prepare inline-reflow engine
nsInlineReflow inlineReflow(state.mLineLayout, state, this);
@@ -1781,7 +1767,7 @@ nsBlockFrame::ReflowAround(nsIPresContext& aPresContext,
}
// Compute our final size
ComputeFinalSize(state, aMetrics, aDesiredRect);
ComputeFinalSize(state, aMetrics);
#ifdef NS_DEBUG
if (GetVerifyTreeEnable()) {
@@ -1853,17 +1839,13 @@ nsBlockFrame::RenumberLists(nsBlockReflowState& aState)
void
nsBlockFrame::ComputeFinalSize(nsBlockReflowState& aState,
nsHTMLReflowMetrics& aMetrics,
nsRect& aDesiredRect)
nsHTMLReflowMetrics& aMetrics)
{
aDesiredRect.x = 0;
aDesiredRect.y = 0;
// Compute final width
PRIntn ss = aState.mStyleSizeFlags;
if (NS_SIZE_HAS_WIDTH & ss) {
// Use style defined width
aDesiredRect.width = aState.mBorderPadding.left +
aMetrics.width = aState.mBorderPadding.left +
aState.mStyleSize.width + aState.mBorderPadding.right;
}
else {
@@ -1877,13 +1859,13 @@ nsBlockFrame::ComputeFinalSize(nsBlockReflowState& aState,
contentWidth = aState.maxSize.width;
}
}
aDesiredRect.width = contentWidth;
aMetrics.width = contentWidth;
}
// Compute final height
if (NS_SIZE_HAS_HEIGHT & ss) {
// Use style defined height
aDesiredRect.height = aState.mBorderPadding.top +
aMetrics.height = aState.mBorderPadding.top +
aState.mStyleSize.height + aState.mBorderPadding.bottom;
}
else {
@@ -1895,7 +1877,7 @@ nsBlockFrame::ComputeFinalSize(nsBlockReflowState& aState,
else {
aMetrics.mCarriedOutBottomMargin = aState.mRunningMargin;
}
aDesiredRect.height = aState.mY;
aMetrics.height = aState.mY;
}
// Special check for zero sized content: If our content is zero
@@ -1903,14 +1885,12 @@ nsBlockFrame::ComputeFinalSize(nsBlockReflowState& aState,
if ((NS_SIZE_HAS_BOTH != ss) &&
((0 == aState.mKidXMost - aState.mBorderPadding.left) ||
(0 == aState.mY - aState.mBorderPadding.top))) {
aDesiredRect.width = 0;
aDesiredRect.height = 0;
aMetrics.width = 0;
aMetrics.height = 0;
aMetrics.mCarriedOutBottomMargin = 0;
}
aMetrics.width = aDesiredRect.width;
aMetrics.height = aDesiredRect.height;
aMetrics.ascent = aDesiredRect.height;
aMetrics.ascent = aMetrics.height;
aMetrics.descent = 0;
// XXX this needs reworking I suppose
@@ -2723,12 +2703,15 @@ done:;
// XXX inline frames need this too when they wrap up blocks, right??
// Otherwise blocks in inlines won't interact with floaters properly.
void
nsBlockFrame::PrepareInlineReflow(nsBlockReflowState& aState, nsIFrame* aFrame)
nsBlockFrame::PrepareInlineReflow(nsBlockReflowState& aState,
nsIFrame* aFrame,
PRBool aIsBlock)
{
// Setup initial coordinate system for reflowing the frame into
nscoord x, availWidth, availHeight;
nsIRunaround* runAround;
if (NS_OK == aFrame->QueryInterface(kIRunaroundIID, (void**)&runAround)) {
// XXX KIPP I'm not sure what you want to do here...
if (aIsBlock) {
// XXX Child needs to apply OUR border-padding and IT's left
// margin and right margin! How should this be done?
x = aState.mBorderPadding.left;
@@ -2776,7 +2759,7 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState,
nsInlineReflow& ir = *aState.mInlineReflow;
// Prepare the inline reflow engine
PrepareInlineReflow(aState, aFrame);
PrepareInlineReflow(aState, aFrame, PR_TRUE);
ir.SetIsFirstChild((aLine == mLines) &&
(aFrame == aLine->mFirstChild));
@@ -2913,7 +2896,7 @@ nsBlockFrame::ReflowInlineFrame(nsBlockReflowState& aState,
nsIFrame* nextInFlow;
if (!aState.mInlineReflowPrepared) {
PrepareInlineReflow(aState, aFrame);
PrepareInlineReflow(aState, aFrame, PR_FALSE);
}
PRBool isFirstChild = (aLine == mLines) &&
@@ -3190,7 +3173,7 @@ nsBlockFrame::PlaceLine(nsBlockReflowState& aState,
nsSize availSize;
availSize.width = NS_UNCONSTRAINEDSIZE;
availSize.height = NS_UNCONSTRAINEDSIZE;
nsReflowState reflowState(mBullet, aState, availSize);
nsHTMLReflowState reflowState(mBullet, aState, availSize);
nsHTMLReflowMetrics metrics(nsnull);
nsIInlineReflow* iir;
if (NS_OK == mBullet->QueryInterface(kIInlineReflowIID, (void**) &iir)) {
@@ -3682,7 +3665,7 @@ nsBlockFrame::ReflowFloater(nsIPresContext& aPresContext,
// it's maxSize will be 0,0 until we compute it (we need the reflowState
// for nsLayout::GetStyleSize so we have to do this first)
nsSize kidAvailSize(0, 0);
nsReflowState reflowState(aFloaterFrame, aState, kidAvailSize,
nsHTMLReflowState reflowState(aFloaterFrame, aState, kidAvailSize,
eReflowReason_Initial);
// Compute the available space for the floater. Use the default
@@ -3737,7 +3720,7 @@ nsBlockFrame::ReflowFloater(nsIPresContext& aPresContext,
PRBool
nsBlockFrame::AddFloater(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsIFrame* aFloater,
nsPlaceholderFrame* aPlaceholder)
{

View File

@@ -32,7 +32,6 @@
#include "nsIPresContext.h"
#include "nsIPresShell.h"
#include "nsIReflowCommand.h"
#include "nsIRunaround.h"
#include "nsISpaceManager.h"
#include "nsIStyleContext.h"
#include "nsIView.h"
@@ -125,9 +124,8 @@ class nsBlockFrame;
struct nsBlockReflowState : public nsFrameReflowState {
nsBlockReflowState(nsIPresContext& aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowMetrics& aMetrics,
nsISpaceManager* aSpaceManager);
const nsHTMLReflowState& aReflowState,
const nsHTMLReflowMetrics& aMetrics);
~nsBlockReflowState();
@@ -218,7 +216,6 @@ nsLineLayout::AddFloater(nsPlaceholderFrame* aFrame)
#define nsBlockFrameSuper nsHTMLContainerFrame
class nsBlockFrame : public nsBlockFrameSuper,
public nsIRunaround,
public nsIFloaterContainer
{
public:
@@ -248,17 +245,15 @@ public:
NS_IMETHOD ListTag(FILE* out) const;
NS_IMETHOD VerifyTree() const;
// nsIRunaround
NS_IMETHOD ReflowAround(nsIPresContext& aPresContext,
nsISpaceManager* aSpaceManager,
// nsIHTMLReflow
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsRect& aDesiredRect,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
// nsIFloaterContainer
virtual PRBool AddFloater(nsIPresContext* aPresContext,
const nsReflowState& aPlaceholderReflowState,
const nsHTMLReflowState& aPlaceholderReflowState,
nsIFrame* aFloater,
nsPlaceholderFrame* aPlaceholder);
@@ -313,8 +308,7 @@ public:
nsresult ResizeReflow(nsBlockReflowState& aState);
void ComputeFinalSize(nsBlockReflowState& aState,
nsHTMLReflowMetrics& aMetrics,
nsRect& aDesiredRect);
nsHTMLReflowMetrics& aMetrics);
nsresult ReflowLinesAt(nsBlockReflowState& aState, LineData* aLine);
@@ -328,7 +322,7 @@ public:
void FindFloaters(LineData* aLine);
void PrepareInlineReflow(nsBlockReflowState& aState, nsIFrame* aFrame);
void PrepareInlineReflow(nsBlockReflowState& aState, nsIFrame* aFrame, PRBool aIsBlock);
PRBool ReflowInlineFrame(nsBlockReflowState& aState,
LineData* aLine,
@@ -413,12 +407,12 @@ public:
nsIReflowCommand* aReflowCommand);
NS_IMETHOD InlineReflow(nsLineLayout& aLineLayout,
nsHTMLReflowMetrics& aMetrics,
const nsReflowState& aReflowState);
const nsHTMLReflowState& aReflowState);
void SetListItemOrdinal(nsBlockReflowState& aBlockState);
void GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aMetrics);
void GetListItemText(nsIPresContext& aCX,
@@ -748,7 +742,7 @@ UpdateBulletCB(nsIPresContext& aPresContext, nsIFrame* aFrame, PRIntn aStatus)
void
BulletFrame::GetDesiredSize(nsIPresContext* aCX,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aMetrics)
{
const nsStyleList* myList =
@@ -833,7 +827,7 @@ BulletFrame::GetDesiredSize(nsIPresContext* aCX,
NS_IMETHODIMP
BulletFrame::InlineReflow(nsLineLayout& aLineLayout,
nsHTMLReflowMetrics& aMetrics,
const nsReflowState& aReflowState)
const nsHTMLReflowState& aReflowState)
{
// Get the base size
GetDesiredSize(&aLineLayout.mPresContext, aReflowState, aMetrics);
@@ -1272,7 +1266,7 @@ nsBlockReflowState::BlockBandData::ComputeAvailSpaceRect()
//----------------------------------------------------------------------
static nscoord
GetParentLeftPadding(const nsReflowState* aReflowState)
GetParentLeftPadding(const nsHTMLReflowState* aReflowState)
{
nscoord leftPadding = 0;
while (nsnull != aReflowState) {
@@ -1289,22 +1283,21 @@ GetParentLeftPadding(const nsReflowState* aReflowState)
leftPadding = padding.left;
break;
}
aReflowState = aReflowState->parentReflowState;
aReflowState = (nsHTMLReflowState*)aReflowState->parentReflowState;
}
return leftPadding;
}
nsBlockReflowState::nsBlockReflowState(nsIPresContext& aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowMetrics& aMetrics,
nsISpaceManager* aSpaceManager)
const nsHTMLReflowState& aReflowState,
const nsHTMLReflowMetrics& aMetrics)
: nsFrameReflowState(aPresContext, aReflowState, aMetrics),
mLineLayout(aPresContext, aSpaceManager)
mLineLayout(aPresContext, aReflowState.spaceManager)
{
mInlineReflow = nsnull;
mLineLayout.Init(this);
mSpaceManager = aSpaceManager;
mSpaceManager = aReflowState.spaceManager;
// Translate into our content area and then save the
// coordinate system origin for later.
@@ -1463,10 +1456,6 @@ nsBlockFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
*aInstancePtr = (void*) (this);
return NS_OK;
}
if (aIID.Equals(kIRunaroundIID)) {
*aInstancePtr = (void*) ((nsIRunaround*) this);
return NS_OK;
}
if (aIID.Equals(kIFloaterContainerIID)) {
*aInstancePtr = (void*) ((nsIFloaterContainer*) this);
return NS_OK;
@@ -1690,11 +1679,9 @@ nsBlockFrame::FirstChild(nsIFrame*& aFirstChild) const
// Reflow methods
NS_IMETHODIMP
nsBlockFrame::ReflowAround(nsIPresContext& aPresContext,
nsISpaceManager* aSpaceManager,
nsBlockFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aMetrics,
const nsReflowState& aReflowState,
nsRect& aDesiredRect,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
@@ -1714,8 +1701,7 @@ nsBlockFrame::ReflowAround(nsIPresContext& aPresContext,
// Replace parent provided reflow state with our own significantly
// more extensive version.
nsBlockReflowState state(aPresContext, aReflowState, aMetrics,
aSpaceManager);
nsBlockReflowState state(aPresContext, aReflowState, aMetrics);
// Prepare inline-reflow engine
nsInlineReflow inlineReflow(state.mLineLayout, state, this);
@@ -1781,7 +1767,7 @@ nsBlockFrame::ReflowAround(nsIPresContext& aPresContext,
}
// Compute our final size
ComputeFinalSize(state, aMetrics, aDesiredRect);
ComputeFinalSize(state, aMetrics);
#ifdef NS_DEBUG
if (GetVerifyTreeEnable()) {
@@ -1853,17 +1839,13 @@ nsBlockFrame::RenumberLists(nsBlockReflowState& aState)
void
nsBlockFrame::ComputeFinalSize(nsBlockReflowState& aState,
nsHTMLReflowMetrics& aMetrics,
nsRect& aDesiredRect)
nsHTMLReflowMetrics& aMetrics)
{
aDesiredRect.x = 0;
aDesiredRect.y = 0;
// Compute final width
PRIntn ss = aState.mStyleSizeFlags;
if (NS_SIZE_HAS_WIDTH & ss) {
// Use style defined width
aDesiredRect.width = aState.mBorderPadding.left +
aMetrics.width = aState.mBorderPadding.left +
aState.mStyleSize.width + aState.mBorderPadding.right;
}
else {
@@ -1877,13 +1859,13 @@ nsBlockFrame::ComputeFinalSize(nsBlockReflowState& aState,
contentWidth = aState.maxSize.width;
}
}
aDesiredRect.width = contentWidth;
aMetrics.width = contentWidth;
}
// Compute final height
if (NS_SIZE_HAS_HEIGHT & ss) {
// Use style defined height
aDesiredRect.height = aState.mBorderPadding.top +
aMetrics.height = aState.mBorderPadding.top +
aState.mStyleSize.height + aState.mBorderPadding.bottom;
}
else {
@@ -1895,7 +1877,7 @@ nsBlockFrame::ComputeFinalSize(nsBlockReflowState& aState,
else {
aMetrics.mCarriedOutBottomMargin = aState.mRunningMargin;
}
aDesiredRect.height = aState.mY;
aMetrics.height = aState.mY;
}
// Special check for zero sized content: If our content is zero
@@ -1903,14 +1885,12 @@ nsBlockFrame::ComputeFinalSize(nsBlockReflowState& aState,
if ((NS_SIZE_HAS_BOTH != ss) &&
((0 == aState.mKidXMost - aState.mBorderPadding.left) ||
(0 == aState.mY - aState.mBorderPadding.top))) {
aDesiredRect.width = 0;
aDesiredRect.height = 0;
aMetrics.width = 0;
aMetrics.height = 0;
aMetrics.mCarriedOutBottomMargin = 0;
}
aMetrics.width = aDesiredRect.width;
aMetrics.height = aDesiredRect.height;
aMetrics.ascent = aDesiredRect.height;
aMetrics.ascent = aMetrics.height;
aMetrics.descent = 0;
// XXX this needs reworking I suppose
@@ -2723,12 +2703,15 @@ done:;
// XXX inline frames need this too when they wrap up blocks, right??
// Otherwise blocks in inlines won't interact with floaters properly.
void
nsBlockFrame::PrepareInlineReflow(nsBlockReflowState& aState, nsIFrame* aFrame)
nsBlockFrame::PrepareInlineReflow(nsBlockReflowState& aState,
nsIFrame* aFrame,
PRBool aIsBlock)
{
// Setup initial coordinate system for reflowing the frame into
nscoord x, availWidth, availHeight;
nsIRunaround* runAround;
if (NS_OK == aFrame->QueryInterface(kIRunaroundIID, (void**)&runAround)) {
// XXX KIPP I'm not sure what you want to do here...
if (aIsBlock) {
// XXX Child needs to apply OUR border-padding and IT's left
// margin and right margin! How should this be done?
x = aState.mBorderPadding.left;
@@ -2776,7 +2759,7 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState,
nsInlineReflow& ir = *aState.mInlineReflow;
// Prepare the inline reflow engine
PrepareInlineReflow(aState, aFrame);
PrepareInlineReflow(aState, aFrame, PR_TRUE);
ir.SetIsFirstChild((aLine == mLines) &&
(aFrame == aLine->mFirstChild));
@@ -2913,7 +2896,7 @@ nsBlockFrame::ReflowInlineFrame(nsBlockReflowState& aState,
nsIFrame* nextInFlow;
if (!aState.mInlineReflowPrepared) {
PrepareInlineReflow(aState, aFrame);
PrepareInlineReflow(aState, aFrame, PR_FALSE);
}
PRBool isFirstChild = (aLine == mLines) &&
@@ -3190,7 +3173,7 @@ nsBlockFrame::PlaceLine(nsBlockReflowState& aState,
nsSize availSize;
availSize.width = NS_UNCONSTRAINEDSIZE;
availSize.height = NS_UNCONSTRAINEDSIZE;
nsReflowState reflowState(mBullet, aState, availSize);
nsHTMLReflowState reflowState(mBullet, aState, availSize);
nsHTMLReflowMetrics metrics(nsnull);
nsIInlineReflow* iir;
if (NS_OK == mBullet->QueryInterface(kIInlineReflowIID, (void**) &iir)) {
@@ -3682,7 +3665,7 @@ nsBlockFrame::ReflowFloater(nsIPresContext& aPresContext,
// it's maxSize will be 0,0 until we compute it (we need the reflowState
// for nsLayout::GetStyleSize so we have to do this first)
nsSize kidAvailSize(0, 0);
nsReflowState reflowState(aFloaterFrame, aState, kidAvailSize,
nsHTMLReflowState reflowState(aFloaterFrame, aState, kidAvailSize,
eReflowReason_Initial);
// Compute the available space for the floater. Use the default
@@ -3737,7 +3720,7 @@ nsBlockFrame::ReflowFloater(nsIPresContext& aPresContext,
PRBool
nsBlockFrame::AddFloater(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsIFrame* aFloater,
nsPlaceholderFrame* aPlaceholder)
{

View File

@@ -25,7 +25,6 @@
#include "nsIPresShell.h"
#include "nsIViewManager.h"
#include "nsIDeviceContext.h"
#include "nsIRunaround.h"
#include "nsSpaceManager.h"
#include "nsHTMLAtoms.h"
#include "nsIView.h"
@@ -115,11 +114,12 @@ nsBodyFrame::Init(nsIPresContext& aPresContext, nsIFrame* aChildList)
NS_IMETHODIMP
nsBodyFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
const nsReflowState* rsp = &aReflowState;
nsReflowState resizeReflowState(aReflowState);
const nsHTMLReflowState* rsp = &aReflowState;
nsHTMLReflowState resizeReflowState(aReflowState);
resizeReflowState.spaceManager = mSpaceManager;
NS_FRAME_TRACE_REFLOW_IN("nsBodyFrame::Reflow");
@@ -185,7 +185,8 @@ nsBodyFrame::Reflow(nsIPresContext& aPresContext,
// compute the available space and compute the origin...
nsIHTMLReflow* reflow;
if (NS_OK == nextFrame->QueryInterface(kIHTMLReflowIID, (void**)&reflow)) {
nsReflowState reflowState(nextFrame, aReflowState, aReflowState.maxSize);
nsHTMLReflowState reflowState(nextFrame, aReflowState, aReflowState.maxSize);
reflowState.spaceManager = mSpaceManager;
reflow->WillReflow(aPresContext);
nsresult rv = reflow->Reflow(aPresContext, aDesiredSize, reflowState, aStatus);
if (NS_OK != rv) {
@@ -247,18 +248,15 @@ nsBodyFrame::Reflow(nsIPresContext& aPresContext,
nsRect kidOldRect;
mFirstChild->GetRect(kidOldRect);
// Get the column's desired rect
nsIRunaround* reflowRunaround;
nsReflowState reflowState(mFirstChild, *rsp, kidMaxSize);
nsRect desiredRect;
nsIHTMLReflow* childReflow;
// Get the column's desired size
nsHTMLReflowState reflowState(mFirstChild, *rsp, kidMaxSize);
reflowState.spaceManager = mSpaceManager;
nsIHTMLReflow* htmlReflow;
if (NS_OK == mFirstChild->QueryInterface(kIHTMLReflowIID, (void**)&childReflow)) {
childReflow->WillReflow(aPresContext);
if (NS_OK == mFirstChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
htmlReflow->WillReflow(aPresContext);
mFirstChild->MoveTo(borderPadding.left, borderPadding.top);
mFirstChild->QueryInterface(kIRunaroundIID, (void**)&reflowRunaround);
reflowRunaround->ReflowAround(aPresContext, mSpaceManager, aDesiredSize,
reflowState, desiredRect, aStatus);
htmlReflow->Reflow(aPresContext, aDesiredSize, reflowState, aStatus);
}
// If the frame is complete, then check whether there's a next-in-flow that
@@ -279,8 +277,8 @@ nsBodyFrame::Reflow(nsIPresContext& aPresContext,
mSpaceManager->Translate(-borderPadding.left, -borderPadding.top);
// Place and size the frame
desiredRect.x += borderPadding.left;
desiredRect.y += borderPadding.top;
nsRect desiredRect(borderPadding.left, borderPadding.top,
aDesiredSize.width, aDesiredSize.height);
mFirstChild->SetRect(desiredRect);
// Reflow any absolutely positioned frames that need reflowing
@@ -498,7 +496,7 @@ nsBodyFrame::GetColumnAvailSpace(nsIPresContext& aPresContext,
void
nsBodyFrame::ComputeDesiredSize(nsIPresContext& aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
const nsRect& aDesiredRect,
const nsSize& aMaxSize,
const nsMargin& aBorderPadding,
@@ -671,7 +669,7 @@ NS_METHOD nsBodyFrame::RemoveAbsoluteItem(nsAbsoluteFrame* aAnchorFrame)
// Called at the end of the Reflow() member function so we can process
// any abolutely positioned items that need to be reflowed
void nsBodyFrame::ReflowAbsoluteItems(nsIPresContext* aPresContext,
const nsReflowState& aReflowState)
const nsHTMLReflowState& aReflowState)
{
for (PRInt32 i = 0; i < mAbsoluteItems.Count(); i++) {
// Get the anchor frame and its absolutely positioned frame
@@ -753,7 +751,7 @@ void nsBodyFrame::ReflowAbsoluteItems(nsIPresContext* aPresContext,
}
nsHTMLReflowMetrics desiredSize(nsnull);
nsReflowState reflowState(absoluteFrame, aReflowState, availSize,
nsHTMLReflowState reflowState(absoluteFrame, aReflowState, availSize,
reflowReason);
nsReflowStatus status;
htmlReflow->Reflow(*aPresContext, desiredSize, reflowState, status);
@@ -870,7 +868,7 @@ void nsBodyFrame::TranslatePoint(nsIFrame* aFrameFrom, nsPoint& aPoint) const
}
void nsBodyFrame::ComputeAbsoluteFrameBounds(nsIFrame* aAnchorFrame,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
const nsStylePosition* aPosition,
nsRect& aRect) const
{

View File

@@ -42,7 +42,7 @@ public:
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD CreateContinuingFrame(nsIPresContext& aPresContext,
@@ -85,7 +85,7 @@ protected:
~nsBodyFrame();
void ComputeDesiredSize(nsIPresContext& aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
const nsRect& aDesiredRect,
const nsSize& aMaxSize,
const nsMargin& aBorderPadding,
@@ -94,7 +94,7 @@ protected:
virtual PRIntn GetSkipSides() const;
void ReflowAbsoluteItems(nsIPresContext* aPresContext,
const nsReflowState& aReflowState);
const nsHTMLReflowState& aReflowState);
nsIView* CreateAbsoluteView(const nsStylePosition* aPosition,
const nsStyleDisplay* aDisplay) const;
@@ -102,7 +102,7 @@ protected:
void TranslatePoint(nsIFrame* aFrameFrom, nsPoint& aPoint) const;
void ComputeAbsoluteFrameBounds(nsIFrame* aAnchorFrame,
const nsReflowState& aState,
const nsHTMLReflowState& aState,
const nsStylePosition* aPosition,
nsRect& aRect) const;

View File

@@ -19,7 +19,6 @@
#include "nsIContent.h"
#include "nsIPresContext.h"
#include "nsIRenderingContext.h"
#include "nsIRunaround.h"
#include "nsISpaceManager.h"
#include "nsIStyleContext.h"
#include "nsRect.h"
@@ -293,7 +292,7 @@ NS_METHOD nsContainerFrame::GetCursorAndContentAt(nsIPresContext& aPresContext,
nsReflowStatus nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
nsIPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState)
const nsHTMLReflowState& aReflowState)
{
nsReflowStatus status;

View File

@@ -116,7 +116,7 @@ protected:
nsReflowStatus ReflowChild(nsIFrame* aKidFrame,
nsIPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState);
const nsHTMLReflowState& aReflowState);
/**
* Moves any frames on both the prev-in-flow's overflow list and the receiver's

View File

@@ -1147,7 +1147,7 @@ nsFrame::DidReflow(nsIPresContext& aPresContext,
NS_METHOD nsFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
aDesiredSize.width = 0;

View File

@@ -182,7 +182,7 @@ public:
NS_IMETHOD WillReflow(nsIPresContext& aPresContext);
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD DidReflow(nsIPresContext& aPresContext,
nsDidReflowStatus aStatus);

View File

@@ -23,9 +23,9 @@
#include "nsIHTMLReflow.h"
nsFrameReflowState::nsFrameReflowState(nsIPresContext& aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
const nsHTMLReflowMetrics& aMetrics)
: nsReflowState(aReflowState),
: nsHTMLReflowState(aReflowState),
mPresContext(aPresContext)
{
// While we skip around the reflow state that our parent gave us so

View File

@@ -19,7 +19,7 @@
#ifndef nsFrameReflowState_h___
#define nsFrameReflowState_h___
#include "nsIFrameReflow.h"
#include "nsIHTMLReflow.h"
#include "nsMargin.h"
class nsIPresContext;
@@ -28,10 +28,10 @@ struct nsStyleDisplay;
struct nsStyleSpacing;
struct nsStyleText;
class nsFrameReflowState : public nsReflowState {
class nsFrameReflowState : public nsHTMLReflowState {
public:
nsFrameReflowState(nsIPresContext& aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
const nsHTMLReflowMetrics& aMetrics);
~nsFrameReflowState();

View File

@@ -45,7 +45,7 @@ public:
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD Paint(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext,
@@ -55,7 +55,7 @@ protected:
virtual ~HRuleFrame();
virtual void GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredSize);
PRBool GetNoShade();
@@ -208,7 +208,7 @@ HRuleFrame::Paint(nsIPresContext& aPresContext,
NS_IMETHODIMP
HRuleFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
NS_PRECONDITION(mState & NS_FRAME_IN_REFLOW, "frame is not in reflow");
@@ -242,7 +242,7 @@ HRuleFrame::Reflow(nsIPresContext& aPresContext,
void
HRuleFrame::GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredSize)
{
nsSize size;

View File

@@ -44,7 +44,7 @@ public:
NS_IMETHOD Init(nsIPresContext& aPresContext, nsIFrame* aChildList);
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD HandleEvent(nsIPresContext& aPresContext,
nsGUIEvent* aEvent,
@@ -62,7 +62,7 @@ public:
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD Paint(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext,
@@ -120,7 +120,7 @@ RootFrame::Init(nsIPresContext& aPresContext, nsIFrame* aChildList)
NS_IMETHODIMP
RootFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
NS_FRAME_TRACE_REFLOW_IN("RootFrame::Reflow");
@@ -147,7 +147,7 @@ RootFrame::Reflow(nsIPresContext& aPresContext,
// wants
if (nsnull != mFirstChild) {
nsHTMLReflowMetrics desiredSize(nsnull);
nsReflowState kidReflowState(mFirstChild, aReflowState, aReflowState.maxSize);
nsHTMLReflowState kidReflowState(mFirstChild, aReflowState, aReflowState.maxSize);
nsIHTMLReflow* htmlReflow;
if (NS_OK == mFirstChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
@@ -296,7 +296,7 @@ RootContentFrame::ComputeChildMargins(nsMargin& aMargin)
NS_IMETHODIMP
RootContentFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
NS_FRAME_TRACE_REFLOW_IN("RootContentFrame::Reflow");
@@ -362,7 +362,7 @@ RootContentFrame::Reflow(nsIPresContext& aPresContext,
NS_ASSERTION(next == mFirstChild, "unexpected next reflow command frame");
nsSize maxSize(availWidth, NS_UNCONSTRAINEDSIZE);
nsReflowState kidReflowState(next, aReflowState, maxSize);
nsHTMLReflowState kidReflowState(next, aReflowState, maxSize);
nsIHTMLReflow* htmlReflow;
// Dispatch the reflow command to our child frame. Allow it to be as high
@@ -413,7 +413,7 @@ RootContentFrame::Reflow(nsIPresContext& aPresContext,
// Tile the pages vertically
for (nsIFrame* kidFrame = mFirstChild; nsnull != kidFrame; ) {
// Reflow the page
nsReflowState kidReflowState(kidFrame, aReflowState, pageSize,
nsHTMLReflowState kidReflowState(kidFrame, aReflowState, pageSize,
reflowReason);
nsIHTMLReflow* htmlReflow;
nsReflowStatus status;
@@ -474,7 +474,7 @@ RootContentFrame::Reflow(nsIPresContext& aPresContext,
} else {
nsSize maxSize(availWidth, NS_UNCONSTRAINEDSIZE);
nsReflowState kidReflowState(mFirstChild, aReflowState, maxSize,
nsHTMLReflowState kidReflowState(mFirstChild, aReflowState, maxSize,
reflowReason);
nsIHTMLReflow* htmlReflow;

View File

@@ -20,7 +20,6 @@
#include "nsIAbsoluteItems.h"
#include "nsIAnchoredItems.h"
#include "nsIFloaterContainer.h"
#include "nsIRunaround.h"
#include "nsIInlineReflow.h"
#include "nsIHTMLReflow.h"
@@ -29,5 +28,4 @@ const nsIID kIAnchoredItemsIID = NS_IANCHORED_ITEMS_IID;
const nsIID kIFloaterContainerIID = NS_IFLOATER_CONTAINER_IID;
const nsIID kIHTMLContentIID = NS_IHTMLCONTENT_IID;
const nsIID kIInlineReflowIID = NS_IINLINE_REFLOW_IID;
const nsIID kIRunaroundIID = NS_IRUNAROUND_IID;
const nsIID kIHTMLReflowIID = NS_IHTMLREFLOW_IID;

View File

@@ -25,7 +25,7 @@ class nsIFrame;
class nsIFrameImageLoader;
class nsIPresContext;
class nsISizeOfHandler;
struct nsReflowState;
struct nsHTMLReflowState;
struct nsHTMLReflowMetrics;
struct nsSize;
@@ -72,7 +72,7 @@ public:
PRIntn& aLoadStatus);
void GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsIFrame* aTargetFrame,
nsFrameImageLoaderCB aCallBack,
nsHTMLReflowMetrics& aDesiredSize);

View File

@@ -156,7 +156,7 @@ NS_IMETHODIMP nsHTMLReflowCommand::Dispatch(nsIPresContext& aPresContext,
if (nsnull != root) {
mPath.RemoveElementAt(mPath.Count() - 1);
nsReflowState reflowState(root, *this, aMaxSize, &aRendContext);
nsHTMLReflowState reflowState(root, *this, aMaxSize, &aRendContext);
nsIHTMLReflow* htmlReflow;
nsReflowStatus status;

View File

@@ -21,7 +21,7 @@
#include "nsIFrame.h"
class nsPlaceholderFrame;
class nsIPresContext;
struct nsReflowState;
struct nsHTMLReflowState;
// 5a305ee0-cb55-11d1-8556-00a02468fab6
#define NS_IFLOATER_CONTAINER_IID \
@@ -43,7 +43,7 @@ public:
* element.
*/
virtual PRBool AddFloater(nsIPresContext* aPresContext,
const nsReflowState& aPlaceholderReflowState,
const nsHTMLReflowState& aPlaceholderReflowState,
nsIFrame* aFloater,
nsPlaceholderFrame* aPlaceholder) = 0;
};

View File

@@ -19,6 +19,7 @@
#define nsIHTMLReflow_h___
#include "nsIFrameReflow.h"
class nsISpaceManager;
// IID for the nsIHTMLFrame interface
// a6cf9069-15b3-11d2-932e-00805f8add32
@@ -56,7 +57,7 @@ struct nsHTMLReflowMetrics : nsReflowMetrics {
* structure is ignored and you should use the max size value when reflowing
* the frame.
*
* @see nsReflowState
* @see nsHTMLReflowState
*/
//XXX enum's are prefixed wrong
enum nsReflowConstraint {
@@ -66,23 +67,105 @@ enum nsReflowConstraint {
eReflowSize_FixedContent = 3 // size of your content area is fixed
};
#if 0
// XXX None of this is currently being used...
struct nsHTMLReflowState : nsReflowState {
nsISpaceManager* spaceManager;
// XXX None of this is currently being used...
#if 0
nsReflowConstraint widthConstraint; // constraint that applies to width dimension
nsReflowConstraint heightConstraint; // constraint that applies to height dimension
nsSize minSize; // the min available space in which to reflow.
// Only used for eReflowSize_Constrained
};
#endif
// Constructs an initial reflow state (no parent reflow state) for a
// non-incremental reflow command
nsHTMLReflowState(nsIFrame* aFrame,
nsReflowReason aReason,
const nsSize& aMaxSize,
nsIRenderingContext* aContext,
nsISpaceManager* aSpaceManager = nsnull);
// Constructs an initial reflow state (no parent reflow state) for an
// incremental reflow command
nsHTMLReflowState(nsIFrame* aFrame,
nsIReflowCommand& aReflowCommand,
const nsSize& aMaxSize,
nsIRenderingContext* aContext,
nsISpaceManager* aSpaceManager = nsnull);
// Construct a reflow state for the given frame, parent reflow state, and
// max size. Uses the reflow reason and reflow command from the parent's
// reflow state
nsHTMLReflowState(nsIFrame* aFrame,
const nsHTMLReflowState& aParentReflowState,
const nsSize& aMaxSize);
// Constructs a reflow state that overrides the reflow reason of the parent
// reflow state. Sets the reflow command to NULL
nsHTMLReflowState(nsIFrame* aFrame,
const nsHTMLReflowState& aParentReflowState,
const nsSize& aMaxSize,
nsReflowReason aReflowReason);
};
/**
* Generate a reflow interface specific to HTML/CSS frame objects
*/
class nsIHTMLReflow : public nsIFrameReflow<nsReflowState, nsHTMLReflowMetrics>
class nsIHTMLReflow : public nsIFrameReflow<nsHTMLReflowState, nsHTMLReflowMetrics>
{
};
// Constructs an initial reflow state (no parent reflow state) for a
// non-incremental reflow command
inline
nsHTMLReflowState::nsHTMLReflowState(nsIFrame* aFrame,
nsReflowReason aReason,
const nsSize& aMaxSize,
nsIRenderingContext* aContext,
nsISpaceManager* aSpaceManager)
: nsReflowState(aFrame, aReason, aMaxSize, aContext)
{
spaceManager = aSpaceManager;
}
// Constructs an initial reflow state (no parent reflow state) for an
// incremental reflow command
inline
nsHTMLReflowState::nsHTMLReflowState(nsIFrame* aFrame,
nsIReflowCommand& aReflowCommand,
const nsSize& aMaxSize,
nsIRenderingContext* aContext,
nsISpaceManager* aSpaceManager)
: nsReflowState(aFrame, aReflowCommand, aMaxSize, aContext)
{
spaceManager = aSpaceManager;
}
// Construct a reflow state for the given frame, parent reflow state, and
// max size. Uses the reflow reason and reflow command from the parent's
// reflow state
inline
nsHTMLReflowState::nsHTMLReflowState(nsIFrame* aFrame,
const nsHTMLReflowState& aParentReflowState,
const nsSize& aMaxSize)
: nsReflowState(aFrame, aParentReflowState, aMaxSize)
{
spaceManager = aParentReflowState.spaceManager;
}
// Constructs a reflow state that overrides the reflow reason of the parent
// reflow state. Sets the reflow command to NULL
inline
nsHTMLReflowState::nsHTMLReflowState(nsIFrame* aFrame,
const nsHTMLReflowState& aParentReflowState,
const nsSize& aMaxSize,
nsReflowReason aReflowReason)
: nsReflowState(aFrame, aParentReflowState, aMaxSize, aReflowReason)
{
spaceManager = aParentReflowState.spaceManager;
}
#endif /* nsIHTMLReflow_h___ */

View File

@@ -21,7 +21,7 @@
#include "nsISupports.h"
#include "nsStyleConsts.h"
#include "nsIFrameReflow.h"
#include "nsIHTMLReflow.h"
class nsLineLayout;
struct nsHTMLReflowMetrics;
@@ -46,7 +46,7 @@ public:
*/
NS_IMETHOD InlineReflow(nsLineLayout& aLineLayout,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState) = 0;
const nsHTMLReflowState& aReflowState) = 0;
};
/**

View File

@@ -81,7 +81,7 @@ protected:
void SizeOfWithoutThis(nsISizeOfHandler* aHandler) const;
virtual void GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredSize);
nsIImageMap* GetImageMap();
@@ -266,7 +266,7 @@ nsHTMLImageLoader::StartLoadImage(nsIPresContext* aPresContext,
void
nsHTMLImageLoader::GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsIFrame* aTargetFrame,
nsFrameImageLoaderCB aCallBack,
nsHTMLReflowMetrics& aDesiredSize)
@@ -418,7 +418,7 @@ UpdateImageFrame(nsIPresContext& aPresContext, nsIFrame* aFrame,
void
ImageFrame::GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredSize)
{
if (mSizeFrozen) {

View File

@@ -31,7 +31,7 @@
struct nsInlineReflowState : nsFrameReflowState {
nsInlineReflowState(nsIPresContext& aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
const nsHTMLReflowMetrics& aMetrics);
~nsInlineReflowState();
@@ -40,7 +40,7 @@ struct nsInlineReflowState : nsFrameReflowState {
};
nsInlineReflowState::nsInlineReflowState(nsIPresContext& aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
const nsHTMLReflowMetrics& aMetrics)
: nsFrameReflowState(aPresContext, aReflowState, aMetrics)
{
@@ -76,7 +76,7 @@ public:
nsIReflowCommand* aReflowCommand);
NS_IMETHOD InlineReflow(nsLineLayout& aLineLayout,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState);
const nsHTMLReflowState& aReflowState);
virtual PRIntn GetSkipSides() const;
@@ -311,7 +311,7 @@ nsInlineFrame::InsertNewFrame(nsIPresContext& aPresContext,
NS_IMETHODIMP
nsInlineFrame::InlineReflow(nsLineLayout& aLineLayout,
nsHTMLReflowMetrics& aMetrics,
const nsReflowState& aReflowState)
const nsHTMLReflowState& aReflowState)
{
//XXX ListTag(stdout); printf(": enter (runningMargin=%d)\n", aMetrics.mCarriedInTopMargin);
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,

View File

@@ -20,7 +20,6 @@
#include "nsLineLayout.h"
#include "nsIFontMetrics.h"
#include "nsIPresContext.h"
#include "nsIRunaround.h"
#include "nsISpaceManager.h"
#include "nsIStyleContext.h"
@@ -368,7 +367,7 @@ nsInlineReflow::ReflowFrame(nsHTMLReflowMetrics& aMetrics,
}
// Setup reflow state for reflowing the frame
nsReflowState reflowState(mFrame, mOuterReflowState, mFrameAvailSize);
nsHTMLReflowState reflowState(mFrame, mOuterReflowState, mFrameAvailSize);
reflowState.reason = reason;
// Let frame know that are reflowing it
@@ -380,13 +379,11 @@ nsInlineReflow::ReflowFrame(nsHTMLReflowMetrics& aMetrics,
htmlReflow->WillReflow(mPresContext);
mFrame->MoveTo(x, y);
// There are 3 ways to reflow the child frame: using the
// nsIRunaround interface, using the nsIInlineReflow interface or
// using the default Reflow method in nsIFrame. The order of
// precedence is nsIRunaround, nsIInlineReflow, nsIFrame. For all
// three API's we map the reflow status into an
// There are two ways to reflow the child frame: using the
// using the nsIInlineReflow interface or using the default Reflow
// method in nsIHTMLReflow. The order of precedence is nsIInlineReflow
// then nsIHTMLReflow. We map the reflow status into an
// nsInlineReflowStatus.
nsIRunaround* runAround;
nsIInlineReflow* inlineReflow;
aBounds.x = x;
aBounds.y = y;
@@ -402,20 +399,7 @@ nsInlineReflow::ReflowFrame(nsHTMLReflowMetrics& aMetrics,
nscoord ty = y - mOuterReflowState.mBorderPadding.top;
mSpaceManager->Translate(tx, ty);
if ((nsnull != mSpaceManager) &&
(NS_OK == mFrame->QueryInterface(kIRunaroundIID, (void**)&runAround))) {
nsRect r;
runAround->ReflowAround(mPresContext, mSpaceManager,
aMetrics, reflowState, r, aStatus);
aBounds.width = r.width;
aBounds.height = r.height;
aMetrics.width = r.width;
aMetrics.height = r.height;
aMetrics.ascent = r.height;
aMetrics.descent = 0;
}
else if (NS_OK == mFrame->QueryInterface(kIInlineReflowIID,
(void**)&inlineReflow)) {
if (NS_OK == mFrame->QueryInterface(kIInlineReflowIID, (void**)&inlineReflow)) {
aStatus = inlineReflow->InlineReflow(mLineLayout, aMetrics, reflowState);
mIsInlineAware = PR_TRUE;
aBounds.width = aMetrics.width;

View File

@@ -57,7 +57,7 @@ NS_METHOD nsLeafFrame::Paint(nsIPresContext& aPresContext,
NS_METHOD nsLeafFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
NS_PRECONDITION(mState & NS_FRAME_IN_REFLOW, "frame is not in reflow");

View File

@@ -35,7 +35,7 @@ public:
const nsRect& aDirtyRect);
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD ContentChanged(nsIPresContext* aPresContext,
nsIContent* aChild,
@@ -52,7 +52,7 @@ protected:
* and the descent will be set to zero.
*/
virtual void GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredSize) = 0;
/**

View File

@@ -146,7 +146,7 @@ public:
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD DidReflow(nsIPresContext& aPresContext,
nsDidReflowStatus aStatus);
@@ -163,7 +163,7 @@ protected:
virtual ~nsObjectFrame();
virtual void GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredSize);
@@ -297,7 +297,7 @@ exit:
void
nsObjectFrame::GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aMetrics)
{
// Determine our size stylistically
@@ -340,7 +340,7 @@ nsObjectFrame::GetDesiredSize(nsIPresContext* aPresContext,
NS_IMETHODIMP
nsObjectFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aMetrics,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
// Get our desired size

View File

@@ -66,7 +66,7 @@ void nsPageFrame::CreateFirstChild(nsIPresContext* aPresContext)
NS_METHOD nsPageFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
aStatus = NS_FRAME_COMPLETE; // initialize out parameter
@@ -90,7 +90,7 @@ NS_METHOD nsPageFrame::Reflow(nsIPresContext& aPresContext,
// Dispatch the reflow command to our content child. Allow it to be as high
// as it wants
nsSize maxSize(aReflowState.maxSize.width, NS_UNCONSTRAINEDSIZE);
nsReflowState kidReflowState(mFirstChild, aReflowState, maxSize);
nsHTMLReflowState kidReflowState(mFirstChild, aReflowState, maxSize);
aStatus = ReflowChild(mFirstChild, &aPresContext, aDesiredSize, kidReflowState);
@@ -126,7 +126,7 @@ NS_METHOD nsPageFrame::Reflow(nsIPresContext& aPresContext,
// Resize our frame allowing it only to be as big as we are
// XXX Pay attention to the page's border and padding...
if (nsnull != mFirstChild) {
nsReflowState kidReflowState(mFirstChild, aReflowState, aReflowState.maxSize);
nsHTMLReflowState kidReflowState(mFirstChild, aReflowState, aReflowState.maxSize);
nsIHTMLReflow* htmlReflow;
if (NS_OK == mFirstChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {

View File

@@ -27,7 +27,7 @@ public:
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aMaxSize,
const nsHTMLReflowState& aMaxSize,
nsReflowStatus& aStatus);
NS_IMETHOD CreateContinuingFrame(nsIPresContext& aCX,

View File

@@ -82,7 +82,7 @@ nsPlaceholderFrame::FindTextRuns(nsLineLayout& aLineLayout,
NS_IMETHODIMP
nsPlaceholderFrame::InlineReflow(nsLineLayout& aLineLayout,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState)
const nsHTMLReflowState& aReflowState)
{
nsIPresContext& presContext = aLineLayout.mPresContext;

View File

@@ -45,7 +45,7 @@ public:
nsIReflowCommand* aReflowCommand);
NS_IMETHOD InlineReflow(nsLineLayout& aLineLayout,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState);
const nsHTMLReflowState& aReflowState);
NS_IMETHOD Paint(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect);

View File

@@ -506,7 +506,7 @@ PresShell::InitialReflow(nscoord aWidth, nscoord aHeight)
CreateRenderingContext(mRootFrame, rcx);
nsReflowState reflowState(mRootFrame, eReflowReason_Initial, maxSize, rcx);
nsHTMLReflowState reflowState(mRootFrame, eReflowReason_Initial, maxSize, rcx);
if (NS_OK == mRootFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
htmlReflow->Reflow(*mPresContext, desiredSize, reflowState, status);
@@ -557,7 +557,7 @@ PresShell::ResizeReflow(nscoord aWidth, nscoord aHeight)
CreateRenderingContext(mRootFrame, rcx);
nsReflowState reflowState(mRootFrame, eReflowReason_Resize, maxSize, rcx);
nsHTMLReflowState reflowState(mRootFrame, eReflowReason_Resize, maxSize, rcx);
if (NS_OK == mRootFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
htmlReflow->Reflow(*mPresContext, desiredSize, reflowState, status);

View File

@@ -37,7 +37,7 @@ public:
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD Paint(nsIPresContext& aPresContext,
@@ -92,7 +92,7 @@ nsScrollBodyFrame::CreateFirstChild(nsIPresContext* aPresContext)
NS_IMETHODIMP
nsScrollBodyFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
nsHTMLContainerFrame::CreateViewForFrame(aPresContext, this,
@@ -121,7 +121,7 @@ nsScrollBodyFrame::Reflow(nsIPresContext& aPresContext,
NS_ASSERTION(next == mFirstChild, "unexpected next reflow command frame");
nsSize maxSize(aReflowState.maxSize.width, NS_UNCONSTRAINEDSIZE);
nsReflowState kidReflowState(next, aReflowState, maxSize);
nsHTMLReflowState kidReflowState(next, aReflowState, maxSize);
nsIHTMLReflow* htmlReflow;
if (NS_OK == mFirstChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
@@ -159,7 +159,7 @@ nsScrollBodyFrame::Reflow(nsIPresContext& aPresContext,
// Tile the pages vertically
for (nsIFrame* kidFrame = mFirstChild; nsnull != kidFrame; ) {
// Reflow the page
nsReflowState kidReflowState(kidFrame, aReflowState, pageSize);
nsHTMLReflowState kidReflowState(kidFrame, aReflowState, pageSize);
nsReflowStatus status;
// Place and size the page. If the page is narrower than our
@@ -224,7 +224,7 @@ nsScrollBodyFrame::Reflow(nsIPresContext& aPresContext,
// Allow the frame to be as wide as our max width, and as high
// as it wants to be.
nsSize maxSize(aReflowState.maxSize.width, NS_UNCONSTRAINEDSIZE);
nsReflowState kidReflowState(mFirstChild, aReflowState, maxSize);
nsHTMLReflowState kidReflowState(mFirstChild, aReflowState, maxSize);
nsIHTMLReflow* htmlReflow;
if (NS_OK == mFirstChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
@@ -309,7 +309,7 @@ public:
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD ListTag(FILE* out = stdout) const;
@@ -325,7 +325,7 @@ nsScrollInnerFrame::nsScrollInnerFrame(nsIContent* aContent, nsIFrame* aParent)
NS_IMETHODIMP
nsScrollInnerFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
NS_FRAME_TRACE_MSG(NS_FRAME_TRACE_CALLS,
@@ -389,7 +389,7 @@ nsScrollInnerFrame::Reflow(nsIPresContext& aPresContext,
// Reflow the child
nsHTMLReflowMetrics kidMetrics(aDesiredSize.maxElementSize);
nsReflowState kidReflowState(mFirstChild, aReflowState, maxSize);
nsHTMLReflowState kidReflowState(mFirstChild, aReflowState, maxSize);
nsIHTMLReflow* htmlReflow;
if (NS_OK == mFirstChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
@@ -447,7 +447,7 @@ public:
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD ListTag(FILE* out = stdout) const;
@@ -465,7 +465,7 @@ nsScrollOuterFrame::nsScrollOuterFrame(nsIContent* aContent, nsIFrame* aParent)
NS_IMETHODIMP
nsScrollOuterFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
NS_FRAME_TRACE_MSG(NS_FRAME_TRACE_CALLS,
@@ -503,7 +503,7 @@ nsScrollOuterFrame::Reflow(nsIPresContext& aPresContext,
}
// Reflow the child and get its desired size
nsReflowState kidReflowState(mFirstChild, aReflowState, maxSize);
nsHTMLReflowState kidReflowState(mFirstChild, aReflowState, maxSize);
nsIHTMLReflow* htmlReflow;
if (NS_OK == mFirstChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {

View File

@@ -45,7 +45,7 @@ public:
nsIReflowCommand* aReflowCommand);
NS_IMETHOD InlineReflow(nsLineLayout& aLineLayout,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState);
const nsHTMLReflowState& aReflowState);
PRUint8 GetType();
@@ -92,7 +92,7 @@ SpacerFrame::QueryInterface(REFNSIID aIID, void** aInstancePtrResult)
NS_IMETHODIMP
SpacerFrame::InlineReflow(nsLineLayout& aLineLayout,
nsHTMLReflowMetrics& aMetrics,
const nsReflowState& aReflowState)
const nsHTMLReflowState& aReflowState)
{
nsresult rv = NS_FRAME_COMPLETE;

View File

@@ -154,7 +154,7 @@ public:
NS_IMETHOD InlineReflow(nsLineLayout& aLineLayout,
nsHTMLReflowMetrics& aMetrics,
const nsReflowState& aReflowState);
const nsHTMLReflowState& aReflowState);
// TextFrame methods
struct SelectionInfo {
@@ -198,13 +198,13 @@ public:
nsInlineReflowStatus ReflowPre(nsLineLayout& aLineLayout,
nsHTMLReflowMetrics& aMetrics,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
const nsStyleFont& aFont,
PRInt32 aStartingOffset);
nsInlineReflowStatus ReflowNormal(nsLineLayout& aLineLayout,
nsHTMLReflowMetrics& aMetrics,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
const nsStyleFont& aFontStyle,
const nsStyleText& aTextStyle,
PRInt32 aStartingOffset);
@@ -1304,7 +1304,7 @@ TextFrame::GetPosition(nsIPresContext& aCX,
NS_IMETHODIMP
TextFrame::InlineReflow(nsLineLayout& aLineLayout,
nsHTMLReflowMetrics& aMetrics,
const nsReflowState& aReflowState)
const nsHTMLReflowState& aReflowState)
{
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
("enter TextFrame::Reflow: aMaxSize=%d,%d",
@@ -1357,7 +1357,7 @@ TextFrame::InlineReflow(nsLineLayout& aLineLayout,
nsInlineReflowStatus
TextFrame::ReflowNormal(nsLineLayout& aLineLayout,
nsHTMLReflowMetrics& aMetrics,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
const nsStyleFont& aFont,
const nsStyleText& aTextStyle,
PRInt32 aStartingOffset)
@@ -1532,7 +1532,7 @@ TextFrame::ReflowNormal(nsLineLayout& aLineLayout,
nsInlineReflowStatus
TextFrame::ReflowPre(nsLineLayout& aLineLayout,
nsHTMLReflowMetrics& aMetrics,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
const nsStyleFont& aFont,
PRInt32 aStartingOffset)
{

View File

@@ -114,7 +114,7 @@ public:
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD VerifyTree() const;
nscoord GetBorderWidth(nsIPresContext& aPresContext);
@@ -123,7 +123,7 @@ public:
protected:
virtual ~nsHTMLFrameOuterFrame();
virtual void GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredSize);
virtual PRIntn GetSkipSides() const;
PRBool *mIsInline;
@@ -152,7 +152,7 @@ public:
*/
NS_IMETHOD Reflow(nsIPresContext& aCX,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD MoveTo(nscoord aX, nscoord aY);
@@ -171,7 +171,7 @@ protected:
virtual ~nsHTMLFrameInnerFrame();
virtual void GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredSize);
nsIWebShell* mWebShell;
@@ -223,7 +223,7 @@ nsHTMLFrameOuterFrame::GetSkipSides() const
void
nsHTMLFrameOuterFrame::GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredSize)
{
// <frame> processing does not use this routine, only <iframe>
@@ -287,7 +287,7 @@ NS_IMETHODIMP nsHTMLFrameOuterFrame::ListTag(FILE* out) const
NS_IMETHODIMP
nsHTMLFrameOuterFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
//printf("OuterFrame::Reflow %X (%d,%d) \n", this, aReflowState.maxSize.width, aReflowState.maxSize.height);
@@ -317,7 +317,7 @@ nsHTMLFrameOuterFrame::Reflow(nsIPresContext& aPresContext,
// Reflow the child and get its desired size
nsHTMLReflowMetrics kidMetrics(aDesiredSize.maxElementSize);
nsReflowState kidReflowState(mFirstChild, aReflowState, innerSize);
nsHTMLReflowState kidReflowState(mFirstChild, aReflowState, innerSize);
nsIHTMLReflow* htmlReflow;
if (NS_OK == mFirstChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
@@ -693,7 +693,7 @@ nsHTMLFrameInnerFrame::CreateWebShell(nsIPresContext& aPresContext,
NS_IMETHODIMP
nsHTMLFrameInnerFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
//printf("InnerFrame::Reflow %X (%d,%d) \n", this, aReflowState.maxSize.width, aReflowState.maxSize.height);
@@ -757,7 +757,7 @@ nsHTMLFrameInnerFrame::Reflow(nsIPresContext& aPresContext,
void
nsHTMLFrameInnerFrame::GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredSize)
{
// it must be defined, but not called

View File

@@ -75,7 +75,7 @@ public:
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
PRBool GetVisibility() { return mVisibility; }
@@ -87,7 +87,7 @@ protected:
PRInt32 aWidth, PRBool aVertical, PRBool aVisible);
virtual ~nsHTMLFramesetBorderFrame();
virtual void GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredSize);
PRInt32 mWidth;
PRBool mVertical;
@@ -114,14 +114,14 @@ public:
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
protected:
nsHTMLFramesetBlankFrame(nsIContent* aContent, nsIFrame* aParentFrame);
virtual ~nsHTMLFramesetBlankFrame();
virtual void GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredSize);
friend class nsHTMLFramesetFrame;
friend class nsHTMLFrameset;
@@ -361,7 +361,7 @@ nsHTMLFramesetFrame::GetSkipSides() const
void
nsHTMLFramesetFrame::GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredSize)
{
nsHTMLFramesetFrame* framesetParent = GetFramesetParent(this);
@@ -607,7 +607,7 @@ nsHTMLFramesetFrame::ParseRowColSpec(nsString& aSpec, PRInt32 aMaxNumValues,
void
nsHTMLFramesetFrame::ReflowPlaceChild(nsIFrame* aChild,
nsIPresContext& aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsPoint& aOffset,
nsSize& aSize,
nsFramesetDrag* aDrag,
@@ -670,7 +670,7 @@ nsHTMLFramesetFrame::ReflowPlaceChild(nsIFrame* aChild,
}
}
nsReflowState reflowState(aChild, aReflowState, aSize);
nsHTMLReflowState reflowState(aChild, aReflowState, aSize);
nsIHTMLReflow* htmlReflow;
if (NS_OK == aChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
@@ -822,7 +822,7 @@ nscolor nsHTMLFramesetFrame::GetBorderColor(nsIContent* aContent)
NS_IMETHODIMP
nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
//printf("FramesetFrame::Reflow %X (%d,%d) \n", this, aReflowState.maxSize.width, aReflowState.maxSize.height);
@@ -837,7 +837,7 @@ NS_IMETHODIMP
nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
nsFramesetDrag* aDrag,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
//printf("FramesetFrame2::Reflow %X (%d,%d) \n", this, aReflowState.maxSize.width, aReflowState.maxSize.height);
@@ -1401,7 +1401,7 @@ nsHTMLFramesetFrame::MouseDrag(nsIPresContext& aPresContext, nsGUIEvent* aEvent)
shell = aPresContext.GetShell();
shell->CreateRenderingContext(this, acx);
NS_RELEASE(shell);
nsReflowState state(this, eReflowReason_Initial, size, acx);
nsHTMLReflowState state(this, eReflowReason_Initial, size, acx);
state.reason = eReflowReason_Incremental;
nsReflowStatus status;
nsDidReflowStatus didStatus;
@@ -1463,7 +1463,7 @@ printf("nsHTMLFramesetBorderFrame destructor %X \n", this);
}
void nsHTMLFramesetBorderFrame::GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredSize)
{
aDesiredSize.width = aReflowState.maxSize.width;
@@ -1486,7 +1486,7 @@ void nsHTMLFramesetBorderFrame::SetColor(nscolor aColor)
NS_IMETHODIMP
nsHTMLFramesetBorderFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
//printf("BorderFrame::Reflow %X (%d,%d) \n", this, aReflowState.maxSize.width, aReflowState.maxSize.height);
@@ -1632,7 +1632,7 @@ nsHTMLFramesetBlankFrame::~nsHTMLFramesetBlankFrame()
}
void nsHTMLFramesetBlankFrame::GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredSize)
{
aDesiredSize.width = aReflowState.maxSize.width;
@@ -1644,7 +1644,7 @@ void nsHTMLFramesetBlankFrame::GetDesiredSize(nsIPresContext* aPresContext,
NS_IMETHODIMP
nsHTMLFramesetBlankFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
GetDesiredSize(&aPresContext, aReflowState, aDesiredSize);

View File

@@ -27,7 +27,7 @@ class nsIFrame;
class nsIPresContext;
class nsIRenderingContext;
struct nsRect;
struct nsReflowState;
struct nsHTMLReflowState;
struct nsSize;
class nsIAtom;
class nsIWebShell;
@@ -118,13 +118,13 @@ public:
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsFramesetDrag* aDrag,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD VerifyTree() const;
@@ -142,7 +142,7 @@ protected:
nsFramesetSpec* aSpecs, nscoord* aValues);
virtual void GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredSize);
PRInt32 GetBorderWidth(nsIPresContext* aPresContext);
@@ -166,7 +166,7 @@ protected:
void ReflowPlaceChild(nsIFrame* aChild,
nsIPresContext& aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsPoint& aOffset,
nsSize& aSize,
nsFramesetDrag* aDrag = 0,

View File

@@ -273,7 +273,7 @@ nsButtonControlFrame::MouseClicked(nsIPresContext* aPresContext)
NS_METHOD
nsButtonControlFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
PRInt32 type;
@@ -297,7 +297,7 @@ nsButtonControlFrame::Reflow(nsIPresContext& aPresContext,
void
nsButtonControlFrame::GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredLayoutSize,
nsSize& aDesiredWidgetSize)
{

View File

@@ -33,7 +33,7 @@ public:
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
virtual void PostCreateWidget(nsIPresContext* aPresContext);
@@ -64,7 +64,7 @@ protected:
virtual ~nsButtonControlFrame();
virtual void GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredLayoutSize,
nsSize& aDesiredWidgetSize);

View File

@@ -59,7 +59,7 @@ public:
protected:
virtual ~nsCheckboxControlFrame();
virtual void GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredLayoutSize,
nsSize& aDesiredWidgetSize);
};
@@ -101,7 +101,7 @@ nsCheckboxControlFrame::GetCID()
void
nsCheckboxControlFrame::GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredLayoutSize,
nsSize& aDesiredWidgetSize)
{

View File

@@ -185,7 +185,7 @@ void SetType(nsIHTMLContent* aElement, nsString& aValue)
NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
PRInt32 numChildren = LengthOf(mFirstChild);
@@ -225,7 +225,7 @@ NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext& aPresContext,
childFrame = mFirstChild;
nsPoint offset(0,0);
while (nsnull != childFrame) { // reflow, place, size the children
nsReflowState reflowState(childFrame, aReflowState, maxSize);
nsHTMLReflowState reflowState(childFrame, aReflowState, maxSize);
nsIHTMLReflow* htmlReflow;
if (NS_OK == childFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {

View File

@@ -36,7 +36,7 @@ public:
NS_IMETHOD Reflow(nsIPresContext& aCX,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
virtual void MouseClicked(nsIPresContext* aPresContext);

View File

@@ -163,7 +163,7 @@ nsFormControlFrame::Paint(nsIPresContext& aPresContext,
void
nsFormControlFrame::GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredLayoutSize,
nsSize& aDesiredWidgetSize)
{
@@ -182,7 +182,7 @@ nsFormControlFrame::GetDesiredSize(nsIPresContext* aPresContext,
void
nsFormControlFrame::GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredSize)
{
nsSize ignore;
@@ -210,7 +210,7 @@ nsFormControlFrame::DidReflow(nsIPresContext& aPresContext,
NS_METHOD
nsFormControlFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
nsIView* view = nsnull;
@@ -552,7 +552,7 @@ NS_METHOD nsFormControlFrame::HandleEvent(nsIPresContext& aPresContext,
}
void nsFormControlFrame::GetStyleSize(nsIPresContext& aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsSize& aSize)
{
PRIntn ss = nsCSSLayout::GetStyleSize(&aPresContext, aReflowState, aSize);

View File

@@ -120,7 +120,7 @@ public:
*/
NS_IMETHOD Reflow(nsIPresContext& aCX,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
// new behavior
@@ -218,11 +218,11 @@ protected:
* @param aMaxSize the maximum size available for this frame
*/
virtual void GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredSize);
virtual void GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredLayoutSize,
nsSize& aDesiredWidgetSize);
@@ -235,7 +235,7 @@ protected:
* for aSize.width or aSize.height indicate unset values.
*/
void GetStyleSize(nsIPresContext& aContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsSize& aSize);
//nscoord GetStyleDim(nsIPresContext& aPresContext, nscoord aMaxDim,

View File

@@ -114,7 +114,7 @@ nsFormFrame::CanSubmit(nsFormControlFrame& aFrame)
void
nsFormFrame::GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredSize)
{
aDesiredSize.width = 0;
@@ -202,7 +202,7 @@ nsFormFrame::GetEnctype(PRInt32* aEnctype)
NS_IMETHODIMP
nsFormFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
GetDesiredSize(&aPresContext, aReflowState, aDesiredSize);

View File

@@ -26,7 +26,7 @@ class nsString;
class nsIContent;
class nsIFrame;
class nsIPresContext;
struct nsReflowState;
struct nsHTMLReflowState;
class nsFormControlFrame;
class nsRadioControlFrame;
class nsIFormControlFrame;
@@ -39,7 +39,7 @@ public:
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
virtual ~nsFormFrame();
@@ -69,7 +69,7 @@ protected:
NS_IMETHOD_(nsrefcnt) AddRef(void);
NS_IMETHOD_(nsrefcnt) Release(void);
virtual void GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredSize);
void RemoveRadioGroups();
void ProcessAsURLEncoded(PRBool aIsPost, nsString& aData);

View File

@@ -83,7 +83,7 @@ nsRadioControlFrame::GetCID()
void
nsRadioControlFrame::GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredLayoutSize,
nsSize& aDesiredWidgetSize)
{

View File

@@ -52,7 +52,7 @@ protected:
virtual ~nsRadioControlFrame();
virtual void GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredLayoutSize,
nsSize& aDesiredWidgetSize);
PRBool *mInitialChecked;

View File

@@ -94,7 +94,7 @@ protected:
virtual ~nsSelectControlFrame();
virtual void GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredLayoutSize,
nsSize& aDesiredWidgetSize);
@@ -193,7 +193,7 @@ nsSelectControlFrame::GetCID()
void
nsSelectControlFrame::GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredLayoutSize,
nsSize& aDesiredWidgetSize)
{

View File

@@ -169,7 +169,7 @@ nsTextControlFrame::EnterPressed(nsIPresContext& aPresContext)
void
nsTextControlFrame::GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredLayoutSize,
nsSize& aDesiredWidgetSize)
{

View File

@@ -58,7 +58,7 @@ protected:
virtual ~nsTextControlFrame();
virtual void GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredLayoutSize,
nsSize& aDesiredWidgetSize);
};

View File

@@ -20,7 +20,7 @@
#include "nsStyleConsts.h"
#include "nsIContent.h"
#include "nsIFrame.h"
#include "nsIFrameReflow.h"
#include "nsIHTMLReflow.h"
#include "nsIFontMetrics.h"
#include "nsIPresContext.h"
#include "nsRect.h"
@@ -126,7 +126,7 @@ nsCSSLayout::RelativePositionChildren(nsIPresContext* aCX,
// XXX check against other possible values and update
static PRBool
GetStyleDimension(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
const nsStylePosition* aStylePos,
const nsStyleCoord& aCoord,
nscoord& aResult)
@@ -185,7 +185,7 @@ GetStyleDimension(nsIPresContext* aPresContext,
PRIntn
nsCSSLayout::GetStyleSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsSize& aStyleSize)
{
// XXX if display == row || rowspan ignore width

View File

@@ -24,7 +24,7 @@ class nsIPresContext;
struct nsSize;
struct nsStyleFont;
struct nsStyleText;
struct nsReflowState;
struct nsHTMLReflowState;
class nsCSSLayout {
public:
@@ -54,7 +54,7 @@ public:
* stylistically.
*/
static PRIntn GetStyleSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsSize& aStyleSize);
// Return value from GetStyleSize

View File

@@ -170,7 +170,7 @@ PRBool BasicTableLayoutStrategy::Initialize(nsSize* aMaxElementSize)
}
PRBool BasicTableLayoutStrategy::BalanceColumnWidths(nsIStyleContext *aTableStyle,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nscoord aMaxWidth)
{
#ifdef NS_DEBUG
@@ -805,7 +805,7 @@ void BasicTableLayoutStrategy::DistributeFixedSpace(nsVoidArray *aColSpanList)
aMaxWidth is the space the parent gave us (minus border & padding) to fit ourselves into
aTableIsAutoWidth is true if the table is auto-width, false if it is anything else (percent, fixed, etc)
*/
PRBool BasicTableLayoutStrategy::BalanceProportionalColumns(const nsReflowState& aReflowState,
PRBool BasicTableLayoutStrategy::BalanceProportionalColumns(const nsHTMLReflowState& aReflowState,
nscoord aAvailWidth,
nscoord aMaxWidth,
nscoord aTableSpecifiedWidth,
@@ -918,7 +918,7 @@ PRBool BasicTableLayoutStrategy::SetColumnsToMinWidth()
/* the table fits in the given space. Set all columns to their desired width,
* and if we are not an auto-width table add extra space to fluff out the total width
*/
PRBool BasicTableLayoutStrategy::BalanceColumnsTableFits(const nsReflowState& aReflowState,
PRBool BasicTableLayoutStrategy::BalanceColumnsTableFits(const nsHTMLReflowState& aReflowState,
nscoord aAvailWidth,
nscoord aMaxWidth,
nscoord aTableSpecifiedWidth,
@@ -1641,7 +1641,7 @@ void BasicTableLayoutStrategy::DistributeExcessSpace(nscoord aAvailWidth,
/* assign columns widths for a table whose max size doesn't fit in the available space
*/
PRBool BasicTableLayoutStrategy::BalanceColumnsConstrained( const nsReflowState& aReflowState,
PRBool BasicTableLayoutStrategy::BalanceColumnsConstrained( const nsHTMLReflowState& aReflowState,
nscoord aAvailWidth,
nscoord aMaxWidth,
PRBool aTableIsAutoWidth)

View File

@@ -92,7 +92,7 @@ public:
* @param aMaxWidth - the computed max width for columns to fit into
*/
virtual PRBool BalanceColumnWidths(nsIStyleContext * aTableStyle,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nscoord aMaxWidth);
// these accessors are mostly for debugging purposes
@@ -131,7 +131,7 @@ protected:
* @return PR_TRUE if all is well, PR_FALSE if there was an unrecoverable error
*
*/
virtual PRBool BalanceProportionalColumns(const nsReflowState& aReflowState,
virtual PRBool BalanceProportionalColumns(const nsHTMLReflowState& aReflowState,
nscoord aAvailWidth,
nscoord aMaxWidth,
nscoord aTableSpecifiedWidth,
@@ -158,7 +158,7 @@ protected:
*
* @return PR_TRUE if all is well, PR_FALSE if there was an unrecoverable error
*/
virtual PRBool BalanceColumnsTableFits(const nsReflowState& aReflowState,
virtual PRBool BalanceColumnsTableFits(const nsHTMLReflowState& aReflowState,
nscoord aAvailWidth,
nscoord aMaxWidth,
nscoord aTableSpecifiedWidth,
@@ -179,7 +179,7 @@ protected:
*
* TODO: rename this method to reflect that it is a Nav4 compatibility method
*/
virtual PRBool BalanceColumnsConstrained(const nsReflowState& aReflowState,
virtual PRBool BalanceColumnsConstrained(const nsHTMLReflowState& aReflowState,
nscoord aAvailWidth,
nscoord aMaxWidth,
PRBool aTableIsAutoWidth);

View File

@@ -45,7 +45,7 @@ FixedTableLayoutStrategy::~FixedTableLayoutStrategy()
}
PRBool FixedTableLayoutStrategy::BalanceColumnWidths(nsIStyleContext *aTableStyle,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nscoord aMaxWidth)
{
#ifdef NS_DEBUG

View File

@@ -58,7 +58,7 @@ public:
* @param aMaxWidth - the computed max width for columns to fit into
*/
virtual PRBool BalanceColumnWidths(nsIStyleContext * aTableStyle,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nscoord aMaxWidth);
protected:

View File

@@ -23,7 +23,7 @@
#include "nsSize.h"
class nsIStyleContext;
struct nsReflowState;
struct nsHTMLReflowState;
class nsITableLayoutStrategy
{
@@ -42,7 +42,7 @@ public:
*/
virtual PRBool BalanceColumnWidths(nsIStyleContext *aTableStyle,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nscoord aMaxWidth)=0;
/** return the computed max "natural" size of the table.

View File

@@ -249,7 +249,7 @@ PRInt32 nsTableCellFrame::GetColSpan()
*/
NS_METHOD nsTableCellFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
#ifdef NS_DEBUG
@@ -325,7 +325,7 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics kidSize(pMaxElementSize);
kidSize.width=kidSize.height=kidSize.ascent=kidSize.descent=0;
SetPriorAvailWidth(aReflowState.maxSize.width);
nsReflowState kidReflowState(mFirstChild, aReflowState, availSize);
nsHTMLReflowState kidReflowState(mFirstChild, aReflowState, availSize);
nsIHTMLReflow* htmlReflow;
if (NS_OK == mFirstChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {

View File

@@ -66,7 +66,7 @@ public:
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
/**

View File

@@ -62,7 +62,7 @@ NS_METHOD nsTableColFrame::Paint(nsIPresContext& aPresContext,
NS_METHOD nsTableColFrame::Reflow(nsIPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
NS_ASSERTION(nsnull!=aPresContext, "bad arg");

View File

@@ -49,7 +49,7 @@ public:
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
/** return the index of the column the col represents. always >= 0 */

Some files were not shown because too many files have changed in this diff Show More