зеркало из https://github.com/mozilla/pjs.git
Introduce a setter for nsHTMLReflowState::mComputedHeight so that we're sure to
update the resize flags properly. Bug 388084, r+sr+a=dbaron
This commit is contained in:
Родитель
a8a6192839
Коммит
45ac2edcbc
|
@ -6070,8 +6070,10 @@ PresShell::DoReflow(nsIFrame* target)
|
|||
NS_ASSERTION(reflowState.mComputedMargin == nsMargin(0, 0, 0, 0),
|
||||
"reflow state should not set margin for reflow roots");
|
||||
if (size.height != NS_UNCONSTRAINEDSIZE) {
|
||||
reflowState.mComputedHeight =
|
||||
nscoord computedHeight =
|
||||
size.height - reflowState.mComputedBorderPadding.TopBottom();
|
||||
computedHeight = PR_MAX(computedHeight, 0);
|
||||
reflowState.SetComputedHeight(computedHeight);
|
||||
}
|
||||
NS_ASSERTION(reflowState.ComputedWidth() ==
|
||||
size.width -
|
||||
|
|
|
@ -679,7 +679,7 @@ nsComboboxControlFrame::Reflow(nsPresContext* aPresContext,
|
|||
nsRect buttonRect = mButtonFrame->GetRect();
|
||||
// If we have a non-intrinsic computed height, our kids should have sized
|
||||
// themselves properly on their own.
|
||||
if (aReflowState.mComputedHeight == NS_INTRINSICSIZE) {
|
||||
if (aReflowState.ComputedHeight() == NS_INTRINSICSIZE) {
|
||||
// The display frame is going to be the right height and width at this
|
||||
// point. Use its height as the button height.
|
||||
nsRect displayRect = mDisplayFrame->GetRect();
|
||||
|
@ -694,10 +694,10 @@ nsComboboxControlFrame::Reflow(nsPresContext* aPresContext,
|
|||
// The button and display area should be equal heights, unless the computed
|
||||
// height on the combobox is too small to fit their borders and padding.
|
||||
NS_ASSERTION(buttonHeight == displayHeight ||
|
||||
(aReflowState.mComputedHeight < buttonHeight &&
|
||||
(aReflowState.ComputedHeight() < buttonHeight &&
|
||||
buttonHeight ==
|
||||
mButtonFrame->GetUsedBorderAndPadding().TopBottom()) ||
|
||||
(aReflowState.mComputedHeight < displayHeight &&
|
||||
(aReflowState.ComputedHeight() < displayHeight &&
|
||||
displayHeight ==
|
||||
mDisplayFrame->GetUsedBorderAndPadding().TopBottom()),
|
||||
"Different heights?");
|
||||
|
@ -1098,11 +1098,11 @@ nsComboboxDisplayFrame::Reflow(nsPresContext* aPresContext,
|
|||
nsReflowStatus& aStatus)
|
||||
{
|
||||
nsHTMLReflowState state(aReflowState);
|
||||
if (state.mComputedHeight == NS_INTRINSICSIZE) {
|
||||
if (state.ComputedHeight() == NS_INTRINSICSIZE) {
|
||||
// Note that the only way we can have a computed height here is if the
|
||||
// combobox had a specified height. If it didn't, size based on what our
|
||||
// rows look like, for lack of anything better.
|
||||
state.mComputedHeight = mComboBox->mListControlFrame->GetHeightOfARow();
|
||||
state.SetComputedHeight(mComboBox->mListControlFrame->GetHeightOfARow());
|
||||
}
|
||||
nscoord computedWidth = mComboBox->mDisplayWidth -
|
||||
state.mComputedBorderPadding.LeftRight();
|
||||
|
|
|
@ -493,7 +493,7 @@ nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
|
|||
// always give the legend as much size as it wants
|
||||
legendReflowState.
|
||||
SetComputedWidth(mLegendFrame->GetPrefWidth(aReflowState.rendContext));
|
||||
legendReflowState.mComputedHeight = NS_INTRINSICSIZE;
|
||||
legendReflowState.SetComputedHeight(NS_INTRINSICSIZE);
|
||||
|
||||
nsHTMLReflowMetrics legendDesiredSize;
|
||||
|
||||
|
@ -555,9 +555,9 @@ nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
|
|||
|
||||
// set the rect. make sure we add the margin back in.
|
||||
contentRect.SetRect(borderPadding.left,borderPadding.top + mLegendSpace,kidDesiredSize.width ,kidDesiredSize.height);
|
||||
if (aReflowState.mComputedHeight != NS_INTRINSICSIZE &&
|
||||
borderPadding.top + mLegendSpace+kidDesiredSize.height > aReflowState.mComputedHeight) {
|
||||
kidDesiredSize.height = aReflowState.mComputedHeight-(borderPadding.top + mLegendSpace);
|
||||
if (aReflowState.ComputedHeight() != NS_INTRINSICSIZE &&
|
||||
borderPadding.top + mLegendSpace+kidDesiredSize.height > aReflowState.ComputedHeight()) {
|
||||
kidDesiredSize.height = aReflowState.ComputedHeight()-(borderPadding.top + mLegendSpace);
|
||||
}
|
||||
|
||||
FinishReflowChild(mContentFrame, aPresContext, &kidReflowState,
|
||||
|
@ -620,18 +620,18 @@ nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
|
|||
}
|
||||
|
||||
// Return our size and our result
|
||||
if (aReflowState.mComputedHeight == NS_INTRINSICSIZE) {
|
||||
if (aReflowState.ComputedHeight() == NS_INTRINSICSIZE) {
|
||||
aDesiredSize.height = mLegendSpace +
|
||||
borderPadding.top +
|
||||
contentRect.height +
|
||||
borderPadding.bottom;
|
||||
borderPadding.TopBottom() +
|
||||
contentRect.height;
|
||||
} else {
|
||||
nscoord min = borderPadding.top + borderPadding.bottom + mLegendRect.height;
|
||||
aDesiredSize.height = aReflowState.mComputedHeight + borderPadding.top + borderPadding.bottom;
|
||||
nscoord min = borderPadding.TopBottom() + mLegendRect.height;
|
||||
aDesiredSize.height =
|
||||
aReflowState.ComputedHeight() + borderPadding.TopBottom();
|
||||
if (aDesiredSize.height < min)
|
||||
aDesiredSize.height = min;
|
||||
}
|
||||
aDesiredSize.width = contentRect.width + borderPadding.left + borderPadding.right;
|
||||
aDesiredSize.width = contentRect.width + borderPadding.LeftRight();
|
||||
aDesiredSize.mOverflowArea = nsRect(0, 0, aDesiredSize.width, aDesiredSize.height);
|
||||
if (mLegendFrame)
|
||||
ConsiderChildOverflow(aDesiredSize.mOverflowArea, mLegendFrame);
|
||||
|
|
|
@ -404,7 +404,7 @@ NS_IMETHODIMP nsFileControlFrame::Reflow(nsPresContext* aPresContext,
|
|||
nsHTMLReflowState txtKidReflowState(aPresContext,
|
||||
*aReflowState.parentReflowState,
|
||||
this, txtAvailSize);
|
||||
txtKidReflowState.mComputedHeight = aDesiredSize.height;
|
||||
txtKidReflowState.SetComputedHeight(aDesiredSize.height);
|
||||
rv = nsAreaFrame::WillReflow(aPresContext);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "Should have succeeded");
|
||||
rv = nsAreaFrame::Reflow(aPresContext, txtKidSize, txtKidReflowState, aStatus);
|
||||
|
|
|
@ -303,8 +303,8 @@ nsHTMLButtonControlFrame::Reflow(nsPresContext* aPresContext,
|
|||
aDesiredSize.width = aReflowState.ComputedWidth();
|
||||
|
||||
// If computed use the computed value.
|
||||
if (aReflowState.mComputedHeight != NS_INTRINSICSIZE)
|
||||
aDesiredSize.height = aReflowState.mComputedHeight;
|
||||
if (aReflowState.ComputedHeight() != NS_INTRINSICSIZE)
|
||||
aDesiredSize.height = aReflowState.ComputedHeight();
|
||||
else
|
||||
aDesiredSize.height += focusPadding.TopBottom();
|
||||
|
||||
|
@ -384,8 +384,8 @@ nsHTMLButtonControlFrame::ReflowButtonContents(nsPresContext* aPresContext,
|
|||
|
||||
// center child vertically
|
||||
nscoord yoff = 0;
|
||||
if (aReflowState.mComputedHeight != NS_INTRINSICSIZE) {
|
||||
yoff = (aReflowState.mComputedHeight - aDesiredSize.height)/2;
|
||||
if (aReflowState.ComputedHeight() != NS_INTRINSICSIZE) {
|
||||
yoff = (aReflowState.ComputedHeight() - aDesiredSize.height)/2;
|
||||
if (yoff < 0) {
|
||||
yoff = 0;
|
||||
}
|
||||
|
|
|
@ -565,7 +565,7 @@ nsListControlFrame::Reflow(nsPresContext* aPresContext,
|
|||
* compute the new max height and it's the same as the old one.
|
||||
*/
|
||||
|
||||
PRBool autoHeight = (aReflowState.mComputedHeight == NS_UNCONSTRAINEDSIZE);
|
||||
PRBool autoHeight = (aReflowState.ComputedHeight() == NS_UNCONSTRAINEDSIZE);
|
||||
|
||||
mMightNeedSecondPass = autoHeight && NS_SUBTREE_DIRTY(this);
|
||||
|
||||
|
@ -577,8 +577,9 @@ nsListControlFrame::Reflow(nsPresContext* aPresContext,
|
|||
if (!(GetStateBits() & NS_FRAME_FIRST_REFLOW) && autoHeight) {
|
||||
// When not doing an initial reflow, and when the height is auto, start off
|
||||
// with our computed height set to what we'd expect our height to be.
|
||||
state.mComputedHeight = CalcIntrinsicHeight(oldHeightOfARow, length);
|
||||
state.ApplyMinMaxConstraints(nsnull, &state.mComputedHeight);
|
||||
nscoord computedHeight = CalcIntrinsicHeight(oldHeightOfARow, length);
|
||||
state.ApplyMinMaxConstraints(nsnull, &computedHeight);
|
||||
state.SetComputedHeight(computedHeight);
|
||||
}
|
||||
|
||||
nsresult rv = nsHTMLScrollFrame::Reflow(aPresContext, aDesiredSize,
|
||||
|
@ -615,8 +616,9 @@ nsListControlFrame::Reflow(nsPresContext* aPresContext,
|
|||
nsHTMLScrollFrame::DidReflow(aPresContext, &state, aStatus);
|
||||
|
||||
// Now compute the height we want to have
|
||||
state.mComputedHeight = CalcIntrinsicHeight(HeightOfARow(), length);
|
||||
state.ApplyMinMaxConstraints(nsnull, &state.mComputedHeight);
|
||||
nscoord computedHeight = CalcIntrinsicHeight(HeightOfARow(), length);
|
||||
state.ApplyMinMaxConstraints(nsnull, &computedHeight);
|
||||
state.SetComputedHeight(computedHeight);
|
||||
|
||||
nsHTMLScrollFrame::WillReflow(aPresContext);
|
||||
|
||||
|
@ -632,7 +634,7 @@ nsListControlFrame::ReflowAsDropdown(nsPresContext* aPresContext,
|
|||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
NS_PRECONDITION(aReflowState.mComputedHeight == NS_UNCONSTRAINEDSIZE,
|
||||
NS_PRECONDITION(aReflowState.ComputedHeight() == NS_UNCONSTRAINEDSIZE,
|
||||
"We should not have a computed height here!");
|
||||
|
||||
mMightNeedSecondPass = NS_SUBTREE_DIRTY(this);
|
||||
|
@ -648,7 +650,7 @@ nsListControlFrame::ReflowAsDropdown(nsPresContext* aPresContext,
|
|||
// Note: At this point, mLastDropdownComputedHeight can be
|
||||
// NS_UNCONSTRAINEDSIZE in cases when last time we didn't have to constrain
|
||||
// the height. That's fine; just do the same thing as last time.
|
||||
state.mComputedHeight = mLastDropdownComputedHeight;
|
||||
state.SetComputedHeight(mLastDropdownComputedHeight);
|
||||
oldVisibleHeight = GetScrolledFrame()->GetSize().height;
|
||||
} else {
|
||||
// Set oldVisibleHeight to something that will never test true against a
|
||||
|
@ -729,22 +731,22 @@ nsListControlFrame::ReflowAsDropdown(nsPresContext* aPresContext,
|
|||
}
|
||||
}
|
||||
|
||||
state.mComputedHeight = mNumDisplayRows * heightOfARow;
|
||||
state.SetComputedHeight(mNumDisplayRows * heightOfARow);
|
||||
// Note: no need to apply min/max constraints, since we have no such
|
||||
// rules applied to the combobox dropdown.
|
||||
// XXXbz this is ending up too big!! Figure out why.
|
||||
} else if (visibleHeight == 0) {
|
||||
// Looks like we have no options. Just size us to a single row height.
|
||||
state.mComputedHeight = heightOfARow;
|
||||
state.SetComputedHeight(heightOfARow);
|
||||
} else {
|
||||
// Not too big, not too small. Just use it!
|
||||
state.mComputedHeight = NS_UNCONSTRAINEDSIZE;
|
||||
state.SetComputedHeight(NS_UNCONSTRAINEDSIZE);
|
||||
}
|
||||
|
||||
// Note: At this point, state.mComputedHeight can be NS_UNCONSTRAINEDSIZE in
|
||||
// cases when there were some options, but not too many (so no scrollbar was
|
||||
// needed). That's fine; just store that.
|
||||
mLastDropdownComputedHeight = state.mComputedHeight;
|
||||
mLastDropdownComputedHeight = state.ComputedHeight();
|
||||
|
||||
nsHTMLScrollFrame::WillReflow(aPresContext);
|
||||
return nsHTMLScrollFrame::Reflow(aPresContext, aDesiredSize, state, aStatus);
|
||||
|
|
|
@ -338,7 +338,7 @@ nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame* aDelegat
|
|||
PrettyUC(aReflowState.availableHeight, height);
|
||||
printf(" a=%s,%s ", width, height);
|
||||
PrettyUC(aReflowState.ComputedWidth(), width);
|
||||
PrettyUC(aReflowState.mComputedHeight, height);
|
||||
PrettyUC(aReflowState.ComputedHeight(), height);
|
||||
printf("c=%s,%s \n", width, height);
|
||||
}
|
||||
AutoNoisyIndenter indent(nsBlockFrame::gNoisy);
|
||||
|
|
|
@ -824,9 +824,9 @@ CalculateContainingBlockSizeForAbsolutes(const nsHTMLReflowState& aReflowState,
|
|||
cbSize.width = PR_MAX(0,
|
||||
aLastRS->ComputedWidth() + aLastRS->mComputedPadding.LeftRight() - scrollbars.LeftRight());
|
||||
}
|
||||
if (aLastRS->mComputedHeight != NS_UNCONSTRAINEDSIZE) {
|
||||
if (aLastRS->ComputedHeight() != NS_UNCONSTRAINEDSIZE) {
|
||||
cbSize.height = PR_MAX(0,
|
||||
aLastRS->mComputedHeight + aLastRS->mComputedPadding.TopBottom() - scrollbars.TopBottom());
|
||||
aLastRS->ComputedHeight() + aLastRS->mComputedPadding.TopBottom() - scrollbars.TopBottom());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -848,7 +848,7 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
|||
ListTag(stdout);
|
||||
printf(": begin reflow availSize=%d,%d computedSize=%d,%d\n",
|
||||
aReflowState.availableWidth, aReflowState.availableHeight,
|
||||
aReflowState.ComputedWidth(), aReflowState.mComputedHeight);
|
||||
aReflowState.ComputedWidth(), aReflowState.ComputedHeight());
|
||||
}
|
||||
AutoNoisyIndenter indent(gNoisy);
|
||||
PRTime start = LL_ZERO; // Initialize these variablies to silence the compiler.
|
||||
|
@ -1130,7 +1130,7 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
|||
// viewport height, which can't change during incremental
|
||||
// reflow.
|
||||
PRBool cbHeightChanged =
|
||||
!(isRoot && NS_UNCONSTRAINEDSIZE == aReflowState.mComputedHeight) &&
|
||||
!(isRoot && NS_UNCONSTRAINEDSIZE == aReflowState.ComputedHeight()) &&
|
||||
aMetrics.height != oldSize.height;
|
||||
|
||||
rv = mAbsoluteContainer.Reflow(this, aPresContext, aReflowState,
|
||||
|
@ -1263,10 +1263,10 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState,
|
|||
}
|
||||
|
||||
// Compute final height
|
||||
if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedHeight) {
|
||||
if (NS_UNCONSTRAINEDSIZE != aReflowState.ComputedHeight()) {
|
||||
// Figure out how much of the computed height should be
|
||||
// applied to this frame.
|
||||
nscoord computedHeightLeftOver = aReflowState.mComputedHeight;
|
||||
nscoord computedHeightLeftOver = aReflowState.ComputedHeight();
|
||||
if (GetPrevInFlow()) {
|
||||
// Reduce the height by the computed height of prev-in-flows.
|
||||
for (nsIFrame* prev = GetPrevInFlow(); prev; prev = prev->GetPrevInFlow()) {
|
||||
|
|
|
@ -175,7 +175,7 @@ nsBlockReflowContext::ComputeCollapsedTopMargin(const nsHTMLReflowState& aRS,
|
|||
if (frame != aRS.frame) {
|
||||
NS_ASSERTION(frame->GetParent() == aRS.frame,
|
||||
"Can only drill through one level of block wrapper");
|
||||
nsSize availSpace(aRS.ComputedWidth(), aRS.mComputedHeight);
|
||||
nsSize availSpace(aRS.ComputedWidth(), aRS.ComputedHeight());
|
||||
outerReflowState = new nsHTMLReflowState(prescontext,
|
||||
aRS, frame, availSpace);
|
||||
if (!outerReflowState)
|
||||
|
@ -183,7 +183,7 @@ nsBlockReflowContext::ComputeCollapsedTopMargin(const nsHTMLReflowState& aRS,
|
|||
}
|
||||
{
|
||||
nsSize availSpace(outerReflowState->ComputedWidth(),
|
||||
outerReflowState->mComputedHeight);
|
||||
outerReflowState->ComputedHeight());
|
||||
nsHTMLReflowState innerReflowState(prescontext,
|
||||
*outerReflowState, kid,
|
||||
availSpace);
|
||||
|
|
|
@ -225,8 +225,8 @@ nsColumnSetFrame::ChooseColumnStrategy(const nsHTMLReflowState& aReflowState)
|
|||
availContentWidth = aReflowState.ComputedWidth();
|
||||
}
|
||||
nscoord colHeight = GetAvailableContentHeight(aReflowState);
|
||||
if (aReflowState.mComputedHeight != NS_INTRINSICSIZE) {
|
||||
colHeight = aReflowState.mComputedHeight;
|
||||
if (aReflowState.ComputedHeight() != NS_INTRINSICSIZE) {
|
||||
colHeight = aReflowState.ComputedHeight();
|
||||
}
|
||||
|
||||
nscoord colGap = GetColumnGap(this, colStyle);
|
||||
|
@ -282,7 +282,7 @@ nsColumnSetFrame::ChooseColumnStrategy(const nsHTMLReflowState& aReflowState)
|
|||
|
||||
// NOTE that the non-balancing behavior for non-auto computed height
|
||||
// is not in the CSS3 columns draft as of 18 January 2001
|
||||
if (aReflowState.mComputedHeight == NS_INTRINSICSIZE) {
|
||||
if (aReflowState.ComputedHeight() == NS_INTRINSICSIZE) {
|
||||
// Balancing!
|
||||
if (numColumns <= 0) {
|
||||
// Hmm, auto column count, column width or available width is unknown,
|
||||
|
@ -488,7 +488,7 @@ nsColumnSetFrame::ReflowChildren(nsHTMLReflowMetrics& aDesiredSize,
|
|||
|
||||
nsHTMLReflowState kidReflowState(PresContext(), aReflowState, child,
|
||||
availSize, availSize.width,
|
||||
aReflowState.mComputedHeight);
|
||||
aReflowState.ComputedHeight());
|
||||
kidReflowState.mFlags.mIsTopOfPage = PR_TRUE;
|
||||
kidReflowState.mFlags.mTableIsSplittable = PR_FALSE;
|
||||
|
||||
|
@ -638,8 +638,8 @@ nsColumnSetFrame::ReflowChildren(nsHTMLReflowMetrics& aDesiredSize,
|
|||
nsSize contentSize = nsSize(contentRect.XMost(), contentRect.YMost());
|
||||
|
||||
// Apply computed and min/max values
|
||||
if (aReflowState.mComputedHeight != NS_INTRINSICSIZE) {
|
||||
contentSize.height = aReflowState.mComputedHeight;
|
||||
if (aReflowState.ComputedHeight() != NS_INTRINSICSIZE) {
|
||||
contentSize.height = aReflowState.ComputedHeight();
|
||||
} else {
|
||||
if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedMaxHeight) {
|
||||
contentSize.height = PR_MIN(aReflowState.mComputedMaxHeight, contentSize.height);
|
||||
|
|
|
@ -3302,8 +3302,8 @@ nsFrame::DidReflow(nsPresContext* aPresContext,
|
|||
// where a table cell has no computed height but can fabricate one
|
||||
// when the cell height is known.
|
||||
if (aReflowState && aReflowState->mPercentHeightObserver &&
|
||||
((NS_UNCONSTRAINEDSIZE == aReflowState->mComputedHeight) || // no computed height
|
||||
(0 == aReflowState->mComputedHeight)) &&
|
||||
((NS_UNCONSTRAINEDSIZE == aReflowState->ComputedHeight()) || // no computed height
|
||||
(0 == aReflowState->ComputedHeight())) &&
|
||||
(eStyleUnit_Percent == aReflowState->mStylePosition->mHeight.GetUnit())) {
|
||||
|
||||
nsIFrame* prevInFlow = GetPrevInFlow();
|
||||
|
@ -6187,7 +6187,7 @@ nsFrame::BoxReflow(nsBoxLayoutState& aState,
|
|||
if (parentSize.width != NS_INTRINSICSIZE)
|
||||
parentReflowState.SetComputedWidth(parentSize.width);
|
||||
if (parentSize.height != NS_INTRINSICSIZE)
|
||||
parentReflowState.mComputedHeight = parentSize.height;
|
||||
parentReflowState.SetComputedHeight(parentSize.height);
|
||||
parentReflowState.mComputedMargin.SizeTo(0, 0, 0, 0);
|
||||
// XXX use box methods
|
||||
parentFrame->GetPadding(parentReflowState.mComputedPadding);
|
||||
|
@ -6215,12 +6215,12 @@ nsFrame::BoxReflow(nsBoxLayoutState& aState,
|
|||
reflowState.SetComputedWidth(computedWidth);
|
||||
}
|
||||
if (aHeight != NS_INTRINSICSIZE) {
|
||||
reflowState.mComputedHeight =
|
||||
nscoord computedHeight =
|
||||
aHeight - reflowState.mComputedBorderPadding.TopBottom();
|
||||
if (reflowState.mComputedHeight < 0)
|
||||
reflowState.mComputedHeight = 0;
|
||||
computedHeight = PR_MAX(computedHeight, 0);
|
||||
reflowState.SetComputedHeight(computedHeight);
|
||||
} else {
|
||||
reflowState.mComputedHeight =
|
||||
reflowState.SetComputedHeight(
|
||||
ComputeSize(aRenderingContext, availSize, availSize.width,
|
||||
nsSize(reflowState.mComputedMargin.LeftRight(),
|
||||
reflowState.mComputedMargin.TopBottom()),
|
||||
|
@ -6230,7 +6230,8 @@ nsFrame::BoxReflow(nsBoxLayoutState& aState,
|
|||
reflowState.mComputedPadding.TopBottom()),
|
||||
nsSize(reflowState.mComputedPadding.LeftRight(),
|
||||
reflowState.mComputedPadding.TopBottom()),
|
||||
PR_FALSE).height;
|
||||
PR_FALSE).height
|
||||
);
|
||||
}
|
||||
|
||||
// Box layout calls SetRect before Layout, whereas non-box layout
|
||||
|
@ -6246,7 +6247,8 @@ nsFrame::BoxReflow(nsBoxLayoutState& aState,
|
|||
|
||||
#ifdef DEBUG_REFLOW
|
||||
nsAdaptorAddIndents();
|
||||
printf("Size=(%d,%d)\n",reflowState.ComputedWidth(), reflowState.mComputedHeight);
|
||||
printf("Size=(%d,%d)\n",reflowState.ComputedWidth(),
|
||||
reflowState.ComputedHeight());
|
||||
nsAdaptorAddIndents();
|
||||
nsAdaptorPrintReason(reflowState);
|
||||
printf("\n");
|
||||
|
@ -7211,7 +7213,7 @@ static void DisplayReflowEnterPrint(nsPresContext* aPresContext,
|
|||
printf("Reflow a=%s,%s ", width, height);
|
||||
|
||||
DR_state->PrettyUC(aReflowState.ComputedWidth(), width);
|
||||
DR_state->PrettyUC(aReflowState.mComputedHeight, height);
|
||||
DR_state->PrettyUC(aReflowState.ComputedHeight(), height);
|
||||
printf("c=%s,%s ", width, height);
|
||||
|
||||
if (aFrame->GetStateBits() & NS_FRAME_IS_DIRTY)
|
||||
|
@ -7246,7 +7248,7 @@ static void DisplayReflowEnterPrint(nsPresContext* aPresContext,
|
|||
CheckPixelError(aReflowState.availableWidth, p2t);
|
||||
CheckPixelError(aReflowState.availableHeight, p2t);
|
||||
CheckPixelError(aReflowState.ComputedWidth(), p2t);
|
||||
CheckPixelError(aReflowState.mComputedHeight, p2t);
|
||||
CheckPixelError(aReflowState.ComputedHeight(), p2t);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -269,7 +269,7 @@ static nsSize ComputeInsideBorderSize(ScrollReflowState* aState,
|
|||
contentWidth = aDesiredInsideBorderSize.width -
|
||||
aState->mReflowState.mComputedPadding.LeftRight();
|
||||
}
|
||||
nscoord contentHeight = aState->mReflowState.mComputedHeight;
|
||||
nscoord contentHeight = aState->mReflowState.ComputedHeight();
|
||||
if (contentHeight == NS_UNCONSTRAINEDSIZE) {
|
||||
contentHeight = aDesiredInsideBorderSize.height -
|
||||
aState->mReflowState.mComputedPadding.TopBottom();
|
||||
|
|
|
@ -137,7 +137,7 @@ nsHTMLCanvasFrame::Reflow(nsPresContext* aPresContext,
|
|||
aStatus = NS_FRAME_COMPLETE;
|
||||
|
||||
aMetrics.width = aReflowState.ComputedWidth();
|
||||
aMetrics.height = aReflowState.mComputedHeight;
|
||||
aMetrics.height = aReflowState.ComputedHeight();
|
||||
|
||||
// stash this away so we can compute our inner area later
|
||||
mBorderPadding = aReflowState.mComputedBorderPadding;
|
||||
|
|
|
@ -263,6 +263,32 @@ nsHTMLReflowState::SetComputedWidth(nscoord aComputedWidth)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsHTMLReflowState::SetComputedHeight(nscoord aComputedHeight)
|
||||
{
|
||||
NS_ASSERTION(frame, "Must have a frame!");
|
||||
// It'd be nice to assert that |frame| is not in reflow, but this fails for
|
||||
// two reasons:
|
||||
//
|
||||
// 1) Viewport frames reset the computed height on a copy of their reflow
|
||||
// state when reflowing fixed-pos kids. In that case we actually don't
|
||||
// want to mess with the resize flags, because comparing the frame's rect
|
||||
// to the munged computed width is pointless.
|
||||
// 2) nsFrame::BoxReflow creates a reflow state for its parent. This reflow
|
||||
// state is not used to reflow the parent, but just as a parent for the
|
||||
// frame's own reflow state. So given a nsBoxFrame inside some non-XUL
|
||||
// (like a text control, for example), we'll end up creating a reflow
|
||||
// state for the parent while the parent is reflowing.
|
||||
|
||||
NS_PRECONDITION(aComputedHeight >= 0, "Invalid computed height");
|
||||
if (mComputedHeight != aComputedHeight) {
|
||||
mComputedHeight = aComputedHeight;
|
||||
if (frame->GetType() != nsGkAtoms::viewportFrame) { // Or check GetParent()?
|
||||
InitResizeFlags(frame->PresContext());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsHTMLReflowState::Init(nsPresContext* aPresContext,
|
||||
nscoord aContainingBlockWidth,
|
||||
|
@ -346,7 +372,7 @@ IsQuirkContainingBlockHeight(const nsHTMLReflowState* rs)
|
|||
|
||||
// Note: This next condition could change due to a style change,
|
||||
// but that would cause a style reflow anyway, which means we're ok.
|
||||
if (NS_AUTOHEIGHT == rs->mComputedHeight) {
|
||||
if (NS_AUTOHEIGHT == rs->ComputedHeight()) {
|
||||
if (!rs->frame->GetStyleDisplay()->IsAbsolutelyPositioned()) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
@ -1400,7 +1426,7 @@ CalcQuirkContainingBlockHeight(const nsHTMLReflowState* aCBReflowState)
|
|||
// go any further (see bug 221784). The behavior we want here is: 1) If
|
||||
// not auto-height, use this as the percentage base. 2) If auto-height,
|
||||
// keep looking, unless the frame is positioned.
|
||||
if (NS_AUTOHEIGHT == rs->mComputedHeight) {
|
||||
if (NS_AUTOHEIGHT == rs->ComputedHeight()) {
|
||||
if (rs->frame->GetStyleDisplay()->IsAbsolutelyPositioned()) {
|
||||
break;
|
||||
} else {
|
||||
|
@ -1429,7 +1455,7 @@ CalcQuirkContainingBlockHeight(const nsHTMLReflowState* aCBReflowState)
|
|||
// if the ancestor is the page content frame then the percent base is
|
||||
// the avail height, otherwise it is the computed height
|
||||
result = (nsGkAtoms::pageContentFrame == frameType)
|
||||
? rs->availableHeight : rs->mComputedHeight;
|
||||
? rs->availableHeight : rs->ComputedHeight();
|
||||
// if unconstrained - don't sutract borders - would result in huge height
|
||||
if (NS_AUTOHEIGHT == result) return result;
|
||||
|
||||
|
|
|
@ -278,7 +278,6 @@ private:
|
|||
// containing block, the margin/border/padding areas, and the min/max width.
|
||||
nscoord mComputedWidth;
|
||||
|
||||
public:
|
||||
// The computed height specifies the frame's content height, and it does
|
||||
// not apply to inline non-replaced elements
|
||||
//
|
||||
|
@ -294,6 +293,7 @@ public:
|
|||
// means you use your intrinsic height as the computed height
|
||||
nscoord mComputedHeight;
|
||||
|
||||
public:
|
||||
// Computed values for 'left/top/right/bottom' offsets. Only applies to
|
||||
// 'positioned' elements
|
||||
nsMargin mComputedOffsets;
|
||||
|
@ -447,8 +447,13 @@ public:
|
|||
}
|
||||
|
||||
nscoord ComputedWidth() const { return mComputedWidth; }
|
||||
// This method doesn't apply min/max computed widths to the value passed in.
|
||||
void SetComputedWidth(nscoord aComputedWidth);
|
||||
|
||||
nscoord ComputedHeight() const { return mComputedHeight; }
|
||||
// This method doesn't apply min/max computed heights to the value passed in.
|
||||
void SetComputedHeight(nscoord aComputedHeight);
|
||||
|
||||
void SetTruncated(const nsHTMLReflowMetrics& aMetrics, nsReflowStatus* aStatus) const;
|
||||
|
||||
protected:
|
||||
|
|
|
@ -149,7 +149,7 @@ static PRBool HaveFixedSize(const nsStylePosition* aStylePosition)
|
|||
inline PRBool HaveFixedSize(const nsHTMLReflowState& aReflowState)
|
||||
{
|
||||
NS_ASSERTION(aReflowState.mStylePosition, "crappy reflowState - null stylePosition");
|
||||
// when an image has percent css style height or width, but mComputedHeight
|
||||
// when an image has percent css style height or width, but ComputedHeight()
|
||||
// or ComputedWidth() of reflow state is NS_UNCONSTRAINEDSIZE
|
||||
// it needs to return PR_FALSE to cause an incremental reflow later
|
||||
// if an image is inside table like bug 156731 simple testcase III,
|
||||
|
@ -158,7 +158,7 @@ inline PRBool HaveFixedSize(const nsHTMLReflowState& aReflowState)
|
|||
// see bug 156731
|
||||
nsStyleUnit heightUnit = (*(aReflowState.mStylePosition)).mHeight.GetUnit();
|
||||
nsStyleUnit widthUnit = (*(aReflowState.mStylePosition)).mWidth.GetUnit();
|
||||
return ((eStyleUnit_Percent == heightUnit && NS_UNCONSTRAINEDSIZE == aReflowState.mComputedHeight) ||
|
||||
return ((eStyleUnit_Percent == heightUnit && NS_UNCONSTRAINEDSIZE == aReflowState.ComputedHeight()) ||
|
||||
(eStyleUnit_Percent == widthUnit && (NS_UNCONSTRAINEDSIZE == aReflowState.ComputedWidth() ||
|
||||
0 == aReflowState.ComputedWidth())))
|
||||
? PR_FALSE
|
||||
|
@ -792,7 +792,7 @@ nsImageFrame::Reflow(nsPresContext* aPresContext,
|
|||
}
|
||||
|
||||
mComputedSize =
|
||||
nsSize(aReflowState.ComputedWidth(), aReflowState.mComputedHeight);
|
||||
nsSize(aReflowState.ComputedWidth(), aReflowState.ComputedHeight());
|
||||
RecalculateTransform();
|
||||
|
||||
aMetrics.width = mComputedSize.width;
|
||||
|
|
|
@ -87,8 +87,8 @@ nsLeafFrame::Reflow(nsPresContext* aPresContext,
|
|||
"Shouldn't have unconstrained stuff here");
|
||||
|
||||
aMetrics.width = aReflowState.ComputedWidth();
|
||||
if (NS_INTRINSICSIZE != aReflowState.mComputedHeight) {
|
||||
aMetrics.height = aReflowState.mComputedHeight;
|
||||
if (NS_INTRINSICSIZE != aReflowState.ComputedHeight()) {
|
||||
aMetrics.height = aReflowState.ComputedHeight();
|
||||
} else {
|
||||
aMetrics.height = GetIntrinsicHeight();
|
||||
// XXXbz using NS_CSS_MINMAX like this presupposes content-box sizing.
|
||||
|
|
|
@ -644,7 +644,7 @@ nsObjectFrame::GetDesiredSize(nsPresContext* aPresContext,
|
|||
}
|
||||
|
||||
aMetrics.width = aReflowState.ComputedWidth();
|
||||
aMetrics.height = aReflowState.mComputedHeight;
|
||||
aMetrics.height = aReflowState.ComputedHeight();
|
||||
|
||||
// for EMBED and APPLET, default to 240x200 for compatibility
|
||||
nsIAtom *atom = mContent->Tag();
|
||||
|
|
|
@ -287,7 +287,7 @@ nsSimplePageSequenceFrame::Reflow(nsPresContext* aPresContext,
|
|||
nsReflowStatus status;
|
||||
|
||||
kidReflowState.SetComputedWidth(kidReflowState.availableWidth);
|
||||
//kidReflowState.mComputedHeight = kidReflowState.availableHeight;
|
||||
//kidReflowState.SetComputedHeight(kidReflowState.availableHeight);
|
||||
PR_PL(("AV W: %d H: %d\n", kidReflowState.availableWidth, kidReflowState.availableHeight));
|
||||
|
||||
// Set the shared data into the page frame before reflow
|
||||
|
|
|
@ -232,9 +232,10 @@ nsPoint
|
|||
if (scrollingFrame) {
|
||||
nsMargin scrollbars = scrollingFrame->GetActualScrollbarSizes();
|
||||
aReflowState->SetComputedWidth(aReflowState->ComputedWidth() -
|
||||
(scrollbars.left + scrollbars.right));
|
||||
aReflowState->availableWidth -= scrollbars.left + scrollbars.right;
|
||||
aReflowState->mComputedHeight -= scrollbars.top + scrollbars.bottom;
|
||||
scrollbars.LeftRight());
|
||||
aReflowState->availableWidth -= scrollbars.LeftRight();
|
||||
aReflowState->SetComputedHeight(aReflowState->ComputedHeight() -
|
||||
scrollbars.TopBottom());
|
||||
// XXX why don't we also adjust "aReflowState->availableHeight"?
|
||||
return nsPoint(scrollbars.left, scrollbars.top);
|
||||
}
|
||||
|
@ -280,7 +281,7 @@ ViewportFrame::Reflow(nsPresContext* aPresContext,
|
|||
kidFrame, availableSpace);
|
||||
|
||||
// Reflow the frame
|
||||
kidReflowState.mComputedHeight = aReflowState.availableHeight;
|
||||
kidReflowState.SetComputedHeight(aReflowState.availableHeight);
|
||||
rv = ReflowChild(kidFrame, aPresContext, kidDesiredSize, kidReflowState,
|
||||
0, 0, 0, aStatus);
|
||||
kidRect.width = kidDesiredSize.width;
|
||||
|
@ -317,7 +318,7 @@ ViewportFrame::Reflow(nsPresContext* aPresContext,
|
|||
// Just reflow all the fixed-pos frames.
|
||||
rv = mFixedContainer.Reflow(this, aPresContext, reflowState,
|
||||
reflowState.ComputedWidth(),
|
||||
reflowState.mComputedHeight,
|
||||
reflowState.ComputedHeight(),
|
||||
PR_TRUE, PR_TRUE); // XXX could be optimized
|
||||
|
||||
// If we were dirty then do a repaint
|
||||
|
|
|
@ -1050,7 +1050,7 @@ nsMathMLContainerFrame::Reflow(nsPresContext* aPresContext,
|
|||
// Asking each child to cache its bounding metrics
|
||||
|
||||
nsReflowStatus childStatus;
|
||||
nsSize availSize(aReflowState.ComputedWidth(), aReflowState.mComputedHeight);
|
||||
nsSize availSize(aReflowState.ComputedWidth(), aReflowState.ComputedHeight());
|
||||
nsHTMLReflowMetrics childDesiredSize(
|
||||
aDesiredSize.mFlags | NS_REFLOW_CALC_BOUNDING_METRICS);
|
||||
nsIFrame* childFrame = mFrames.FirstChild();
|
||||
|
|
|
@ -132,7 +132,7 @@ nsMathMLTokenFrame::Reflow(nsPresContext* aPresContext,
|
|||
// ask our children to compute their bounding metrics
|
||||
nsHTMLReflowMetrics childDesiredSize(
|
||||
aDesiredSize.mFlags | NS_REFLOW_CALC_BOUNDING_METRICS);
|
||||
nsSize availSize(aReflowState.ComputedWidth(), aReflowState.mComputedHeight);
|
||||
nsSize availSize(aReflowState.ComputedWidth(), aReflowState.ComputedHeight());
|
||||
PRInt32 count = 0;
|
||||
nsIFrame* childFrame = GetFirstChild(nsnull);
|
||||
while (childFrame) {
|
||||
|
|
|
@ -283,7 +283,7 @@ nsMathMLmactionFrame::Reflow(nsPresContext* aPresContext,
|
|||
nsIFrame* childFrame = GetSelectedFrame();
|
||||
if (childFrame) {
|
||||
nsSize availSize(aReflowState.ComputedWidth(),
|
||||
aReflowState.mComputedHeight);
|
||||
aReflowState.ComputedHeight());
|
||||
nsHTMLReflowState childReflowState(aPresContext, aReflowState,
|
||||
childFrame, availSize);
|
||||
rv = ReflowChild(childFrame, aPresContext, aDesiredSize,
|
||||
|
|
|
@ -286,7 +286,7 @@ nsMathMLmfencedFrame::doReflow(nsPresContext* aPresContext,
|
|||
|
||||
PRInt32 count = 0;
|
||||
nsReflowStatus childStatus;
|
||||
nsSize availSize(aReflowState.ComputedWidth(), aReflowState.mComputedHeight);
|
||||
nsSize availSize(aReflowState.ComputedWidth(), aReflowState.ComputedHeight());
|
||||
nsHTMLReflowMetrics childDesiredSize(
|
||||
aDesiredSize.mFlags | NS_REFLOW_CALC_BOUNDING_METRICS);
|
||||
nsIFrame* firstChild = aForFrame->GetFirstChild(nsnull);
|
||||
|
|
|
@ -163,7 +163,7 @@ nsMathMLmrootFrame::Reflow(nsPresContext* aPresContext,
|
|||
// ask our children to compute their bounding metrics
|
||||
nsHTMLReflowMetrics childDesiredSize(
|
||||
aDesiredSize.mFlags | NS_REFLOW_CALC_BOUNDING_METRICS);
|
||||
nsSize availSize(aReflowState.ComputedWidth(), aReflowState.mComputedHeight);
|
||||
nsSize availSize(aReflowState.ComputedWidth(), aReflowState.ComputedHeight());
|
||||
nsReflowStatus childStatus;
|
||||
|
||||
aDesiredSize.width = aDesiredSize.height = 0;
|
||||
|
|
|
@ -166,7 +166,7 @@ nsSVGForeignObjectFrame::Reflow(nsPresContext* aPresContext,
|
|||
NS_ASSERTION(!aReflowState.parentReflowState,
|
||||
"should only get reflow from being reflow root");
|
||||
NS_ASSERTION(aReflowState.ComputedWidth() == GetSize().width &&
|
||||
aReflowState.mComputedHeight == GetSize().height,
|
||||
aReflowState.ComputedHeight() == GetSize().height,
|
||||
"reflow roots should be reflown at existing size and "
|
||||
"svg.css should ensure we have no padding/border/margin");
|
||||
|
||||
|
@ -174,7 +174,7 @@ nsSVGForeignObjectFrame::Reflow(nsPresContext* aPresContext,
|
|||
|
||||
// XXX why don't we convert from CSS pixels to app units? How does this work?
|
||||
aDesiredSize.width = aReflowState.ComputedWidth();
|
||||
aDesiredSize.height = aReflowState.mComputedHeight;
|
||||
aDesiredSize.height = aReflowState.ComputedHeight();
|
||||
aDesiredSize.mOverflowArea =
|
||||
nsRect(nsPoint(0, 0), nsSize(aDesiredSize.width, aDesiredSize.height));
|
||||
aStatus = NS_FRAME_COMPLETE;
|
||||
|
@ -624,7 +624,7 @@ nsSVGForeignObjectFrame::DoReflow()
|
|||
"does not get styled");
|
||||
NS_ASSERTION(reflowState.ComputedWidth() == size.width,
|
||||
"reflow state made child wrong size");
|
||||
reflowState.mComputedHeight = size.height;
|
||||
reflowState.SetComputedHeight(size.height);
|
||||
|
||||
ReflowChild(kid, presContext, desiredSize, reflowState, 0, 0,
|
||||
NS_FRAME_NO_MOVE_FRAME, status);
|
||||
|
|
|
@ -635,8 +635,8 @@ nsSVGOuterSVGFrame::CalculateAvailableSpace(nsRect *maxRect,
|
|||
if (aReflowState.availableHeight != NS_INTRINSICSIZE)
|
||||
maxRect->height = aReflowState.availableHeight;
|
||||
else if (aReflowState.parentReflowState &&
|
||||
aReflowState.parentReflowState->mComputedHeight != NS_INTRINSICSIZE)
|
||||
maxRect->height = aReflowState.parentReflowState->mComputedHeight;
|
||||
aReflowState.parentReflowState->ComputedHeight() != NS_INTRINSICSIZE)
|
||||
maxRect->height = aReflowState.parentReflowState->ComputedHeight();
|
||||
else
|
||||
maxRect->height = NS_MAXSIZE;
|
||||
|
||||
|
|
|
@ -129,8 +129,8 @@ nsTableCellFrame::NotifyPercentHeight(const nsHTMLReflowState& aReflowState)
|
|||
const nsHTMLReflowState *cellRS = aReflowState.mCBReflowState;
|
||||
|
||||
if (cellRS && cellRS->frame == this &&
|
||||
(cellRS->mComputedHeight == NS_UNCONSTRAINEDSIZE ||
|
||||
cellRS->mComputedHeight == 0)) { // XXXldb Why 0?
|
||||
(cellRS->ComputedHeight() == NS_UNCONSTRAINEDSIZE ||
|
||||
cellRS->ComputedHeight() == 0)) { // XXXldb Why 0?
|
||||
// This is a percentage height on a frame whose percentage heights
|
||||
// are based on the height of the cell, since its containing block
|
||||
// is the inner cell frame.
|
||||
|
@ -819,13 +819,13 @@ NS_METHOD nsTableCellFrame::Reflow(nsPresContext* aPresContext,
|
|||
nscoord computedPaginatedHeight = 0;
|
||||
|
||||
if (aReflowState.mFlags.mSpecialHeightReflow) {
|
||||
((nsHTMLReflowState&)aReflowState).mComputedHeight = mRect.height - topInset - bottomInset;
|
||||
const_cast<nsHTMLReflowState&>(aReflowState).SetComputedHeight(mRect.height - topInset - bottomInset);
|
||||
DISPLAY_REFLOW_CHANGE();
|
||||
}
|
||||
else if (aPresContext->IsPaginated()) {
|
||||
computedPaginatedHeight = CalcUnpaginagedHeight(aPresContext, (nsTableCellFrame&)*this, *tableFrame, topInset + bottomInset);
|
||||
if (computedPaginatedHeight > 0) {
|
||||
((nsHTMLReflowState&)aReflowState).mComputedHeight = computedPaginatedHeight;
|
||||
const_cast<nsHTMLReflowState&>(aReflowState).SetComputedHeight(computedPaginatedHeight);
|
||||
DISPLAY_REFLOW_CHANGE();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1721,8 +1721,8 @@ void
|
|||
nsTableFrame::CheckRequestSpecialHeightReflow(const nsHTMLReflowState& aReflowState)
|
||||
{
|
||||
if (!aReflowState.frame->GetPrevInFlow() && // 1st in flow
|
||||
(NS_UNCONSTRAINEDSIZE == aReflowState.mComputedHeight || // no computed height
|
||||
0 == aReflowState.mComputedHeight) &&
|
||||
(NS_UNCONSTRAINEDSIZE == aReflowState.ComputedHeight() || // no computed height
|
||||
0 == aReflowState.ComputedHeight()) &&
|
||||
eStyleUnit_Percent == aReflowState.mStylePosition->mHeight.GetUnit() && // pct height
|
||||
nsTableFrame::AncestorsHaveStyleHeight(*aReflowState.parentReflowState)) {
|
||||
nsTableFrame::RequestSpecialHeightReflow(aReflowState);
|
||||
|
@ -1845,7 +1845,7 @@ NS_METHOD nsTableFrame::Reflow(nsPresContext* aPresContext,
|
|||
PRBool haveDesiredHeight = PR_FALSE;
|
||||
PRBool reflowedChildren = PR_FALSE;
|
||||
|
||||
if (aReflowState.mComputedHeight != NS_UNCONSTRAINEDSIZE ||
|
||||
if (aReflowState.ComputedHeight() != NS_UNCONSTRAINEDSIZE ||
|
||||
// Also check mVResize, to handle the first Reflow preceding a
|
||||
// special height Reflow, when we've already had a special height
|
||||
// Reflow (where mComputedHeight would not be
|
||||
|
@ -3187,7 +3187,7 @@ nsTableFrame::DistributeHeightToRows(const nsHTMLReflowState& aReflowState,
|
|||
// distribute space to each pct height row whose row group doesn't have a computed
|
||||
// height, and base the pct on the table height. If the row group had a computed
|
||||
// height, then this was already done in nsTableRowGroupFrame::CalculateRowHeights
|
||||
nscoord pctBasis = aReflowState.mComputedHeight - (GetCellSpacingY() * (GetRowCount() + 1));
|
||||
nscoord pctBasis = aReflowState.ComputedHeight() - (GetCellSpacingY() * (GetRowCount() + 1));
|
||||
nscoord yOriginRG = borderPadding.top + GetCellSpacingY();
|
||||
nscoord yEndRG = yOriginRG;
|
||||
PRUint32 rgX;
|
||||
|
@ -3505,7 +3505,7 @@ nsTableFrame::IsAutoHeight()
|
|||
nscoord
|
||||
nsTableFrame::CalcBorderBoxHeight(const nsHTMLReflowState& aState)
|
||||
{
|
||||
nscoord height = aState.mComputedHeight;
|
||||
nscoord height = aState.ComputedHeight();
|
||||
if (NS_AUTOHEIGHT != height) {
|
||||
nsMargin borderPadding = GetContentAreaOffset(&aState);
|
||||
height += borderPadding.top + borderPadding.bottom;
|
||||
|
|
|
@ -511,7 +511,7 @@ GetContainingBlockSize(const nsHTMLReflowState& aOuterRS)
|
|||
if (NS_UNCONSTRAINEDSIZE == size.width) {
|
||||
size.width = 0;
|
||||
}
|
||||
size.height = containRS->mComputedHeight;
|
||||
size.height = containRS->ComputedHeight();
|
||||
if (NS_UNCONSTRAINEDSIZE == size.height) {
|
||||
size.height = 0;
|
||||
}
|
||||
|
|
|
@ -73,16 +73,17 @@ void nsTableCellReflowState::FixUp(const nsSize& aAvailSpace)
|
|||
NS_ASSERTION(NS_UNCONSTRAINEDSIZE != aAvailSpace.width,
|
||||
"unconstrained available width in reflow");
|
||||
if (NS_UNCONSTRAINEDSIZE != ComputedWidth()) {
|
||||
nscoord computedWidth = aAvailSpace.width - mComputedBorderPadding.left -
|
||||
mComputedBorderPadding.right;
|
||||
nscoord computedWidth =
|
||||
aAvailSpace.width - mComputedBorderPadding.LeftRight();
|
||||
computedWidth = PR_MAX(0, computedWidth);
|
||||
SetComputedWidth(computedWidth);
|
||||
}
|
||||
if (NS_UNCONSTRAINEDSIZE != mComputedHeight) {
|
||||
if (NS_UNCONSTRAINEDSIZE != aAvailSpace.height) {
|
||||
mComputedHeight = aAvailSpace.height - mComputedBorderPadding.top - mComputedBorderPadding.bottom;
|
||||
mComputedHeight = PR_MAX(0, mComputedHeight);
|
||||
}
|
||||
if (NS_UNCONSTRAINEDSIZE != ComputedHeight() &&
|
||||
NS_UNCONSTRAINEDSIZE != aAvailSpace.height) {
|
||||
nscoord computedHeight =
|
||||
aAvailSpace.height - mComputedBorderPadding.TopBottom();
|
||||
computedHeight = PR_MAX(0, computedHeight);
|
||||
SetComputedHeight(computedHeight);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -495,8 +496,8 @@ nsTableRowFrame::CalcHeight(const nsHTMLReflowState& aReflowState)
|
|||
if (!tableFrame)
|
||||
return 0;
|
||||
|
||||
nscoord computedHeight = (NS_UNCONSTRAINEDSIZE == aReflowState.mComputedHeight)
|
||||
? 0 : aReflowState.mComputedHeight;
|
||||
nscoord computedHeight = (NS_UNCONSTRAINEDSIZE == aReflowState.ComputedHeight())
|
||||
? 0 : aReflowState.ComputedHeight();
|
||||
ResetHeight(computedHeight);
|
||||
|
||||
const nsStylePosition* position = GetStylePosition();
|
||||
|
|
|
@ -757,9 +757,9 @@ nsTableRowGroupFrame::CalculateRowHeights(nsPresContext* aPresContext,
|
|||
PRBool styleHeightAllocation = PR_FALSE;
|
||||
nscoord rowGroupHeight = startRowGroupHeight + heightOfRows + ((numRows - 1) * cellSpacingY);
|
||||
// if we have a style height, allocate the extra height to unconstrained rows
|
||||
if ((aReflowState.mComputedHeight > rowGroupHeight) &&
|
||||
(NS_UNCONSTRAINEDSIZE != aReflowState.mComputedHeight)) {
|
||||
nscoord extraComputedHeight = aReflowState.mComputedHeight - rowGroupHeight;
|
||||
if ((aReflowState.ComputedHeight() > rowGroupHeight) &&
|
||||
(NS_UNCONSTRAINEDSIZE != aReflowState.ComputedHeight())) {
|
||||
nscoord extraComputedHeight = aReflowState.ComputedHeight() - rowGroupHeight;
|
||||
nscoord extraUsed = 0;
|
||||
PRBool haveUnStyledRows = (heightOfUnStyledRows > 0);
|
||||
nscoord divisor = (haveUnStyledRows)
|
||||
|
@ -786,7 +786,7 @@ nsTableRowGroupFrame::CalculateRowHeights(nsPresContext* aPresContext,
|
|||
}
|
||||
}
|
||||
}
|
||||
rowGroupHeight = aReflowState.mComputedHeight;
|
||||
rowGroupHeight = aReflowState.ComputedHeight();
|
||||
}
|
||||
|
||||
nscoord yOrigin = startRowGroupHeight;
|
||||
|
@ -1295,8 +1295,8 @@ nsTableRowGroupFrame::Reflow(nsPresContext* aPresContext,
|
|||
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||
}
|
||||
|
||||
SetHasStyleHeight((NS_UNCONSTRAINEDSIZE != aReflowState.mComputedHeight) &&
|
||||
(aReflowState.mComputedHeight > 0));
|
||||
SetHasStyleHeight((NS_UNCONSTRAINEDSIZE != aReflowState.ComputedHeight()) &&
|
||||
(aReflowState.ComputedHeight() > 0));
|
||||
|
||||
// just set our width to what was available. The table will calculate the width and not use our value.
|
||||
aDesiredSize.width = aReflowState.availableWidth;
|
||||
|
@ -1440,9 +1440,9 @@ nsTableRowGroupFrame::GetHeightBasis(const nsHTMLReflowState& aReflowState)
|
|||
nscoord result = 0;
|
||||
nsTableFrame* tableFrame = nsTableFrame::GetTableFrame(this);
|
||||
if (tableFrame) {
|
||||
if ((aReflowState.mComputedHeight > 0) && (aReflowState.mComputedHeight < NS_UNCONSTRAINEDSIZE)) {
|
||||
if ((aReflowState.ComputedHeight() > 0) && (aReflowState.ComputedHeight() < NS_UNCONSTRAINEDSIZE)) {
|
||||
nscoord cellSpacing = PR_MAX(0, GetRowCount() - 1) * tableFrame->GetCellSpacingY();
|
||||
result = aReflowState.mComputedHeight - cellSpacing;
|
||||
result = aReflowState.ComputedHeight() - cellSpacing;
|
||||
}
|
||||
else {
|
||||
const nsHTMLReflowState* parentRS = aReflowState.parentReflowState;
|
||||
|
@ -1450,9 +1450,9 @@ nsTableRowGroupFrame::GetHeightBasis(const nsHTMLReflowState& aReflowState)
|
|||
parentRS = parentRS->parentReflowState;
|
||||
}
|
||||
if (parentRS && (tableFrame == parentRS->frame) &&
|
||||
(parentRS->mComputedHeight > 0) && (parentRS->mComputedHeight < NS_UNCONSTRAINEDSIZE)) {
|
||||
(parentRS->ComputedHeight() > 0) && (parentRS->ComputedHeight() < NS_UNCONSTRAINEDSIZE)) {
|
||||
nscoord cellSpacing = PR_MAX(0, tableFrame->GetRowCount() + 1) * tableFrame->GetCellSpacingY();
|
||||
result = parentRS->mComputedHeight - cellSpacing;
|
||||
result = parentRS->ComputedHeight() - cellSpacing;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -683,7 +683,7 @@ nsBoxFrame::Reflow(nsPresContext* aPresContext,
|
|||
printSize("AW", aReflowState.availableWidth);
|
||||
printSize("AH", aReflowState.availableHeight);
|
||||
printSize("CW", aReflowState.ComputedWidth());
|
||||
printSize("CH", aReflowState.mComputedHeight);
|
||||
printSize("CH", aReflowState.ComputedHeight());
|
||||
|
||||
printf(" *\n");
|
||||
|
||||
|
@ -694,7 +694,7 @@ nsBoxFrame::Reflow(nsPresContext* aPresContext,
|
|||
// create the layout state
|
||||
nsBoxLayoutState state(aPresContext, aReflowState.rendContext);
|
||||
|
||||
nsSize computedSize(aReflowState.ComputedWidth(),aReflowState.mComputedHeight);
|
||||
nsSize computedSize(aReflowState.ComputedWidth(),aReflowState.ComputedHeight());
|
||||
|
||||
nsMargin m;
|
||||
m = aReflowState.mComputedBorderPadding;
|
||||
|
@ -715,7 +715,7 @@ nsBoxFrame::Reflow(nsPresContext* aPresContext,
|
|||
// get our desiredSize
|
||||
computedSize.width += m.left + m.right;
|
||||
|
||||
if (aReflowState.mComputedHeight == NS_INTRINSICSIZE) {
|
||||
if (aReflowState.ComputedHeight() == NS_INTRINSICSIZE) {
|
||||
computedSize.height = prefSize.height;
|
||||
} else {
|
||||
computedSize.height += m.top + m.bottom;
|
||||
|
|
|
@ -243,7 +243,8 @@ nsLeafBoxFrame::Reflow(nsPresContext* aPresContext,
|
|||
DO_GLOBAL_REFLOW_COUNT("nsLeafBoxFrame");
|
||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
|
||||
|
||||
NS_ASSERTION(aReflowState.ComputedWidth() >=0 && aReflowState.mComputedHeight >= 0, "Computed Size < 0");
|
||||
NS_ASSERTION(aReflowState.ComputedWidth() >=0 &&
|
||||
aReflowState.ComputedHeight() >= 0, "Computed Size < 0");
|
||||
|
||||
#ifdef DO_NOISY_REFLOW
|
||||
printf("\n-------------Starting LeafBoxFrame Reflow ----------------------------\n");
|
||||
|
@ -266,7 +267,7 @@ nsLeafBoxFrame::Reflow(nsPresContext* aPresContext,
|
|||
printSize("AW", aReflowState.availableWidth);
|
||||
printSize("AH", aReflowState.availableHeight);
|
||||
printSize("CW", aReflowState.ComputedWidth());
|
||||
printSize("CH", aReflowState.mComputedHeight);
|
||||
printSize("CH", aReflowState.ComputedHeight());
|
||||
|
||||
printf(" *\n");
|
||||
|
||||
|
@ -277,7 +278,7 @@ nsLeafBoxFrame::Reflow(nsPresContext* aPresContext,
|
|||
// create the layout state
|
||||
nsBoxLayoutState state(aPresContext, aReflowState.rendContext);
|
||||
|
||||
nsSize computedSize(aReflowState.ComputedWidth(),aReflowState.mComputedHeight);
|
||||
nsSize computedSize(aReflowState.ComputedWidth(),aReflowState.ComputedHeight());
|
||||
|
||||
nsMargin m;
|
||||
m = aReflowState.mComputedBorderPadding;
|
||||
|
@ -285,7 +286,7 @@ nsLeafBoxFrame::Reflow(nsPresContext* aPresContext,
|
|||
//GetBorderAndPadding(m);
|
||||
|
||||
// this happens sometimes. So lets handle it gracefully.
|
||||
if (aReflowState.mComputedHeight == 0) {
|
||||
if (aReflowState.ComputedHeight() == 0) {
|
||||
nsSize minSize = GetMinSize(state);
|
||||
computedSize.height = minSize.height - m.top - m.bottom;
|
||||
}
|
||||
|
@ -307,7 +308,7 @@ nsLeafBoxFrame::Reflow(nsPresContext* aPresContext,
|
|||
computedSize.width += m.left + m.right;
|
||||
}
|
||||
|
||||
if (aReflowState.mComputedHeight == NS_INTRINSICSIZE) {
|
||||
if (aReflowState.ComputedHeight() == NS_INTRINSICSIZE) {
|
||||
computedSize.height = prefSize.height;
|
||||
} else {
|
||||
computedSize.height += m.top + m.bottom;
|
||||
|
|
Загрузка…
Ссылка в новой задаче