зеркало из https://github.com/mozilla/pjs.git
Eliminated nsIRunaround interface, and folded space manager parameter into
nsHTMLReflowState structure
This commit is contained in:
Родитель
ab5f4b2393
Коммит
f095846367
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -31,7 +31,6 @@ EXPORTS = \
|
|||
nsIPresContext.h \
|
||||
nsIPresShell.h \
|
||||
nsIReflowCommand.h \
|
||||
nsIRunaround.h \
|
||||
nsISelection.h \
|
||||
nsISpaceManager.h \
|
||||
nsStyleCoord.h \
|
||||
|
|
|
@ -29,7 +29,6 @@ EXPORTS = \
|
|||
nsIPresContext.h \
|
||||
nsIPresShell.h \
|
||||
nsIReflowCommand.h \
|
||||
nsIRunaround.h \
|
||||
nsISelection.h \
|
||||
nsISpaceManager.h \
|
||||
nsStyleCoord.h \
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -183,10 +183,10 @@ void SetType(nsIHTMLContent* aElement, nsString& aValue)
|
|||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
PRInt32 numChildren = LengthOf(mFirstChild);
|
||||
|
||||
|
@ -225,8 +225,8 @@ 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);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
nsHTMLReflowState reflowState(childFrame, aReflowState, maxSize);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == childFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
|
|
|
@ -34,10 +34,10 @@ public:
|
|||
|
||||
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
||||
|
||||
NS_IMETHOD Reflow(nsIPresContext& aCX,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
NS_IMETHOD Reflow(nsIPresContext& aCX,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
virtual void MouseClicked(nsIPresContext* aPresContext);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -169,7 +169,7 @@ nsTextControlFrame::EnterPressed(nsIPresContext& aPresContext)
|
|||
|
||||
void
|
||||
nsTextControlFrame::GetDesiredSize(nsIPresContext* aPresContext,
|
||||
const nsReflowState& aReflowState,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsHTMLReflowMetrics& aDesiredLayoutSize,
|
||||
nsSize& aDesiredWidgetSize)
|
||||
{
|
||||
|
|
|
@ -58,7 +58,7 @@ protected:
|
|||
virtual ~nsTextControlFrame();
|
||||
|
||||
virtual void GetDesiredSize(nsIPresContext* aPresContext,
|
||||
const nsReflowState& aReflowState,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsHTMLReflowMetrics& aDesiredLayoutSize,
|
||||
nsSize& aDesiredWidgetSize);
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,19 +245,17 @@ public:
|
|||
NS_IMETHOD ListTag(FILE* out) const;
|
||||
NS_IMETHOD VerifyTree() const;
|
||||
|
||||
// nsIRunaround
|
||||
NS_IMETHOD ReflowAround(nsIPresContext& aPresContext,
|
||||
nsISpaceManager* aSpaceManager,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsRect& aDesiredRect,
|
||||
nsReflowStatus& aStatus);
|
||||
// nsIHTMLReflow
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
// nsIFloaterContainer
|
||||
virtual PRBool AddFloater(nsIPresContext* aPresContext,
|
||||
const nsReflowState& aPlaceholderReflowState,
|
||||
nsIFrame* aFloater,
|
||||
nsPlaceholderFrame* aPlaceholder);
|
||||
virtual PRBool AddFloater(nsIPresContext* aPresContext,
|
||||
const nsHTMLReflowState& aPlaceholderReflowState,
|
||||
nsIFrame* aFloater,
|
||||
nsPlaceholderFrame* aPlaceholder);
|
||||
|
||||
#ifdef DO_SELECTION
|
||||
NS_IMETHOD HandleEvent(nsIPresContext& aPresContext,
|
||||
|
@ -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,12 +1679,10 @@ nsBlockFrame::FirstChild(nsIFrame*& aFirstChild) const
|
|||
// Reflow methods
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::ReflowAround(nsIPresContext& aPresContext,
|
||||
nsISpaceManager* aSpaceManager,
|
||||
nsHTMLReflowMetrics& aMetrics,
|
||||
const nsReflowState& aReflowState,
|
||||
nsRect& aDesiredRect,
|
||||
nsReflowStatus& aStatus)
|
||||
nsBlockFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aMetrics,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
||||
("enter nsBlockFrame::Reflow: maxSize=%d,%d reason=%d",
|
||||
|
@ -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,8 +3665,8 @@ 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,
|
||||
eReflowReason_Initial);
|
||||
nsHTMLReflowState reflowState(aFloaterFrame, aState, kidAvailSize,
|
||||
eReflowReason_Initial);
|
||||
|
||||
// Compute the available space for the floater. Use the default
|
||||
// 'auto' width and height values
|
||||
|
@ -3737,7 +3720,7 @@ nsBlockFrame::ReflowFloater(nsIPresContext& aPresContext,
|
|||
|
||||
PRBool
|
||||
nsBlockFrame::AddFloater(nsIPresContext* aPresContext,
|
||||
const nsReflowState& aReflowState,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsIFrame* aFloater,
|
||||
nsPlaceholderFrame* aPlaceholder)
|
||||
{
|
||||
|
|
|
@ -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,19 +245,17 @@ public:
|
|||
NS_IMETHOD ListTag(FILE* out) const;
|
||||
NS_IMETHOD VerifyTree() const;
|
||||
|
||||
// nsIRunaround
|
||||
NS_IMETHOD ReflowAround(nsIPresContext& aPresContext,
|
||||
nsISpaceManager* aSpaceManager,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsRect& aDesiredRect,
|
||||
nsReflowStatus& aStatus);
|
||||
// nsIHTMLReflow
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
// nsIFloaterContainer
|
||||
virtual PRBool AddFloater(nsIPresContext* aPresContext,
|
||||
const nsReflowState& aPlaceholderReflowState,
|
||||
nsIFrame* aFloater,
|
||||
nsPlaceholderFrame* aPlaceholder);
|
||||
virtual PRBool AddFloater(nsIPresContext* aPresContext,
|
||||
const nsHTMLReflowState& aPlaceholderReflowState,
|
||||
nsIFrame* aFloater,
|
||||
nsPlaceholderFrame* aPlaceholder);
|
||||
|
||||
#ifdef DO_SELECTION
|
||||
NS_IMETHOD HandleEvent(nsIPresContext& aPresContext,
|
||||
|
@ -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,12 +1679,10 @@ nsBlockFrame::FirstChild(nsIFrame*& aFirstChild) const
|
|||
// Reflow methods
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::ReflowAround(nsIPresContext& aPresContext,
|
||||
nsISpaceManager* aSpaceManager,
|
||||
nsHTMLReflowMetrics& aMetrics,
|
||||
const nsReflowState& aReflowState,
|
||||
nsRect& aDesiredRect,
|
||||
nsReflowStatus& aStatus)
|
||||
nsBlockFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aMetrics,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
||||
("enter nsBlockFrame::Reflow: maxSize=%d,%d reason=%d",
|
||||
|
@ -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,8 +3665,8 @@ 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,
|
||||
eReflowReason_Initial);
|
||||
nsHTMLReflowState reflowState(aFloaterFrame, aState, kidAvailSize,
|
||||
eReflowReason_Initial);
|
||||
|
||||
// Compute the available space for the floater. Use the default
|
||||
// 'auto' width and height values
|
||||
|
@ -3737,7 +3720,7 @@ nsBlockFrame::ReflowFloater(nsIPresContext& aPresContext,
|
|||
|
||||
PRBool
|
||||
nsBlockFrame::AddFloater(nsIPresContext* aPresContext,
|
||||
const nsReflowState& aReflowState,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsIFrame* aFloater,
|
||||
nsPlaceholderFrame* aPlaceholder)
|
||||
{
|
||||
|
|
|
@ -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,19 +245,17 @@ public:
|
|||
NS_IMETHOD ListTag(FILE* out) const;
|
||||
NS_IMETHOD VerifyTree() const;
|
||||
|
||||
// nsIRunaround
|
||||
NS_IMETHOD ReflowAround(nsIPresContext& aPresContext,
|
||||
nsISpaceManager* aSpaceManager,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsRect& aDesiredRect,
|
||||
nsReflowStatus& aStatus);
|
||||
// nsIHTMLReflow
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
// nsIFloaterContainer
|
||||
virtual PRBool AddFloater(nsIPresContext* aPresContext,
|
||||
const nsReflowState& aPlaceholderReflowState,
|
||||
nsIFrame* aFloater,
|
||||
nsPlaceholderFrame* aPlaceholder);
|
||||
virtual PRBool AddFloater(nsIPresContext* aPresContext,
|
||||
const nsHTMLReflowState& aPlaceholderReflowState,
|
||||
nsIFrame* aFloater,
|
||||
nsPlaceholderFrame* aPlaceholder);
|
||||
|
||||
#ifdef DO_SELECTION
|
||||
NS_IMETHOD HandleEvent(nsIPresContext& aPresContext,
|
||||
|
@ -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,12 +1679,10 @@ nsBlockFrame::FirstChild(nsIFrame*& aFirstChild) const
|
|||
// Reflow methods
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::ReflowAround(nsIPresContext& aPresContext,
|
||||
nsISpaceManager* aSpaceManager,
|
||||
nsHTMLReflowMetrics& aMetrics,
|
||||
const nsReflowState& aReflowState,
|
||||
nsRect& aDesiredRect,
|
||||
nsReflowStatus& aStatus)
|
||||
nsBlockFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aMetrics,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
||||
("enter nsBlockFrame::Reflow: maxSize=%d,%d reason=%d",
|
||||
|
@ -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,8 +3665,8 @@ 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,
|
||||
eReflowReason_Initial);
|
||||
nsHTMLReflowState reflowState(aFloaterFrame, aState, kidAvailSize,
|
||||
eReflowReason_Initial);
|
||||
|
||||
// Compute the available space for the floater. Use the default
|
||||
// 'auto' width and height values
|
||||
|
@ -3737,7 +3720,7 @@ nsBlockFrame::ReflowFloater(nsIPresContext& aPresContext,
|
|||
|
||||
PRBool
|
||||
nsBlockFrame::AddFloater(nsIPresContext* aPresContext,
|
||||
const nsReflowState& aReflowState,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsIFrame* aFloater,
|
||||
nsPlaceholderFrame* aPlaceholder)
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -113,10 +113,10 @@ protected:
|
|||
* Reflow a child frame and return the status of the reflow. If the child
|
||||
* is complete and it has next-in-flows, then delete the next-in-flows.
|
||||
*/
|
||||
nsReflowStatus ReflowChild(nsIFrame* aKidFrame,
|
||||
nsIPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState);
|
||||
nsReflowStatus ReflowChild(nsIFrame* aKidFrame,
|
||||
nsIPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState);
|
||||
|
||||
/**
|
||||
* Moves any frames on both the prev-in-flow's overflow list and the receiver's
|
||||
|
|
|
@ -1145,10 +1145,10 @@ nsFrame::DidReflow(nsIPresContext& aPresContext,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD nsFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
NS_METHOD nsFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
aDesiredSize.width = 0;
|
||||
aDesiredSize.height = 0;
|
||||
|
|
|
@ -180,10 +180,10 @@ public:
|
|||
|
||||
// nsIHTMLReflow
|
||||
NS_IMETHOD WillReflow(nsIPresContext& aPresContext);
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
NS_IMETHOD DidReflow(nsIPresContext& aPresContext,
|
||||
nsDidReflowStatus aStatus);
|
||||
NS_IMETHOD GetReflowMetrics(nsIPresContext& aPresContext,
|
||||
|
|
|
@ -112,10 +112,10 @@ public:
|
|||
nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect);
|
||||
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
NS_IMETHOD VerifyTree() const;
|
||||
nscoord GetBorderWidth(nsIPresContext& aPresContext);
|
||||
PRBool IsInline();
|
||||
|
@ -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;
|
||||
|
@ -150,10 +150,10 @@ public:
|
|||
/**
|
||||
* @see nsIFrame::Reflow
|
||||
*/
|
||||
NS_IMETHOD Reflow(nsIPresContext& aCX,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
NS_IMETHOD Reflow(nsIPresContext& aCX,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
NS_IMETHOD MoveTo(nscoord aX, nscoord aY);
|
||||
NS_IMETHOD SizeTo(nscoord aWidth, nscoord aHeight);
|
||||
|
@ -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>
|
||||
|
@ -285,10 +285,10 @@ NS_IMETHODIMP nsHTMLFrameOuterFrame::ListTag(FILE* out) const
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFrameOuterFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
nsHTMLFrameOuterFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
//printf("OuterFrame::Reflow %X (%d,%d) \n", this, aReflowState.maxSize.width, aReflowState.maxSize.height);
|
||||
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
||||
|
@ -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)) {
|
||||
|
@ -691,10 +691,10 @@ nsHTMLFrameInnerFrame::CreateWebShell(nsIPresContext& aPresContext,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFrameInnerFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
nsHTMLFrameInnerFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
//printf("InnerFrame::Reflow %X (%d,%d) \n", this, aReflowState.maxSize.width, aReflowState.maxSize.height);
|
||||
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
||||
|
@ -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
|
||||
|
|
|
@ -73,10 +73,10 @@ public:
|
|||
nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect);
|
||||
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
PRBool GetVisibility() { return mVisibility; }
|
||||
void SetVisibility(PRBool aVisibility);
|
||||
|
@ -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;
|
||||
|
@ -112,16 +112,16 @@ public:
|
|||
nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect);
|
||||
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
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);
|
||||
|
@ -605,13 +605,13 @@ nsHTMLFramesetFrame::ParseRowColSpec(nsString& aSpec, PRInt32 aMaxNumValues,
|
|||
}
|
||||
|
||||
void
|
||||
nsHTMLFramesetFrame::ReflowPlaceChild(nsIFrame* aChild,
|
||||
nsIPresContext& aPresContext,
|
||||
const nsReflowState& aReflowState,
|
||||
nsPoint& aOffset,
|
||||
nsSize& aSize,
|
||||
nsFramesetDrag* aDrag,
|
||||
nsPoint* aCellIndex)
|
||||
nsHTMLFramesetFrame::ReflowPlaceChild(nsIFrame* aChild,
|
||||
nsIPresContext& aPresContext,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsPoint& aOffset,
|
||||
nsSize& aSize,
|
||||
nsFramesetDrag* aDrag,
|
||||
nsPoint* aCellIndex)
|
||||
{
|
||||
PRBool needFramesetReflow = PR_FALSE;
|
||||
nsFramesetDrag* childDrag = nsnull;
|
||||
|
@ -670,8 +670,8 @@ nsHTMLFramesetFrame::ReflowPlaceChild(nsIFrame* aChild,
|
|||
}
|
||||
}
|
||||
|
||||
nsReflowState reflowState(aChild, aReflowState, aSize);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
nsHTMLReflowState reflowState(aChild, aReflowState, aSize);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == aChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
|
@ -820,10 +820,10 @@ nscolor nsHTMLFramesetFrame::GetBorderColor(nsIContent* aContent)
|
|||
#define BLANK 2
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
//printf("FramesetFrame::Reflow %X (%d,%d) \n", this, aReflowState.maxSize.width, aReflowState.maxSize.height);
|
||||
return Reflow(aPresContext, nsnull, aDesiredSize, aReflowState, aStatus);
|
||||
|
@ -834,11 +834,11 @@ static NS_DEFINE_IID(kViewCID, NS_VIEW_CID);
|
|||
static NS_DEFINE_IID(kIViewIID, NS_IVIEW_IID);
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsFramesetDrag* aDrag,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsFramesetDrag* aDrag,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
//printf("FramesetFrame2::Reflow %X (%d,%d) \n", this, aReflowState.maxSize.width, aReflowState.maxSize.height);
|
||||
// Always get the size so that the caller knows how big we are
|
||||
|
@ -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;
|
||||
|
@ -1484,10 +1484,10 @@ void nsHTMLFramesetBorderFrame::SetColor(nscolor aColor)
|
|||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFramesetBorderFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
nsHTMLFramesetBorderFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
//printf("BorderFrame::Reflow %X (%d,%d) \n", this, aReflowState.maxSize.width, aReflowState.maxSize.height);
|
||||
GetDesiredSize(&aPresContext, aReflowState, aDesiredSize);
|
||||
|
@ -1632,7 +1632,7 @@ nsHTMLFramesetBlankFrame::~nsHTMLFramesetBlankFrame()
|
|||
}
|
||||
|
||||
void nsHTMLFramesetBlankFrame::GetDesiredSize(nsIPresContext* aPresContext,
|
||||
const nsReflowState& aReflowState,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsHTMLReflowMetrics& aDesiredSize)
|
||||
{
|
||||
aDesiredSize.width = aReflowState.maxSize.width;
|
||||
|
@ -1642,10 +1642,10 @@ void nsHTMLFramesetBlankFrame::GetDesiredSize(nsIPresContext* aPresContext,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFramesetBlankFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
nsHTMLFramesetBlankFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
GetDesiredSize(&aPresContext, aReflowState, aDesiredSize);
|
||||
aStatus = NS_FRAME_COMPLETE;
|
||||
|
|
|
@ -27,7 +27,7 @@ class nsIFrame;
|
|||
class nsIPresContext;
|
||||
class nsIRenderingContext;
|
||||
struct nsRect;
|
||||
struct nsReflowState;
|
||||
struct nsHTMLReflowState;
|
||||
struct nsSize;
|
||||
class nsIAtom;
|
||||
class nsIWebShell;
|
||||
|
@ -116,16 +116,16 @@ public:
|
|||
nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect);
|
||||
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsFramesetDrag* aDrag,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsFramesetDrag* aDrag,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
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);
|
||||
|
@ -164,13 +164,13 @@ protected:
|
|||
PRInt32 ParseRowColSpec(nsString& aSpec, PRInt32 aMaxNumValues,
|
||||
nsFramesetSpec* aSpecs);
|
||||
|
||||
void ReflowPlaceChild(nsIFrame* aChild,
|
||||
nsIPresContext& aPresContext,
|
||||
const nsReflowState& aReflowState,
|
||||
nsPoint& aOffset,
|
||||
nsSize& aSize,
|
||||
nsFramesetDrag* aDrag = 0,
|
||||
nsPoint* aCellIndex = 0);
|
||||
void ReflowPlaceChild(nsIFrame* aChild,
|
||||
nsIPresContext& aPresContext,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsPoint& aOffset,
|
||||
nsSize& aSize,
|
||||
nsFramesetDrag* aDrag = 0,
|
||||
nsPoint* aCellIndex = 0);
|
||||
|
||||
PRBool CanResize(PRBool aVertical, PRBool aLeft);
|
||||
PRBool CanChildResize(PRBool aVertical, PRBool aLeft, PRInt32 aChildX, PRBool aFrameset);
|
||||
|
|
|
@ -42,10 +42,10 @@ public:
|
|||
RootFrame(nsIContent* aContent);
|
||||
|
||||
NS_IMETHOD Init(nsIPresContext& aPresContext, nsIFrame* aChildList);
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
NS_IMETHOD HandleEvent(nsIPresContext& aPresContext,
|
||||
nsGUIEvent* aEvent,
|
||||
nsEventStatus& aEventStatus);
|
||||
|
@ -60,10 +60,10 @@ class RootContentFrame : public nsContainerFrame {
|
|||
public:
|
||||
RootContentFrame(nsIContent* aContent, nsIFrame* aParent);
|
||||
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect);
|
||||
|
@ -118,10 +118,10 @@ RootFrame::Init(nsIPresContext& aPresContext, nsIFrame* aChildList)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
RootFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
RootFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
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)) {
|
||||
|
@ -294,10 +294,10 @@ RootContentFrame::ComputeChildMargins(nsMargin& aMargin)
|
|||
#define PAGE_SPACING_TWIPS 100
|
||||
|
||||
NS_IMETHODIMP
|
||||
RootContentFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
RootContentFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
NS_FRAME_TRACE_REFLOW_IN("RootContentFrame::Reflow");
|
||||
|
||||
|
@ -361,9 +361,9 @@ RootContentFrame::Reflow(nsIPresContext& aPresContext,
|
|||
aReflowState.reflowCommand->GetNext(next);
|
||||
NS_ASSERTION(next == mFirstChild, "unexpected next reflow command frame");
|
||||
|
||||
nsSize maxSize(availWidth, NS_UNCONSTRAINEDSIZE);
|
||||
nsReflowState kidReflowState(next, aReflowState, maxSize);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
nsSize maxSize(availWidth, NS_UNCONSTRAINEDSIZE);
|
||||
nsHTMLReflowState kidReflowState(next, aReflowState, maxSize);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
// Dispatch the reflow command to our child frame. Allow it to be as high
|
||||
// as it wants
|
||||
|
@ -413,8 +413,8 @@ RootContentFrame::Reflow(nsIPresContext& aPresContext,
|
|||
// Tile the pages vertically
|
||||
for (nsIFrame* kidFrame = mFirstChild; nsnull != kidFrame; ) {
|
||||
// Reflow the page
|
||||
nsReflowState kidReflowState(kidFrame, aReflowState, pageSize,
|
||||
reflowReason);
|
||||
nsHTMLReflowState kidReflowState(kidFrame, aReflowState, pageSize,
|
||||
reflowReason);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
nsReflowStatus status;
|
||||
|
||||
|
@ -473,9 +473,9 @@ RootContentFrame::Reflow(nsIPresContext& aPresContext,
|
|||
}
|
||||
|
||||
} else {
|
||||
nsSize maxSize(availWidth, NS_UNCONSTRAINEDSIZE);
|
||||
nsReflowState kidReflowState(mFirstChild, aReflowState, maxSize,
|
||||
reflowReason);
|
||||
nsSize maxSize(availWidth, NS_UNCONSTRAINEDSIZE);
|
||||
nsHTMLReflowState kidReflowState(mFirstChild, aReflowState, maxSize,
|
||||
reflowReason);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == mFirstChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
|
|
|
@ -156,9 +156,9 @@ NS_IMETHODIMP nsHTMLReflowCommand::Dispatch(nsIPresContext& aPresContext,
|
|||
if (nsnull != root) {
|
||||
mPath.RemoveElementAt(mPath.Count() - 1);
|
||||
|
||||
nsReflowState reflowState(root, *this, aMaxSize, &aRendContext);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
nsReflowStatus status;
|
||||
nsHTMLReflowState reflowState(root, *this, aMaxSize, &aRendContext);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
nsReflowStatus status;
|
||||
|
||||
if (NS_OK == root->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->Reflow(aPresContext, aDesiredSize, reflowState, status);
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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;
|
||||
|
||||
/**
|
||||
|
|
|
@ -144,10 +144,10 @@ public:
|
|||
|
||||
// NS_IMETHOD Init(nsIPresContext& aPresContext, nsIFrame *aChildList);
|
||||
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
NS_IMETHOD DidReflow(nsIPresContext& aPresContext,
|
||||
nsDidReflowStatus aStatus);
|
||||
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
||||
|
@ -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
|
||||
|
@ -338,10 +338,10 @@ nsObjectFrame::GetDesiredSize(nsIPresContext* aPresContext,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsObjectFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aMetrics,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
nsObjectFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aMetrics,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
// Get our desired size
|
||||
GetDesiredSize(&aPresContext, aReflowState, aMetrics);
|
||||
|
|
|
@ -64,10 +64,10 @@ void nsPageFrame::CreateFirstChild(nsIPresContext* aPresContext)
|
|||
}
|
||||
}
|
||||
|
||||
NS_METHOD nsPageFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
NS_METHOD nsPageFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
aStatus = NS_FRAME_COMPLETE; // initialize out parameter
|
||||
|
||||
|
@ -89,8 +89,8 @@ 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);
|
||||
nsSize maxSize(aReflowState.maxSize.width, NS_UNCONSTRAINEDSIZE);
|
||||
nsHTMLReflowState kidReflowState(mFirstChild, aReflowState, maxSize);
|
||||
|
||||
aStatus = ReflowChild(mFirstChild, &aPresContext, aDesiredSize, kidReflowState);
|
||||
|
||||
|
@ -126,8 +126,8 @@ 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);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
nsHTMLReflowState kidReflowState(mFirstChild, aReflowState, aReflowState.maxSize);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == mFirstChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
// Get the child's desired size
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -80,9 +80,9 @@ nsPlaceholderFrame::FindTextRuns(nsLineLayout& aLineLayout,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPlaceholderFrame::InlineReflow(nsLineLayout& aLineLayout,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState)
|
||||
nsPlaceholderFrame::InlineReflow(nsLineLayout& aLineLayout,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState)
|
||||
{
|
||||
nsIPresContext& presContext = aLineLayout.mPresContext;
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -43,9 +43,9 @@ public:
|
|||
// nsIInlineReflow
|
||||
NS_IMETHOD FindTextRuns(nsLineLayout& aLineLayout,
|
||||
nsIReflowCommand* aReflowCommand);
|
||||
NS_IMETHOD InlineReflow(nsLineLayout& aLineLayout,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState);
|
||||
NS_IMETHOD InlineReflow(nsLineLayout& aLineLayout,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState);
|
||||
|
||||
PRUint8 GetType();
|
||||
|
||||
|
@ -90,9 +90,9 @@ SpacerFrame::QueryInterface(REFNSIID aIID, void** aInstancePtrResult)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
SpacerFrame::InlineReflow(nsLineLayout& aLineLayout,
|
||||
nsHTMLReflowMetrics& aMetrics,
|
||||
const nsReflowState& aReflowState)
|
||||
SpacerFrame::InlineReflow(nsLineLayout& aLineLayout,
|
||||
nsHTMLReflowMetrics& aMetrics,
|
||||
const nsHTMLReflowState& aReflowState)
|
||||
{
|
||||
nsresult rv = NS_FRAME_COMPLETE;
|
||||
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -52,10 +52,10 @@ nsAbsoluteFrame::~nsAbsoluteFrame()
|
|||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsAbsoluteFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
NS_IMETHODIMP nsAbsoluteFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
if (eReflowReason_Initial == aReflowState.reason) {
|
||||
// By this point we expect to have been told which absolute frame we're
|
||||
|
|
|
@ -39,12 +39,13 @@ public:
|
|||
nsIFrame* GetAbsoluteFrame() const {return mFrame;}
|
||||
void SetAbsoluteFrame(nsIFrame* aAbsoluteFrame) {mFrame = aAbsoluteFrame;}
|
||||
|
||||
// nsIFrame overrides
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
// nsIHTMLReflow overrides
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
// nsIFrame overrides
|
||||
NS_IMETHOD ContentChanged(nsIPresContext* aPresContext,
|
||||
nsIContent* aChild,
|
||||
nsISupports* aSubContent);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,19 +245,17 @@ public:
|
|||
NS_IMETHOD ListTag(FILE* out) const;
|
||||
NS_IMETHOD VerifyTree() const;
|
||||
|
||||
// nsIRunaround
|
||||
NS_IMETHOD ReflowAround(nsIPresContext& aPresContext,
|
||||
nsISpaceManager* aSpaceManager,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsRect& aDesiredRect,
|
||||
nsReflowStatus& aStatus);
|
||||
// nsIHTMLReflow
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
// nsIFloaterContainer
|
||||
virtual PRBool AddFloater(nsIPresContext* aPresContext,
|
||||
const nsReflowState& aPlaceholderReflowState,
|
||||
nsIFrame* aFloater,
|
||||
nsPlaceholderFrame* aPlaceholder);
|
||||
virtual PRBool AddFloater(nsIPresContext* aPresContext,
|
||||
const nsHTMLReflowState& aPlaceholderReflowState,
|
||||
nsIFrame* aFloater,
|
||||
nsPlaceholderFrame* aPlaceholder);
|
||||
|
||||
#ifdef DO_SELECTION
|
||||
NS_IMETHOD HandleEvent(nsIPresContext& aPresContext,
|
||||
|
@ -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,12 +1679,10 @@ nsBlockFrame::FirstChild(nsIFrame*& aFirstChild) const
|
|||
// Reflow methods
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::ReflowAround(nsIPresContext& aPresContext,
|
||||
nsISpaceManager* aSpaceManager,
|
||||
nsHTMLReflowMetrics& aMetrics,
|
||||
const nsReflowState& aReflowState,
|
||||
nsRect& aDesiredRect,
|
||||
nsReflowStatus& aStatus)
|
||||
nsBlockFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aMetrics,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
||||
("enter nsBlockFrame::Reflow: maxSize=%d,%d reason=%d",
|
||||
|
@ -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,8 +3665,8 @@ 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,
|
||||
eReflowReason_Initial);
|
||||
nsHTMLReflowState reflowState(aFloaterFrame, aState, kidAvailSize,
|
||||
eReflowReason_Initial);
|
||||
|
||||
// Compute the available space for the floater. Use the default
|
||||
// 'auto' width and height values
|
||||
|
@ -3737,7 +3720,7 @@ nsBlockFrame::ReflowFloater(nsIPresContext& aPresContext,
|
|||
|
||||
PRBool
|
||||
nsBlockFrame::AddFloater(nsIPresContext* aPresContext,
|
||||
const nsReflowState& aReflowState,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsIFrame* aFloater,
|
||||
nsPlaceholderFrame* aPlaceholder)
|
||||
{
|
||||
|
|
|
@ -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,19 +245,17 @@ public:
|
|||
NS_IMETHOD ListTag(FILE* out) const;
|
||||
NS_IMETHOD VerifyTree() const;
|
||||
|
||||
// nsIRunaround
|
||||
NS_IMETHOD ReflowAround(nsIPresContext& aPresContext,
|
||||
nsISpaceManager* aSpaceManager,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsRect& aDesiredRect,
|
||||
nsReflowStatus& aStatus);
|
||||
// nsIHTMLReflow
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
// nsIFloaterContainer
|
||||
virtual PRBool AddFloater(nsIPresContext* aPresContext,
|
||||
const nsReflowState& aPlaceholderReflowState,
|
||||
nsIFrame* aFloater,
|
||||
nsPlaceholderFrame* aPlaceholder);
|
||||
virtual PRBool AddFloater(nsIPresContext* aPresContext,
|
||||
const nsHTMLReflowState& aPlaceholderReflowState,
|
||||
nsIFrame* aFloater,
|
||||
nsPlaceholderFrame* aPlaceholder);
|
||||
|
||||
#ifdef DO_SELECTION
|
||||
NS_IMETHOD HandleEvent(nsIPresContext& aPresContext,
|
||||
|
@ -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,12 +1679,10 @@ nsBlockFrame::FirstChild(nsIFrame*& aFirstChild) const
|
|||
// Reflow methods
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::ReflowAround(nsIPresContext& aPresContext,
|
||||
nsISpaceManager* aSpaceManager,
|
||||
nsHTMLReflowMetrics& aMetrics,
|
||||
const nsReflowState& aReflowState,
|
||||
nsRect& aDesiredRect,
|
||||
nsReflowStatus& aStatus)
|
||||
nsBlockFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aMetrics,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
||||
("enter nsBlockFrame::Reflow: maxSize=%d,%d reason=%d",
|
||||
|
@ -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,8 +3665,8 @@ 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,
|
||||
eReflowReason_Initial);
|
||||
nsHTMLReflowState reflowState(aFloaterFrame, aState, kidAvailSize,
|
||||
eReflowReason_Initial);
|
||||
|
||||
// Compute the available space for the floater. Use the default
|
||||
// 'auto' width and height values
|
||||
|
@ -3737,7 +3720,7 @@ nsBlockFrame::ReflowFloater(nsIPresContext& aPresContext,
|
|||
|
||||
PRBool
|
||||
nsBlockFrame::AddFloater(nsIPresContext* aPresContext,
|
||||
const nsReflowState& aReflowState,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsIFrame* aFloater,
|
||||
nsPlaceholderFrame* aPlaceholder)
|
||||
{
|
||||
|
|
|
@ -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,19 +245,17 @@ public:
|
|||
NS_IMETHOD ListTag(FILE* out) const;
|
||||
NS_IMETHOD VerifyTree() const;
|
||||
|
||||
// nsIRunaround
|
||||
NS_IMETHOD ReflowAround(nsIPresContext& aPresContext,
|
||||
nsISpaceManager* aSpaceManager,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsRect& aDesiredRect,
|
||||
nsReflowStatus& aStatus);
|
||||
// nsIHTMLReflow
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
// nsIFloaterContainer
|
||||
virtual PRBool AddFloater(nsIPresContext* aPresContext,
|
||||
const nsReflowState& aPlaceholderReflowState,
|
||||
nsIFrame* aFloater,
|
||||
nsPlaceholderFrame* aPlaceholder);
|
||||
virtual PRBool AddFloater(nsIPresContext* aPresContext,
|
||||
const nsHTMLReflowState& aPlaceholderReflowState,
|
||||
nsIFrame* aFloater,
|
||||
nsPlaceholderFrame* aPlaceholder);
|
||||
|
||||
#ifdef DO_SELECTION
|
||||
NS_IMETHOD HandleEvent(nsIPresContext& aPresContext,
|
||||
|
@ -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,12 +1679,10 @@ nsBlockFrame::FirstChild(nsIFrame*& aFirstChild) const
|
|||
// Reflow methods
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::ReflowAround(nsIPresContext& aPresContext,
|
||||
nsISpaceManager* aSpaceManager,
|
||||
nsHTMLReflowMetrics& aMetrics,
|
||||
const nsReflowState& aReflowState,
|
||||
nsRect& aDesiredRect,
|
||||
nsReflowStatus& aStatus)
|
||||
nsBlockFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aMetrics,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
||||
("enter nsBlockFrame::Reflow: maxSize=%d,%d reason=%d",
|
||||
|
@ -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,8 +3665,8 @@ 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,
|
||||
eReflowReason_Initial);
|
||||
nsHTMLReflowState reflowState(aFloaterFrame, aState, kidAvailSize,
|
||||
eReflowReason_Initial);
|
||||
|
||||
// Compute the available space for the floater. Use the default
|
||||
// 'auto' width and height values
|
||||
|
@ -3737,7 +3720,7 @@ nsBlockFrame::ReflowFloater(nsIPresContext& aPresContext,
|
|||
|
||||
PRBool
|
||||
nsBlockFrame::AddFloater(nsIPresContext* aPresContext,
|
||||
const nsReflowState& aReflowState,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsIFrame* aFloater,
|
||||
nsPlaceholderFrame* aPlaceholder)
|
||||
{
|
||||
|
|
|
@ -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"
|
||||
|
@ -113,13 +112,14 @@ nsBodyFrame::Init(nsIPresContext& aPresContext, nsIFrame* aChildList)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBodyFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
nsBodyFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
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,
|
||||
|
@ -670,8 +668,8 @@ 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)
|
||||
void nsBodyFrame::ReflowAbsoluteItems(nsIPresContext* aPresContext,
|
||||
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);
|
||||
|
@ -869,10 +867,10 @@ void nsBodyFrame::TranslatePoint(nsIFrame* aFrameFrom, nsPoint& aPoint) const
|
|||
}
|
||||
}
|
||||
|
||||
void nsBodyFrame::ComputeAbsoluteFrameBounds(nsIFrame* aAnchorFrame,
|
||||
const nsReflowState& aReflowState,
|
||||
const nsStylePosition* aPosition,
|
||||
nsRect& aRect) const
|
||||
void nsBodyFrame::ComputeAbsoluteFrameBounds(nsIFrame* aAnchorFrame,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
const nsStylePosition* aPosition,
|
||||
nsRect& aRect) const
|
||||
{
|
||||
// Compute the offset and size of the view based on the position properties,
|
||||
// and the inner rect of the containing block (which we get from the reflow
|
||||
|
|
|
@ -40,10 +40,10 @@ public:
|
|||
|
||||
NS_IMETHOD Init(nsIPresContext& aPresContext, nsIFrame* aChildList);
|
||||
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
|
@ -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,17 +94,17 @@ protected:
|
|||
virtual PRIntn GetSkipSides() const;
|
||||
|
||||
void ReflowAbsoluteItems(nsIPresContext* aPresContext,
|
||||
const nsReflowState& aReflowState);
|
||||
const nsHTMLReflowState& aReflowState);
|
||||
|
||||
nsIView* CreateAbsoluteView(const nsStylePosition* aPosition,
|
||||
const nsStyleDisplay* aDisplay) const;
|
||||
|
||||
void TranslatePoint(nsIFrame* aFrameFrom, nsPoint& aPoint) const;
|
||||
|
||||
void ComputeAbsoluteFrameBounds(nsIFrame* aAnchorFrame,
|
||||
const nsReflowState& aState,
|
||||
const nsStylePosition* aPosition,
|
||||
nsRect& aRect) const;
|
||||
void ComputeAbsoluteFrameBounds(nsIFrame* aAnchorFrame,
|
||||
const nsHTMLReflowState& aState,
|
||||
const nsStylePosition* aPosition,
|
||||
nsRect& aRect) const;
|
||||
|
||||
void AddFrame(nsIFrame* aFrame);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -113,10 +113,10 @@ protected:
|
|||
* Reflow a child frame and return the status of the reflow. If the child
|
||||
* is complete and it has next-in-flows, then delete the next-in-flows.
|
||||
*/
|
||||
nsReflowStatus ReflowChild(nsIFrame* aKidFrame,
|
||||
nsIPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState);
|
||||
nsReflowStatus ReflowChild(nsIFrame* aKidFrame,
|
||||
nsIPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState);
|
||||
|
||||
/**
|
||||
* Moves any frames on both the prev-in-flow's overflow list and the receiver's
|
||||
|
|
|
@ -1145,10 +1145,10 @@ nsFrame::DidReflow(nsIPresContext& aPresContext,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD nsFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
NS_METHOD nsFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
aDesiredSize.width = 0;
|
||||
aDesiredSize.height = 0;
|
||||
|
|
|
@ -180,10 +180,10 @@ public:
|
|||
|
||||
// nsIHTMLReflow
|
||||
NS_IMETHOD WillReflow(nsIPresContext& aPresContext);
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
NS_IMETHOD DidReflow(nsIPresContext& aPresContext,
|
||||
nsDidReflowStatus aStatus);
|
||||
NS_IMETHOD GetReflowMetrics(nsIPresContext& aPresContext,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
@ -206,10 +206,10 @@ HRuleFrame::Paint(nsIPresContext& aPresContext,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HRuleFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
HRuleFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
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;
|
||||
|
|
|
@ -42,10 +42,10 @@ public:
|
|||
RootFrame(nsIContent* aContent);
|
||||
|
||||
NS_IMETHOD Init(nsIPresContext& aPresContext, nsIFrame* aChildList);
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
NS_IMETHOD HandleEvent(nsIPresContext& aPresContext,
|
||||
nsGUIEvent* aEvent,
|
||||
nsEventStatus& aEventStatus);
|
||||
|
@ -60,10 +60,10 @@ class RootContentFrame : public nsContainerFrame {
|
|||
public:
|
||||
RootContentFrame(nsIContent* aContent, nsIFrame* aParent);
|
||||
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect);
|
||||
|
@ -118,10 +118,10 @@ RootFrame::Init(nsIPresContext& aPresContext, nsIFrame* aChildList)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
RootFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
RootFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
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)) {
|
||||
|
@ -294,10 +294,10 @@ RootContentFrame::ComputeChildMargins(nsMargin& aMargin)
|
|||
#define PAGE_SPACING_TWIPS 100
|
||||
|
||||
NS_IMETHODIMP
|
||||
RootContentFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
RootContentFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
NS_FRAME_TRACE_REFLOW_IN("RootContentFrame::Reflow");
|
||||
|
||||
|
@ -361,9 +361,9 @@ RootContentFrame::Reflow(nsIPresContext& aPresContext,
|
|||
aReflowState.reflowCommand->GetNext(next);
|
||||
NS_ASSERTION(next == mFirstChild, "unexpected next reflow command frame");
|
||||
|
||||
nsSize maxSize(availWidth, NS_UNCONSTRAINEDSIZE);
|
||||
nsReflowState kidReflowState(next, aReflowState, maxSize);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
nsSize maxSize(availWidth, NS_UNCONSTRAINEDSIZE);
|
||||
nsHTMLReflowState kidReflowState(next, aReflowState, maxSize);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
// Dispatch the reflow command to our child frame. Allow it to be as high
|
||||
// as it wants
|
||||
|
@ -413,8 +413,8 @@ RootContentFrame::Reflow(nsIPresContext& aPresContext,
|
|||
// Tile the pages vertically
|
||||
for (nsIFrame* kidFrame = mFirstChild; nsnull != kidFrame; ) {
|
||||
// Reflow the page
|
||||
nsReflowState kidReflowState(kidFrame, aReflowState, pageSize,
|
||||
reflowReason);
|
||||
nsHTMLReflowState kidReflowState(kidFrame, aReflowState, pageSize,
|
||||
reflowReason);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
nsReflowStatus status;
|
||||
|
||||
|
@ -473,9 +473,9 @@ RootContentFrame::Reflow(nsIPresContext& aPresContext,
|
|||
}
|
||||
|
||||
} else {
|
||||
nsSize maxSize(availWidth, NS_UNCONSTRAINEDSIZE);
|
||||
nsReflowState kidReflowState(mFirstChild, aReflowState, maxSize,
|
||||
reflowReason);
|
||||
nsSize maxSize(availWidth, NS_UNCONSTRAINEDSIZE);
|
||||
nsHTMLReflowState kidReflowState(mFirstChild, aReflowState, maxSize,
|
||||
reflowReason);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == mFirstChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -156,9 +156,9 @@ NS_IMETHODIMP nsHTMLReflowCommand::Dispatch(nsIPresContext& aPresContext,
|
|||
if (nsnull != root) {
|
||||
mPath.RemoveElementAt(mPath.Count() - 1);
|
||||
|
||||
nsReflowState reflowState(root, *this, aMaxSize, &aRendContext);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
nsReflowStatus status;
|
||||
nsHTMLReflowState reflowState(root, *this, aMaxSize, &aRendContext);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
nsReflowStatus status;
|
||||
|
||||
if (NS_OK == root->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->Reflow(aPresContext, aDesiredSize, reflowState, status);
|
||||
|
|
|
@ -1,51 +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 nsIFloaterContainer_h___
|
||||
#define nsIFloaterContainer_h___
|
||||
|
||||
#include "nsIFrame.h"
|
||||
class nsPlaceholderFrame;
|
||||
class nsIPresContext;
|
||||
struct nsReflowState;
|
||||
|
||||
// 5a305ee0-cb55-11d1-8556-00a02468fab6
|
||||
#define NS_IFLOATER_CONTAINER_IID \
|
||||
{ 0x5a305ee0, 0xcb55, 0x11d1, {0x85, 0x56, 0x0, 0xa0, 0x24, 0x68, 0xfa, 0xb6}}
|
||||
|
||||
/**
|
||||
* An interface for communicating with the enclosing block-level container
|
||||
* about floating elements. Note that this interface is not an nsISupports
|
||||
* interface, and therefore you cannot QueryInterface() back
|
||||
*/
|
||||
class nsIFloaterContainer
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Notification of a newly created floating element.
|
||||
*
|
||||
* @param aFloater the floating element
|
||||
* @param aPlaceholder the placeholder frame associated with the floating
|
||||
* element.
|
||||
*/
|
||||
virtual PRBool AddFloater(nsIPresContext* aPresContext,
|
||||
const nsReflowState& aPlaceholderReflowState,
|
||||
nsIFrame* aFloater,
|
||||
nsPlaceholderFrame* aPlaceholder) = 0;
|
||||
};
|
||||
|
||||
#endif /* nsIFloaterContainer_h___ */
|
|
@ -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___ */
|
||||
|
||||
|
||||
|
|
|
@ -1,106 +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 "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#ifndef nsIInlineReflow_h___
|
||||
#define nsIInlineReflow_h___
|
||||
|
||||
#include "nsISupports.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIFrameReflow.h"
|
||||
class nsLineLayout;
|
||||
struct nsHTMLReflowMetrics;
|
||||
|
||||
/* d76e29b0-ff56-11d1-89e7-006008911b81 */
|
||||
#define NS_IINLINE_REFLOW_IID \
|
||||
{0xd76e29b0, 0xff56, 0x11d1, {0x89, 0xe7, 0x00, 0x60, 0x08, 0x91, 0x1b, 0x81}}
|
||||
|
||||
class nsIInlineReflow {
|
||||
public:
|
||||
/**
|
||||
* Recursively find all of the text runs contained in an outer
|
||||
* block container. Inline frames implement this by recursing over
|
||||
* their children; note that inlines frames may need to create
|
||||
* missing child frames before proceeding (e.g. when a tree
|
||||
* containing inlines is appended/inserted into a block container
|
||||
*/
|
||||
NS_IMETHOD FindTextRuns(nsLineLayout& aLineLayout,
|
||||
nsIReflowCommand* aReflowCommand) = 0;
|
||||
|
||||
/**
|
||||
* InlineReflow method. See below for how to interpret the return value.
|
||||
*/
|
||||
NS_IMETHOD InlineReflow(nsLineLayout& aLineLayout,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState) = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* For InlineReflow the return value (an nsresult) indicates the
|
||||
* status of the reflow operation. If the return value is negative
|
||||
* then some sort of catastrophic error has occured (e.g. out of memory).
|
||||
* If the return value is non-negative then the macros below can be
|
||||
* used to interpret it.
|
||||
*
|
||||
* This is an extension of the nsReflowStatus value; it's bits are used
|
||||
* in addition the bits that we add.
|
||||
*/
|
||||
typedef nsReflowStatus nsInlineReflowStatus;
|
||||
|
||||
// This bit is set, when a break is requested. This bit is orthogonal
|
||||
// to the nsIFrame::nsReflowStatus completion bits.
|
||||
#define NS_INLINE_BREAK 0x0100
|
||||
|
||||
#define NS_INLINE_IS_BREAK(_status) \
|
||||
(0 != ((_status) & NS_INLINE_BREAK))
|
||||
|
||||
// When a break is requested, this bit when set indicates that the
|
||||
// break should occur after the frame just reflowed; when the bit is
|
||||
// clear the break should occur before the frame just reflowed.
|
||||
#define NS_INLINE_BREAK_BEFORE 0x0000
|
||||
#define NS_INLINE_BREAK_AFTER 0x0200
|
||||
|
||||
#define NS_INLINE_IS_BREAK_AFTER(_status) \
|
||||
(0 != ((_status) & NS_INLINE_BREAK_AFTER))
|
||||
|
||||
#define NS_INLINE_IS_BREAK_BEFORE(_status) \
|
||||
(NS_INLINE_BREAK == ((_status) & (NS_INLINE_BREAK|NS_INLINE_BREAK_AFTER)))
|
||||
|
||||
// The type of break requested can be found in these bits.
|
||||
#define NS_INLINE_BREAK_TYPE_MASK 0xF000
|
||||
|
||||
#define NS_INLINE_GET_BREAK_TYPE(_status) (((_status) >> 12) & 0xF)
|
||||
|
||||
#define NS_INLINE_MAKE_BREAK_TYPE(_type) ((_type) << 12)
|
||||
|
||||
// Construct a line-break-before status. Note that there is no
|
||||
// completion status for a line-break before because we *know* that
|
||||
// the frame will be reflowed later and hence it's current completion
|
||||
// status doesn't matter.
|
||||
#define NS_INLINE_LINE_BREAK_BEFORE() \
|
||||
(NS_INLINE_BREAK | NS_INLINE_BREAK_BEFORE | \
|
||||
NS_INLINE_MAKE_BREAK_TYPE(NS_STYLE_CLEAR_LINE))
|
||||
|
||||
// Take a completion status and add to it the desire to have a
|
||||
// line-break after. For this macro we do need the completion status
|
||||
// because the user of the status will need to know whether to
|
||||
// continue the frame or not.
|
||||
#define NS_INLINE_LINE_BREAK_AFTER(_completionStatus) \
|
||||
((_completionStatus) | NS_INLINE_BREAK | NS_INLINE_BREAK_AFTER | \
|
||||
NS_INLINE_MAKE_BREAK_TYPE(NS_STYLE_CLEAR_LINE))
|
||||
|
||||
#endif /* nsIInlineReflow_h___ */
|
|
@ -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) {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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;
|
||||
|
||||
/**
|
||||
|
|
|
@ -144,10 +144,10 @@ public:
|
|||
|
||||
// NS_IMETHOD Init(nsIPresContext& aPresContext, nsIFrame *aChildList);
|
||||
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
NS_IMETHOD DidReflow(nsIPresContext& aPresContext,
|
||||
nsDidReflowStatus aStatus);
|
||||
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
||||
|
@ -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
|
||||
|
@ -338,10 +338,10 @@ nsObjectFrame::GetDesiredSize(nsIPresContext* aPresContext,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsObjectFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aMetrics,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
nsObjectFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aMetrics,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
// Get our desired size
|
||||
GetDesiredSize(&aPresContext, aReflowState, aMetrics);
|
||||
|
|
|
@ -64,10 +64,10 @@ void nsPageFrame::CreateFirstChild(nsIPresContext* aPresContext)
|
|||
}
|
||||
}
|
||||
|
||||
NS_METHOD nsPageFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
NS_METHOD nsPageFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
aStatus = NS_FRAME_COMPLETE; // initialize out parameter
|
||||
|
||||
|
@ -89,8 +89,8 @@ 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);
|
||||
nsSize maxSize(aReflowState.maxSize.width, NS_UNCONSTRAINEDSIZE);
|
||||
nsHTMLReflowState kidReflowState(mFirstChild, aReflowState, maxSize);
|
||||
|
||||
aStatus = ReflowChild(mFirstChild, &aPresContext, aDesiredSize, kidReflowState);
|
||||
|
||||
|
@ -126,8 +126,8 @@ 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);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
nsHTMLReflowState kidReflowState(mFirstChild, aReflowState, aReflowState.maxSize);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == mFirstChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
// Get the child's desired size
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -80,9 +80,9 @@ nsPlaceholderFrame::FindTextRuns(nsLineLayout& aLineLayout,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPlaceholderFrame::InlineReflow(nsLineLayout& aLineLayout,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState)
|
||||
nsPlaceholderFrame::InlineReflow(nsLineLayout& aLineLayout,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState)
|
||||
{
|
||||
nsIPresContext& presContext = aLineLayout.mPresContext;
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -35,10 +35,10 @@ class nsScrollBodyFrame : public nsContainerFrame {
|
|||
public:
|
||||
nsScrollBodyFrame(nsIContent* aContent, nsIFrame* aParent);
|
||||
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
|
@ -90,10 +90,10 @@ nsScrollBodyFrame::CreateFirstChild(nsIPresContext* aPresContext)
|
|||
#define PAGE_SPACING 100
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsScrollBodyFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
nsScrollBodyFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
nsHTMLContainerFrame::CreateViewForFrame(aPresContext, this,
|
||||
nsnull, PR_TRUE);
|
||||
|
@ -120,9 +120,9 @@ nsScrollBodyFrame::Reflow(nsIPresContext& aPresContext,
|
|||
aReflowState.reflowCommand->GetNext(next);
|
||||
NS_ASSERTION(next == mFirstChild, "unexpected next reflow command frame");
|
||||
|
||||
nsSize maxSize(aReflowState.maxSize.width, NS_UNCONSTRAINEDSIZE);
|
||||
nsReflowState kidReflowState(next, aReflowState, maxSize);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
nsSize maxSize(aReflowState.maxSize.width, NS_UNCONSTRAINEDSIZE);
|
||||
nsHTMLReflowState kidReflowState(next, aReflowState, maxSize);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == mFirstChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
// Dispatch the reflow command to our child frame. Allow it to be as high
|
||||
|
@ -159,8 +159,8 @@ nsScrollBodyFrame::Reflow(nsIPresContext& aPresContext,
|
|||
// Tile the pages vertically
|
||||
for (nsIFrame* kidFrame = mFirstChild; nsnull != kidFrame; ) {
|
||||
// Reflow the page
|
||||
nsReflowState kidReflowState(kidFrame, aReflowState, pageSize);
|
||||
nsReflowStatus status;
|
||||
nsHTMLReflowState kidReflowState(kidFrame, aReflowState, pageSize);
|
||||
nsReflowStatus status;
|
||||
|
||||
// Place and size the page. If the page is narrower than our
|
||||
// max width then center it horizontally
|
||||
|
@ -223,9 +223,9 @@ nsScrollBodyFrame::Reflow(nsIPresContext& aPresContext,
|
|||
} else {
|
||||
// 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);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
nsSize maxSize(aReflowState.maxSize.width, NS_UNCONSTRAINEDSIZE);
|
||||
nsHTMLReflowState kidReflowState(mFirstChild, aReflowState, maxSize);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == mFirstChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
// Get the child's desired size. Our child's desired height is our
|
||||
|
@ -307,10 +307,10 @@ class nsScrollInnerFrame : public nsContainerFrame {
|
|||
public:
|
||||
nsScrollInnerFrame(nsIContent* aContent, nsIFrame* aParent);
|
||||
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
NS_IMETHOD ListTag(FILE* out = stdout) const;
|
||||
|
||||
|
@ -323,10 +323,10 @@ nsScrollInnerFrame::nsScrollInnerFrame(nsIContent* aContent, nsIFrame* aParent)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsScrollInnerFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
nsScrollInnerFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
NS_FRAME_TRACE_MSG(NS_FRAME_TRACE_CALLS,
|
||||
("enter nsScrollInnerFrame::Reflow: maxSize=%d,%d",
|
||||
|
@ -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)) {
|
||||
|
@ -445,10 +445,10 @@ class nsScrollOuterFrame : public nsHTMLContainerFrame {
|
|||
public:
|
||||
nsScrollOuterFrame(nsIContent* aContent, nsIFrame* aParent);
|
||||
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
NS_IMETHOD ListTag(FILE* out = stdout) const;
|
||||
|
||||
|
@ -463,10 +463,10 @@ nsScrollOuterFrame::nsScrollOuterFrame(nsIContent* aContent, nsIFrame* aParent)
|
|||
|
||||
//XXX incremental reflow pass through
|
||||
NS_IMETHODIMP
|
||||
nsScrollOuterFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
nsScrollOuterFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
NS_FRAME_TRACE_MSG(NS_FRAME_TRACE_CALLS,
|
||||
("enter nsScrollOuterFrame::Reflow: maxSize=%d,%d",
|
||||
|
@ -503,8 +503,8 @@ nsScrollOuterFrame::Reflow(nsIPresContext& aPresContext,
|
|||
}
|
||||
|
||||
// Reflow the child and get its desired size
|
||||
nsReflowState kidReflowState(mFirstChild, aReflowState, maxSize);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
nsHTMLReflowState kidReflowState(mFirstChild, aReflowState, maxSize);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == mFirstChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
|
|
|
@ -43,9 +43,9 @@ public:
|
|||
// nsIInlineReflow
|
||||
NS_IMETHOD FindTextRuns(nsLineLayout& aLineLayout,
|
||||
nsIReflowCommand* aReflowCommand);
|
||||
NS_IMETHOD InlineReflow(nsLineLayout& aLineLayout,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState);
|
||||
NS_IMETHOD InlineReflow(nsLineLayout& aLineLayout,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState);
|
||||
|
||||
PRUint8 GetType();
|
||||
|
||||
|
@ -90,9 +90,9 @@ SpacerFrame::QueryInterface(REFNSIID aIID, void** aInstancePtrResult)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
SpacerFrame::InlineReflow(nsLineLayout& aLineLayout,
|
||||
nsHTMLReflowMetrics& aMetrics,
|
||||
const nsReflowState& aReflowState)
|
||||
SpacerFrame::InlineReflow(nsLineLayout& aLineLayout,
|
||||
nsHTMLReflowMetrics& aMetrics,
|
||||
const nsHTMLReflowState& aReflowState)
|
||||
{
|
||||
nsresult rv = NS_FRAME_COMPLETE;
|
||||
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -112,10 +112,10 @@ public:
|
|||
nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect);
|
||||
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
NS_IMETHOD VerifyTree() const;
|
||||
nscoord GetBorderWidth(nsIPresContext& aPresContext);
|
||||
PRBool IsInline();
|
||||
|
@ -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;
|
||||
|
@ -150,10 +150,10 @@ public:
|
|||
/**
|
||||
* @see nsIFrame::Reflow
|
||||
*/
|
||||
NS_IMETHOD Reflow(nsIPresContext& aCX,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
NS_IMETHOD Reflow(nsIPresContext& aCX,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
NS_IMETHOD MoveTo(nscoord aX, nscoord aY);
|
||||
NS_IMETHOD SizeTo(nscoord aWidth, nscoord aHeight);
|
||||
|
@ -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>
|
||||
|
@ -285,10 +285,10 @@ NS_IMETHODIMP nsHTMLFrameOuterFrame::ListTag(FILE* out) const
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFrameOuterFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
nsHTMLFrameOuterFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
//printf("OuterFrame::Reflow %X (%d,%d) \n", this, aReflowState.maxSize.width, aReflowState.maxSize.height);
|
||||
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
||||
|
@ -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)) {
|
||||
|
@ -691,10 +691,10 @@ nsHTMLFrameInnerFrame::CreateWebShell(nsIPresContext& aPresContext,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFrameInnerFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
nsHTMLFrameInnerFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
//printf("InnerFrame::Reflow %X (%d,%d) \n", this, aReflowState.maxSize.width, aReflowState.maxSize.height);
|
||||
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
||||
|
@ -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
|
||||
|
|
|
@ -73,10 +73,10 @@ public:
|
|||
nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect);
|
||||
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
PRBool GetVisibility() { return mVisibility; }
|
||||
void SetVisibility(PRBool aVisibility);
|
||||
|
@ -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;
|
||||
|
@ -112,16 +112,16 @@ public:
|
|||
nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect);
|
||||
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
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);
|
||||
|
@ -605,13 +605,13 @@ nsHTMLFramesetFrame::ParseRowColSpec(nsString& aSpec, PRInt32 aMaxNumValues,
|
|||
}
|
||||
|
||||
void
|
||||
nsHTMLFramesetFrame::ReflowPlaceChild(nsIFrame* aChild,
|
||||
nsIPresContext& aPresContext,
|
||||
const nsReflowState& aReflowState,
|
||||
nsPoint& aOffset,
|
||||
nsSize& aSize,
|
||||
nsFramesetDrag* aDrag,
|
||||
nsPoint* aCellIndex)
|
||||
nsHTMLFramesetFrame::ReflowPlaceChild(nsIFrame* aChild,
|
||||
nsIPresContext& aPresContext,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsPoint& aOffset,
|
||||
nsSize& aSize,
|
||||
nsFramesetDrag* aDrag,
|
||||
nsPoint* aCellIndex)
|
||||
{
|
||||
PRBool needFramesetReflow = PR_FALSE;
|
||||
nsFramesetDrag* childDrag = nsnull;
|
||||
|
@ -670,8 +670,8 @@ nsHTMLFramesetFrame::ReflowPlaceChild(nsIFrame* aChild,
|
|||
}
|
||||
}
|
||||
|
||||
nsReflowState reflowState(aChild, aReflowState, aSize);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
nsHTMLReflowState reflowState(aChild, aReflowState, aSize);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == aChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
|
@ -820,10 +820,10 @@ nscolor nsHTMLFramesetFrame::GetBorderColor(nsIContent* aContent)
|
|||
#define BLANK 2
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
//printf("FramesetFrame::Reflow %X (%d,%d) \n", this, aReflowState.maxSize.width, aReflowState.maxSize.height);
|
||||
return Reflow(aPresContext, nsnull, aDesiredSize, aReflowState, aStatus);
|
||||
|
@ -834,11 +834,11 @@ static NS_DEFINE_IID(kViewCID, NS_VIEW_CID);
|
|||
static NS_DEFINE_IID(kIViewIID, NS_IVIEW_IID);
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsFramesetDrag* aDrag,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsFramesetDrag* aDrag,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
//printf("FramesetFrame2::Reflow %X (%d,%d) \n", this, aReflowState.maxSize.width, aReflowState.maxSize.height);
|
||||
// Always get the size so that the caller knows how big we are
|
||||
|
@ -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;
|
||||
|
@ -1484,10 +1484,10 @@ void nsHTMLFramesetBorderFrame::SetColor(nscolor aColor)
|
|||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFramesetBorderFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
nsHTMLFramesetBorderFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
//printf("BorderFrame::Reflow %X (%d,%d) \n", this, aReflowState.maxSize.width, aReflowState.maxSize.height);
|
||||
GetDesiredSize(&aPresContext, aReflowState, aDesiredSize);
|
||||
|
@ -1632,7 +1632,7 @@ nsHTMLFramesetBlankFrame::~nsHTMLFramesetBlankFrame()
|
|||
}
|
||||
|
||||
void nsHTMLFramesetBlankFrame::GetDesiredSize(nsIPresContext* aPresContext,
|
||||
const nsReflowState& aReflowState,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsHTMLReflowMetrics& aDesiredSize)
|
||||
{
|
||||
aDesiredSize.width = aReflowState.maxSize.width;
|
||||
|
@ -1642,10 +1642,10 @@ void nsHTMLFramesetBlankFrame::GetDesiredSize(nsIPresContext* aPresContext,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFramesetBlankFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
nsHTMLFramesetBlankFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
GetDesiredSize(&aPresContext, aReflowState, aDesiredSize);
|
||||
aStatus = NS_FRAME_COMPLETE;
|
||||
|
|
|
@ -27,7 +27,7 @@ class nsIFrame;
|
|||
class nsIPresContext;
|
||||
class nsIRenderingContext;
|
||||
struct nsRect;
|
||||
struct nsReflowState;
|
||||
struct nsHTMLReflowState;
|
||||
struct nsSize;
|
||||
class nsIAtom;
|
||||
class nsIWebShell;
|
||||
|
@ -116,16 +116,16 @@ public:
|
|||
nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect);
|
||||
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsFramesetDrag* aDrag,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsFramesetDrag* aDrag,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
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);
|
||||
|
@ -164,13 +164,13 @@ protected:
|
|||
PRInt32 ParseRowColSpec(nsString& aSpec, PRInt32 aMaxNumValues,
|
||||
nsFramesetSpec* aSpecs);
|
||||
|
||||
void ReflowPlaceChild(nsIFrame* aChild,
|
||||
nsIPresContext& aPresContext,
|
||||
const nsReflowState& aReflowState,
|
||||
nsPoint& aOffset,
|
||||
nsSize& aSize,
|
||||
nsFramesetDrag* aDrag = 0,
|
||||
nsPoint* aCellIndex = 0);
|
||||
void ReflowPlaceChild(nsIFrame* aChild,
|
||||
nsIPresContext& aPresContext,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsPoint& aOffset,
|
||||
nsSize& aSize,
|
||||
nsFramesetDrag* aDrag = 0,
|
||||
nsPoint* aCellIndex = 0);
|
||||
|
||||
PRBool CanResize(PRBool aVertical, PRBool aLeft);
|
||||
PRBool CanChildResize(PRBool aVertical, PRBool aLeft, PRInt32 aChildX, PRBool aFrameset);
|
||||
|
|
|
@ -271,10 +271,10 @@ nsButtonControlFrame::MouseClicked(nsIPresContext* aPresContext)
|
|||
}
|
||||
|
||||
NS_METHOD
|
||||
nsButtonControlFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
nsButtonControlFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
PRInt32 type;
|
||||
GetType(&type);
|
||||
|
@ -297,7 +297,7 @@ nsButtonControlFrame::Reflow(nsIPresContext& aPresContext,
|
|||
|
||||
void
|
||||
nsButtonControlFrame::GetDesiredSize(nsIPresContext* aPresContext,
|
||||
const nsReflowState& aReflowState,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsHTMLReflowMetrics& aDesiredLayoutSize,
|
||||
nsSize& aDesiredWidgetSize)
|
||||
{
|
||||
|
|
|
@ -31,10 +31,10 @@ public:
|
|||
nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect);
|
||||
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
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);
|
||||
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -183,10 +183,10 @@ void SetType(nsIHTMLContent* aElement, nsString& aValue)
|
|||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
PRInt32 numChildren = LengthOf(mFirstChild);
|
||||
|
||||
|
@ -225,8 +225,8 @@ 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);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
nsHTMLReflowState reflowState(childFrame, aReflowState, maxSize);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == childFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
|
|
|
@ -34,10 +34,10 @@ public:
|
|||
|
||||
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
||||
|
||||
NS_IMETHOD Reflow(nsIPresContext& aCX,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
NS_IMETHOD Reflow(nsIPresContext& aCX,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
virtual void MouseClicked(nsIPresContext* aPresContext);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -83,7 +83,7 @@ nsRadioControlFrame::GetCID()
|
|||
|
||||
void
|
||||
nsRadioControlFrame::GetDesiredSize(nsIPresContext* aPresContext,
|
||||
const nsReflowState& aReflowState,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsHTMLReflowMetrics& aDesiredLayoutSize,
|
||||
nsSize& aDesiredWidgetSize)
|
||||
{
|
||||
|
|
|
@ -52,7 +52,7 @@ protected:
|
|||
virtual ~nsRadioControlFrame();
|
||||
|
||||
virtual void GetDesiredSize(nsIPresContext* aPresContext,
|
||||
const nsReflowState& aReflowState,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsHTMLReflowMetrics& aDesiredLayoutSize,
|
||||
nsSize& aDesiredWidgetSize);
|
||||
PRBool *mInitialChecked;
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -169,7 +169,7 @@ nsTextControlFrame::EnterPressed(nsIPresContext& aPresContext)
|
|||
|
||||
void
|
||||
nsTextControlFrame::GetDesiredSize(nsIPresContext* aPresContext,
|
||||
const nsReflowState& aReflowState,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsHTMLReflowMetrics& aDesiredLayoutSize,
|
||||
nsSize& aDesiredWidgetSize)
|
||||
{
|
||||
|
|
|
@ -58,7 +58,7 @@ protected:
|
|||
virtual ~nsTextControlFrame();
|
||||
|
||||
virtual void GetDesiredSize(nsIPresContext* aPresContext,
|
||||
const nsReflowState& aReflowState,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsHTMLReflowMetrics& aDesiredLayoutSize,
|
||||
nsSize& aDesiredWidgetSize);
|
||||
};
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -45,7 +45,7 @@ FixedTableLayoutStrategy::~FixedTableLayoutStrategy()
|
|||
}
|
||||
|
||||
PRBool FixedTableLayoutStrategy::BalanceColumnWidths(nsIStyleContext *aTableStyle,
|
||||
const nsReflowState& aReflowState,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nscoord aMaxWidth)
|
||||
{
|
||||
#ifdef NS_DEBUG
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -66,7 +66,7 @@ public:
|
|||
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
/**
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -47,10 +47,10 @@ public:
|
|||
nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect);
|
||||
|
||||
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
/** return the index of the column the col represents. always >= 0 */
|
||||
virtual int GetColumnIndex ();
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче