Mozilla/mozilla/layout/html/base/src/nsFrameReflowState.cpp
troy%netscape.com e191c422d9 Eliminated nsIRunaround interface, and folded space manager parameter into
nsHTMLReflowState structure


git-svn-id: svn://10.0.0.236/trunk@11749 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-02 04:10:00 +00:00

74 lines
2.5 KiB
C++

/* -*- 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.
*/
#include "nsFrameReflowState.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsIFrame.h"
#include "nsIHTMLReflow.h"
nsFrameReflowState::nsFrameReflowState(nsIPresContext& aPresContext,
const nsHTMLReflowState& aReflowState,
const nsHTMLReflowMetrics& aMetrics)
: nsHTMLReflowState(aReflowState),
mPresContext(aPresContext)
{
// While we skip around the reflow state that our parent gave us so
// that the parentReflowState is linked properly, we don't want to
// skip over it's reason.
reason = aReflowState.reason;
mNextRCFrame = nsnull;
// Initialize max-element-size
mComputeMaxElementSize = nsnull != aMetrics.maxElementSize;
mMaxElementSize.width = 0;
mMaxElementSize.height = 0;
// Get style data that we need
frame->GetStyleData(eStyleStruct_Text,
(const nsStyleStruct*&) mStyleText);
frame->GetStyleData(eStyleStruct_Display,
(const nsStyleStruct*&) mStyleDisplay);
frame->GetStyleData(eStyleStruct_Spacing,
(const nsStyleStruct*&) mStyleSpacing);
// Calculate our border and padding value
mStyleSpacing->CalcBorderPaddingFor(frame, mBorderPadding);
// Set mNoWrap flag
switch (mStyleText->mWhiteSpace) {
case NS_STYLE_WHITESPACE_PRE:
case NS_STYLE_WHITESPACE_NOWRAP:
mNoWrap = PR_TRUE;
break;
default:
mNoWrap = PR_FALSE;
break;
}
// Set mDirection value
mDirection = mStyleDisplay->mDirection;
// Initialize running margin value
mRunningMargin = aMetrics.mCarriedInTopMargin;
}
nsFrameReflowState::~nsFrameReflowState()
{
}