From a89529386ff2f66f0c9325276dc61285674e1c76 Mon Sep 17 00:00:00 2001 From: "troy%netscape.com" Date: Tue, 20 Jul 1999 03:41:03 +0000 Subject: [PATCH] Added 'm' prefix to some of the nsHTMLReflowState data members git-svn-id: svn://10.0.0.236/trunk@40215 18797224-902f-48f8-a5cc-f745e15eee43 --- .../layout/forms/nsComboboxControlFrame.cpp | 8 +- mozilla/layout/forms/nsFieldSetFrame.cpp | 14 +- mozilla/layout/forms/nsFormControlFrame.cpp | 8 +- .../layout/forms/nsHTMLButtonControlFrame.cpp | 26 +- mozilla/layout/forms/nsListControlFrame.cpp | 20 +- .../generic/nsAbsoluteContainingBlock.cpp | 58 +-- mozilla/layout/generic/nsAreaFrame.cpp | 2 +- mozilla/layout/generic/nsBlockFrame.cpp | 24 +- .../layout/generic/nsBlockReflowContext.cpp | 14 +- mozilla/layout/generic/nsBlockReflowState.cpp | 24 +- mozilla/layout/generic/nsBlockReflowState.h | 24 +- mozilla/layout/generic/nsFrameFrame.cpp | 8 +- mozilla/layout/generic/nsHTMLFrame.cpp | 20 +- mozilla/layout/generic/nsHTMLReflowState.cpp | 370 +++++++++--------- mozilla/layout/generic/nsLineLayout.cpp | 6 +- mozilla/layout/generic/nsObjectFrame.cpp | 12 +- mozilla/layout/generic/nsViewportFrame.cpp | 24 +- .../base/src/nsAbsoluteContainingBlock.cpp | 58 +-- mozilla/layout/html/base/src/nsAreaFrame.cpp | 2 +- mozilla/layout/html/base/src/nsBlockFrame.cpp | 24 +- .../html/base/src/nsBlockReflowContext.cpp | 14 +- .../html/base/src/nsBlockReflowState.cpp | 24 +- .../layout/html/base/src/nsBlockReflowState.h | 24 +- mozilla/layout/html/base/src/nsHRFrame.cpp | 12 +- mozilla/layout/html/base/src/nsHTMLFrame.cpp | 20 +- .../html/base/src/nsHTMLImageLoader.cpp | 4 +- .../html/base/src/nsHTMLReflowState.cpp | 370 +++++++++--------- mozilla/layout/html/base/src/nsIHTMLReflow.h | 10 +- mozilla/layout/html/base/src/nsLineLayout.cpp | 6 +- .../layout/html/base/src/nsObjectFrame.cpp | 12 +- .../layout/html/base/src/nsScrollFrame.cpp | 24 +- .../layout/html/base/src/nsViewportFrame.cpp | 24 +- .../layout/html/document/src/nsFrameFrame.cpp | 8 +- .../html/forms/src/nsButtonControlFrame.cpp | 4 +- .../html/forms/src/nsComboboxControlFrame.cpp | 8 +- .../layout/html/forms/src/nsFieldSetFrame.cpp | 14 +- .../html/forms/src/nsFormControlFrame.cpp | 8 +- .../forms/src/nsHTMLButtonControlFrame.cpp | 26 +- .../layout/html/forms/src/nsLabelFrame.cpp | 26 +- .../html/forms/src/nsListControlFrame.cpp | 20 +- .../layout/html/table/src/nsTableFrame.cpp | 12 +- mozilla/layout/tables/nsTableFrame.cpp | 12 +- mozilla/layout/xul/base/src/nsBoxFrame.cpp | 26 +- .../xul/base/src/nsColorPickerFrame.cpp | 8 +- mozilla/layout/xul/base/src/nsDeckFrame.cpp | 16 +- .../layout/xul/base/src/nsFontPickerFrame.cpp | 8 +- .../xul/base/src/nsProgressMeterFrame.cpp | 8 +- mozilla/layout/xul/base/src/nsSliderFrame.cpp | 24 +- .../layout/xul/base/src/nsSpinnerFrame.cpp | 8 +- .../xul/base/src/nsTitledButtonFrame.cpp | 12 +- .../xul/base/src/nsTreeRowGroupFrame.cpp | 2 +- .../xul/base/src/nsTriStateCheckboxFrame.cpp | 8 +- 52 files changed, 774 insertions(+), 774 deletions(-) diff --git a/mozilla/layout/forms/nsComboboxControlFrame.cpp b/mozilla/layout/forms/nsComboboxControlFrame.cpp index 0202a7ef1aa..43960355bff 100644 --- a/mozilla/layout/forms/nsComboboxControlFrame.cpp +++ b/mozilla/layout/forms/nsComboboxControlFrame.cpp @@ -357,8 +357,8 @@ nsComboboxControlFrame::ReflowComboChildFrame(nsIFrame* aFrame, nsSize availSize(aAvailableWidth, aAvailableHeight); nsHTMLReflowState kidReflowState(aPresContext, aReflowState, aFrame, availSize); - kidReflowState.computedWidth = aAvailableWidth; - kidReflowState.computedHeight = aAvailableHeight; + kidReflowState.mComputedWidth = aAvailableWidth; + kidReflowState.mComputedHeight = aAvailableHeight; // Reflow child nsresult rv = ReflowChild(aFrame, aPresContext, aDesiredSize, kidReflowState, aStatus); @@ -628,7 +628,7 @@ nsComboboxControlFrame::Reflow(nsIPresContext& aPresContext, //Set the desired size for the button and display frame - if (NS_UNCONSTRAINEDSIZE == firstPassState.computedWidth) { + if (NS_UNCONSTRAINEDSIZE == firstPassState.mComputedWidth) { // A width has not been specified for the select so size the display area to // match the width of the longest item in the drop-down list. The dropdown // list has already been reflowed and sized to shrink around its contents above. @@ -672,7 +672,7 @@ nsComboboxControlFrame::Reflow(nsIPresContext& aPresContext, // Compute display width buttonFrame->GetRect(buttonRect); nscoord displayWidth; - displayWidth = firstPassState.computedWidth - buttonRect.width; + displayWidth = firstPassState.mComputedWidth - buttonRect.width; // Set the displayFrame to match the displayWidth computed above SetChildFrameSize(displayFrame, displayWidth, size.height); diff --git a/mozilla/layout/forms/nsFieldSetFrame.cpp b/mozilla/layout/forms/nsFieldSetFrame.cpp index d869a22b5f1..6ffe6aaefd5 100644 --- a/mozilla/layout/forms/nsFieldSetFrame.cpp +++ b/mozilla/layout/forms/nsFieldSetFrame.cpp @@ -293,7 +293,7 @@ nsFieldSetFrame::Reflow(nsIPresContext& aPresContext, nsReflowStatus& aStatus) { // availSize could have unconstrained values, don't perform any addition on them - nsSize availSize(aReflowState.computedWidth, aReflowState.computedHeight); + nsSize availSize(aReflowState.mComputedWidth, aReflowState.mComputedHeight); // get our border and padding const nsMargin &borderPadding = aReflowState.mComputedBorderPadding; @@ -307,8 +307,8 @@ nsFieldSetFrame::Reflow(nsIPresContext& aPresContext, mLegendFrame, nsSize(NS_INTRINSICSIZE,NS_INTRINSICSIZE)); // always give the legend as much size as it needs - legendReflowState.computedWidth = NS_INTRINSICSIZE; - legendReflowState.computedHeight = NS_INTRINSICSIZE; + legendReflowState.mComputedWidth = NS_INTRINSICSIZE; + legendReflowState.mComputedHeight = NS_INTRINSICSIZE; ReflowChild(mLegendFrame, aPresContext, aDesiredSize, legendReflowState, aStatus); @@ -399,25 +399,25 @@ nsFieldSetFrame::Reflow(nsIPresContext& aPresContext, mLegendFrame->SetRect(actualLegendRect); // Return our size and our result - if (aReflowState.computedHeight == NS_INTRINSICSIZE) { + if (aReflowState.mComputedHeight == NS_INTRINSICSIZE) { aDesiredSize.height = mLegendSpace + borderPadding.top + aDesiredSize.height + borderPadding.bottom; } else { nscoord min = borderPadding.top + borderPadding.bottom + mLegendRect.height; - aDesiredSize.height = aReflowState.computedHeight + borderPadding.top + borderPadding.bottom; + aDesiredSize.height = aReflowState.mComputedHeight + borderPadding.top + borderPadding.bottom; if (aDesiredSize.height < min) aDesiredSize.height = min; } - if (aReflowState.computedWidth == NS_INTRINSICSIZE) { + if (aReflowState.mComputedWidth == NS_INTRINSICSIZE) { aDesiredSize.width = borderPadding.left + aDesiredSize.width + borderPadding.right; } else { nscoord min = borderPadding.left + borderPadding.right + mLegendRect.width; - aDesiredSize.width = aReflowState.computedWidth + borderPadding.left + borderPadding.right; + aDesiredSize.width = aReflowState.mComputedWidth + borderPadding.left + borderPadding.right; if (aDesiredSize.width < min) aDesiredSize.width = min; } diff --git a/mozilla/layout/forms/nsFormControlFrame.cpp b/mozilla/layout/forms/nsFormControlFrame.cpp index 7c6b6ac783b..af08d0ae837 100644 --- a/mozilla/layout/forms/nsFormControlFrame.cpp +++ b/mozilla/layout/forms/nsFormControlFrame.cpp @@ -639,14 +639,14 @@ nsFormControlFrame::GetStyleSize(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsSize& aSize) { - if (aReflowState.computedWidth != NS_INTRINSICSIZE) { - aSize.width = aReflowState.computedWidth; + if (aReflowState.mComputedWidth != NS_INTRINSICSIZE) { + aSize.width = aReflowState.mComputedWidth; } else { aSize.width = CSS_NOTSET; } - if (aReflowState.computedHeight != NS_INTRINSICSIZE) { - aSize.height = aReflowState.computedHeight; + if (aReflowState.mComputedHeight != NS_INTRINSICSIZE) { + aSize.height = aReflowState.mComputedHeight; } else { aSize.height = CSS_NOTSET; diff --git a/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp b/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp index ba199cbceb2..b5b48d6df7b 100644 --- a/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp +++ b/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp @@ -375,25 +375,25 @@ nsHTMLButtonControlFrame::Paint(nsIPresContext& aPresContext, static void ButtonHack(nsHTMLReflowState& aReflowState, char* aMessage) { - if (aReflowState.computedWidth == 0) { - aReflowState.computedWidth = aReflowState.availableWidth; + if (aReflowState.mComputedWidth == 0) { + aReflowState.mComputedWidth = aReflowState.availableWidth; } - if ((aReflowState.computedWidth != NS_INTRINSICSIZE) && - (aReflowState.computedWidth > aReflowState.availableWidth) && + if ((aReflowState.mComputedWidth != NS_INTRINSICSIZE) && + (aReflowState.mComputedWidth > aReflowState.availableWidth) && (aReflowState.availableWidth > 0)) { // printf("BUG - %s has a computed width = %d, available width = %d \n", -// aMessage, aReflowState.computedWidth, aReflowState.availableWidth); - aReflowState.computedWidth = aReflowState.availableWidth; +// aMessage, aReflowState.mComputedWidth, aReflowState.availableWidth); + aReflowState.mComputedWidth = aReflowState.availableWidth; } - if (aReflowState.computedHeight == 0) { - aReflowState.computedHeight = aReflowState.availableHeight; + if (aReflowState.mComputedHeight == 0) { + aReflowState.mComputedHeight = aReflowState.availableHeight; } - if ((aReflowState.computedHeight != NS_INTRINSICSIZE) && - (aReflowState.computedHeight > aReflowState.availableHeight) && + if ((aReflowState.mComputedHeight != NS_INTRINSICSIZE) && + (aReflowState.mComputedHeight > aReflowState.availableHeight) && (aReflowState.availableHeight > 0)) { // printf("BUG - %s has a computed height = %d, available height = %d \n", -// aMessage, aReflowState.computedHeight, aReflowState.availableHeight); - aReflowState.computedHeight = aReflowState.availableHeight; +// aMessage, aReflowState.mComputedHeight, aReflowState.availableHeight); + aReflowState.mComputedHeight = aReflowState.availableHeight; } } @@ -445,7 +445,7 @@ nsHTMLButtonControlFrame::Reflow(nsIPresContext& aPresContext, // reflow the child nsIFrame* firstKid = mFrames.FirstChild(); - nsSize availSize(aReflowState.computedWidth, aReflowState.computedHeight); + nsSize availSize(aReflowState.mComputedWidth, aReflowState.mComputedHeight); // indent the child inside us by the the focus border. We must do this separate from the // regular border. diff --git a/mozilla/layout/forms/nsListControlFrame.cpp b/mozilla/layout/forms/nsListControlFrame.cpp index 8fc1c86149e..8e22ab2e4a5 100644 --- a/mozilla/layout/forms/nsListControlFrame.cpp +++ b/mozilla/layout/forms/nsListControlFrame.cpp @@ -272,8 +272,8 @@ nsListControlFrame::Reflow(nsIPresContext& aPresContext, // Get the size of option elements inside the listbox // Compute the width based on the longest line in the listbox. - firstPassState.computedWidth = NS_UNCONSTRAINEDSIZE; - firstPassState.computedHeight = NS_UNCONSTRAINEDSIZE; + firstPassState.mComputedWidth = NS_UNCONSTRAINEDSIZE; + firstPassState.mComputedHeight = NS_UNCONSTRAINEDSIZE; firstPassState.availableWidth = NS_UNCONSTRAINEDSIZE; firstPassState.availableHeight = NS_UNCONSTRAINEDSIZE; @@ -341,16 +341,16 @@ nsListControlFrame::Reflow(nsIPresContext& aPresContext, nscoord visibleWidth = 0; if (IsInDropDownMode() == PR_TRUE) { // Calculate visible width for dropdown - if (NS_UNCONSTRAINEDSIZE == aReflowState.computedWidth) { + if (NS_UNCONSTRAINEDSIZE == aReflowState.mComputedWidth) { visibleWidth = scrolledAreaWidth; } else { - visibleWidth = aReflowState.computedWidth - (border.left + border.right); + visibleWidth = aReflowState.mComputedWidth - (border.left + border.right); } } else { - if (NS_UNCONSTRAINEDSIZE == aReflowState.computedWidth) { + if (NS_UNCONSTRAINEDSIZE == aReflowState.mComputedWidth) { visibleWidth = scrolledAreaWidth; } else { - visibleWidth = aReflowState.computedWidth; + visibleWidth = aReflowState.mComputedWidth; } } @@ -380,8 +380,8 @@ nsListControlFrame::Reflow(nsIPresContext& aPresContext, } else { // Calculate the visible height of the listbox - if (NS_UNCONSTRAINEDSIZE != aReflowState.computedHeight) { - visibleHeight = aReflowState.computedHeight; + if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedHeight) { + visibleHeight = aReflowState.mComputedHeight; } else { visibleHeight = mNumRows * heightOfARow; } @@ -398,8 +398,8 @@ nsListControlFrame::Reflow(nsIPresContext& aPresContext, // Do a second reflow with the adjusted width and height settings // This sets up all of the frames with the correct width and height. - secondPassState.computedWidth = visibleWidth; - secondPassState.computedHeight = visibleHeight; + secondPassState.mComputedWidth = visibleWidth; + secondPassState.mComputedHeight = visibleHeight; secondPassState.reason = eReflowReason_Resize; nsScrollFrame::Reflow(aPresContext, aDesiredSize, diff --git a/mozilla/layout/generic/nsAbsoluteContainingBlock.cpp b/mozilla/layout/generic/nsAbsoluteContainingBlock.cpp index 404db77f299..e1e6ab01b89 100644 --- a/mozilla/layout/generic/nsAbsoluteContainingBlock.cpp +++ b/mozilla/layout/generic/nsAbsoluteContainingBlock.cpp @@ -202,7 +202,7 @@ nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIPresContext& aPresCon if (NS_SUCCEEDED(rv)) { htmlReflow->WillReflow(aPresContext); - nsSize availSize(aReflowState.computedWidth, NS_UNCONSTRAINEDSIZE); + nsSize availSize(aReflowState.mComputedWidth, NS_UNCONSTRAINEDSIZE); nsHTMLReflowMetrics kidDesiredSize(nsnull); nsHTMLReflowState kidReflowState(aPresContext, aReflowState, aKidFrame, availSize); @@ -217,7 +217,7 @@ nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIPresContext& aPresCon // Because we don't know the size of a replaced element until after we reflow // it 'auto' margins must be computed now - if (NS_FRAME_IS_REPLACED(kidReflowState.frameType)) { + if (NS_FRAME_IS_REPLACED(kidReflowState.mFrameType)) { // Get the containing block width/height nscoord containingBlockWidth, containingBlockHeight; kidReflowState.ComputeContainingBlockRectangle(&aReflowState, @@ -225,72 +225,72 @@ nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIPresContext& aPresCon containingBlockHeight); // XXX This code belongs in nsHTMLReflowState... - if ((NS_AUTOMARGIN == kidReflowState.computedMargin.left) || - (NS_AUTOMARGIN == kidReflowState.computedMargin.right)) { + if ((NS_AUTOMARGIN == kidReflowState.mComputedMargin.left) || + (NS_AUTOMARGIN == kidReflowState.mComputedMargin.right)) { // Calculate the amount of space for margins nscoord availMarginSpace = containingBlockWidth - kidReflowState.computedOffsets.left - kidReflowState.mComputedBorderPadding.left - kidDesiredSize.width - kidReflowState.mComputedBorderPadding.right - kidReflowState.computedOffsets.right; - if (NS_AUTOMARGIN == kidReflowState.computedMargin.left) { - if (NS_AUTOMARGIN == kidReflowState.computedMargin.right) { + if (NS_AUTOMARGIN == kidReflowState.mComputedMargin.left) { + if (NS_AUTOMARGIN == kidReflowState.mComputedMargin.right) { // Both 'margin-left' and 'margin-right' are 'auto', so they get // equal values - kidReflowState.computedMargin.left = availMarginSpace / 2; - kidReflowState.computedMargin.right = availMarginSpace - - kidReflowState.computedMargin.left; + kidReflowState.mComputedMargin.left = availMarginSpace / 2; + kidReflowState.mComputedMargin.right = availMarginSpace - + kidReflowState.mComputedMargin.left; } else { // Just 'margin-left' is 'auto' - kidReflowState.computedMargin.left = availMarginSpace - - kidReflowState.computedMargin.right; + kidReflowState.mComputedMargin.left = availMarginSpace - + kidReflowState.mComputedMargin.right; } } else { // Just 'margin-right' is 'auto' - kidReflowState.computedMargin.right = availMarginSpace - - kidReflowState.computedMargin.left; + kidReflowState.mComputedMargin.right = availMarginSpace - + kidReflowState.mComputedMargin.left; } } - if ((NS_AUTOMARGIN == kidReflowState.computedMargin.top) || - (NS_AUTOMARGIN == kidReflowState.computedMargin.bottom)) { + if ((NS_AUTOMARGIN == kidReflowState.mComputedMargin.top) || + (NS_AUTOMARGIN == kidReflowState.mComputedMargin.bottom)) { // Calculate the amount of space for margins nscoord availMarginSpace = containingBlockHeight - kidReflowState.computedOffsets.top - kidReflowState.mComputedBorderPadding.top - kidDesiredSize.height - kidReflowState.mComputedBorderPadding.bottom - kidReflowState.computedOffsets.bottom; - if (NS_AUTOMARGIN == kidReflowState.computedMargin.top) { - if (NS_AUTOMARGIN == kidReflowState.computedMargin.bottom) { + if (NS_AUTOMARGIN == kidReflowState.mComputedMargin.top) { + if (NS_AUTOMARGIN == kidReflowState.mComputedMargin.bottom) { // Both 'margin-top' and 'margin-bottom' are 'auto', so they get // equal values - kidReflowState.computedMargin.top = availMarginSpace / 2; - kidReflowState.computedMargin.bottom = availMarginSpace - - kidReflowState.computedMargin.top; + kidReflowState.mComputedMargin.top = availMarginSpace / 2; + kidReflowState.mComputedMargin.bottom = availMarginSpace - + kidReflowState.mComputedMargin.top; } else { // Just 'margin-top' is 'auto' - kidReflowState.computedMargin.top = availMarginSpace - - kidReflowState.computedMargin.bottom; + kidReflowState.mComputedMargin.top = availMarginSpace - + kidReflowState.mComputedMargin.bottom; } } else { // Just 'margin-bottom' is 'auto' - kidReflowState.computedMargin.bottom = availMarginSpace - - kidReflowState.computedMargin.top; + kidReflowState.mComputedMargin.bottom = availMarginSpace - + kidReflowState.mComputedMargin.top; } } } // XXX If the child had a fixed height, then make sure it respected it... - if (NS_AUTOHEIGHT != kidReflowState.computedHeight) { - if (kidDesiredSize.height < kidReflowState.computedHeight) { - kidDesiredSize.height = kidReflowState.computedHeight; + if (NS_AUTOHEIGHT != kidReflowState.mComputedHeight) { + if (kidDesiredSize.height < kidReflowState.mComputedHeight) { + kidDesiredSize.height = kidReflowState.mComputedHeight; kidDesiredSize.height += kidReflowState.mComputedBorderPadding.top + kidReflowState.mComputedBorderPadding.bottom; } } // Position the child relative to our padding edge - nsRect rect(border.left + kidReflowState.computedOffsets.left + kidReflowState.computedMargin.left, - border.top + kidReflowState.computedOffsets.top + kidReflowState.computedMargin.top, + nsRect rect(border.left + kidReflowState.computedOffsets.left + kidReflowState.mComputedMargin.left, + border.top + kidReflowState.computedOffsets.top + kidReflowState.mComputedMargin.top, kidDesiredSize.width, kidDesiredSize.height); aKidFrame->SetRect(rect); } diff --git a/mozilla/layout/generic/nsAreaFrame.cpp b/mozilla/layout/generic/nsAreaFrame.cpp index b23b120184a..a2cddede3ac 100644 --- a/mozilla/layout/generic/nsAreaFrame.cpp +++ b/mozilla/layout/generic/nsAreaFrame.cpp @@ -278,7 +278,7 @@ nsAreaFrame::Reflow(nsIPresContext& aPresContext, if (nsnull != mSpaceManager) { // Modify the reflow state and set the space manager nsHTMLReflowState& reflowState = (nsHTMLReflowState&)aReflowState; - reflowState.spaceManager = mSpaceManager; + reflowState.mSpaceManager = mSpaceManager; // Clear the spacemanager's regions. mSpaceManager->ClearRegions(); diff --git a/mozilla/layout/generic/nsBlockFrame.cpp b/mozilla/layout/generic/nsBlockFrame.cpp index baadd0e9636..3d3cfee4886 100644 --- a/mozilla/layout/generic/nsBlockFrame.cpp +++ b/mozilla/layout/generic/nsBlockFrame.cpp @@ -441,7 +441,7 @@ nsBlockReflowState::nsBlockReflowState(const nsHTMLReflowState& aReflowState, { mLineLayout = aLineLayout; - mSpaceManager = aReflowState.spaceManager; + mSpaceManager = aReflowState.mSpaceManager; // Translate into our content area and then save the // coordinate system origin for later. @@ -458,8 +458,8 @@ nsBlockReflowState::nsBlockReflowState(const nsHTMLReflowState& aReflowState, // Compute content area width (the content area is inside the border // and padding) mUnconstrainedWidth = PR_FALSE; - if (NS_UNCONSTRAINEDSIZE != aReflowState.computedWidth) { - mContentArea.width = aReflowState.computedWidth; + if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedWidth) { + mContentArea.width = aReflowState.mComputedWidth; } else { if (NS_UNCONSTRAINEDSIZE == aReflowState.availableWidth) { @@ -645,7 +645,7 @@ nsBlockReflowState::RecoverVerticalMargins(nsLineBox* aLine, } // Compute collapsed bottom margin - nscoord bottomMargin = reflowState.computedMargin.bottom; + nscoord bottomMargin = reflowState.mComputedMargin.bottom; bottomMargin = nsBlockReflowContext::MaxMargin(bottomMargin, aLine->mCarriedOutBottomMargin); @@ -1148,7 +1148,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus) { - nsLineLayout lineLayout(aPresContext, aReflowState.spaceManager, + nsLineLayout lineLayout(aPresContext, aReflowState.mSpaceManager, &aReflowState, nsnull != aMetrics.maxElementSize); nsBlockReflowState state(aReflowState, &aPresContext, this, aMetrics, &lineLayout); @@ -1321,7 +1321,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, ListTag(stdout); printf(": availSize=%d,%d computed=%d,%d metrics=%d,%d carriedMargin=%d\n", aReflowState.availableWidth, aReflowState.availableHeight, - aReflowState.computedWidth, aReflowState.computedHeight, + aReflowState.mComputedWidth, aReflowState.mComputedHeight, aMetrics.width, aMetrics.height, aMetrics.mCarriedOutBottomMargin); #endif @@ -1331,7 +1331,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, static PRBool HaveAutoWidth(const nsHTMLReflowState& aReflowState) { - if (NS_UNCONSTRAINEDSIZE == aReflowState.computedWidth) { + if (NS_UNCONSTRAINEDSIZE == aReflowState.mComputedWidth) { return PR_TRUE; } const nsStylePosition* pos = aReflowState.mStylePosition; @@ -1401,10 +1401,10 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState, nscoord minWidth = aState.mKidXMost + borderPadding.right; if (!HaveAutoWidth(aReflowState)) { // Use style defined width - aMetrics.width = borderPadding.left + aReflowState.computedWidth + + aMetrics.width = borderPadding.left + aReflowState.mComputedWidth + borderPadding.right; // XXX quote css1 section here - if ((0 == aReflowState.computedWidth) && (aMetrics.width < minWidth)) { + if ((0 == aReflowState.mComputedWidth) && (aMetrics.width < minWidth)) { aMetrics.width = minWidth; } @@ -1492,9 +1492,9 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState, } // Compute final height - if (NS_UNCONSTRAINEDSIZE != aReflowState.computedHeight) { + if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedHeight) { // Use style defined height - aMetrics.height = borderPadding.top + aReflowState.computedHeight + + aMetrics.height = borderPadding.top + aReflowState.mComputedHeight + borderPadding.bottom; // When style defines the height use it for the max-element-size @@ -5706,7 +5706,7 @@ nsBlockFrame::ReflowBullet(nsBlockReflowState& aState, // Place the bullet now; use its right margin to distance it // from the rest of the frames in the line - nscoord x = - reflowState.computedMargin.right - aMetrics.width; + nscoord x = - reflowState.mComputedMargin.right - aMetrics.width; // Approximate the bullets position; vertical alignment will provide // the final vertical location. diff --git a/mozilla/layout/generic/nsBlockReflowContext.cpp b/mozilla/layout/generic/nsBlockReflowContext.cpp index 4a75d4c4a9d..ddd0dbb805a 100644 --- a/mozilla/layout/generic/nsBlockReflowContext.cpp +++ b/mozilla/layout/generic/nsBlockReflowContext.cpp @@ -70,7 +70,7 @@ nsBlockReflowContext::ComputeCollapsedTopMargin(nsIPresContext* aPresContext, nsHTMLReflowState& aRS) { // Get aFrame's top margin - nscoord topMargin = aRS.computedMargin.top; + nscoord topMargin = aRS.mComputedMargin.top; // Calculate aFrame's generational top-margin from its child // blocks. Note that if aFrame has a non-zero top-border or @@ -90,7 +90,7 @@ nsBlockReflowContext::ComputeCollapsedTopMargin(nsIPresContext* aPresContext, // child blocks margin and so in so that we can look into // it. For its margins to be computed we need to have a reflow // state for it. - nsSize availSpace(aRS.computedWidth, aRS.computedHeight); + nsSize availSpace(aRS.mComputedWidth, aRS.mComputedHeight); nsHTMLReflowState reflowState(*aPresContext, aRS, childFrame, availSpace); generationalTopMargin = @@ -183,7 +183,7 @@ nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame, // Compute x/y coordinate where reflow will begin. Use the rules // from 10.3.3 to determine what to apply. At this point in the // reflow auto left/right margins will have a zero value. - mMargin = reflowState.computedMargin; + mMargin = reflowState.mComputedMargin; mStyleSpacing = reflowState.mStyleSpacing; nscoord x = aSpace.x + mMargin.left; nscoord y = aSpace.y + topMargin; @@ -218,10 +218,10 @@ nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame, // border+padding before translating. nscoord tx = x - mOuterReflowState.mComputedBorderPadding.left; nscoord ty = y - mOuterReflowState.mComputedBorderPadding.top; - mOuterReflowState.spaceManager->Translate(tx, ty); + mOuterReflowState.mSpaceManager->Translate(tx, ty); rv = htmlReflow->Reflow(*mPresContext, mMetrics, reflowState, aFrameReflowStatus); - mOuterReflowState.spaceManager->Translate(-tx, -ty); + mOuterReflowState.mSpaceManager->Translate(-tx, -ty); #ifdef DEBUG if (!NS_INLINE_IS_BREAK_BEFORE(aFrameReflowStatus)) { @@ -379,7 +379,7 @@ nsBlockReflowContext::PlaceBlock(PRBool aForceFit, // downward, just below another floater? nscoord dy = mSpace.y - mY; htmlReflow->MoveInSpaceManager(mPresContext, - mOuterReflowState.spaceManager, 0, dy); + mOuterReflowState.mSpaceManager, 0, dy); } y = mSpace.y; @@ -507,7 +507,7 @@ nsBlockReflowContext::PlaceBlock(PRBool aForceFit, // If the child has any floaters that impact the space manager, // slide them now htmlReflow->MoveInSpaceManager(mPresContext, - mOuterReflowState.spaceManager, + mOuterReflowState.mSpaceManager, dx, dy); } } diff --git a/mozilla/layout/generic/nsBlockReflowState.cpp b/mozilla/layout/generic/nsBlockReflowState.cpp index baadd0e9636..3d3cfee4886 100644 --- a/mozilla/layout/generic/nsBlockReflowState.cpp +++ b/mozilla/layout/generic/nsBlockReflowState.cpp @@ -441,7 +441,7 @@ nsBlockReflowState::nsBlockReflowState(const nsHTMLReflowState& aReflowState, { mLineLayout = aLineLayout; - mSpaceManager = aReflowState.spaceManager; + mSpaceManager = aReflowState.mSpaceManager; // Translate into our content area and then save the // coordinate system origin for later. @@ -458,8 +458,8 @@ nsBlockReflowState::nsBlockReflowState(const nsHTMLReflowState& aReflowState, // Compute content area width (the content area is inside the border // and padding) mUnconstrainedWidth = PR_FALSE; - if (NS_UNCONSTRAINEDSIZE != aReflowState.computedWidth) { - mContentArea.width = aReflowState.computedWidth; + if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedWidth) { + mContentArea.width = aReflowState.mComputedWidth; } else { if (NS_UNCONSTRAINEDSIZE == aReflowState.availableWidth) { @@ -645,7 +645,7 @@ nsBlockReflowState::RecoverVerticalMargins(nsLineBox* aLine, } // Compute collapsed bottom margin - nscoord bottomMargin = reflowState.computedMargin.bottom; + nscoord bottomMargin = reflowState.mComputedMargin.bottom; bottomMargin = nsBlockReflowContext::MaxMargin(bottomMargin, aLine->mCarriedOutBottomMargin); @@ -1148,7 +1148,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus) { - nsLineLayout lineLayout(aPresContext, aReflowState.spaceManager, + nsLineLayout lineLayout(aPresContext, aReflowState.mSpaceManager, &aReflowState, nsnull != aMetrics.maxElementSize); nsBlockReflowState state(aReflowState, &aPresContext, this, aMetrics, &lineLayout); @@ -1321,7 +1321,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, ListTag(stdout); printf(": availSize=%d,%d computed=%d,%d metrics=%d,%d carriedMargin=%d\n", aReflowState.availableWidth, aReflowState.availableHeight, - aReflowState.computedWidth, aReflowState.computedHeight, + aReflowState.mComputedWidth, aReflowState.mComputedHeight, aMetrics.width, aMetrics.height, aMetrics.mCarriedOutBottomMargin); #endif @@ -1331,7 +1331,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, static PRBool HaveAutoWidth(const nsHTMLReflowState& aReflowState) { - if (NS_UNCONSTRAINEDSIZE == aReflowState.computedWidth) { + if (NS_UNCONSTRAINEDSIZE == aReflowState.mComputedWidth) { return PR_TRUE; } const nsStylePosition* pos = aReflowState.mStylePosition; @@ -1401,10 +1401,10 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState, nscoord minWidth = aState.mKidXMost + borderPadding.right; if (!HaveAutoWidth(aReflowState)) { // Use style defined width - aMetrics.width = borderPadding.left + aReflowState.computedWidth + + aMetrics.width = borderPadding.left + aReflowState.mComputedWidth + borderPadding.right; // XXX quote css1 section here - if ((0 == aReflowState.computedWidth) && (aMetrics.width < minWidth)) { + if ((0 == aReflowState.mComputedWidth) && (aMetrics.width < minWidth)) { aMetrics.width = minWidth; } @@ -1492,9 +1492,9 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState, } // Compute final height - if (NS_UNCONSTRAINEDSIZE != aReflowState.computedHeight) { + if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedHeight) { // Use style defined height - aMetrics.height = borderPadding.top + aReflowState.computedHeight + + aMetrics.height = borderPadding.top + aReflowState.mComputedHeight + borderPadding.bottom; // When style defines the height use it for the max-element-size @@ -5706,7 +5706,7 @@ nsBlockFrame::ReflowBullet(nsBlockReflowState& aState, // Place the bullet now; use its right margin to distance it // from the rest of the frames in the line - nscoord x = - reflowState.computedMargin.right - aMetrics.width; + nscoord x = - reflowState.mComputedMargin.right - aMetrics.width; // Approximate the bullets position; vertical alignment will provide // the final vertical location. diff --git a/mozilla/layout/generic/nsBlockReflowState.h b/mozilla/layout/generic/nsBlockReflowState.h index baadd0e9636..3d3cfee4886 100644 --- a/mozilla/layout/generic/nsBlockReflowState.h +++ b/mozilla/layout/generic/nsBlockReflowState.h @@ -441,7 +441,7 @@ nsBlockReflowState::nsBlockReflowState(const nsHTMLReflowState& aReflowState, { mLineLayout = aLineLayout; - mSpaceManager = aReflowState.spaceManager; + mSpaceManager = aReflowState.mSpaceManager; // Translate into our content area and then save the // coordinate system origin for later. @@ -458,8 +458,8 @@ nsBlockReflowState::nsBlockReflowState(const nsHTMLReflowState& aReflowState, // Compute content area width (the content area is inside the border // and padding) mUnconstrainedWidth = PR_FALSE; - if (NS_UNCONSTRAINEDSIZE != aReflowState.computedWidth) { - mContentArea.width = aReflowState.computedWidth; + if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedWidth) { + mContentArea.width = aReflowState.mComputedWidth; } else { if (NS_UNCONSTRAINEDSIZE == aReflowState.availableWidth) { @@ -645,7 +645,7 @@ nsBlockReflowState::RecoverVerticalMargins(nsLineBox* aLine, } // Compute collapsed bottom margin - nscoord bottomMargin = reflowState.computedMargin.bottom; + nscoord bottomMargin = reflowState.mComputedMargin.bottom; bottomMargin = nsBlockReflowContext::MaxMargin(bottomMargin, aLine->mCarriedOutBottomMargin); @@ -1148,7 +1148,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus) { - nsLineLayout lineLayout(aPresContext, aReflowState.spaceManager, + nsLineLayout lineLayout(aPresContext, aReflowState.mSpaceManager, &aReflowState, nsnull != aMetrics.maxElementSize); nsBlockReflowState state(aReflowState, &aPresContext, this, aMetrics, &lineLayout); @@ -1321,7 +1321,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, ListTag(stdout); printf(": availSize=%d,%d computed=%d,%d metrics=%d,%d carriedMargin=%d\n", aReflowState.availableWidth, aReflowState.availableHeight, - aReflowState.computedWidth, aReflowState.computedHeight, + aReflowState.mComputedWidth, aReflowState.mComputedHeight, aMetrics.width, aMetrics.height, aMetrics.mCarriedOutBottomMargin); #endif @@ -1331,7 +1331,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, static PRBool HaveAutoWidth(const nsHTMLReflowState& aReflowState) { - if (NS_UNCONSTRAINEDSIZE == aReflowState.computedWidth) { + if (NS_UNCONSTRAINEDSIZE == aReflowState.mComputedWidth) { return PR_TRUE; } const nsStylePosition* pos = aReflowState.mStylePosition; @@ -1401,10 +1401,10 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState, nscoord minWidth = aState.mKidXMost + borderPadding.right; if (!HaveAutoWidth(aReflowState)) { // Use style defined width - aMetrics.width = borderPadding.left + aReflowState.computedWidth + + aMetrics.width = borderPadding.left + aReflowState.mComputedWidth + borderPadding.right; // XXX quote css1 section here - if ((0 == aReflowState.computedWidth) && (aMetrics.width < minWidth)) { + if ((0 == aReflowState.mComputedWidth) && (aMetrics.width < minWidth)) { aMetrics.width = minWidth; } @@ -1492,9 +1492,9 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState, } // Compute final height - if (NS_UNCONSTRAINEDSIZE != aReflowState.computedHeight) { + if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedHeight) { // Use style defined height - aMetrics.height = borderPadding.top + aReflowState.computedHeight + + aMetrics.height = borderPadding.top + aReflowState.mComputedHeight + borderPadding.bottom; // When style defines the height use it for the max-element-size @@ -5706,7 +5706,7 @@ nsBlockFrame::ReflowBullet(nsBlockReflowState& aState, // Place the bullet now; use its right margin to distance it // from the rest of the frames in the line - nscoord x = - reflowState.computedMargin.right - aMetrics.width; + nscoord x = - reflowState.mComputedMargin.right - aMetrics.width; // Approximate the bullets position; vertical alignment will provide // the final vertical location. diff --git a/mozilla/layout/generic/nsFrameFrame.cpp b/mozilla/layout/generic/nsFrameFrame.cpp index d623aee31cd..dca2ac96da7 100644 --- a/mozilla/layout/generic/nsFrameFrame.cpp +++ b/mozilla/layout/generic/nsFrameFrame.cpp @@ -284,14 +284,14 @@ nsHTMLFrameOuterFrame::GetDesiredSize(nsIPresContext* aPresContext, // XXX this needs to be changed from (200,200) to a better default // for inline frames - if (NS_UNCONSTRAINEDSIZE != aReflowState.computedWidth) { - aDesiredSize.width = aReflowState.computedWidth; + if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedWidth) { + aDesiredSize.width = aReflowState.mComputedWidth; } else { aDesiredSize.width = NSIntPixelsToTwips(200, p2t); } - if (NS_UNCONSTRAINEDSIZE != aReflowState.computedHeight) { - aDesiredSize.height = aReflowState.computedHeight; + if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedHeight) { + aDesiredSize.height = aReflowState.mComputedHeight; } else { aDesiredSize.height = NSIntPixelsToTwips(200, p2t); diff --git a/mozilla/layout/generic/nsHTMLFrame.cpp b/mozilla/layout/generic/nsHTMLFrame.cpp index 613b80eb4ed..da1233d0ede 100644 --- a/mozilla/layout/generic/nsHTMLFrame.cpp +++ b/mozilla/layout/generic/nsHTMLFrame.cpp @@ -284,17 +284,17 @@ RootFrame::Reflow(nsIPresContext& aPresContext, // If our height is fixed, then make sure the child frame plus its top and // bottom margin is at least that high as well... - if (NS_AUTOHEIGHT != aReflowState.computedHeight) { - nscoord totalHeight = kidDesiredSize.height + kidReflowState.computedMargin.top + - kidReflowState.computedMargin.bottom; + if (NS_AUTOHEIGHT != aReflowState.mComputedHeight) { + nscoord totalHeight = kidDesiredSize.height + kidReflowState.mComputedMargin.top + + kidReflowState.mComputedMargin.bottom; - if (totalHeight < aReflowState.computedHeight) { - kidDesiredSize.height += aReflowState.computedHeight - totalHeight; + if (totalHeight < aReflowState.mComputedHeight) { + kidDesiredSize.height += aReflowState.mComputedHeight - totalHeight; } } // Position and size the child frame - nsRect rect(kidReflowState.computedMargin.left, kidReflowState.computedMargin.top, + nsRect rect(kidReflowState.mComputedMargin.left, kidReflowState.mComputedMargin.top, kidDesiredSize.width, kidDesiredSize.height); kidFrame->SetRect(rect); } @@ -306,10 +306,10 @@ RootFrame::Reflow(nsIPresContext& aPresContext, } // Return our desired size - aDesiredSize.width = kidDesiredSize.width + kidReflowState.computedMargin.left + - kidReflowState.computedMargin.right; - aDesiredSize.height = kidDesiredSize.height + kidReflowState.computedMargin.top + - kidReflowState.computedMargin.bottom; + aDesiredSize.width = kidDesiredSize.width + kidReflowState.mComputedMargin.left + + kidReflowState.mComputedMargin.right; + aDesiredSize.height = kidDesiredSize.height + kidReflowState.mComputedMargin.top + + kidReflowState.mComputedMargin.bottom; aDesiredSize.ascent = aDesiredSize.height; aDesiredSize.descent = 0; // XXX Don't completely ignore NS_FRAME_OUTSIDE_CHILDREN for child frames diff --git a/mozilla/layout/generic/nsHTMLReflowState.cpp b/mozilla/layout/generic/nsHTMLReflowState.cpp index 7dc86041d95..a3bfdf5487e 100644 --- a/mozilla/layout/generic/nsHTMLReflowState.cpp +++ b/mozilla/layout/generic/nsHTMLReflowState.cpp @@ -51,7 +51,7 @@ nsHTMLReflowState::nsHTMLReflowState(nsIPresContext& aPresContext, availableWidth = aAvailableSpace.width; availableHeight = aAvailableSpace.height; rendContext = aRenderingContext; - spaceManager = nsnull; + mSpaceManager = nsnull; lineLayout = nsnull; isTopOfPage = PR_FALSE; Init(aPresContext); @@ -74,7 +74,7 @@ nsHTMLReflowState::nsHTMLReflowState(nsIPresContext& aPresContext, availableWidth = aAvailableSpace.width; availableHeight = aAvailableSpace.height; rendContext = aRenderingContext; - spaceManager = nsnull; + mSpaceManager = nsnull; lineLayout = nsnull; isTopOfPage = PR_FALSE; Init(aPresContext); @@ -99,7 +99,7 @@ nsHTMLReflowState::nsHTMLReflowState(nsIPresContext& aPresContext, availableHeight = aAvailableSpace.height; rendContext = aParentReflowState.rendContext; - spaceManager = aParentReflowState.spaceManager; + mSpaceManager = aParentReflowState.mSpaceManager; lineLayout = aParentReflowState.lineLayout; isTopOfPage = aParentReflowState.isTopOfPage; @@ -121,7 +121,7 @@ nsHTMLReflowState::nsHTMLReflowState(nsIPresContext& aPresContext, availableHeight = aAvailableSpace.height; rendContext = aParentReflowState.rendContext; - spaceManager = aParentReflowState.spaceManager; + mSpaceManager = aParentReflowState.mSpaceManager; lineLayout = aParentReflowState.lineLayout; isTopOfPage = aParentReflowState.isTopOfPage; @@ -141,7 +141,7 @@ nsHTMLReflowState::Init(nsIPresContext& aPresContext) (const nsStyleStruct*&)mStyleDisplay); frame->GetStyleData(eStyleStruct_Spacing, (const nsStyleStruct*&)mStyleSpacing); - frameType = DetermineFrameType(frame, mStylePosition, mStyleDisplay); + mFrameType = DetermineFrameType(frame, mStylePosition, mStyleDisplay); InitConstraints(aPresContext); } @@ -177,7 +177,7 @@ nsHTMLReflowState::GetContainingBlockContentWidth(const nsReflowState* aParentRS const nsHTMLReflowState* rs = GetContainingBlockReflowState(aParentRS); if (nsnull != rs) { - return ((nsHTMLReflowState*)aParentRS)->computedWidth;/* XXX cast */ + return ((nsHTMLReflowState*)aParentRS)->mComputedWidth;/* XXX cast */ } return width; } @@ -472,9 +472,9 @@ nsHTMLReflowState::InitAbsoluteConstraints(nsIPresContext& aPresContext, if (eStyleUnit_Auto == widthUnit) { // The element has a 'width' value of 'auto' - if (NS_FRAME_IS_REPLACED(frameType)) { + if (NS_FRAME_IS_REPLACED(mFrameType)) { // Substitute the element's intrinsic width - computedWidth = NS_INTRINSICSIZE; + mComputedWidth = NS_INTRINSICSIZE; } else { // Any remaining 'auto' values for 'left', 'right', 'margin-left', or @@ -484,33 +484,33 @@ nsHTMLReflowState::InitAbsoluteConstraints(nsIPresContext& aPresContext, marginLeftIsAuto = PR_FALSE; marginRightIsAuto = PR_FALSE; - computedWidth = containingBlockWidth - computedOffsets.left - - computedMargin.left - mComputedBorderPadding.left - + mComputedWidth = containingBlockWidth - computedOffsets.left - + mComputedMargin.left - mComputedBorderPadding.left - mComputedBorderPadding.right - - computedMargin.right - computedOffsets.right; + mComputedMargin.right - computedOffsets.right; } // Factor in any minimum and maximum size information - if (computedWidth > mComputedMaxWidth) { - computedWidth = mComputedMaxWidth; - } else if (computedWidth < mComputedMinWidth) { - computedWidth = mComputedMinWidth; + if (mComputedWidth > mComputedMaxWidth) { + mComputedWidth = mComputedMaxWidth; + } else if (mComputedWidth < mComputedMinWidth) { + mComputedWidth = mComputedMinWidth; } } else { if (eStyleUnit_Inherit == widthUnit) { - computedWidth = containingBlockWidth; + mComputedWidth = containingBlockWidth; } else { // Use the specified value for the computed width ComputeHorizontalValue(containingBlockWidth, widthUnit, - mStylePosition->mWidth, computedWidth); + mStylePosition->mWidth, mComputedWidth); } // Factor in any minimum and maximum size information - if (computedWidth > mComputedMaxWidth) { - computedWidth = mComputedMaxWidth; - } else if (computedWidth < mComputedMinWidth) { - computedWidth = mComputedMinWidth; + if (mComputedWidth > mComputedMaxWidth) { + mComputedWidth = mComputedMaxWidth; + } else if (mComputedWidth < mComputedMinWidth) { + mComputedWidth = mComputedMinWidth; } } @@ -518,50 +518,50 @@ nsHTMLReflowState::InitAbsoluteConstraints(nsIPresContext& aPresContext, if (leftIsAuto) { // Any 'auto' on 'margin-left' or 'margin-right' are replaced with 0 // (their default value) - computedOffsets.left = containingBlockWidth - computedMargin.left - - mComputedBorderPadding.left - computedWidth - + computedOffsets.left = containingBlockWidth - mComputedMargin.left - + mComputedBorderPadding.left - mComputedWidth - mComputedBorderPadding.right - - computedMargin.right - computedOffsets.right; + mComputedMargin.right - computedOffsets.right; } else if (rightIsAuto) { // Any 'auto' on 'margin-left' or 'margin-right' are replaced with 0 // (their default value) computedOffsets.right = containingBlockWidth - computedOffsets.left - - computedMargin.left - mComputedBorderPadding.left - computedWidth - - mComputedBorderPadding.right - computedMargin.right; + mComputedMargin.left - mComputedBorderPadding.left - mComputedWidth - + mComputedBorderPadding.right - mComputedMargin.right; } else if (marginLeftIsAuto || marginRightIsAuto) { // All that's left to solve for are 'auto' values for 'margin-left' and // 'margin-right' - if (NS_FRAME_IS_REPLACED(frameType)) { + if (NS_FRAME_IS_REPLACED(mFrameType)) { // We can't solve for 'auto' values for 'margin-left' and 'margin-right' // until after we reflow the frame and it tells us its intrinsic width if (marginLeftIsAuto) { - computedMargin.left = NS_AUTOMARGIN; + mComputedMargin.left = NS_AUTOMARGIN; } if (marginRightIsAuto) { - computedMargin.right = NS_AUTOMARGIN; + mComputedMargin.right = NS_AUTOMARGIN; } } else { // Calculate the amount of space for margins nscoord availMarginSpace = containingBlockWidth - computedOffsets.left - mComputedBorderPadding.left - - computedWidth - mComputedBorderPadding.right - + mComputedWidth - mComputedBorderPadding.right - computedOffsets.right; if (marginLeftIsAuto) { if (marginRightIsAuto) { // Both 'margin-left' and 'margin-right' are 'auto', so they get // equal values - computedMargin.left = availMarginSpace / 2; - computedMargin.right = availMarginSpace - computedMargin.left; + mComputedMargin.left = availMarginSpace / 2; + mComputedMargin.right = availMarginSpace - mComputedMargin.left; } else { // Just 'margin-left' is 'auto' - computedMargin.left = availMarginSpace - computedMargin.right; + mComputedMargin.left = availMarginSpace - mComputedMargin.right; } } else { // Just 'margin-right' is 'auto' - computedMargin.right = availMarginSpace - computedMargin.left; + mComputedMargin.right = availMarginSpace - mComputedMargin.left; } } } @@ -614,8 +614,8 @@ nsHTMLReflowState::InitAbsoluteConstraints(nsIPresContext& aPresContext, PRBool marginBottomIsAuto = (eStyleUnit_Auto == mStyleSpacing->mMargin.GetBottomUnit()); if (eStyleUnit_Auto == heightUnit) { - if (NS_FRAME_IS_REPLACED(frameType)) { - computedHeight = NS_INTRINSICSIZE; + if (NS_FRAME_IS_REPLACED(mFrameType)) { + mComputedHeight = NS_INTRINSICSIZE; } else { // Replace any 'auto' on 'margin-top' or 'margin-bottom' with 0 (their // default values) @@ -629,37 +629,37 @@ nsHTMLReflowState::InitAbsoluteConstraints(nsIPresContext& aPresContext, if (NS_AUTOHEIGHT == containingBlockHeight) { // If the containing block's height was not explicitly specified (i.e., // it depends on its content height), then so does our height - computedHeight = NS_AUTOHEIGHT; + mComputedHeight = NS_AUTOHEIGHT; } else { - computedHeight = containingBlockHeight - computedOffsets.top - - computedMargin.top - mComputedBorderPadding.top - + mComputedHeight = containingBlockHeight - computedOffsets.top - + mComputedMargin.top - mComputedBorderPadding.top - mComputedBorderPadding.bottom - - computedMargin.bottom - computedOffsets.bottom; + mComputedMargin.bottom - computedOffsets.bottom; // Factor in any minimum and maximum size information - if (computedHeight > mComputedMaxHeight) { - computedHeight = mComputedMaxHeight; - } else if (computedHeight < mComputedMinHeight) { - computedHeight = mComputedMinHeight; + if (mComputedHeight > mComputedMaxHeight) { + mComputedHeight = mComputedMaxHeight; + } else if (mComputedHeight < mComputedMinHeight) { + mComputedHeight = mComputedMinHeight; } } } } else { if (eStyleUnit_Inherit == heightUnit) { - computedHeight = containingBlockHeight; + mComputedHeight = containingBlockHeight; } else { // Use the specified value for the computed height ComputeVerticalValue(containingBlockHeight, heightUnit, - mStylePosition->mHeight, computedHeight); + mStylePosition->mHeight, mComputedHeight); } // Factor in any minimum and maximum size information - if (computedHeight > mComputedMaxHeight) { - computedHeight = mComputedMaxHeight; + if (mComputedHeight > mComputedMaxHeight) { + mComputedHeight = mComputedMaxHeight; } - if (computedHeight < mComputedMinHeight) { - computedHeight = mComputedMinHeight; + if (mComputedHeight < mComputedMinHeight) { + mComputedHeight = mComputedMinHeight; } } @@ -668,40 +668,40 @@ nsHTMLReflowState::InitAbsoluteConstraints(nsIPresContext& aPresContext, if (bottomIsAuto) { // Any 'auto' on 'margin-top' or 'margin-bottom' are replaced with 0 computedOffsets.bottom = containingBlockHeight - computedOffsets.top - - computedMargin.top - mComputedBorderPadding.top - computedHeight - - mComputedBorderPadding.bottom - computedMargin.bottom; + mComputedMargin.top - mComputedBorderPadding.top - mComputedHeight - + mComputedBorderPadding.bottom - mComputedMargin.bottom; } else if (marginTopIsAuto || marginBottomIsAuto) { // All that's left to solve for are 'auto' values for 'margin-top' and // 'margin-bottom' - if (NS_FRAME_IS_REPLACED(frameType)) { + if (NS_FRAME_IS_REPLACED(mFrameType)) { // We can't solve for 'auto' values for 'margin-top' and 'margin-bottom' // until after we reflow the frame and it tells us its intrinsic height if (marginTopIsAuto) { - computedMargin.top = NS_AUTOMARGIN; + mComputedMargin.top = NS_AUTOMARGIN; } if (marginBottomIsAuto) { - computedMargin.bottom = NS_AUTOMARGIN; + mComputedMargin.bottom = NS_AUTOMARGIN; } } else { // Calculate the amount of space for margins nscoord availMarginSpace = containingBlockHeight - computedOffsets.top - - mComputedBorderPadding.top - computedHeight - mComputedBorderPadding.bottom - + mComputedBorderPadding.top - mComputedHeight - mComputedBorderPadding.bottom - computedOffsets.bottom; if (marginTopIsAuto) { if (marginBottomIsAuto) { // Both 'margin-top' and 'margin-bottom' are 'auto', so they get // equal values - computedMargin.top = availMarginSpace / 2; - computedMargin.bottom = availMarginSpace - computedMargin.top; + mComputedMargin.top = availMarginSpace / 2; + mComputedMargin.bottom = availMarginSpace - mComputedMargin.top; } else { // Just 'margin-top' is 'auto' - computedMargin.top = availMarginSpace - computedMargin.bottom; + mComputedMargin.top = availMarginSpace - mComputedMargin.bottom; } } else { // Just 'margin-bottom' is 'auto' - computedMargin.bottom = availMarginSpace - computedMargin.top; + mComputedMargin.bottom = availMarginSpace - mComputedMargin.top; } } } @@ -717,12 +717,12 @@ nsHTMLReflowState::ComputeContainingBlockRectangle(const nsHTMLReflowState* aCon { // Unless the element is absolutely positioned, the containing block is // formed by the content edge of the nearest block-level ancestor - aContainingBlockWidth = aContainingBlockRS->computedWidth; - aContainingBlockHeight = aContainingBlockRS->computedHeight; + aContainingBlockWidth = aContainingBlockRS->mComputedWidth; + aContainingBlockHeight = aContainingBlockRS->mComputedHeight; - if (NS_FRAME_GET_TYPE(frameType) == NS_CSS_FRAME_TYPE_ABSOLUTE) { + if (NS_FRAME_GET_TYPE(mFrameType) == NS_CSS_FRAME_TYPE_ABSOLUTE) { // See if the ancestor is block-level or inline-level - if (NS_FRAME_GET_TYPE(aContainingBlockRS->frameType) == NS_CSS_FRAME_TYPE_INLINE) { + if (NS_FRAME_GET_TYPE(aContainingBlockRS->mFrameType) == NS_CSS_FRAME_TYPE_INLINE) { // The CSS2 spec says that if the ancestor is inline-level, the containing // block depends on the 'direction' property of the ancestor. For direction // 'ltr', it's the top and left of the content edges of the first box and @@ -734,13 +734,13 @@ nsHTMLReflowState::ComputeContainingBlockRectangle(const nsHTMLReflowState* aCon // the computed width and height of the nearest block-level ancestor const nsHTMLReflowState* cbrs = aContainingBlockRS; while (cbrs) { - nsCSSFrameType type = NS_FRAME_GET_TYPE(cbrs->frameType); + nsCSSFrameType type = NS_FRAME_GET_TYPE(cbrs->mFrameType); if ((NS_CSS_FRAME_TYPE_BLOCK == type) || (NS_CSS_FRAME_TYPE_FLOATING == type) || (NS_CSS_FRAME_TYPE_ABSOLUTE == type)) { - aContainingBlockWidth = cbrs->computedWidth; - aContainingBlockHeight = cbrs->computedHeight; + aContainingBlockWidth = cbrs->mComputedWidth; + aContainingBlockHeight = cbrs->mComputedHeight; if (NS_CSS_FRAME_TYPE_ABSOLUTE == type) { aContainingBlockWidth += cbrs->mComputedPadding.left + @@ -774,9 +774,9 @@ nsHTMLReflowState::InitConstraints(nsIPresContext& aPresContext) // If this is the root frame, then set the computed width and // height equal to the available space if (nsnull == parentReflowState) { - computedWidth = availableWidth; - computedHeight = availableHeight; - computedMargin.SizeTo(0, 0, 0, 0); + mComputedWidth = availableWidth; + mComputedHeight = availableHeight; + mComputedMargin.SizeTo(0, 0, 0, 0); mComputedPadding.SizeTo(0, 0, 0, 0); mComputedBorderPadding.SizeTo(0, 0, 0, 0); computedOffsets.SizeTo(0, 0, 0, 0); @@ -821,7 +821,7 @@ nsHTMLReflowState::InitConstraints(nsIPresContext& aPresContext) if (nsLayoutAtoms::scrollFrame == cbFrameType) { // Use the scroll frame's computed height instead containingBlockHeight = - ((nsHTMLReflowState*)cbrs->parentReflowState)->computedHeight; + ((nsHTMLReflowState*)cbrs->parentReflowState)->mComputedHeight; } NS_IF_RELEASE(cbFrameType); } @@ -863,78 +863,78 @@ nsHTMLReflowState::InitConstraints(nsIPresContext& aPresContext) ComputeMinMaxValues(containingBlockWidth, containingBlockHeight, cbrs); // Calculate the computed width and height. This varies by frame type - if ((NS_FRAME_REPLACED(NS_CSS_FRAME_TYPE_INLINE) == frameType) || - (NS_FRAME_REPLACED(NS_CSS_FRAME_TYPE_FLOATING) == frameType)) { + if ((NS_FRAME_REPLACED(NS_CSS_FRAME_TYPE_INLINE) == mFrameType) || + (NS_FRAME_REPLACED(NS_CSS_FRAME_TYPE_FLOATING) == mFrameType)) { // Inline replaced element and floating replaced element are basically // treated the same. First calculate the computed width if (eStyleUnit_Inherit == widthUnit) { - computedWidth = containingBlockWidth; + mComputedWidth = containingBlockWidth; } else if (eStyleUnit_Auto == widthUnit) { // A specified value of 'auto' uses the element's intrinsic width - computedWidth = NS_INTRINSICSIZE; + mComputedWidth = NS_INTRINSICSIZE; } else { ComputeHorizontalValue(containingBlockWidth, widthUnit, mStylePosition->mWidth, - computedWidth); + mComputedWidth); } - if (computedWidth > mComputedMaxWidth) { - computedWidth = mComputedMaxWidth; - } else if (computedWidth < mComputedMinWidth) { - computedWidth = mComputedMinWidth; + if (mComputedWidth > mComputedMaxWidth) { + mComputedWidth = mComputedMaxWidth; + } else if (mComputedWidth < mComputedMinWidth) { + mComputedWidth = mComputedMinWidth; } // Now calculate the computed height if (eStyleUnit_Inherit == heightUnit) { - computedHeight = containingBlockHeight; + mComputedHeight = containingBlockHeight; } else if (eStyleUnit_Auto == heightUnit) { // A specified value of 'auto' uses the element's intrinsic height - computedHeight = NS_INTRINSICSIZE; + mComputedHeight = NS_INTRINSICSIZE; } else { ComputeVerticalValue(containingBlockHeight, heightUnit, mStylePosition->mHeight, - computedHeight); + mComputedHeight); } - if (computedHeight > mComputedMaxHeight) { - computedHeight = mComputedMaxHeight; - } else if (computedHeight < mComputedMinHeight) { - computedHeight = mComputedMinHeight; + if (mComputedHeight > mComputedMaxHeight) { + mComputedHeight = mComputedMaxHeight; + } else if (mComputedHeight < mComputedMinHeight) { + mComputedHeight = mComputedMinHeight; } - } else if (NS_CSS_FRAME_TYPE_FLOATING == frameType) { + } else if (NS_CSS_FRAME_TYPE_FLOATING == mFrameType) { // Floating non-replaced element. First calculate the computed width if (eStyleUnit_Inherit == widthUnit) { - computedWidth = containingBlockWidth; + mComputedWidth = containingBlockWidth; } else if (eStyleUnit_Auto == widthUnit) { // A specified value of 'auto' becomes a computed width of 0 - computedWidth = 0; + mComputedWidth = 0; } else { ComputeHorizontalValue(containingBlockWidth, widthUnit, mStylePosition->mWidth, - computedWidth); + mComputedWidth); } - if (computedWidth > mComputedMaxWidth) { - computedWidth = mComputedMaxWidth; - } else if (computedWidth < mComputedMinWidth) { - computedWidth = mComputedMinWidth; + if (mComputedWidth > mComputedMaxWidth) { + mComputedWidth = mComputedMaxWidth; + } else if (mComputedWidth < mComputedMinWidth) { + mComputedWidth = mComputedMinWidth; } // Now calculate the computed height if (eStyleUnit_Inherit == heightUnit) { - computedHeight = containingBlockHeight; + mComputedHeight = containingBlockHeight; } else if (eStyleUnit_Auto == heightUnit) { - computedHeight = NS_AUTOHEIGHT; // let it choose its height + mComputedHeight = NS_AUTOHEIGHT; // let it choose its height } else { ComputeVerticalValue(containingBlockHeight, heightUnit, mStylePosition->mHeight, - computedHeight); + mComputedHeight); } - if (computedHeight > mComputedMaxHeight) { - computedHeight = mComputedMaxHeight; - } else if (computedHeight < mComputedMinHeight) { - computedHeight = mComputedMinHeight; + if (mComputedHeight > mComputedMaxHeight) { + mComputedHeight = mComputedMaxHeight; + } else if (mComputedHeight < mComputedMinHeight) { + mComputedHeight = mComputedMinHeight; } - } else if (NS_CSS_FRAME_TYPE_INTERNAL_TABLE == frameType) { + } else if (NS_CSS_FRAME_TYPE_INTERNAL_TABLE == mFrameType) { // Internal table elements. The rules vary depending on the type. // Calculate the computed width if ((NS_STYLE_DISPLAY_TABLE_ROW == mStyleDisplay->mDisplay) || @@ -944,21 +944,21 @@ nsHTMLReflowState::InitConstraints(nsIPresContext& aPresContext) } if (eStyleUnit_Inherit == widthUnit) { - computedWidth = containingBlockWidth; + mComputedWidth = containingBlockWidth; } else if (eStyleUnit_Auto == widthUnit) { - computedWidth = availableWidth; + mComputedWidth = availableWidth; - if (computedWidth != NS_UNCONSTRAINEDSIZE) { + if (mComputedWidth != NS_UNCONSTRAINEDSIZE) { // Internal table elements don't have margins, but they have border // and padding - computedWidth -= mComputedBorderPadding.left + + mComputedWidth -= mComputedBorderPadding.left + mComputedBorderPadding.right; } } else { ComputeHorizontalValue(containingBlockWidth, widthUnit, mStylePosition->mWidth, - computedWidth); + mComputedWidth); } // Calculate the computed height @@ -968,20 +968,20 @@ nsHTMLReflowState::InitConstraints(nsIPresContext& aPresContext) heightUnit = eStyleUnit_Auto; } if (eStyleUnit_Inherit == heightUnit) { - computedHeight = containingBlockHeight; + mComputedHeight = containingBlockHeight; } else if (eStyleUnit_Auto == heightUnit) { - computedHeight = NS_AUTOHEIGHT; + mComputedHeight = NS_AUTOHEIGHT; } else { ComputeVerticalValue(containingBlockHeight, heightUnit, mStylePosition->mHeight, - computedHeight); + mComputedHeight); } // Doesn't apply to table elements mComputedMinWidth = mComputedMinHeight = 0; mComputedMaxWidth = mComputedMaxHeight = NS_UNCONSTRAINEDSIZE; - } else if (NS_FRAME_GET_TYPE(frameType) == NS_CSS_FRAME_TYPE_ABSOLUTE) { + } else if (NS_FRAME_GET_TYPE(mFrameType) == NS_CSS_FRAME_TYPE_ABSOLUTE) { // XXX not sure if this belongs here or somewhere else - cwk // an nsHTMLFrameInnerFrame doesn't get a placeholder frame, the nsHTMLFrameOuterFrame does nsIAtom* targetFrameType; @@ -991,13 +991,13 @@ nsHTMLReflowState::InitConstraints(nsIPresContext& aPresContext) containingBlockHeight); } NS_IF_RELEASE(targetFrameType); - } else if (NS_CSS_FRAME_TYPE_INLINE == frameType) { + } else if (NS_CSS_FRAME_TYPE_INLINE == mFrameType) { // Inline non-replaced elements do not have computed widths or heights // XXX add this check to HaveFixedContentHeight/Width too - computedWidth = NS_UNCONSTRAINEDSIZE; - computedHeight = NS_UNCONSTRAINEDSIZE; - computedMargin.top = 0; - computedMargin.bottom = 0; + mComputedWidth = NS_UNCONSTRAINEDSIZE; + mComputedHeight = NS_UNCONSTRAINEDSIZE; + mComputedMargin.top = 0; + mComputedMargin.bottom = 0; mComputedMinWidth = mComputedMinHeight = 0; mComputedMaxWidth = mComputedMaxHeight = NS_UNCONSTRAINEDSIZE; } else { @@ -1020,10 +1020,10 @@ nsHTMLReflowState::ComputeBlockBoxData(nsIPresContext& aPresContext, { // Compute the content width if (eStyleUnit_Auto == aWidthUnit) { - if (NS_FRAME_IS_REPLACED(frameType)) { + if (NS_FRAME_IS_REPLACED(mFrameType)) { // Block-level replaced element in the flow. A specified value of // 'auto' uses the element's intrinsic width (CSS2 10.3.4) - computedWidth = NS_INTRINSICSIZE; + mComputedWidth = NS_INTRINSICSIZE; } else { // Block-level non-replaced element in the flow. 'auto' values // for margin-left and margin-right become 0 and the sum of the @@ -1032,21 +1032,21 @@ nsHTMLReflowState::ComputeBlockBoxData(nsIPresContext& aPresContext, if (NS_UNCONSTRAINEDSIZE == availableWidth) { // During pass1 table reflow, auto side margin values are // uncomputable (== 0). - computedWidth = NS_UNCONSTRAINEDSIZE; + mComputedWidth = NS_UNCONSTRAINEDSIZE; } else { - computedWidth = availableWidth - computedMargin.left - - computedMargin.right - mComputedBorderPadding.left - + mComputedWidth = availableWidth - mComputedMargin.left - + mComputedMargin.right - mComputedBorderPadding.left - mComputedBorderPadding.right; // Take into account any min and max values - if (computedWidth > mComputedMaxWidth) { + if (mComputedWidth > mComputedMaxWidth) { // Apply the rules again, but this time using 'max-width' as // the value for 'width' - computedWidth = mComputedMaxWidth; - } else if (computedWidth < mComputedMinWidth) { + mComputedWidth = mComputedMaxWidth; + } else if (mComputedWidth < mComputedMinWidth) { // Apply the rules again, but this time using 'min-width' as // the value for 'width' - computedWidth = mComputedMinWidth; + mComputedWidth = mComputedMinWidth; } } } @@ -1060,26 +1060,26 @@ nsHTMLReflowState::ComputeBlockBoxData(nsIPresContext& aPresContext, // elements width, because we want to skip over any intervening // inline elements (since width doesn't apply to them). if (NS_UNCONSTRAINEDSIZE != aContainingBlockWidth) { - computedWidth = aContainingBlockWidth; + mComputedWidth = aContainingBlockWidth; } else { - computedWidth = NS_UNCONSTRAINEDSIZE; + mComputedWidth = NS_UNCONSTRAINEDSIZE; } } else { ComputeHorizontalValue(aContainingBlockWidth, aWidthUnit, - mStylePosition->mWidth, computedWidth); + mStylePosition->mWidth, mComputedWidth); } // Take into account any min and max values - if (computedWidth > mComputedMaxWidth) { - computedWidth = mComputedMaxWidth; - } else if (computedWidth < mComputedMinWidth) { - computedWidth = mComputedMinWidth; + if (mComputedWidth > mComputedMaxWidth) { + mComputedWidth = mComputedMaxWidth; + } else if (mComputedWidth < mComputedMinWidth) { + mComputedWidth = mComputedMinWidth; } // Now that we have the computed-width, compute the side margins - CalculateBlockSideMargins(cbrs, computedWidth); + CalculateBlockSideMargins(cbrs, mComputedWidth); } @@ -1092,27 +1092,27 @@ nsHTMLReflowState::ComputeBlockBoxData(nsIPresContext& aPresContext, // elements height because we want to skip over any interveening // inline elements (since height doesn't apply to them). if (NS_UNCONSTRAINEDSIZE != aContainingBlockHeight) { - computedHeight = aContainingBlockHeight; + mComputedHeight = aContainingBlockHeight; } else { - computedHeight = NS_UNCONSTRAINEDSIZE; + mComputedHeight = NS_UNCONSTRAINEDSIZE; } } else if (eStyleUnit_Auto == aHeightUnit) { - if (NS_FRAME_IS_REPLACED(frameType)) { + if (NS_FRAME_IS_REPLACED(mFrameType)) { // For replaced elements use the intrinsic size for "auto" - computedHeight = NS_INTRINSICSIZE; + mComputedHeight = NS_INTRINSICSIZE; } else { // For non-replaced elements auto means unconstrained - computedHeight = NS_UNCONSTRAINEDSIZE; + mComputedHeight = NS_UNCONSTRAINEDSIZE; } } else { ComputeVerticalValue(aContainingBlockHeight, aHeightUnit, - mStylePosition->mHeight, computedHeight); + mStylePosition->mHeight, mComputedHeight); } - if (computedHeight > mComputedMaxHeight) { - computedHeight = mComputedMaxHeight; - } else if (computedHeight < mComputedMinHeight) { - computedHeight = mComputedMinHeight; + if (mComputedHeight > mComputedMaxHeight) { + mComputedHeight = mComputedMaxHeight; + } else if (mComputedHeight < mComputedMinHeight) { + mComputedHeight = mComputedMinHeight; } } @@ -1125,19 +1125,19 @@ nsHTMLReflowState::ComputeBlockBoxData(nsIPresContext& aPresContext, // Note: the width unit is not auto when this is called void nsHTMLReflowState::CalculateBlockSideMargins(const nsHTMLReflowState* cbrs, - nscoord aComputedWidth) + nscoord amComputedWidth) { // We can only provide values for auto side margins in a constrained // reflow. For unconstrained reflow there is no effective width to // compute against... - if ((NS_UNCONSTRAINEDSIZE == aComputedWidth) || - (NS_UNCONSTRAINEDSIZE == cbrs->computedWidth)) { + if ((NS_UNCONSTRAINEDSIZE == amComputedWidth) || + (NS_UNCONSTRAINEDSIZE == cbrs->mComputedWidth)) { return; } - nscoord sum = computedMargin.left + mComputedBorderPadding.left + - aComputedWidth + mComputedBorderPadding.right + computedMargin.right; - if (sum == cbrs->computedWidth) { + nscoord sum = mComputedMargin.left + mComputedBorderPadding.left + + amComputedWidth + mComputedBorderPadding.right + mComputedMargin.right; + if (sum == cbrs->mComputedWidth) { // The sum is already correct return; } @@ -1150,18 +1150,18 @@ nsHTMLReflowState::CalculateBlockSideMargins(const nsHTMLReflowState* cbrs, eStyleUnit_Auto == mStyleSpacing->mMargin.GetRightUnit(); // Calculate how much space is available for margins - nscoord availMarginSpace = cbrs->computedWidth - aComputedWidth - + nscoord availMarginSpace = cbrs->mComputedWidth - amComputedWidth - mComputedBorderPadding.left - mComputedBorderPadding.right; if (availMarginSpace < 0) { // Whoops - the element is too large for the available space. In // this case use the "direction" property to pin the element to // the left or right side. Note that we look at the parent's // direction since the parent will be placing this element. - computedMargin.left = 0; - computedMargin.right = 0; + mComputedMargin.left = 0; + mComputedMargin.right = 0; const nsHTMLReflowState* prs = (const nsHTMLReflowState*)parentReflowState; if (prs && (NS_STYLE_DIRECTION_RTL == prs->mStyleDisplay->mDirection)) { - computedMargin.left = availMarginSpace; + mComputedMargin.left = availMarginSpace; } } else { @@ -1187,13 +1187,13 @@ nsHTMLReflowState::CalculateBlockSideMargins(const nsHTMLReflowState* cbrs, if (isAutoLeftMargin) { if (isAutoRightMargin) { // Both margins are 'auto' so their computed values are equal - computedMargin.left = availMarginSpace / 2; - computedMargin.right = availMarginSpace - computedMargin.left; + mComputedMargin.left = availMarginSpace / 2; + mComputedMargin.right = availMarginSpace - mComputedMargin.left; } else { - computedMargin.left = availMarginSpace - computedMargin.right; + mComputedMargin.left = availMarginSpace - mComputedMargin.right; } } else if (isAutoRightMargin) { - computedMargin.right = availMarginSpace - computedMargin.left; + mComputedMargin.right = availMarginSpace - mComputedMargin.left; } } } @@ -1202,20 +1202,20 @@ nsHTMLReflowState::CalculateBlockSideMargins(const nsHTMLReflowState* cbrs, // XXX I have no idea if this is right or not -- kipp void nsHTMLReflowState::CalculateTableSideMargins(const nsHTMLReflowState* cbrs, - nscoord aComputedWidth) + nscoord amComputedWidth) { // We can only provide values for auto side margins in a constrained // reflow. For unconstrained reflow there is no effective width to // compute against... - if ((NS_UNCONSTRAINEDSIZE != aComputedWidth) && - (NS_UNCONSTRAINEDSIZE != cbrs->computedWidth)) { + if ((NS_UNCONSTRAINEDSIZE != amComputedWidth) && + (NS_UNCONSTRAINEDSIZE != cbrs->mComputedWidth)) { PRBool isAutoLeftMargin = eStyleUnit_Auto == mStyleSpacing->mMargin.GetLeftUnit(); PRBool isAutoRightMargin = eStyleUnit_Auto == mStyleSpacing->mMargin.GetRightUnit(); // Calculate how much space is available for margins - nscoord availMarginSpace = cbrs->computedWidth - aComputedWidth - + nscoord availMarginSpace = cbrs->mComputedWidth - amComputedWidth - mComputedBorderPadding.left - mComputedBorderPadding.right; if (availMarginSpace != 0) { @@ -1223,13 +1223,13 @@ nsHTMLReflowState::CalculateTableSideMargins(const nsHTMLReflowState* cbrs, if (isAutoLeftMargin) { if (isAutoRightMargin) { // Both margins are 'auto' so their computed values are equal - computedMargin.left = availMarginSpace / 2; - computedMargin.right = availMarginSpace - computedMargin.left; + mComputedMargin.left = availMarginSpace / 2; + mComputedMargin.right = availMarginSpace - mComputedMargin.left; } else { - computedMargin.left = availMarginSpace - computedMargin.right; + mComputedMargin.left = availMarginSpace - mComputedMargin.right; } } else if (isAutoRightMargin) { - computedMargin.right = availMarginSpace - computedMargin.left; + mComputedMargin.right = availMarginSpace - mComputedMargin.left; } } } @@ -1375,30 +1375,30 @@ nsHTMLReflowState::ComputeMargin(nscoord aContainingBlockWidth, const nsHTMLReflowState* aContainingBlockRS) { // If style style can provide us the margin directly, then use it. - if (!mStyleSpacing->GetMargin(computedMargin)) { + if (!mStyleSpacing->GetMargin(mComputedMargin)) { // We have to compute the value if (NS_UNCONSTRAINEDSIZE == aContainingBlockWidth) { - computedMargin.left = 0; - computedMargin.right = 0; + mComputedMargin.left = 0; + mComputedMargin.right = 0; } else { nsStyleCoord left, right; if (eStyleUnit_Inherit == mStyleSpacing->mMargin.GetLeftUnit()) { - computedMargin.left = aContainingBlockRS->computedMargin.left; + mComputedMargin.left = aContainingBlockRS->mComputedMargin.left; } else { ComputeHorizontalValue(aContainingBlockWidth, mStyleSpacing->mMargin.GetLeftUnit(), mStyleSpacing->mMargin.GetLeft(left), - computedMargin.left); + mComputedMargin.left); } if (eStyleUnit_Inherit == mStyleSpacing->mMargin.GetRightUnit()) { - computedMargin.right = aContainingBlockRS->computedMargin.right; + mComputedMargin.right = aContainingBlockRS->mComputedMargin.right; } else { ComputeHorizontalValue(aContainingBlockWidth, mStyleSpacing->mMargin.GetRightUnit(), mStyleSpacing->mMargin.GetRight(right), - computedMargin.right); + mComputedMargin.right); } } @@ -1409,20 +1409,20 @@ nsHTMLReflowState::ComputeMargin(nscoord aContainingBlockWidth, // calculated with respect to the *height* of the containing // block when in a paginated context. if (eStyleUnit_Inherit == mStyleSpacing->mMargin.GetTopUnit()) { - computedMargin.top = aContainingBlockRS->computedMargin.top; + mComputedMargin.top = aContainingBlockRS->mComputedMargin.top; } else { - ComputeVerticalValue(rs2->computedHeight, + ComputeVerticalValue(rs2->mComputedHeight, mStyleSpacing->mMargin.GetTopUnit(), mStyleSpacing->mMargin.GetTop(top), - computedMargin.top); + mComputedMargin.top); } if (eStyleUnit_Inherit == mStyleSpacing->mMargin.GetBottomUnit()) { - computedMargin.bottom = aContainingBlockRS->computedMargin.bottom; + mComputedMargin.bottom = aContainingBlockRS->mComputedMargin.bottom; } else { - ComputeVerticalValue(rs2->computedHeight, + ComputeVerticalValue(rs2->mComputedHeight, mStyleSpacing->mMargin.GetBottomUnit(), mStyleSpacing->mMargin.GetBottom(bottom), - computedMargin.bottom); + mComputedMargin.bottom); } } else { @@ -1430,25 +1430,25 @@ nsHTMLReflowState::ComputeMargin(nscoord aContainingBlockWidth, // calculated with respect to the *width* of the containing // block, even for margin-top and margin-bottom. if (NS_UNCONSTRAINEDSIZE == aContainingBlockWidth) { - computedMargin.top = 0; - computedMargin.bottom = 0; + mComputedMargin.top = 0; + mComputedMargin.bottom = 0; } else { if (eStyleUnit_Inherit == mStyleSpacing->mMargin.GetTopUnit()) { - computedMargin.top = aContainingBlockRS->computedMargin.top; + mComputedMargin.top = aContainingBlockRS->mComputedMargin.top; } else { ComputeHorizontalValue(aContainingBlockWidth, mStyleSpacing->mMargin.GetTopUnit(), mStyleSpacing->mMargin.GetTop(top), - computedMargin.top); + mComputedMargin.top); } if (eStyleUnit_Inherit == mStyleSpacing->mMargin.GetBottomUnit()) { - computedMargin.bottom = aContainingBlockRS->computedMargin.bottom; + mComputedMargin.bottom = aContainingBlockRS->mComputedMargin.bottom; } else { ComputeHorizontalValue(aContainingBlockWidth, mStyleSpacing->mMargin.GetBottomUnit(), mStyleSpacing->mMargin.GetBottom(bottom), - computedMargin.bottom); + mComputedMargin.bottom); } } } diff --git a/mozilla/layout/generic/nsLineLayout.cpp b/mozilla/layout/generic/nsLineLayout.cpp index a993a2f5545..4b77ca5e719 100644 --- a/mozilla/layout/generic/nsLineLayout.cpp +++ b/mozilla/layout/generic/nsLineLayout.cpp @@ -778,9 +778,9 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame, // Stash copies of some of the computed state away for later // (vertical alignment, for example) pfd->mFrame = aFrame; - pfd->mMargin = reflowState.computedMargin; + pfd->mMargin = reflowState.mComputedMargin; pfd->mBorderPadding = reflowState.mComputedBorderPadding; - pfd->mFrameType = reflowState.frameType; + pfd->mFrameType = reflowState.mFrameType; pfd->mRelativePos = reflowState.mStylePosition->mPosition == NS_STYLE_POSITION_RELATIVE; if (pfd->mRelativePos) { @@ -1284,7 +1284,7 @@ nsLineLayout::VerticalAlignFrames(nsRect& aLineBoxResult, // Synthesize a PerFrameData for the block frame PerFrameData rootPFD; rootPFD.mFrame = mBlockReflowState->frame; - rootPFD.mFrameType = mBlockReflowState->frameType; + rootPFD.mFrameType = mBlockReflowState->mFrameType; rootPFD.mAscent = 0; rootPFD.mDescent = 0; mRootSpan->mFrame = &rootPFD; diff --git a/mozilla/layout/generic/nsObjectFrame.cpp b/mozilla/layout/generic/nsObjectFrame.cpp index d79ae1eb6d4..d488fedf57e 100644 --- a/mozilla/layout/generic/nsObjectFrame.cpp +++ b/mozilla/layout/generic/nsObjectFrame.cpp @@ -490,12 +490,12 @@ nsObjectFrame::GetDesiredSize(nsIPresContext* aPresContext, PRUint32 width = EMBED_DEF_DIM; PRUint32 height = EMBED_DEF_DIM; - if (NS_UNCONSTRAINEDSIZE != aReflowState.computedWidth) { - aMetrics.width = aReflowState.computedWidth; + if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedWidth) { + aMetrics.width = aReflowState.mComputedWidth; haveWidth = PR_TRUE; } - if (NS_UNCONSTRAINEDSIZE != aReflowState.computedHeight) { - aMetrics.height = aReflowState.computedHeight; + if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedHeight) { + aMetrics.height = aReflowState.mComputedHeight; haveHeight = PR_TRUE; } @@ -1372,7 +1372,7 @@ nsObjectFrame::HandleImage(nsIPresContext& aPresContext, if(eHTMLUnit_Pixel == val.GetUnit()) { nscoord width = val.GetPixelValue(); - kidReflowState.computedWidth = NSIntPixelsToTwips(width, p2t); + kidReflowState.mComputedWidth = NSIntPixelsToTwips(width, p2t); } } if(NS_CONTENT_ATTR_HAS_VALUE == hc->GetHTMLAttribute(nsHTMLAtoms::height, val)) @@ -1380,7 +1380,7 @@ nsObjectFrame::HandleImage(nsIPresContext& aPresContext, if(eHTMLUnit_Pixel == val.GetUnit()) { nscoord height = val.GetPixelValue(); - kidReflowState.computedHeight = NSIntPixelsToTwips(height, p2t); + kidReflowState.mComputedHeight = NSIntPixelsToTwips(height, p2t); } } } diff --git a/mozilla/layout/generic/nsViewportFrame.cpp b/mozilla/layout/generic/nsViewportFrame.cpp index 5a8b9cb0e65..b5d1ef8cf13 100644 --- a/mozilla/layout/generic/nsViewportFrame.cpp +++ b/mozilla/layout/generic/nsViewportFrame.cpp @@ -170,8 +170,8 @@ ViewportFrame::CalculateFixedContainingBlockSize(nsIPresContext& aPresC { // Initialize the values to the computed width/height in our reflow // state struct - aWidth = aReflowState.computedWidth; - aHeight = aReflowState.computedHeight; + aWidth = aReflowState.mComputedWidth; + aHeight = aReflowState.mComputedHeight; // Get our prinicpal child frame and see if we're scrollable nsIFrame* kidFrame = mFrames.FirstChild(); @@ -232,17 +232,17 @@ ViewportFrame::ReflowFixedFrame(nsIPresContext& aPresContext, htmlReflow->Reflow(aPresContext, kidDesiredSize, kidReflowState, aStatus); // XXX If the child had a fixed height, then make sure it respected it... - if (NS_AUTOHEIGHT != kidReflowState.computedHeight) { - if (kidDesiredSize.height < kidReflowState.computedHeight) { - kidDesiredSize.height = kidReflowState.computedHeight; + if (NS_AUTOHEIGHT != kidReflowState.mComputedHeight) { + if (kidDesiredSize.height < kidReflowState.mComputedHeight) { + kidDesiredSize.height = kidReflowState.mComputedHeight; kidDesiredSize.height += kidReflowState.mComputedBorderPadding.top + kidReflowState.mComputedBorderPadding.bottom; } } // Position the child - nsRect rect(kidReflowState.computedOffsets.left + kidReflowState.computedMargin.left, - kidReflowState.computedOffsets.top + kidReflowState.computedMargin.top, + nsRect rect(kidReflowState.computedOffsets.left + kidReflowState.mComputedMargin.left, + kidReflowState.computedOffsets.top + kidReflowState.mComputedMargin.top, kidDesiredSize.width, kidDesiredSize.height); aKidFrame->SetRect(rect); htmlReflow->DidReflow(aPresContext, NS_FRAME_REFLOW_FINISHED); @@ -270,8 +270,8 @@ ViewportFrame::ReflowFixedFrames(nsIPresContext& aPresContext, // to reflect the available space for the fixed items // XXX Find a cleaner way to do this... nsHTMLReflowState reflowState(aReflowState); - reflowState.computedWidth = width; - reflowState.computedHeight = height; + reflowState.mComputedWidth = width; + reflowState.mComputedHeight = height; nsIFrame* kidFrame; for (kidFrame = mFixedFrames.FirstChild(); nsnull != kidFrame; kidFrame->GetNextSibling(&kidFrame)) { @@ -343,8 +343,8 @@ ViewportFrame::IncrementalReflow(nsIPresContext& aPresContext, // to reflect the available space for the fixed items // XXX Find a cleaner way to do this... nsHTMLReflowState reflowState(aReflowState); - reflowState.computedWidth = width; - reflowState.computedHeight = height; + reflowState.mComputedWidth = width; + reflowState.mComputedHeight = height; nsReflowStatus status; ReflowFixedFrame(aPresContext, reflowState, newFrames, PR_TRUE, status); @@ -433,7 +433,7 @@ ViewportFrame::Reflow(nsIPresContext& aPresContext, // Reflow the frame nsIHTMLReflow* htmlReflow; if (NS_OK == kidFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) { - kidReflowState.computedHeight = aReflowState.availableHeight; + kidReflowState.mComputedHeight = aReflowState.availableHeight; ReflowChild(kidFrame, aPresContext, kidDesiredSize, kidReflowState, aStatus); diff --git a/mozilla/layout/html/base/src/nsAbsoluteContainingBlock.cpp b/mozilla/layout/html/base/src/nsAbsoluteContainingBlock.cpp index 404db77f299..e1e6ab01b89 100644 --- a/mozilla/layout/html/base/src/nsAbsoluteContainingBlock.cpp +++ b/mozilla/layout/html/base/src/nsAbsoluteContainingBlock.cpp @@ -202,7 +202,7 @@ nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIPresContext& aPresCon if (NS_SUCCEEDED(rv)) { htmlReflow->WillReflow(aPresContext); - nsSize availSize(aReflowState.computedWidth, NS_UNCONSTRAINEDSIZE); + nsSize availSize(aReflowState.mComputedWidth, NS_UNCONSTRAINEDSIZE); nsHTMLReflowMetrics kidDesiredSize(nsnull); nsHTMLReflowState kidReflowState(aPresContext, aReflowState, aKidFrame, availSize); @@ -217,7 +217,7 @@ nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIPresContext& aPresCon // Because we don't know the size of a replaced element until after we reflow // it 'auto' margins must be computed now - if (NS_FRAME_IS_REPLACED(kidReflowState.frameType)) { + if (NS_FRAME_IS_REPLACED(kidReflowState.mFrameType)) { // Get the containing block width/height nscoord containingBlockWidth, containingBlockHeight; kidReflowState.ComputeContainingBlockRectangle(&aReflowState, @@ -225,72 +225,72 @@ nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIPresContext& aPresCon containingBlockHeight); // XXX This code belongs in nsHTMLReflowState... - if ((NS_AUTOMARGIN == kidReflowState.computedMargin.left) || - (NS_AUTOMARGIN == kidReflowState.computedMargin.right)) { + if ((NS_AUTOMARGIN == kidReflowState.mComputedMargin.left) || + (NS_AUTOMARGIN == kidReflowState.mComputedMargin.right)) { // Calculate the amount of space for margins nscoord availMarginSpace = containingBlockWidth - kidReflowState.computedOffsets.left - kidReflowState.mComputedBorderPadding.left - kidDesiredSize.width - kidReflowState.mComputedBorderPadding.right - kidReflowState.computedOffsets.right; - if (NS_AUTOMARGIN == kidReflowState.computedMargin.left) { - if (NS_AUTOMARGIN == kidReflowState.computedMargin.right) { + if (NS_AUTOMARGIN == kidReflowState.mComputedMargin.left) { + if (NS_AUTOMARGIN == kidReflowState.mComputedMargin.right) { // Both 'margin-left' and 'margin-right' are 'auto', so they get // equal values - kidReflowState.computedMargin.left = availMarginSpace / 2; - kidReflowState.computedMargin.right = availMarginSpace - - kidReflowState.computedMargin.left; + kidReflowState.mComputedMargin.left = availMarginSpace / 2; + kidReflowState.mComputedMargin.right = availMarginSpace - + kidReflowState.mComputedMargin.left; } else { // Just 'margin-left' is 'auto' - kidReflowState.computedMargin.left = availMarginSpace - - kidReflowState.computedMargin.right; + kidReflowState.mComputedMargin.left = availMarginSpace - + kidReflowState.mComputedMargin.right; } } else { // Just 'margin-right' is 'auto' - kidReflowState.computedMargin.right = availMarginSpace - - kidReflowState.computedMargin.left; + kidReflowState.mComputedMargin.right = availMarginSpace - + kidReflowState.mComputedMargin.left; } } - if ((NS_AUTOMARGIN == kidReflowState.computedMargin.top) || - (NS_AUTOMARGIN == kidReflowState.computedMargin.bottom)) { + if ((NS_AUTOMARGIN == kidReflowState.mComputedMargin.top) || + (NS_AUTOMARGIN == kidReflowState.mComputedMargin.bottom)) { // Calculate the amount of space for margins nscoord availMarginSpace = containingBlockHeight - kidReflowState.computedOffsets.top - kidReflowState.mComputedBorderPadding.top - kidDesiredSize.height - kidReflowState.mComputedBorderPadding.bottom - kidReflowState.computedOffsets.bottom; - if (NS_AUTOMARGIN == kidReflowState.computedMargin.top) { - if (NS_AUTOMARGIN == kidReflowState.computedMargin.bottom) { + if (NS_AUTOMARGIN == kidReflowState.mComputedMargin.top) { + if (NS_AUTOMARGIN == kidReflowState.mComputedMargin.bottom) { // Both 'margin-top' and 'margin-bottom' are 'auto', so they get // equal values - kidReflowState.computedMargin.top = availMarginSpace / 2; - kidReflowState.computedMargin.bottom = availMarginSpace - - kidReflowState.computedMargin.top; + kidReflowState.mComputedMargin.top = availMarginSpace / 2; + kidReflowState.mComputedMargin.bottom = availMarginSpace - + kidReflowState.mComputedMargin.top; } else { // Just 'margin-top' is 'auto' - kidReflowState.computedMargin.top = availMarginSpace - - kidReflowState.computedMargin.bottom; + kidReflowState.mComputedMargin.top = availMarginSpace - + kidReflowState.mComputedMargin.bottom; } } else { // Just 'margin-bottom' is 'auto' - kidReflowState.computedMargin.bottom = availMarginSpace - - kidReflowState.computedMargin.top; + kidReflowState.mComputedMargin.bottom = availMarginSpace - + kidReflowState.mComputedMargin.top; } } } // XXX If the child had a fixed height, then make sure it respected it... - if (NS_AUTOHEIGHT != kidReflowState.computedHeight) { - if (kidDesiredSize.height < kidReflowState.computedHeight) { - kidDesiredSize.height = kidReflowState.computedHeight; + if (NS_AUTOHEIGHT != kidReflowState.mComputedHeight) { + if (kidDesiredSize.height < kidReflowState.mComputedHeight) { + kidDesiredSize.height = kidReflowState.mComputedHeight; kidDesiredSize.height += kidReflowState.mComputedBorderPadding.top + kidReflowState.mComputedBorderPadding.bottom; } } // Position the child relative to our padding edge - nsRect rect(border.left + kidReflowState.computedOffsets.left + kidReflowState.computedMargin.left, - border.top + kidReflowState.computedOffsets.top + kidReflowState.computedMargin.top, + nsRect rect(border.left + kidReflowState.computedOffsets.left + kidReflowState.mComputedMargin.left, + border.top + kidReflowState.computedOffsets.top + kidReflowState.mComputedMargin.top, kidDesiredSize.width, kidDesiredSize.height); aKidFrame->SetRect(rect); } diff --git a/mozilla/layout/html/base/src/nsAreaFrame.cpp b/mozilla/layout/html/base/src/nsAreaFrame.cpp index b23b120184a..a2cddede3ac 100644 --- a/mozilla/layout/html/base/src/nsAreaFrame.cpp +++ b/mozilla/layout/html/base/src/nsAreaFrame.cpp @@ -278,7 +278,7 @@ nsAreaFrame::Reflow(nsIPresContext& aPresContext, if (nsnull != mSpaceManager) { // Modify the reflow state and set the space manager nsHTMLReflowState& reflowState = (nsHTMLReflowState&)aReflowState; - reflowState.spaceManager = mSpaceManager; + reflowState.mSpaceManager = mSpaceManager; // Clear the spacemanager's regions. mSpaceManager->ClearRegions(); diff --git a/mozilla/layout/html/base/src/nsBlockFrame.cpp b/mozilla/layout/html/base/src/nsBlockFrame.cpp index baadd0e9636..3d3cfee4886 100644 --- a/mozilla/layout/html/base/src/nsBlockFrame.cpp +++ b/mozilla/layout/html/base/src/nsBlockFrame.cpp @@ -441,7 +441,7 @@ nsBlockReflowState::nsBlockReflowState(const nsHTMLReflowState& aReflowState, { mLineLayout = aLineLayout; - mSpaceManager = aReflowState.spaceManager; + mSpaceManager = aReflowState.mSpaceManager; // Translate into our content area and then save the // coordinate system origin for later. @@ -458,8 +458,8 @@ nsBlockReflowState::nsBlockReflowState(const nsHTMLReflowState& aReflowState, // Compute content area width (the content area is inside the border // and padding) mUnconstrainedWidth = PR_FALSE; - if (NS_UNCONSTRAINEDSIZE != aReflowState.computedWidth) { - mContentArea.width = aReflowState.computedWidth; + if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedWidth) { + mContentArea.width = aReflowState.mComputedWidth; } else { if (NS_UNCONSTRAINEDSIZE == aReflowState.availableWidth) { @@ -645,7 +645,7 @@ nsBlockReflowState::RecoverVerticalMargins(nsLineBox* aLine, } // Compute collapsed bottom margin - nscoord bottomMargin = reflowState.computedMargin.bottom; + nscoord bottomMargin = reflowState.mComputedMargin.bottom; bottomMargin = nsBlockReflowContext::MaxMargin(bottomMargin, aLine->mCarriedOutBottomMargin); @@ -1148,7 +1148,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus) { - nsLineLayout lineLayout(aPresContext, aReflowState.spaceManager, + nsLineLayout lineLayout(aPresContext, aReflowState.mSpaceManager, &aReflowState, nsnull != aMetrics.maxElementSize); nsBlockReflowState state(aReflowState, &aPresContext, this, aMetrics, &lineLayout); @@ -1321,7 +1321,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, ListTag(stdout); printf(": availSize=%d,%d computed=%d,%d metrics=%d,%d carriedMargin=%d\n", aReflowState.availableWidth, aReflowState.availableHeight, - aReflowState.computedWidth, aReflowState.computedHeight, + aReflowState.mComputedWidth, aReflowState.mComputedHeight, aMetrics.width, aMetrics.height, aMetrics.mCarriedOutBottomMargin); #endif @@ -1331,7 +1331,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, static PRBool HaveAutoWidth(const nsHTMLReflowState& aReflowState) { - if (NS_UNCONSTRAINEDSIZE == aReflowState.computedWidth) { + if (NS_UNCONSTRAINEDSIZE == aReflowState.mComputedWidth) { return PR_TRUE; } const nsStylePosition* pos = aReflowState.mStylePosition; @@ -1401,10 +1401,10 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState, nscoord minWidth = aState.mKidXMost + borderPadding.right; if (!HaveAutoWidth(aReflowState)) { // Use style defined width - aMetrics.width = borderPadding.left + aReflowState.computedWidth + + aMetrics.width = borderPadding.left + aReflowState.mComputedWidth + borderPadding.right; // XXX quote css1 section here - if ((0 == aReflowState.computedWidth) && (aMetrics.width < minWidth)) { + if ((0 == aReflowState.mComputedWidth) && (aMetrics.width < minWidth)) { aMetrics.width = minWidth; } @@ -1492,9 +1492,9 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState, } // Compute final height - if (NS_UNCONSTRAINEDSIZE != aReflowState.computedHeight) { + if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedHeight) { // Use style defined height - aMetrics.height = borderPadding.top + aReflowState.computedHeight + + aMetrics.height = borderPadding.top + aReflowState.mComputedHeight + borderPadding.bottom; // When style defines the height use it for the max-element-size @@ -5706,7 +5706,7 @@ nsBlockFrame::ReflowBullet(nsBlockReflowState& aState, // Place the bullet now; use its right margin to distance it // from the rest of the frames in the line - nscoord x = - reflowState.computedMargin.right - aMetrics.width; + nscoord x = - reflowState.mComputedMargin.right - aMetrics.width; // Approximate the bullets position; vertical alignment will provide // the final vertical location. diff --git a/mozilla/layout/html/base/src/nsBlockReflowContext.cpp b/mozilla/layout/html/base/src/nsBlockReflowContext.cpp index 4a75d4c4a9d..ddd0dbb805a 100644 --- a/mozilla/layout/html/base/src/nsBlockReflowContext.cpp +++ b/mozilla/layout/html/base/src/nsBlockReflowContext.cpp @@ -70,7 +70,7 @@ nsBlockReflowContext::ComputeCollapsedTopMargin(nsIPresContext* aPresContext, nsHTMLReflowState& aRS) { // Get aFrame's top margin - nscoord topMargin = aRS.computedMargin.top; + nscoord topMargin = aRS.mComputedMargin.top; // Calculate aFrame's generational top-margin from its child // blocks. Note that if aFrame has a non-zero top-border or @@ -90,7 +90,7 @@ nsBlockReflowContext::ComputeCollapsedTopMargin(nsIPresContext* aPresContext, // child blocks margin and so in so that we can look into // it. For its margins to be computed we need to have a reflow // state for it. - nsSize availSpace(aRS.computedWidth, aRS.computedHeight); + nsSize availSpace(aRS.mComputedWidth, aRS.mComputedHeight); nsHTMLReflowState reflowState(*aPresContext, aRS, childFrame, availSpace); generationalTopMargin = @@ -183,7 +183,7 @@ nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame, // Compute x/y coordinate where reflow will begin. Use the rules // from 10.3.3 to determine what to apply. At this point in the // reflow auto left/right margins will have a zero value. - mMargin = reflowState.computedMargin; + mMargin = reflowState.mComputedMargin; mStyleSpacing = reflowState.mStyleSpacing; nscoord x = aSpace.x + mMargin.left; nscoord y = aSpace.y + topMargin; @@ -218,10 +218,10 @@ nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame, // border+padding before translating. nscoord tx = x - mOuterReflowState.mComputedBorderPadding.left; nscoord ty = y - mOuterReflowState.mComputedBorderPadding.top; - mOuterReflowState.spaceManager->Translate(tx, ty); + mOuterReflowState.mSpaceManager->Translate(tx, ty); rv = htmlReflow->Reflow(*mPresContext, mMetrics, reflowState, aFrameReflowStatus); - mOuterReflowState.spaceManager->Translate(-tx, -ty); + mOuterReflowState.mSpaceManager->Translate(-tx, -ty); #ifdef DEBUG if (!NS_INLINE_IS_BREAK_BEFORE(aFrameReflowStatus)) { @@ -379,7 +379,7 @@ nsBlockReflowContext::PlaceBlock(PRBool aForceFit, // downward, just below another floater? nscoord dy = mSpace.y - mY; htmlReflow->MoveInSpaceManager(mPresContext, - mOuterReflowState.spaceManager, 0, dy); + mOuterReflowState.mSpaceManager, 0, dy); } y = mSpace.y; @@ -507,7 +507,7 @@ nsBlockReflowContext::PlaceBlock(PRBool aForceFit, // If the child has any floaters that impact the space manager, // slide them now htmlReflow->MoveInSpaceManager(mPresContext, - mOuterReflowState.spaceManager, + mOuterReflowState.mSpaceManager, dx, dy); } } diff --git a/mozilla/layout/html/base/src/nsBlockReflowState.cpp b/mozilla/layout/html/base/src/nsBlockReflowState.cpp index baadd0e9636..3d3cfee4886 100644 --- a/mozilla/layout/html/base/src/nsBlockReflowState.cpp +++ b/mozilla/layout/html/base/src/nsBlockReflowState.cpp @@ -441,7 +441,7 @@ nsBlockReflowState::nsBlockReflowState(const nsHTMLReflowState& aReflowState, { mLineLayout = aLineLayout; - mSpaceManager = aReflowState.spaceManager; + mSpaceManager = aReflowState.mSpaceManager; // Translate into our content area and then save the // coordinate system origin for later. @@ -458,8 +458,8 @@ nsBlockReflowState::nsBlockReflowState(const nsHTMLReflowState& aReflowState, // Compute content area width (the content area is inside the border // and padding) mUnconstrainedWidth = PR_FALSE; - if (NS_UNCONSTRAINEDSIZE != aReflowState.computedWidth) { - mContentArea.width = aReflowState.computedWidth; + if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedWidth) { + mContentArea.width = aReflowState.mComputedWidth; } else { if (NS_UNCONSTRAINEDSIZE == aReflowState.availableWidth) { @@ -645,7 +645,7 @@ nsBlockReflowState::RecoverVerticalMargins(nsLineBox* aLine, } // Compute collapsed bottom margin - nscoord bottomMargin = reflowState.computedMargin.bottom; + nscoord bottomMargin = reflowState.mComputedMargin.bottom; bottomMargin = nsBlockReflowContext::MaxMargin(bottomMargin, aLine->mCarriedOutBottomMargin); @@ -1148,7 +1148,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus) { - nsLineLayout lineLayout(aPresContext, aReflowState.spaceManager, + nsLineLayout lineLayout(aPresContext, aReflowState.mSpaceManager, &aReflowState, nsnull != aMetrics.maxElementSize); nsBlockReflowState state(aReflowState, &aPresContext, this, aMetrics, &lineLayout); @@ -1321,7 +1321,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, ListTag(stdout); printf(": availSize=%d,%d computed=%d,%d metrics=%d,%d carriedMargin=%d\n", aReflowState.availableWidth, aReflowState.availableHeight, - aReflowState.computedWidth, aReflowState.computedHeight, + aReflowState.mComputedWidth, aReflowState.mComputedHeight, aMetrics.width, aMetrics.height, aMetrics.mCarriedOutBottomMargin); #endif @@ -1331,7 +1331,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, static PRBool HaveAutoWidth(const nsHTMLReflowState& aReflowState) { - if (NS_UNCONSTRAINEDSIZE == aReflowState.computedWidth) { + if (NS_UNCONSTRAINEDSIZE == aReflowState.mComputedWidth) { return PR_TRUE; } const nsStylePosition* pos = aReflowState.mStylePosition; @@ -1401,10 +1401,10 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState, nscoord minWidth = aState.mKidXMost + borderPadding.right; if (!HaveAutoWidth(aReflowState)) { // Use style defined width - aMetrics.width = borderPadding.left + aReflowState.computedWidth + + aMetrics.width = borderPadding.left + aReflowState.mComputedWidth + borderPadding.right; // XXX quote css1 section here - if ((0 == aReflowState.computedWidth) && (aMetrics.width < minWidth)) { + if ((0 == aReflowState.mComputedWidth) && (aMetrics.width < minWidth)) { aMetrics.width = minWidth; } @@ -1492,9 +1492,9 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState, } // Compute final height - if (NS_UNCONSTRAINEDSIZE != aReflowState.computedHeight) { + if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedHeight) { // Use style defined height - aMetrics.height = borderPadding.top + aReflowState.computedHeight + + aMetrics.height = borderPadding.top + aReflowState.mComputedHeight + borderPadding.bottom; // When style defines the height use it for the max-element-size @@ -5706,7 +5706,7 @@ nsBlockFrame::ReflowBullet(nsBlockReflowState& aState, // Place the bullet now; use its right margin to distance it // from the rest of the frames in the line - nscoord x = - reflowState.computedMargin.right - aMetrics.width; + nscoord x = - reflowState.mComputedMargin.right - aMetrics.width; // Approximate the bullets position; vertical alignment will provide // the final vertical location. diff --git a/mozilla/layout/html/base/src/nsBlockReflowState.h b/mozilla/layout/html/base/src/nsBlockReflowState.h index baadd0e9636..3d3cfee4886 100644 --- a/mozilla/layout/html/base/src/nsBlockReflowState.h +++ b/mozilla/layout/html/base/src/nsBlockReflowState.h @@ -441,7 +441,7 @@ nsBlockReflowState::nsBlockReflowState(const nsHTMLReflowState& aReflowState, { mLineLayout = aLineLayout; - mSpaceManager = aReflowState.spaceManager; + mSpaceManager = aReflowState.mSpaceManager; // Translate into our content area and then save the // coordinate system origin for later. @@ -458,8 +458,8 @@ nsBlockReflowState::nsBlockReflowState(const nsHTMLReflowState& aReflowState, // Compute content area width (the content area is inside the border // and padding) mUnconstrainedWidth = PR_FALSE; - if (NS_UNCONSTRAINEDSIZE != aReflowState.computedWidth) { - mContentArea.width = aReflowState.computedWidth; + if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedWidth) { + mContentArea.width = aReflowState.mComputedWidth; } else { if (NS_UNCONSTRAINEDSIZE == aReflowState.availableWidth) { @@ -645,7 +645,7 @@ nsBlockReflowState::RecoverVerticalMargins(nsLineBox* aLine, } // Compute collapsed bottom margin - nscoord bottomMargin = reflowState.computedMargin.bottom; + nscoord bottomMargin = reflowState.mComputedMargin.bottom; bottomMargin = nsBlockReflowContext::MaxMargin(bottomMargin, aLine->mCarriedOutBottomMargin); @@ -1148,7 +1148,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus) { - nsLineLayout lineLayout(aPresContext, aReflowState.spaceManager, + nsLineLayout lineLayout(aPresContext, aReflowState.mSpaceManager, &aReflowState, nsnull != aMetrics.maxElementSize); nsBlockReflowState state(aReflowState, &aPresContext, this, aMetrics, &lineLayout); @@ -1321,7 +1321,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, ListTag(stdout); printf(": availSize=%d,%d computed=%d,%d metrics=%d,%d carriedMargin=%d\n", aReflowState.availableWidth, aReflowState.availableHeight, - aReflowState.computedWidth, aReflowState.computedHeight, + aReflowState.mComputedWidth, aReflowState.mComputedHeight, aMetrics.width, aMetrics.height, aMetrics.mCarriedOutBottomMargin); #endif @@ -1331,7 +1331,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, static PRBool HaveAutoWidth(const nsHTMLReflowState& aReflowState) { - if (NS_UNCONSTRAINEDSIZE == aReflowState.computedWidth) { + if (NS_UNCONSTRAINEDSIZE == aReflowState.mComputedWidth) { return PR_TRUE; } const nsStylePosition* pos = aReflowState.mStylePosition; @@ -1401,10 +1401,10 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState, nscoord minWidth = aState.mKidXMost + borderPadding.right; if (!HaveAutoWidth(aReflowState)) { // Use style defined width - aMetrics.width = borderPadding.left + aReflowState.computedWidth + + aMetrics.width = borderPadding.left + aReflowState.mComputedWidth + borderPadding.right; // XXX quote css1 section here - if ((0 == aReflowState.computedWidth) && (aMetrics.width < minWidth)) { + if ((0 == aReflowState.mComputedWidth) && (aMetrics.width < minWidth)) { aMetrics.width = minWidth; } @@ -1492,9 +1492,9 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState, } // Compute final height - if (NS_UNCONSTRAINEDSIZE != aReflowState.computedHeight) { + if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedHeight) { // Use style defined height - aMetrics.height = borderPadding.top + aReflowState.computedHeight + + aMetrics.height = borderPadding.top + aReflowState.mComputedHeight + borderPadding.bottom; // When style defines the height use it for the max-element-size @@ -5706,7 +5706,7 @@ nsBlockFrame::ReflowBullet(nsBlockReflowState& aState, // Place the bullet now; use its right margin to distance it // from the rest of the frames in the line - nscoord x = - reflowState.computedMargin.right - aMetrics.width; + nscoord x = - reflowState.mComputedMargin.right - aMetrics.width; // Approximate the bullets position; vertical alignment will provide // the final vertical location. diff --git a/mozilla/layout/html/base/src/nsHRFrame.cpp b/mozilla/layout/html/base/src/nsHRFrame.cpp index da13e84326c..40359424638 100644 --- a/mozilla/layout/html/base/src/nsHRFrame.cpp +++ b/mozilla/layout/html/base/src/nsHRFrame.cpp @@ -172,8 +172,8 @@ HRuleFrame::Reflow(nsIPresContext& aPresContext, // Compute the width float p2t; aPresContext.GetScaledPixelsToTwips(&p2t); - if (NS_UNCONSTRAINEDSIZE != aReflowState.computedWidth) { - aDesiredSize.width = aReflowState.computedWidth; + if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedWidth) { + aDesiredSize.width = aReflowState.mComputedWidth; } else { if (NS_UNCONSTRAINEDSIZE == aReflowState.availableWidth) { @@ -189,8 +189,8 @@ HRuleFrame::Reflow(nsIPresContext& aPresContext, // Get the thickness of the rule. Note that this specifies the // height of the rule, not the height of the frame. nscoord thickness; - if (NS_UNCONSTRAINEDSIZE != aReflowState.computedHeight) { - thickness = aReflowState.computedHeight; + if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedHeight) { + thickness = aReflowState.mComputedHeight; } else { thickness = NSIntPixelsToTwips(DEFAULT_THICKNESS, p2t); @@ -220,7 +220,7 @@ HRuleFrame::Reflow(nsIPresContext& aPresContext, // are springy. if (nsnull != aDesiredSize.maxElementSize) { nscoord onePixel = NSIntPixelsToTwips(1, p2t); - if (NS_UNCONSTRAINEDSIZE != aReflowState.computedWidth) { + if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedWidth) { if (eStyleUnit_Percent == aReflowState.mStylePosition->mWidth.GetUnit()) { // When the HR is using a percentage width, make sure it @@ -228,7 +228,7 @@ HRuleFrame::Reflow(nsIPresContext& aPresContext, aDesiredSize.maxElementSize->width = onePixel; } else { - aDesiredSize.maxElementSize->width = aReflowState.computedWidth; + aDesiredSize.maxElementSize->width = aReflowState.mComputedWidth; } } else { diff --git a/mozilla/layout/html/base/src/nsHTMLFrame.cpp b/mozilla/layout/html/base/src/nsHTMLFrame.cpp index 613b80eb4ed..da1233d0ede 100644 --- a/mozilla/layout/html/base/src/nsHTMLFrame.cpp +++ b/mozilla/layout/html/base/src/nsHTMLFrame.cpp @@ -284,17 +284,17 @@ RootFrame::Reflow(nsIPresContext& aPresContext, // If our height is fixed, then make sure the child frame plus its top and // bottom margin is at least that high as well... - if (NS_AUTOHEIGHT != aReflowState.computedHeight) { - nscoord totalHeight = kidDesiredSize.height + kidReflowState.computedMargin.top + - kidReflowState.computedMargin.bottom; + if (NS_AUTOHEIGHT != aReflowState.mComputedHeight) { + nscoord totalHeight = kidDesiredSize.height + kidReflowState.mComputedMargin.top + + kidReflowState.mComputedMargin.bottom; - if (totalHeight < aReflowState.computedHeight) { - kidDesiredSize.height += aReflowState.computedHeight - totalHeight; + if (totalHeight < aReflowState.mComputedHeight) { + kidDesiredSize.height += aReflowState.mComputedHeight - totalHeight; } } // Position and size the child frame - nsRect rect(kidReflowState.computedMargin.left, kidReflowState.computedMargin.top, + nsRect rect(kidReflowState.mComputedMargin.left, kidReflowState.mComputedMargin.top, kidDesiredSize.width, kidDesiredSize.height); kidFrame->SetRect(rect); } @@ -306,10 +306,10 @@ RootFrame::Reflow(nsIPresContext& aPresContext, } // Return our desired size - aDesiredSize.width = kidDesiredSize.width + kidReflowState.computedMargin.left + - kidReflowState.computedMargin.right; - aDesiredSize.height = kidDesiredSize.height + kidReflowState.computedMargin.top + - kidReflowState.computedMargin.bottom; + aDesiredSize.width = kidDesiredSize.width + kidReflowState.mComputedMargin.left + + kidReflowState.mComputedMargin.right; + aDesiredSize.height = kidDesiredSize.height + kidReflowState.mComputedMargin.top + + kidReflowState.mComputedMargin.bottom; aDesiredSize.ascent = aDesiredSize.height; aDesiredSize.descent = 0; // XXX Don't completely ignore NS_FRAME_OUTSIDE_CHILDREN for child frames diff --git a/mozilla/layout/html/base/src/nsHTMLImageLoader.cpp b/mozilla/layout/html/base/src/nsHTMLImageLoader.cpp index c146c7b56c4..92e37351faf 100644 --- a/mozilla/layout/html/base/src/nsHTMLImageLoader.cpp +++ b/mozilla/layout/html/base/src/nsHTMLImageLoader.cpp @@ -223,8 +223,8 @@ nsHTMLImageLoader::GetDesiredSize(nsIPresContext* aPresContext, PRBool fixedContentHeight = PR_FALSE; if (aReflowState) { - widthConstraint = aReflowState->computedWidth; - heightConstraint = aReflowState->computedHeight; + widthConstraint = aReflowState->mComputedWidth; + heightConstraint = aReflowState->mComputedHeight; // Determine whether the image has fixed content width and height if (NS_UNCONSTRAINEDSIZE != widthConstraint) { diff --git a/mozilla/layout/html/base/src/nsHTMLReflowState.cpp b/mozilla/layout/html/base/src/nsHTMLReflowState.cpp index 7dc86041d95..a3bfdf5487e 100644 --- a/mozilla/layout/html/base/src/nsHTMLReflowState.cpp +++ b/mozilla/layout/html/base/src/nsHTMLReflowState.cpp @@ -51,7 +51,7 @@ nsHTMLReflowState::nsHTMLReflowState(nsIPresContext& aPresContext, availableWidth = aAvailableSpace.width; availableHeight = aAvailableSpace.height; rendContext = aRenderingContext; - spaceManager = nsnull; + mSpaceManager = nsnull; lineLayout = nsnull; isTopOfPage = PR_FALSE; Init(aPresContext); @@ -74,7 +74,7 @@ nsHTMLReflowState::nsHTMLReflowState(nsIPresContext& aPresContext, availableWidth = aAvailableSpace.width; availableHeight = aAvailableSpace.height; rendContext = aRenderingContext; - spaceManager = nsnull; + mSpaceManager = nsnull; lineLayout = nsnull; isTopOfPage = PR_FALSE; Init(aPresContext); @@ -99,7 +99,7 @@ nsHTMLReflowState::nsHTMLReflowState(nsIPresContext& aPresContext, availableHeight = aAvailableSpace.height; rendContext = aParentReflowState.rendContext; - spaceManager = aParentReflowState.spaceManager; + mSpaceManager = aParentReflowState.mSpaceManager; lineLayout = aParentReflowState.lineLayout; isTopOfPage = aParentReflowState.isTopOfPage; @@ -121,7 +121,7 @@ nsHTMLReflowState::nsHTMLReflowState(nsIPresContext& aPresContext, availableHeight = aAvailableSpace.height; rendContext = aParentReflowState.rendContext; - spaceManager = aParentReflowState.spaceManager; + mSpaceManager = aParentReflowState.mSpaceManager; lineLayout = aParentReflowState.lineLayout; isTopOfPage = aParentReflowState.isTopOfPage; @@ -141,7 +141,7 @@ nsHTMLReflowState::Init(nsIPresContext& aPresContext) (const nsStyleStruct*&)mStyleDisplay); frame->GetStyleData(eStyleStruct_Spacing, (const nsStyleStruct*&)mStyleSpacing); - frameType = DetermineFrameType(frame, mStylePosition, mStyleDisplay); + mFrameType = DetermineFrameType(frame, mStylePosition, mStyleDisplay); InitConstraints(aPresContext); } @@ -177,7 +177,7 @@ nsHTMLReflowState::GetContainingBlockContentWidth(const nsReflowState* aParentRS const nsHTMLReflowState* rs = GetContainingBlockReflowState(aParentRS); if (nsnull != rs) { - return ((nsHTMLReflowState*)aParentRS)->computedWidth;/* XXX cast */ + return ((nsHTMLReflowState*)aParentRS)->mComputedWidth;/* XXX cast */ } return width; } @@ -472,9 +472,9 @@ nsHTMLReflowState::InitAbsoluteConstraints(nsIPresContext& aPresContext, if (eStyleUnit_Auto == widthUnit) { // The element has a 'width' value of 'auto' - if (NS_FRAME_IS_REPLACED(frameType)) { + if (NS_FRAME_IS_REPLACED(mFrameType)) { // Substitute the element's intrinsic width - computedWidth = NS_INTRINSICSIZE; + mComputedWidth = NS_INTRINSICSIZE; } else { // Any remaining 'auto' values for 'left', 'right', 'margin-left', or @@ -484,33 +484,33 @@ nsHTMLReflowState::InitAbsoluteConstraints(nsIPresContext& aPresContext, marginLeftIsAuto = PR_FALSE; marginRightIsAuto = PR_FALSE; - computedWidth = containingBlockWidth - computedOffsets.left - - computedMargin.left - mComputedBorderPadding.left - + mComputedWidth = containingBlockWidth - computedOffsets.left - + mComputedMargin.left - mComputedBorderPadding.left - mComputedBorderPadding.right - - computedMargin.right - computedOffsets.right; + mComputedMargin.right - computedOffsets.right; } // Factor in any minimum and maximum size information - if (computedWidth > mComputedMaxWidth) { - computedWidth = mComputedMaxWidth; - } else if (computedWidth < mComputedMinWidth) { - computedWidth = mComputedMinWidth; + if (mComputedWidth > mComputedMaxWidth) { + mComputedWidth = mComputedMaxWidth; + } else if (mComputedWidth < mComputedMinWidth) { + mComputedWidth = mComputedMinWidth; } } else { if (eStyleUnit_Inherit == widthUnit) { - computedWidth = containingBlockWidth; + mComputedWidth = containingBlockWidth; } else { // Use the specified value for the computed width ComputeHorizontalValue(containingBlockWidth, widthUnit, - mStylePosition->mWidth, computedWidth); + mStylePosition->mWidth, mComputedWidth); } // Factor in any minimum and maximum size information - if (computedWidth > mComputedMaxWidth) { - computedWidth = mComputedMaxWidth; - } else if (computedWidth < mComputedMinWidth) { - computedWidth = mComputedMinWidth; + if (mComputedWidth > mComputedMaxWidth) { + mComputedWidth = mComputedMaxWidth; + } else if (mComputedWidth < mComputedMinWidth) { + mComputedWidth = mComputedMinWidth; } } @@ -518,50 +518,50 @@ nsHTMLReflowState::InitAbsoluteConstraints(nsIPresContext& aPresContext, if (leftIsAuto) { // Any 'auto' on 'margin-left' or 'margin-right' are replaced with 0 // (their default value) - computedOffsets.left = containingBlockWidth - computedMargin.left - - mComputedBorderPadding.left - computedWidth - + computedOffsets.left = containingBlockWidth - mComputedMargin.left - + mComputedBorderPadding.left - mComputedWidth - mComputedBorderPadding.right - - computedMargin.right - computedOffsets.right; + mComputedMargin.right - computedOffsets.right; } else if (rightIsAuto) { // Any 'auto' on 'margin-left' or 'margin-right' are replaced with 0 // (their default value) computedOffsets.right = containingBlockWidth - computedOffsets.left - - computedMargin.left - mComputedBorderPadding.left - computedWidth - - mComputedBorderPadding.right - computedMargin.right; + mComputedMargin.left - mComputedBorderPadding.left - mComputedWidth - + mComputedBorderPadding.right - mComputedMargin.right; } else if (marginLeftIsAuto || marginRightIsAuto) { // All that's left to solve for are 'auto' values for 'margin-left' and // 'margin-right' - if (NS_FRAME_IS_REPLACED(frameType)) { + if (NS_FRAME_IS_REPLACED(mFrameType)) { // We can't solve for 'auto' values for 'margin-left' and 'margin-right' // until after we reflow the frame and it tells us its intrinsic width if (marginLeftIsAuto) { - computedMargin.left = NS_AUTOMARGIN; + mComputedMargin.left = NS_AUTOMARGIN; } if (marginRightIsAuto) { - computedMargin.right = NS_AUTOMARGIN; + mComputedMargin.right = NS_AUTOMARGIN; } } else { // Calculate the amount of space for margins nscoord availMarginSpace = containingBlockWidth - computedOffsets.left - mComputedBorderPadding.left - - computedWidth - mComputedBorderPadding.right - + mComputedWidth - mComputedBorderPadding.right - computedOffsets.right; if (marginLeftIsAuto) { if (marginRightIsAuto) { // Both 'margin-left' and 'margin-right' are 'auto', so they get // equal values - computedMargin.left = availMarginSpace / 2; - computedMargin.right = availMarginSpace - computedMargin.left; + mComputedMargin.left = availMarginSpace / 2; + mComputedMargin.right = availMarginSpace - mComputedMargin.left; } else { // Just 'margin-left' is 'auto' - computedMargin.left = availMarginSpace - computedMargin.right; + mComputedMargin.left = availMarginSpace - mComputedMargin.right; } } else { // Just 'margin-right' is 'auto' - computedMargin.right = availMarginSpace - computedMargin.left; + mComputedMargin.right = availMarginSpace - mComputedMargin.left; } } } @@ -614,8 +614,8 @@ nsHTMLReflowState::InitAbsoluteConstraints(nsIPresContext& aPresContext, PRBool marginBottomIsAuto = (eStyleUnit_Auto == mStyleSpacing->mMargin.GetBottomUnit()); if (eStyleUnit_Auto == heightUnit) { - if (NS_FRAME_IS_REPLACED(frameType)) { - computedHeight = NS_INTRINSICSIZE; + if (NS_FRAME_IS_REPLACED(mFrameType)) { + mComputedHeight = NS_INTRINSICSIZE; } else { // Replace any 'auto' on 'margin-top' or 'margin-bottom' with 0 (their // default values) @@ -629,37 +629,37 @@ nsHTMLReflowState::InitAbsoluteConstraints(nsIPresContext& aPresContext, if (NS_AUTOHEIGHT == containingBlockHeight) { // If the containing block's height was not explicitly specified (i.e., // it depends on its content height), then so does our height - computedHeight = NS_AUTOHEIGHT; + mComputedHeight = NS_AUTOHEIGHT; } else { - computedHeight = containingBlockHeight - computedOffsets.top - - computedMargin.top - mComputedBorderPadding.top - + mComputedHeight = containingBlockHeight - computedOffsets.top - + mComputedMargin.top - mComputedBorderPadding.top - mComputedBorderPadding.bottom - - computedMargin.bottom - computedOffsets.bottom; + mComputedMargin.bottom - computedOffsets.bottom; // Factor in any minimum and maximum size information - if (computedHeight > mComputedMaxHeight) { - computedHeight = mComputedMaxHeight; - } else if (computedHeight < mComputedMinHeight) { - computedHeight = mComputedMinHeight; + if (mComputedHeight > mComputedMaxHeight) { + mComputedHeight = mComputedMaxHeight; + } else if (mComputedHeight < mComputedMinHeight) { + mComputedHeight = mComputedMinHeight; } } } } else { if (eStyleUnit_Inherit == heightUnit) { - computedHeight = containingBlockHeight; + mComputedHeight = containingBlockHeight; } else { // Use the specified value for the computed height ComputeVerticalValue(containingBlockHeight, heightUnit, - mStylePosition->mHeight, computedHeight); + mStylePosition->mHeight, mComputedHeight); } // Factor in any minimum and maximum size information - if (computedHeight > mComputedMaxHeight) { - computedHeight = mComputedMaxHeight; + if (mComputedHeight > mComputedMaxHeight) { + mComputedHeight = mComputedMaxHeight; } - if (computedHeight < mComputedMinHeight) { - computedHeight = mComputedMinHeight; + if (mComputedHeight < mComputedMinHeight) { + mComputedHeight = mComputedMinHeight; } } @@ -668,40 +668,40 @@ nsHTMLReflowState::InitAbsoluteConstraints(nsIPresContext& aPresContext, if (bottomIsAuto) { // Any 'auto' on 'margin-top' or 'margin-bottom' are replaced with 0 computedOffsets.bottom = containingBlockHeight - computedOffsets.top - - computedMargin.top - mComputedBorderPadding.top - computedHeight - - mComputedBorderPadding.bottom - computedMargin.bottom; + mComputedMargin.top - mComputedBorderPadding.top - mComputedHeight - + mComputedBorderPadding.bottom - mComputedMargin.bottom; } else if (marginTopIsAuto || marginBottomIsAuto) { // All that's left to solve for are 'auto' values for 'margin-top' and // 'margin-bottom' - if (NS_FRAME_IS_REPLACED(frameType)) { + if (NS_FRAME_IS_REPLACED(mFrameType)) { // We can't solve for 'auto' values for 'margin-top' and 'margin-bottom' // until after we reflow the frame and it tells us its intrinsic height if (marginTopIsAuto) { - computedMargin.top = NS_AUTOMARGIN; + mComputedMargin.top = NS_AUTOMARGIN; } if (marginBottomIsAuto) { - computedMargin.bottom = NS_AUTOMARGIN; + mComputedMargin.bottom = NS_AUTOMARGIN; } } else { // Calculate the amount of space for margins nscoord availMarginSpace = containingBlockHeight - computedOffsets.top - - mComputedBorderPadding.top - computedHeight - mComputedBorderPadding.bottom - + mComputedBorderPadding.top - mComputedHeight - mComputedBorderPadding.bottom - computedOffsets.bottom; if (marginTopIsAuto) { if (marginBottomIsAuto) { // Both 'margin-top' and 'margin-bottom' are 'auto', so they get // equal values - computedMargin.top = availMarginSpace / 2; - computedMargin.bottom = availMarginSpace - computedMargin.top; + mComputedMargin.top = availMarginSpace / 2; + mComputedMargin.bottom = availMarginSpace - mComputedMargin.top; } else { // Just 'margin-top' is 'auto' - computedMargin.top = availMarginSpace - computedMargin.bottom; + mComputedMargin.top = availMarginSpace - mComputedMargin.bottom; } } else { // Just 'margin-bottom' is 'auto' - computedMargin.bottom = availMarginSpace - computedMargin.top; + mComputedMargin.bottom = availMarginSpace - mComputedMargin.top; } } } @@ -717,12 +717,12 @@ nsHTMLReflowState::ComputeContainingBlockRectangle(const nsHTMLReflowState* aCon { // Unless the element is absolutely positioned, the containing block is // formed by the content edge of the nearest block-level ancestor - aContainingBlockWidth = aContainingBlockRS->computedWidth; - aContainingBlockHeight = aContainingBlockRS->computedHeight; + aContainingBlockWidth = aContainingBlockRS->mComputedWidth; + aContainingBlockHeight = aContainingBlockRS->mComputedHeight; - if (NS_FRAME_GET_TYPE(frameType) == NS_CSS_FRAME_TYPE_ABSOLUTE) { + if (NS_FRAME_GET_TYPE(mFrameType) == NS_CSS_FRAME_TYPE_ABSOLUTE) { // See if the ancestor is block-level or inline-level - if (NS_FRAME_GET_TYPE(aContainingBlockRS->frameType) == NS_CSS_FRAME_TYPE_INLINE) { + if (NS_FRAME_GET_TYPE(aContainingBlockRS->mFrameType) == NS_CSS_FRAME_TYPE_INLINE) { // The CSS2 spec says that if the ancestor is inline-level, the containing // block depends on the 'direction' property of the ancestor. For direction // 'ltr', it's the top and left of the content edges of the first box and @@ -734,13 +734,13 @@ nsHTMLReflowState::ComputeContainingBlockRectangle(const nsHTMLReflowState* aCon // the computed width and height of the nearest block-level ancestor const nsHTMLReflowState* cbrs = aContainingBlockRS; while (cbrs) { - nsCSSFrameType type = NS_FRAME_GET_TYPE(cbrs->frameType); + nsCSSFrameType type = NS_FRAME_GET_TYPE(cbrs->mFrameType); if ((NS_CSS_FRAME_TYPE_BLOCK == type) || (NS_CSS_FRAME_TYPE_FLOATING == type) || (NS_CSS_FRAME_TYPE_ABSOLUTE == type)) { - aContainingBlockWidth = cbrs->computedWidth; - aContainingBlockHeight = cbrs->computedHeight; + aContainingBlockWidth = cbrs->mComputedWidth; + aContainingBlockHeight = cbrs->mComputedHeight; if (NS_CSS_FRAME_TYPE_ABSOLUTE == type) { aContainingBlockWidth += cbrs->mComputedPadding.left + @@ -774,9 +774,9 @@ nsHTMLReflowState::InitConstraints(nsIPresContext& aPresContext) // If this is the root frame, then set the computed width and // height equal to the available space if (nsnull == parentReflowState) { - computedWidth = availableWidth; - computedHeight = availableHeight; - computedMargin.SizeTo(0, 0, 0, 0); + mComputedWidth = availableWidth; + mComputedHeight = availableHeight; + mComputedMargin.SizeTo(0, 0, 0, 0); mComputedPadding.SizeTo(0, 0, 0, 0); mComputedBorderPadding.SizeTo(0, 0, 0, 0); computedOffsets.SizeTo(0, 0, 0, 0); @@ -821,7 +821,7 @@ nsHTMLReflowState::InitConstraints(nsIPresContext& aPresContext) if (nsLayoutAtoms::scrollFrame == cbFrameType) { // Use the scroll frame's computed height instead containingBlockHeight = - ((nsHTMLReflowState*)cbrs->parentReflowState)->computedHeight; + ((nsHTMLReflowState*)cbrs->parentReflowState)->mComputedHeight; } NS_IF_RELEASE(cbFrameType); } @@ -863,78 +863,78 @@ nsHTMLReflowState::InitConstraints(nsIPresContext& aPresContext) ComputeMinMaxValues(containingBlockWidth, containingBlockHeight, cbrs); // Calculate the computed width and height. This varies by frame type - if ((NS_FRAME_REPLACED(NS_CSS_FRAME_TYPE_INLINE) == frameType) || - (NS_FRAME_REPLACED(NS_CSS_FRAME_TYPE_FLOATING) == frameType)) { + if ((NS_FRAME_REPLACED(NS_CSS_FRAME_TYPE_INLINE) == mFrameType) || + (NS_FRAME_REPLACED(NS_CSS_FRAME_TYPE_FLOATING) == mFrameType)) { // Inline replaced element and floating replaced element are basically // treated the same. First calculate the computed width if (eStyleUnit_Inherit == widthUnit) { - computedWidth = containingBlockWidth; + mComputedWidth = containingBlockWidth; } else if (eStyleUnit_Auto == widthUnit) { // A specified value of 'auto' uses the element's intrinsic width - computedWidth = NS_INTRINSICSIZE; + mComputedWidth = NS_INTRINSICSIZE; } else { ComputeHorizontalValue(containingBlockWidth, widthUnit, mStylePosition->mWidth, - computedWidth); + mComputedWidth); } - if (computedWidth > mComputedMaxWidth) { - computedWidth = mComputedMaxWidth; - } else if (computedWidth < mComputedMinWidth) { - computedWidth = mComputedMinWidth; + if (mComputedWidth > mComputedMaxWidth) { + mComputedWidth = mComputedMaxWidth; + } else if (mComputedWidth < mComputedMinWidth) { + mComputedWidth = mComputedMinWidth; } // Now calculate the computed height if (eStyleUnit_Inherit == heightUnit) { - computedHeight = containingBlockHeight; + mComputedHeight = containingBlockHeight; } else if (eStyleUnit_Auto == heightUnit) { // A specified value of 'auto' uses the element's intrinsic height - computedHeight = NS_INTRINSICSIZE; + mComputedHeight = NS_INTRINSICSIZE; } else { ComputeVerticalValue(containingBlockHeight, heightUnit, mStylePosition->mHeight, - computedHeight); + mComputedHeight); } - if (computedHeight > mComputedMaxHeight) { - computedHeight = mComputedMaxHeight; - } else if (computedHeight < mComputedMinHeight) { - computedHeight = mComputedMinHeight; + if (mComputedHeight > mComputedMaxHeight) { + mComputedHeight = mComputedMaxHeight; + } else if (mComputedHeight < mComputedMinHeight) { + mComputedHeight = mComputedMinHeight; } - } else if (NS_CSS_FRAME_TYPE_FLOATING == frameType) { + } else if (NS_CSS_FRAME_TYPE_FLOATING == mFrameType) { // Floating non-replaced element. First calculate the computed width if (eStyleUnit_Inherit == widthUnit) { - computedWidth = containingBlockWidth; + mComputedWidth = containingBlockWidth; } else if (eStyleUnit_Auto == widthUnit) { // A specified value of 'auto' becomes a computed width of 0 - computedWidth = 0; + mComputedWidth = 0; } else { ComputeHorizontalValue(containingBlockWidth, widthUnit, mStylePosition->mWidth, - computedWidth); + mComputedWidth); } - if (computedWidth > mComputedMaxWidth) { - computedWidth = mComputedMaxWidth; - } else if (computedWidth < mComputedMinWidth) { - computedWidth = mComputedMinWidth; + if (mComputedWidth > mComputedMaxWidth) { + mComputedWidth = mComputedMaxWidth; + } else if (mComputedWidth < mComputedMinWidth) { + mComputedWidth = mComputedMinWidth; } // Now calculate the computed height if (eStyleUnit_Inherit == heightUnit) { - computedHeight = containingBlockHeight; + mComputedHeight = containingBlockHeight; } else if (eStyleUnit_Auto == heightUnit) { - computedHeight = NS_AUTOHEIGHT; // let it choose its height + mComputedHeight = NS_AUTOHEIGHT; // let it choose its height } else { ComputeVerticalValue(containingBlockHeight, heightUnit, mStylePosition->mHeight, - computedHeight); + mComputedHeight); } - if (computedHeight > mComputedMaxHeight) { - computedHeight = mComputedMaxHeight; - } else if (computedHeight < mComputedMinHeight) { - computedHeight = mComputedMinHeight; + if (mComputedHeight > mComputedMaxHeight) { + mComputedHeight = mComputedMaxHeight; + } else if (mComputedHeight < mComputedMinHeight) { + mComputedHeight = mComputedMinHeight; } - } else if (NS_CSS_FRAME_TYPE_INTERNAL_TABLE == frameType) { + } else if (NS_CSS_FRAME_TYPE_INTERNAL_TABLE == mFrameType) { // Internal table elements. The rules vary depending on the type. // Calculate the computed width if ((NS_STYLE_DISPLAY_TABLE_ROW == mStyleDisplay->mDisplay) || @@ -944,21 +944,21 @@ nsHTMLReflowState::InitConstraints(nsIPresContext& aPresContext) } if (eStyleUnit_Inherit == widthUnit) { - computedWidth = containingBlockWidth; + mComputedWidth = containingBlockWidth; } else if (eStyleUnit_Auto == widthUnit) { - computedWidth = availableWidth; + mComputedWidth = availableWidth; - if (computedWidth != NS_UNCONSTRAINEDSIZE) { + if (mComputedWidth != NS_UNCONSTRAINEDSIZE) { // Internal table elements don't have margins, but they have border // and padding - computedWidth -= mComputedBorderPadding.left + + mComputedWidth -= mComputedBorderPadding.left + mComputedBorderPadding.right; } } else { ComputeHorizontalValue(containingBlockWidth, widthUnit, mStylePosition->mWidth, - computedWidth); + mComputedWidth); } // Calculate the computed height @@ -968,20 +968,20 @@ nsHTMLReflowState::InitConstraints(nsIPresContext& aPresContext) heightUnit = eStyleUnit_Auto; } if (eStyleUnit_Inherit == heightUnit) { - computedHeight = containingBlockHeight; + mComputedHeight = containingBlockHeight; } else if (eStyleUnit_Auto == heightUnit) { - computedHeight = NS_AUTOHEIGHT; + mComputedHeight = NS_AUTOHEIGHT; } else { ComputeVerticalValue(containingBlockHeight, heightUnit, mStylePosition->mHeight, - computedHeight); + mComputedHeight); } // Doesn't apply to table elements mComputedMinWidth = mComputedMinHeight = 0; mComputedMaxWidth = mComputedMaxHeight = NS_UNCONSTRAINEDSIZE; - } else if (NS_FRAME_GET_TYPE(frameType) == NS_CSS_FRAME_TYPE_ABSOLUTE) { + } else if (NS_FRAME_GET_TYPE(mFrameType) == NS_CSS_FRAME_TYPE_ABSOLUTE) { // XXX not sure if this belongs here or somewhere else - cwk // an nsHTMLFrameInnerFrame doesn't get a placeholder frame, the nsHTMLFrameOuterFrame does nsIAtom* targetFrameType; @@ -991,13 +991,13 @@ nsHTMLReflowState::InitConstraints(nsIPresContext& aPresContext) containingBlockHeight); } NS_IF_RELEASE(targetFrameType); - } else if (NS_CSS_FRAME_TYPE_INLINE == frameType) { + } else if (NS_CSS_FRAME_TYPE_INLINE == mFrameType) { // Inline non-replaced elements do not have computed widths or heights // XXX add this check to HaveFixedContentHeight/Width too - computedWidth = NS_UNCONSTRAINEDSIZE; - computedHeight = NS_UNCONSTRAINEDSIZE; - computedMargin.top = 0; - computedMargin.bottom = 0; + mComputedWidth = NS_UNCONSTRAINEDSIZE; + mComputedHeight = NS_UNCONSTRAINEDSIZE; + mComputedMargin.top = 0; + mComputedMargin.bottom = 0; mComputedMinWidth = mComputedMinHeight = 0; mComputedMaxWidth = mComputedMaxHeight = NS_UNCONSTRAINEDSIZE; } else { @@ -1020,10 +1020,10 @@ nsHTMLReflowState::ComputeBlockBoxData(nsIPresContext& aPresContext, { // Compute the content width if (eStyleUnit_Auto == aWidthUnit) { - if (NS_FRAME_IS_REPLACED(frameType)) { + if (NS_FRAME_IS_REPLACED(mFrameType)) { // Block-level replaced element in the flow. A specified value of // 'auto' uses the element's intrinsic width (CSS2 10.3.4) - computedWidth = NS_INTRINSICSIZE; + mComputedWidth = NS_INTRINSICSIZE; } else { // Block-level non-replaced element in the flow. 'auto' values // for margin-left and margin-right become 0 and the sum of the @@ -1032,21 +1032,21 @@ nsHTMLReflowState::ComputeBlockBoxData(nsIPresContext& aPresContext, if (NS_UNCONSTRAINEDSIZE == availableWidth) { // During pass1 table reflow, auto side margin values are // uncomputable (== 0). - computedWidth = NS_UNCONSTRAINEDSIZE; + mComputedWidth = NS_UNCONSTRAINEDSIZE; } else { - computedWidth = availableWidth - computedMargin.left - - computedMargin.right - mComputedBorderPadding.left - + mComputedWidth = availableWidth - mComputedMargin.left - + mComputedMargin.right - mComputedBorderPadding.left - mComputedBorderPadding.right; // Take into account any min and max values - if (computedWidth > mComputedMaxWidth) { + if (mComputedWidth > mComputedMaxWidth) { // Apply the rules again, but this time using 'max-width' as // the value for 'width' - computedWidth = mComputedMaxWidth; - } else if (computedWidth < mComputedMinWidth) { + mComputedWidth = mComputedMaxWidth; + } else if (mComputedWidth < mComputedMinWidth) { // Apply the rules again, but this time using 'min-width' as // the value for 'width' - computedWidth = mComputedMinWidth; + mComputedWidth = mComputedMinWidth; } } } @@ -1060,26 +1060,26 @@ nsHTMLReflowState::ComputeBlockBoxData(nsIPresContext& aPresContext, // elements width, because we want to skip over any intervening // inline elements (since width doesn't apply to them). if (NS_UNCONSTRAINEDSIZE != aContainingBlockWidth) { - computedWidth = aContainingBlockWidth; + mComputedWidth = aContainingBlockWidth; } else { - computedWidth = NS_UNCONSTRAINEDSIZE; + mComputedWidth = NS_UNCONSTRAINEDSIZE; } } else { ComputeHorizontalValue(aContainingBlockWidth, aWidthUnit, - mStylePosition->mWidth, computedWidth); + mStylePosition->mWidth, mComputedWidth); } // Take into account any min and max values - if (computedWidth > mComputedMaxWidth) { - computedWidth = mComputedMaxWidth; - } else if (computedWidth < mComputedMinWidth) { - computedWidth = mComputedMinWidth; + if (mComputedWidth > mComputedMaxWidth) { + mComputedWidth = mComputedMaxWidth; + } else if (mComputedWidth < mComputedMinWidth) { + mComputedWidth = mComputedMinWidth; } // Now that we have the computed-width, compute the side margins - CalculateBlockSideMargins(cbrs, computedWidth); + CalculateBlockSideMargins(cbrs, mComputedWidth); } @@ -1092,27 +1092,27 @@ nsHTMLReflowState::ComputeBlockBoxData(nsIPresContext& aPresContext, // elements height because we want to skip over any interveening // inline elements (since height doesn't apply to them). if (NS_UNCONSTRAINEDSIZE != aContainingBlockHeight) { - computedHeight = aContainingBlockHeight; + mComputedHeight = aContainingBlockHeight; } else { - computedHeight = NS_UNCONSTRAINEDSIZE; + mComputedHeight = NS_UNCONSTRAINEDSIZE; } } else if (eStyleUnit_Auto == aHeightUnit) { - if (NS_FRAME_IS_REPLACED(frameType)) { + if (NS_FRAME_IS_REPLACED(mFrameType)) { // For replaced elements use the intrinsic size for "auto" - computedHeight = NS_INTRINSICSIZE; + mComputedHeight = NS_INTRINSICSIZE; } else { // For non-replaced elements auto means unconstrained - computedHeight = NS_UNCONSTRAINEDSIZE; + mComputedHeight = NS_UNCONSTRAINEDSIZE; } } else { ComputeVerticalValue(aContainingBlockHeight, aHeightUnit, - mStylePosition->mHeight, computedHeight); + mStylePosition->mHeight, mComputedHeight); } - if (computedHeight > mComputedMaxHeight) { - computedHeight = mComputedMaxHeight; - } else if (computedHeight < mComputedMinHeight) { - computedHeight = mComputedMinHeight; + if (mComputedHeight > mComputedMaxHeight) { + mComputedHeight = mComputedMaxHeight; + } else if (mComputedHeight < mComputedMinHeight) { + mComputedHeight = mComputedMinHeight; } } @@ -1125,19 +1125,19 @@ nsHTMLReflowState::ComputeBlockBoxData(nsIPresContext& aPresContext, // Note: the width unit is not auto when this is called void nsHTMLReflowState::CalculateBlockSideMargins(const nsHTMLReflowState* cbrs, - nscoord aComputedWidth) + nscoord amComputedWidth) { // We can only provide values for auto side margins in a constrained // reflow. For unconstrained reflow there is no effective width to // compute against... - if ((NS_UNCONSTRAINEDSIZE == aComputedWidth) || - (NS_UNCONSTRAINEDSIZE == cbrs->computedWidth)) { + if ((NS_UNCONSTRAINEDSIZE == amComputedWidth) || + (NS_UNCONSTRAINEDSIZE == cbrs->mComputedWidth)) { return; } - nscoord sum = computedMargin.left + mComputedBorderPadding.left + - aComputedWidth + mComputedBorderPadding.right + computedMargin.right; - if (sum == cbrs->computedWidth) { + nscoord sum = mComputedMargin.left + mComputedBorderPadding.left + + amComputedWidth + mComputedBorderPadding.right + mComputedMargin.right; + if (sum == cbrs->mComputedWidth) { // The sum is already correct return; } @@ -1150,18 +1150,18 @@ nsHTMLReflowState::CalculateBlockSideMargins(const nsHTMLReflowState* cbrs, eStyleUnit_Auto == mStyleSpacing->mMargin.GetRightUnit(); // Calculate how much space is available for margins - nscoord availMarginSpace = cbrs->computedWidth - aComputedWidth - + nscoord availMarginSpace = cbrs->mComputedWidth - amComputedWidth - mComputedBorderPadding.left - mComputedBorderPadding.right; if (availMarginSpace < 0) { // Whoops - the element is too large for the available space. In // this case use the "direction" property to pin the element to // the left or right side. Note that we look at the parent's // direction since the parent will be placing this element. - computedMargin.left = 0; - computedMargin.right = 0; + mComputedMargin.left = 0; + mComputedMargin.right = 0; const nsHTMLReflowState* prs = (const nsHTMLReflowState*)parentReflowState; if (prs && (NS_STYLE_DIRECTION_RTL == prs->mStyleDisplay->mDirection)) { - computedMargin.left = availMarginSpace; + mComputedMargin.left = availMarginSpace; } } else { @@ -1187,13 +1187,13 @@ nsHTMLReflowState::CalculateBlockSideMargins(const nsHTMLReflowState* cbrs, if (isAutoLeftMargin) { if (isAutoRightMargin) { // Both margins are 'auto' so their computed values are equal - computedMargin.left = availMarginSpace / 2; - computedMargin.right = availMarginSpace - computedMargin.left; + mComputedMargin.left = availMarginSpace / 2; + mComputedMargin.right = availMarginSpace - mComputedMargin.left; } else { - computedMargin.left = availMarginSpace - computedMargin.right; + mComputedMargin.left = availMarginSpace - mComputedMargin.right; } } else if (isAutoRightMargin) { - computedMargin.right = availMarginSpace - computedMargin.left; + mComputedMargin.right = availMarginSpace - mComputedMargin.left; } } } @@ -1202,20 +1202,20 @@ nsHTMLReflowState::CalculateBlockSideMargins(const nsHTMLReflowState* cbrs, // XXX I have no idea if this is right or not -- kipp void nsHTMLReflowState::CalculateTableSideMargins(const nsHTMLReflowState* cbrs, - nscoord aComputedWidth) + nscoord amComputedWidth) { // We can only provide values for auto side margins in a constrained // reflow. For unconstrained reflow there is no effective width to // compute against... - if ((NS_UNCONSTRAINEDSIZE != aComputedWidth) && - (NS_UNCONSTRAINEDSIZE != cbrs->computedWidth)) { + if ((NS_UNCONSTRAINEDSIZE != amComputedWidth) && + (NS_UNCONSTRAINEDSIZE != cbrs->mComputedWidth)) { PRBool isAutoLeftMargin = eStyleUnit_Auto == mStyleSpacing->mMargin.GetLeftUnit(); PRBool isAutoRightMargin = eStyleUnit_Auto == mStyleSpacing->mMargin.GetRightUnit(); // Calculate how much space is available for margins - nscoord availMarginSpace = cbrs->computedWidth - aComputedWidth - + nscoord availMarginSpace = cbrs->mComputedWidth - amComputedWidth - mComputedBorderPadding.left - mComputedBorderPadding.right; if (availMarginSpace != 0) { @@ -1223,13 +1223,13 @@ nsHTMLReflowState::CalculateTableSideMargins(const nsHTMLReflowState* cbrs, if (isAutoLeftMargin) { if (isAutoRightMargin) { // Both margins are 'auto' so their computed values are equal - computedMargin.left = availMarginSpace / 2; - computedMargin.right = availMarginSpace - computedMargin.left; + mComputedMargin.left = availMarginSpace / 2; + mComputedMargin.right = availMarginSpace - mComputedMargin.left; } else { - computedMargin.left = availMarginSpace - computedMargin.right; + mComputedMargin.left = availMarginSpace - mComputedMargin.right; } } else if (isAutoRightMargin) { - computedMargin.right = availMarginSpace - computedMargin.left; + mComputedMargin.right = availMarginSpace - mComputedMargin.left; } } } @@ -1375,30 +1375,30 @@ nsHTMLReflowState::ComputeMargin(nscoord aContainingBlockWidth, const nsHTMLReflowState* aContainingBlockRS) { // If style style can provide us the margin directly, then use it. - if (!mStyleSpacing->GetMargin(computedMargin)) { + if (!mStyleSpacing->GetMargin(mComputedMargin)) { // We have to compute the value if (NS_UNCONSTRAINEDSIZE == aContainingBlockWidth) { - computedMargin.left = 0; - computedMargin.right = 0; + mComputedMargin.left = 0; + mComputedMargin.right = 0; } else { nsStyleCoord left, right; if (eStyleUnit_Inherit == mStyleSpacing->mMargin.GetLeftUnit()) { - computedMargin.left = aContainingBlockRS->computedMargin.left; + mComputedMargin.left = aContainingBlockRS->mComputedMargin.left; } else { ComputeHorizontalValue(aContainingBlockWidth, mStyleSpacing->mMargin.GetLeftUnit(), mStyleSpacing->mMargin.GetLeft(left), - computedMargin.left); + mComputedMargin.left); } if (eStyleUnit_Inherit == mStyleSpacing->mMargin.GetRightUnit()) { - computedMargin.right = aContainingBlockRS->computedMargin.right; + mComputedMargin.right = aContainingBlockRS->mComputedMargin.right; } else { ComputeHorizontalValue(aContainingBlockWidth, mStyleSpacing->mMargin.GetRightUnit(), mStyleSpacing->mMargin.GetRight(right), - computedMargin.right); + mComputedMargin.right); } } @@ -1409,20 +1409,20 @@ nsHTMLReflowState::ComputeMargin(nscoord aContainingBlockWidth, // calculated with respect to the *height* of the containing // block when in a paginated context. if (eStyleUnit_Inherit == mStyleSpacing->mMargin.GetTopUnit()) { - computedMargin.top = aContainingBlockRS->computedMargin.top; + mComputedMargin.top = aContainingBlockRS->mComputedMargin.top; } else { - ComputeVerticalValue(rs2->computedHeight, + ComputeVerticalValue(rs2->mComputedHeight, mStyleSpacing->mMargin.GetTopUnit(), mStyleSpacing->mMargin.GetTop(top), - computedMargin.top); + mComputedMargin.top); } if (eStyleUnit_Inherit == mStyleSpacing->mMargin.GetBottomUnit()) { - computedMargin.bottom = aContainingBlockRS->computedMargin.bottom; + mComputedMargin.bottom = aContainingBlockRS->mComputedMargin.bottom; } else { - ComputeVerticalValue(rs2->computedHeight, + ComputeVerticalValue(rs2->mComputedHeight, mStyleSpacing->mMargin.GetBottomUnit(), mStyleSpacing->mMargin.GetBottom(bottom), - computedMargin.bottom); + mComputedMargin.bottom); } } else { @@ -1430,25 +1430,25 @@ nsHTMLReflowState::ComputeMargin(nscoord aContainingBlockWidth, // calculated with respect to the *width* of the containing // block, even for margin-top and margin-bottom. if (NS_UNCONSTRAINEDSIZE == aContainingBlockWidth) { - computedMargin.top = 0; - computedMargin.bottom = 0; + mComputedMargin.top = 0; + mComputedMargin.bottom = 0; } else { if (eStyleUnit_Inherit == mStyleSpacing->mMargin.GetTopUnit()) { - computedMargin.top = aContainingBlockRS->computedMargin.top; + mComputedMargin.top = aContainingBlockRS->mComputedMargin.top; } else { ComputeHorizontalValue(aContainingBlockWidth, mStyleSpacing->mMargin.GetTopUnit(), mStyleSpacing->mMargin.GetTop(top), - computedMargin.top); + mComputedMargin.top); } if (eStyleUnit_Inherit == mStyleSpacing->mMargin.GetBottomUnit()) { - computedMargin.bottom = aContainingBlockRS->computedMargin.bottom; + mComputedMargin.bottom = aContainingBlockRS->mComputedMargin.bottom; } else { ComputeHorizontalValue(aContainingBlockWidth, mStyleSpacing->mMargin.GetBottomUnit(), mStyleSpacing->mMargin.GetBottom(bottom), - computedMargin.bottom); + mComputedMargin.bottom); } } } diff --git a/mozilla/layout/html/base/src/nsIHTMLReflow.h b/mozilla/layout/html/base/src/nsIHTMLReflow.h index 6ea8441b1c5..96223d85500 100644 --- a/mozilla/layout/html/base/src/nsIHTMLReflow.h +++ b/mozilla/layout/html/base/src/nsIHTMLReflow.h @@ -129,9 +129,9 @@ typedef PRUint32 nsCSSFrameType; struct nsHTMLReflowState : nsReflowState { // The type of frame, from css's perspective. This value is // initialized by the Init method below. - nsCSSFrameType frameType; + nsCSSFrameType mFrameType; - nsISpaceManager* spaceManager; + nsISpaceManager* mSpaceManager; // LineLayout object (only for inline reflow; set to NULL otherwise) nsLineLayout* lineLayout; @@ -145,7 +145,7 @@ struct nsHTMLReflowState : nsReflowState { // For block-level frames, the computed width is based on the width of the // containing block and the margin/border/padding areas and the min/max // width - nscoord computedWidth; + nscoord mComputedWidth; // The computed height specifies the frame's content height, and it does // not apply to inline non-replaced elements @@ -160,10 +160,10 @@ struct nsHTMLReflowState : nsReflowState { // // For replaced block-level frames, a value of NS_INTRINSICSIZE // means you use your intrinsic height as the computed height - nscoord computedHeight; + nscoord mComputedHeight; // Computed margin values - nsMargin computedMargin; + nsMargin mComputedMargin; // Cached copy of the border values nsMargin mComputedBorderPadding; diff --git a/mozilla/layout/html/base/src/nsLineLayout.cpp b/mozilla/layout/html/base/src/nsLineLayout.cpp index a993a2f5545..4b77ca5e719 100644 --- a/mozilla/layout/html/base/src/nsLineLayout.cpp +++ b/mozilla/layout/html/base/src/nsLineLayout.cpp @@ -778,9 +778,9 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame, // Stash copies of some of the computed state away for later // (vertical alignment, for example) pfd->mFrame = aFrame; - pfd->mMargin = reflowState.computedMargin; + pfd->mMargin = reflowState.mComputedMargin; pfd->mBorderPadding = reflowState.mComputedBorderPadding; - pfd->mFrameType = reflowState.frameType; + pfd->mFrameType = reflowState.mFrameType; pfd->mRelativePos = reflowState.mStylePosition->mPosition == NS_STYLE_POSITION_RELATIVE; if (pfd->mRelativePos) { @@ -1284,7 +1284,7 @@ nsLineLayout::VerticalAlignFrames(nsRect& aLineBoxResult, // Synthesize a PerFrameData for the block frame PerFrameData rootPFD; rootPFD.mFrame = mBlockReflowState->frame; - rootPFD.mFrameType = mBlockReflowState->frameType; + rootPFD.mFrameType = mBlockReflowState->mFrameType; rootPFD.mAscent = 0; rootPFD.mDescent = 0; mRootSpan->mFrame = &rootPFD; diff --git a/mozilla/layout/html/base/src/nsObjectFrame.cpp b/mozilla/layout/html/base/src/nsObjectFrame.cpp index d79ae1eb6d4..d488fedf57e 100644 --- a/mozilla/layout/html/base/src/nsObjectFrame.cpp +++ b/mozilla/layout/html/base/src/nsObjectFrame.cpp @@ -490,12 +490,12 @@ nsObjectFrame::GetDesiredSize(nsIPresContext* aPresContext, PRUint32 width = EMBED_DEF_DIM; PRUint32 height = EMBED_DEF_DIM; - if (NS_UNCONSTRAINEDSIZE != aReflowState.computedWidth) { - aMetrics.width = aReflowState.computedWidth; + if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedWidth) { + aMetrics.width = aReflowState.mComputedWidth; haveWidth = PR_TRUE; } - if (NS_UNCONSTRAINEDSIZE != aReflowState.computedHeight) { - aMetrics.height = aReflowState.computedHeight; + if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedHeight) { + aMetrics.height = aReflowState.mComputedHeight; haveHeight = PR_TRUE; } @@ -1372,7 +1372,7 @@ nsObjectFrame::HandleImage(nsIPresContext& aPresContext, if(eHTMLUnit_Pixel == val.GetUnit()) { nscoord width = val.GetPixelValue(); - kidReflowState.computedWidth = NSIntPixelsToTwips(width, p2t); + kidReflowState.mComputedWidth = NSIntPixelsToTwips(width, p2t); } } if(NS_CONTENT_ATTR_HAS_VALUE == hc->GetHTMLAttribute(nsHTMLAtoms::height, val)) @@ -1380,7 +1380,7 @@ nsObjectFrame::HandleImage(nsIPresContext& aPresContext, if(eHTMLUnit_Pixel == val.GetUnit()) { nscoord height = val.GetPixelValue(); - kidReflowState.computedHeight = NSIntPixelsToTwips(height, p2t); + kidReflowState.mComputedHeight = NSIntPixelsToTwips(height, p2t); } } } diff --git a/mozilla/layout/html/base/src/nsScrollFrame.cpp b/mozilla/layout/html/base/src/nsScrollFrame.cpp index 34e7cc8d2cc..305bed3a3dd 100644 --- a/mozilla/layout/html/base/src/nsScrollFrame.cpp +++ b/mozilla/layout/html/base/src/nsScrollFrame.cpp @@ -315,7 +315,7 @@ nsScrollFrame::CalculateScrollAreaSize(nsIPresContext& aPresContext, *aRoomForVerticalScrollbar = PR_FALSE; // assume there's no vertical scrollbar // Compute the scroll area width - aScrollAreaSize->width = aReflowState.computedWidth; + aScrollAreaSize->width = aReflowState.mComputedWidth; // We need to add back the padding area that was subtracted off by the // reflow state code. @@ -327,7 +327,7 @@ nsScrollFrame::CalculateScrollAreaSize(nsIPresContext& aPresContext, } // Compute the scroll area size - if (NS_AUTOHEIGHT == aReflowState.computedHeight) { + if (NS_AUTOHEIGHT == aReflowState.mComputedHeight) { // We have an 'auto' height and so we should shrink wrap around the // scrolled frame. Let the scrolled frame be as high as the available // height minus our border thickness @@ -338,7 +338,7 @@ nsScrollFrame::CalculateScrollAreaSize(nsIPresContext& aPresContext, } else { // We have a fixed height, so use the computed height and add back any // padding that was subtracted off by the reflow state code - aScrollAreaSize->height = aReflowState.computedHeight + + aScrollAreaSize->height = aReflowState.mComputedHeight + aReflowState.mComputedPadding.top + aReflowState.mComputedPadding.bottom; } @@ -492,11 +492,11 @@ nsScrollFrame::Reflow(nsIPresContext& aPresContext, // Reset the computed width based on the scroll area size // XXX Eplain why we have to do this... if (!unconstrainedWidth) { - kidReflowState.computedWidth = scrollAreaSize.width - - aReflowState.mComputedPadding.left - - aReflowState.mComputedPadding.right; + kidReflowState.mComputedWidth = scrollAreaSize.width - + aReflowState.mComputedPadding.left - + aReflowState.mComputedPadding.right; } - kidReflowState.computedHeight = NS_AUTOHEIGHT; + kidReflowState.mComputedHeight = NS_AUTOHEIGHT; ReflowChild(kidFrame, aPresContext, kidDesiredSize, kidReflowState, aStatus); @@ -506,7 +506,7 @@ nsScrollFrame::Reflow(nsIPresContext& aPresContext, // If we're 'auto' scrolling and not shrink-wrapping our height, then see // whether we correctly predicted whether a vertical scrollbar is needed if ((aReflowState.mStyleDisplay->mOverflow != NS_STYLE_OVERFLOW_SCROLL) && - (NS_AUTOHEIGHT != aReflowState.computedHeight)) { + (NS_AUTOHEIGHT != aReflowState.mComputedHeight)) { PRBool mustReflow = PR_FALSE; @@ -517,7 +517,7 @@ nsScrollFrame::Reflow(nsIPresContext& aPresContext, // reflow with a larger computed width // XXX We need to be checking for horizontal scrolling... kidReflowState.availableWidth += sbWidth; - kidReflowState.computedWidth += sbWidth; + kidReflowState.mComputedWidth += sbWidth; scrollAreaSize.width += sbWidth; mustReflow = PR_TRUE; } @@ -526,7 +526,7 @@ nsScrollFrame::Reflow(nsIPresContext& aPresContext, // We didn't leave room for the vertical scrollbar, but it turns // out we needed it kidReflowState.availableWidth -= sbWidth; - kidReflowState.computedWidth -= sbWidth; + kidReflowState.mComputedWidth -= sbWidth; scrollAreaSize.width -= sbWidth; mustReflow = PR_TRUE; } @@ -544,7 +544,7 @@ nsScrollFrame::Reflow(nsIPresContext& aPresContext, // Make sure the height of the scrolled frame fills the entire scroll area, // unless we're shrink wrapping - if (NS_AUTOHEIGHT != aReflowState.computedHeight) { + if (NS_AUTOHEIGHT != aReflowState.mComputedHeight) { if (kidDesiredSize.height < scrollAreaSize.height) { kidDesiredSize.height = scrollAreaSize.height; @@ -580,7 +580,7 @@ nsScrollFrame::Reflow(nsIPresContext& aPresContext, // For the height if we're shrink wrapping then use whatever is smaller between // the available height and the child's desired size; otherwise, use the scroll // area size - if (NS_AUTOHEIGHT == aReflowState.computedHeight) { + if (NS_AUTOHEIGHT == aReflowState.mComputedHeight) { aDesiredSize.height = PR_MIN(aReflowState.availableHeight, kidDesiredSize.height); } else { aDesiredSize.height = scrollAreaSize.height; diff --git a/mozilla/layout/html/base/src/nsViewportFrame.cpp b/mozilla/layout/html/base/src/nsViewportFrame.cpp index 5a8b9cb0e65..b5d1ef8cf13 100644 --- a/mozilla/layout/html/base/src/nsViewportFrame.cpp +++ b/mozilla/layout/html/base/src/nsViewportFrame.cpp @@ -170,8 +170,8 @@ ViewportFrame::CalculateFixedContainingBlockSize(nsIPresContext& aPresC { // Initialize the values to the computed width/height in our reflow // state struct - aWidth = aReflowState.computedWidth; - aHeight = aReflowState.computedHeight; + aWidth = aReflowState.mComputedWidth; + aHeight = aReflowState.mComputedHeight; // Get our prinicpal child frame and see if we're scrollable nsIFrame* kidFrame = mFrames.FirstChild(); @@ -232,17 +232,17 @@ ViewportFrame::ReflowFixedFrame(nsIPresContext& aPresContext, htmlReflow->Reflow(aPresContext, kidDesiredSize, kidReflowState, aStatus); // XXX If the child had a fixed height, then make sure it respected it... - if (NS_AUTOHEIGHT != kidReflowState.computedHeight) { - if (kidDesiredSize.height < kidReflowState.computedHeight) { - kidDesiredSize.height = kidReflowState.computedHeight; + if (NS_AUTOHEIGHT != kidReflowState.mComputedHeight) { + if (kidDesiredSize.height < kidReflowState.mComputedHeight) { + kidDesiredSize.height = kidReflowState.mComputedHeight; kidDesiredSize.height += kidReflowState.mComputedBorderPadding.top + kidReflowState.mComputedBorderPadding.bottom; } } // Position the child - nsRect rect(kidReflowState.computedOffsets.left + kidReflowState.computedMargin.left, - kidReflowState.computedOffsets.top + kidReflowState.computedMargin.top, + nsRect rect(kidReflowState.computedOffsets.left + kidReflowState.mComputedMargin.left, + kidReflowState.computedOffsets.top + kidReflowState.mComputedMargin.top, kidDesiredSize.width, kidDesiredSize.height); aKidFrame->SetRect(rect); htmlReflow->DidReflow(aPresContext, NS_FRAME_REFLOW_FINISHED); @@ -270,8 +270,8 @@ ViewportFrame::ReflowFixedFrames(nsIPresContext& aPresContext, // to reflect the available space for the fixed items // XXX Find a cleaner way to do this... nsHTMLReflowState reflowState(aReflowState); - reflowState.computedWidth = width; - reflowState.computedHeight = height; + reflowState.mComputedWidth = width; + reflowState.mComputedHeight = height; nsIFrame* kidFrame; for (kidFrame = mFixedFrames.FirstChild(); nsnull != kidFrame; kidFrame->GetNextSibling(&kidFrame)) { @@ -343,8 +343,8 @@ ViewportFrame::IncrementalReflow(nsIPresContext& aPresContext, // to reflect the available space for the fixed items // XXX Find a cleaner way to do this... nsHTMLReflowState reflowState(aReflowState); - reflowState.computedWidth = width; - reflowState.computedHeight = height; + reflowState.mComputedWidth = width; + reflowState.mComputedHeight = height; nsReflowStatus status; ReflowFixedFrame(aPresContext, reflowState, newFrames, PR_TRUE, status); @@ -433,7 +433,7 @@ ViewportFrame::Reflow(nsIPresContext& aPresContext, // Reflow the frame nsIHTMLReflow* htmlReflow; if (NS_OK == kidFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) { - kidReflowState.computedHeight = aReflowState.availableHeight; + kidReflowState.mComputedHeight = aReflowState.availableHeight; ReflowChild(kidFrame, aPresContext, kidDesiredSize, kidReflowState, aStatus); diff --git a/mozilla/layout/html/document/src/nsFrameFrame.cpp b/mozilla/layout/html/document/src/nsFrameFrame.cpp index d623aee31cd..dca2ac96da7 100644 --- a/mozilla/layout/html/document/src/nsFrameFrame.cpp +++ b/mozilla/layout/html/document/src/nsFrameFrame.cpp @@ -284,14 +284,14 @@ nsHTMLFrameOuterFrame::GetDesiredSize(nsIPresContext* aPresContext, // XXX this needs to be changed from (200,200) to a better default // for inline frames - if (NS_UNCONSTRAINEDSIZE != aReflowState.computedWidth) { - aDesiredSize.width = aReflowState.computedWidth; + if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedWidth) { + aDesiredSize.width = aReflowState.mComputedWidth; } else { aDesiredSize.width = NSIntPixelsToTwips(200, p2t); } - if (NS_UNCONSTRAINEDSIZE != aReflowState.computedHeight) { - aDesiredSize.height = aReflowState.computedHeight; + if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedHeight) { + aDesiredSize.height = aReflowState.mComputedHeight; } else { aDesiredSize.height = NSIntPixelsToTwips(200, p2t); diff --git a/mozilla/layout/html/forms/src/nsButtonControlFrame.cpp b/mozilla/layout/html/forms/src/nsButtonControlFrame.cpp index e2f703947f5..9b3f10b11dc 100644 --- a/mozilla/layout/html/forms/src/nsButtonControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsButtonControlFrame.cpp @@ -415,10 +415,10 @@ nsButtonControlFrame::Reflow(nsIPresContext& aPresContext, // if our size is intrinsic. Then we need to return the size we really need // so include our inner borders we use for focus. nsMargin added = mRenderer.GetAddedButtonBorderAndPadding(); - if (aReflowState.computedWidth == NS_INTRINSICSIZE) + if (aReflowState.mComputedWidth == NS_INTRINSICSIZE) aDesiredSize.width += added.left + added.right; - if (aReflowState.computedHeight == NS_INTRINSICSIZE) + if (aReflowState.mComputedHeight == NS_INTRINSICSIZE) aDesiredSize.height += added.top + added.bottom; nsMargin bp(0,0,0,0); diff --git a/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp b/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp index 0202a7ef1aa..43960355bff 100644 --- a/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp @@ -357,8 +357,8 @@ nsComboboxControlFrame::ReflowComboChildFrame(nsIFrame* aFrame, nsSize availSize(aAvailableWidth, aAvailableHeight); nsHTMLReflowState kidReflowState(aPresContext, aReflowState, aFrame, availSize); - kidReflowState.computedWidth = aAvailableWidth; - kidReflowState.computedHeight = aAvailableHeight; + kidReflowState.mComputedWidth = aAvailableWidth; + kidReflowState.mComputedHeight = aAvailableHeight; // Reflow child nsresult rv = ReflowChild(aFrame, aPresContext, aDesiredSize, kidReflowState, aStatus); @@ -628,7 +628,7 @@ nsComboboxControlFrame::Reflow(nsIPresContext& aPresContext, //Set the desired size for the button and display frame - if (NS_UNCONSTRAINEDSIZE == firstPassState.computedWidth) { + if (NS_UNCONSTRAINEDSIZE == firstPassState.mComputedWidth) { // A width has not been specified for the select so size the display area to // match the width of the longest item in the drop-down list. The dropdown // list has already been reflowed and sized to shrink around its contents above. @@ -672,7 +672,7 @@ nsComboboxControlFrame::Reflow(nsIPresContext& aPresContext, // Compute display width buttonFrame->GetRect(buttonRect); nscoord displayWidth; - displayWidth = firstPassState.computedWidth - buttonRect.width; + displayWidth = firstPassState.mComputedWidth - buttonRect.width; // Set the displayFrame to match the displayWidth computed above SetChildFrameSize(displayFrame, displayWidth, size.height); diff --git a/mozilla/layout/html/forms/src/nsFieldSetFrame.cpp b/mozilla/layout/html/forms/src/nsFieldSetFrame.cpp index d869a22b5f1..6ffe6aaefd5 100644 --- a/mozilla/layout/html/forms/src/nsFieldSetFrame.cpp +++ b/mozilla/layout/html/forms/src/nsFieldSetFrame.cpp @@ -293,7 +293,7 @@ nsFieldSetFrame::Reflow(nsIPresContext& aPresContext, nsReflowStatus& aStatus) { // availSize could have unconstrained values, don't perform any addition on them - nsSize availSize(aReflowState.computedWidth, aReflowState.computedHeight); + nsSize availSize(aReflowState.mComputedWidth, aReflowState.mComputedHeight); // get our border and padding const nsMargin &borderPadding = aReflowState.mComputedBorderPadding; @@ -307,8 +307,8 @@ nsFieldSetFrame::Reflow(nsIPresContext& aPresContext, mLegendFrame, nsSize(NS_INTRINSICSIZE,NS_INTRINSICSIZE)); // always give the legend as much size as it needs - legendReflowState.computedWidth = NS_INTRINSICSIZE; - legendReflowState.computedHeight = NS_INTRINSICSIZE; + legendReflowState.mComputedWidth = NS_INTRINSICSIZE; + legendReflowState.mComputedHeight = NS_INTRINSICSIZE; ReflowChild(mLegendFrame, aPresContext, aDesiredSize, legendReflowState, aStatus); @@ -399,25 +399,25 @@ nsFieldSetFrame::Reflow(nsIPresContext& aPresContext, mLegendFrame->SetRect(actualLegendRect); // Return our size and our result - if (aReflowState.computedHeight == NS_INTRINSICSIZE) { + if (aReflowState.mComputedHeight == NS_INTRINSICSIZE) { aDesiredSize.height = mLegendSpace + borderPadding.top + aDesiredSize.height + borderPadding.bottom; } else { nscoord min = borderPadding.top + borderPadding.bottom + mLegendRect.height; - aDesiredSize.height = aReflowState.computedHeight + borderPadding.top + borderPadding.bottom; + aDesiredSize.height = aReflowState.mComputedHeight + borderPadding.top + borderPadding.bottom; if (aDesiredSize.height < min) aDesiredSize.height = min; } - if (aReflowState.computedWidth == NS_INTRINSICSIZE) { + if (aReflowState.mComputedWidth == NS_INTRINSICSIZE) { aDesiredSize.width = borderPadding.left + aDesiredSize.width + borderPadding.right; } else { nscoord min = borderPadding.left + borderPadding.right + mLegendRect.width; - aDesiredSize.width = aReflowState.computedWidth + borderPadding.left + borderPadding.right; + aDesiredSize.width = aReflowState.mComputedWidth + borderPadding.left + borderPadding.right; if (aDesiredSize.width < min) aDesiredSize.width = min; } diff --git a/mozilla/layout/html/forms/src/nsFormControlFrame.cpp b/mozilla/layout/html/forms/src/nsFormControlFrame.cpp index 7c6b6ac783b..af08d0ae837 100644 --- a/mozilla/layout/html/forms/src/nsFormControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsFormControlFrame.cpp @@ -639,14 +639,14 @@ nsFormControlFrame::GetStyleSize(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsSize& aSize) { - if (aReflowState.computedWidth != NS_INTRINSICSIZE) { - aSize.width = aReflowState.computedWidth; + if (aReflowState.mComputedWidth != NS_INTRINSICSIZE) { + aSize.width = aReflowState.mComputedWidth; } else { aSize.width = CSS_NOTSET; } - if (aReflowState.computedHeight != NS_INTRINSICSIZE) { - aSize.height = aReflowState.computedHeight; + if (aReflowState.mComputedHeight != NS_INTRINSICSIZE) { + aSize.height = aReflowState.mComputedHeight; } else { aSize.height = CSS_NOTSET; diff --git a/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.cpp b/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.cpp index ba199cbceb2..b5b48d6df7b 100644 --- a/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.cpp @@ -375,25 +375,25 @@ nsHTMLButtonControlFrame::Paint(nsIPresContext& aPresContext, static void ButtonHack(nsHTMLReflowState& aReflowState, char* aMessage) { - if (aReflowState.computedWidth == 0) { - aReflowState.computedWidth = aReflowState.availableWidth; + if (aReflowState.mComputedWidth == 0) { + aReflowState.mComputedWidth = aReflowState.availableWidth; } - if ((aReflowState.computedWidth != NS_INTRINSICSIZE) && - (aReflowState.computedWidth > aReflowState.availableWidth) && + if ((aReflowState.mComputedWidth != NS_INTRINSICSIZE) && + (aReflowState.mComputedWidth > aReflowState.availableWidth) && (aReflowState.availableWidth > 0)) { // printf("BUG - %s has a computed width = %d, available width = %d \n", -// aMessage, aReflowState.computedWidth, aReflowState.availableWidth); - aReflowState.computedWidth = aReflowState.availableWidth; +// aMessage, aReflowState.mComputedWidth, aReflowState.availableWidth); + aReflowState.mComputedWidth = aReflowState.availableWidth; } - if (aReflowState.computedHeight == 0) { - aReflowState.computedHeight = aReflowState.availableHeight; + if (aReflowState.mComputedHeight == 0) { + aReflowState.mComputedHeight = aReflowState.availableHeight; } - if ((aReflowState.computedHeight != NS_INTRINSICSIZE) && - (aReflowState.computedHeight > aReflowState.availableHeight) && + if ((aReflowState.mComputedHeight != NS_INTRINSICSIZE) && + (aReflowState.mComputedHeight > aReflowState.availableHeight) && (aReflowState.availableHeight > 0)) { // printf("BUG - %s has a computed height = %d, available height = %d \n", -// aMessage, aReflowState.computedHeight, aReflowState.availableHeight); - aReflowState.computedHeight = aReflowState.availableHeight; +// aMessage, aReflowState.mComputedHeight, aReflowState.availableHeight); + aReflowState.mComputedHeight = aReflowState.availableHeight; } } @@ -445,7 +445,7 @@ nsHTMLButtonControlFrame::Reflow(nsIPresContext& aPresContext, // reflow the child nsIFrame* firstKid = mFrames.FirstChild(); - nsSize availSize(aReflowState.computedWidth, aReflowState.computedHeight); + nsSize availSize(aReflowState.mComputedWidth, aReflowState.mComputedHeight); // indent the child inside us by the the focus border. We must do this separate from the // regular border. diff --git a/mozilla/layout/html/forms/src/nsLabelFrame.cpp b/mozilla/layout/html/forms/src/nsLabelFrame.cpp index 9e4a839f0ef..c75e40aac7c 100644 --- a/mozilla/layout/html/forms/src/nsLabelFrame.cpp +++ b/mozilla/layout/html/forms/src/nsLabelFrame.cpp @@ -364,25 +364,25 @@ nsLabelFrame::Paint(nsIPresContext& aPresContext, static void LabelHack(nsHTMLReflowState& aReflowState, char* aMessage) { - if (aReflowState.computedWidth == 0) { - aReflowState.computedWidth = aReflowState.availableWidth; + if (aReflowState.mComputedWidth == 0) { + aReflowState.mComputedWidth = aReflowState.availableWidth; } - if ((aReflowState.computedWidth != NS_INTRINSICSIZE) && - (aReflowState.computedWidth > aReflowState.availableWidth) && + if ((aReflowState.mComputedWidth != NS_INTRINSICSIZE) && + (aReflowState.mComputedWidth > aReflowState.availableWidth) && (aReflowState.availableWidth > 0)) { // printf("BUG - %s has a computed width = %d, available width = %d \n", -// aMessage, aReflowState.computedWidth, aReflowState.availableWidth); - aReflowState.computedWidth = aReflowState.availableWidth; +// aMessage, aReflowState.mComputedWidth, aReflowState.availableWidth); + aReflowState.mComputedWidth = aReflowState.availableWidth; } - if (aReflowState.computedHeight == 0) { - aReflowState.computedHeight = aReflowState.availableHeight; + if (aReflowState.mComputedHeight == 0) { + aReflowState.mComputedHeight = aReflowState.availableHeight; } - if ((aReflowState.computedHeight != NS_INTRINSICSIZE) && - (aReflowState.computedHeight > aReflowState.availableHeight) && + if ((aReflowState.mComputedHeight != NS_INTRINSICSIZE) && + (aReflowState.mComputedHeight > aReflowState.availableHeight) && (aReflowState.availableHeight > 0)) { // printf("BUG - %s has a computed height = %d, available height = %d \n", -// aMessage, aReflowState.computedHeight, aReflowState.availableHeight); - aReflowState.computedHeight = aReflowState.availableHeight; +// aMessage, aReflowState.mComputedHeight, aReflowState.availableHeight); + aReflowState.mComputedHeight = aReflowState.availableHeight; } } @@ -430,7 +430,7 @@ nsLabelFrame::Reflow(nsIPresContext& aPresContext, } } - nsSize availSize(aReflowState.computedWidth, aReflowState.computedHeight); + nsSize availSize(aReflowState.mComputedWidth, aReflowState.mComputedHeight); // get border and padding const nsStyleSpacing* spacing = diff --git a/mozilla/layout/html/forms/src/nsListControlFrame.cpp b/mozilla/layout/html/forms/src/nsListControlFrame.cpp index 8fc1c86149e..8e22ab2e4a5 100644 --- a/mozilla/layout/html/forms/src/nsListControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsListControlFrame.cpp @@ -272,8 +272,8 @@ nsListControlFrame::Reflow(nsIPresContext& aPresContext, // Get the size of option elements inside the listbox // Compute the width based on the longest line in the listbox. - firstPassState.computedWidth = NS_UNCONSTRAINEDSIZE; - firstPassState.computedHeight = NS_UNCONSTRAINEDSIZE; + firstPassState.mComputedWidth = NS_UNCONSTRAINEDSIZE; + firstPassState.mComputedHeight = NS_UNCONSTRAINEDSIZE; firstPassState.availableWidth = NS_UNCONSTRAINEDSIZE; firstPassState.availableHeight = NS_UNCONSTRAINEDSIZE; @@ -341,16 +341,16 @@ nsListControlFrame::Reflow(nsIPresContext& aPresContext, nscoord visibleWidth = 0; if (IsInDropDownMode() == PR_TRUE) { // Calculate visible width for dropdown - if (NS_UNCONSTRAINEDSIZE == aReflowState.computedWidth) { + if (NS_UNCONSTRAINEDSIZE == aReflowState.mComputedWidth) { visibleWidth = scrolledAreaWidth; } else { - visibleWidth = aReflowState.computedWidth - (border.left + border.right); + visibleWidth = aReflowState.mComputedWidth - (border.left + border.right); } } else { - if (NS_UNCONSTRAINEDSIZE == aReflowState.computedWidth) { + if (NS_UNCONSTRAINEDSIZE == aReflowState.mComputedWidth) { visibleWidth = scrolledAreaWidth; } else { - visibleWidth = aReflowState.computedWidth; + visibleWidth = aReflowState.mComputedWidth; } } @@ -380,8 +380,8 @@ nsListControlFrame::Reflow(nsIPresContext& aPresContext, } else { // Calculate the visible height of the listbox - if (NS_UNCONSTRAINEDSIZE != aReflowState.computedHeight) { - visibleHeight = aReflowState.computedHeight; + if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedHeight) { + visibleHeight = aReflowState.mComputedHeight; } else { visibleHeight = mNumRows * heightOfARow; } @@ -398,8 +398,8 @@ nsListControlFrame::Reflow(nsIPresContext& aPresContext, // Do a second reflow with the adjusted width and height settings // This sets up all of the frames with the correct width and height. - secondPassState.computedWidth = visibleWidth; - secondPassState.computedHeight = visibleHeight; + secondPassState.mComputedWidth = visibleWidth; + secondPassState.mComputedHeight = visibleHeight; secondPassState.reason = eReflowReason_Resize; nsScrollFrame::Reflow(aPresContext, aDesiredSize, diff --git a/mozilla/layout/html/table/src/nsTableFrame.cpp b/mozilla/layout/html/table/src/nsTableFrame.cpp index c3fd32facfa..4619193459a 100644 --- a/mozilla/layout/html/table/src/nsTableFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableFrame.cpp @@ -2555,7 +2555,7 @@ NS_METHOD nsTableFrame::Reflow(nsIPresContext& aPresContext, if (nsnull!=mTableLayoutStrategy) { if (PR_TRUE==gsDebug || PR_TRUE==gsDebugIR) printf("TIF Reflow: Re-init layout strategy\n"); - mTableLayoutStrategy->Initialize(aDesiredSize.maxElementSize, GetColCount(), aReflowState.computedWidth); + mTableLayoutStrategy->Initialize(aDesiredSize.maxElementSize, GetColCount(), aReflowState.mComputedWidth); mColumnWidthsValid=PR_TRUE; //so we don't do this a second time below } } @@ -2564,7 +2564,7 @@ NS_METHOD nsTableFrame::Reflow(nsIPresContext& aPresContext, if (PR_TRUE==gsDebug || PR_TRUE==gsDebugIR) printf("TIF Reflow: Re-init layout strategy\n"); if (nsnull!=mTableLayoutStrategy) { - mTableLayoutStrategy->Initialize(aDesiredSize.maxElementSize, GetColCount(), aReflowState.computedWidth); + mTableLayoutStrategy->Initialize(aDesiredSize.maxElementSize, GetColCount(), aReflowState.mComputedWidth); mColumnWidthsValid=PR_TRUE; } } @@ -4102,13 +4102,13 @@ void nsTableFrame::BalanceColumnWidths(nsIPresContext& aPresContext, mTableLayoutStrategy = new FixedTableLayoutStrategy(this); else mTableLayoutStrategy = new BasicTableLayoutStrategy(this, eCompatibility_NavQuirks == mode); - mTableLayoutStrategy->Initialize(aMaxElementSize, GetColCount(), aReflowState.computedWidth); + mTableLayoutStrategy->Initialize(aMaxElementSize, GetColCount(), aReflowState.mComputedWidth); mColumnWidthsValid=PR_TRUE; } // fixed-layout tables need to reinitialize the layout strategy. When there are scroll bars // reflow gets called twice and the 2nd time has the correct space available. else if (!RequiresPass1Layout()) { - mTableLayoutStrategy->Initialize(aMaxElementSize, GetColCount(), aReflowState.computedWidth); + mTableLayoutStrategy->Initialize(aMaxElementSize, GetColCount(), aReflowState.mComputedWidth); } mTableLayoutStrategy->BalanceColumnWidths(mStyleContext, aReflowState, maxWidth); @@ -4203,9 +4203,9 @@ nscoord nsTableFrame::GetEffectiveContainerHeight(const nsHTMLReflowState& aRefl break; } } - if (NS_AUTOHEIGHT != rs->computedHeight) + if (NS_AUTOHEIGHT != rs->mComputedHeight) { - result = rs->computedHeight; + result = rs->mComputedHeight; break; } // XXX: evil cast! diff --git a/mozilla/layout/tables/nsTableFrame.cpp b/mozilla/layout/tables/nsTableFrame.cpp index c3fd32facfa..4619193459a 100644 --- a/mozilla/layout/tables/nsTableFrame.cpp +++ b/mozilla/layout/tables/nsTableFrame.cpp @@ -2555,7 +2555,7 @@ NS_METHOD nsTableFrame::Reflow(nsIPresContext& aPresContext, if (nsnull!=mTableLayoutStrategy) { if (PR_TRUE==gsDebug || PR_TRUE==gsDebugIR) printf("TIF Reflow: Re-init layout strategy\n"); - mTableLayoutStrategy->Initialize(aDesiredSize.maxElementSize, GetColCount(), aReflowState.computedWidth); + mTableLayoutStrategy->Initialize(aDesiredSize.maxElementSize, GetColCount(), aReflowState.mComputedWidth); mColumnWidthsValid=PR_TRUE; //so we don't do this a second time below } } @@ -2564,7 +2564,7 @@ NS_METHOD nsTableFrame::Reflow(nsIPresContext& aPresContext, if (PR_TRUE==gsDebug || PR_TRUE==gsDebugIR) printf("TIF Reflow: Re-init layout strategy\n"); if (nsnull!=mTableLayoutStrategy) { - mTableLayoutStrategy->Initialize(aDesiredSize.maxElementSize, GetColCount(), aReflowState.computedWidth); + mTableLayoutStrategy->Initialize(aDesiredSize.maxElementSize, GetColCount(), aReflowState.mComputedWidth); mColumnWidthsValid=PR_TRUE; } } @@ -4102,13 +4102,13 @@ void nsTableFrame::BalanceColumnWidths(nsIPresContext& aPresContext, mTableLayoutStrategy = new FixedTableLayoutStrategy(this); else mTableLayoutStrategy = new BasicTableLayoutStrategy(this, eCompatibility_NavQuirks == mode); - mTableLayoutStrategy->Initialize(aMaxElementSize, GetColCount(), aReflowState.computedWidth); + mTableLayoutStrategy->Initialize(aMaxElementSize, GetColCount(), aReflowState.mComputedWidth); mColumnWidthsValid=PR_TRUE; } // fixed-layout tables need to reinitialize the layout strategy. When there are scroll bars // reflow gets called twice and the 2nd time has the correct space available. else if (!RequiresPass1Layout()) { - mTableLayoutStrategy->Initialize(aMaxElementSize, GetColCount(), aReflowState.computedWidth); + mTableLayoutStrategy->Initialize(aMaxElementSize, GetColCount(), aReflowState.mComputedWidth); } mTableLayoutStrategy->BalanceColumnWidths(mStyleContext, aReflowState, maxWidth); @@ -4203,9 +4203,9 @@ nscoord nsTableFrame::GetEffectiveContainerHeight(const nsHTMLReflowState& aRefl break; } } - if (NS_AUTOHEIGHT != rs->computedHeight) + if (NS_AUTOHEIGHT != rs->mComputedHeight) { - result = rs->computedHeight; + result = rs->mComputedHeight; break; } // XXX: evil cast! diff --git a/mozilla/layout/xul/base/src/nsBoxFrame.cpp b/mozilla/layout/xul/base/src/nsBoxFrame.cpp index c31fc6973a7..11ff34de0ff 100644 --- a/mozilla/layout/xul/base/src/nsBoxFrame.cpp +++ b/mozilla/layout/xul/base/src/nsBoxFrame.cpp @@ -208,7 +208,7 @@ nsBoxFrame::Reflow(nsIPresContext& aPresContext, if (mSpaceManager) { // Modify the reflow state and set the space manager nsHTMLReflowState& reflowState = (nsHTMLReflowState&)aReflowState; - reflowState.spaceManager = mSpaceManager; + reflowState.mSpaceManager = mSpaceManager; // Clear the spacemanager's regions. mSpaceManager->ClearRegions(); @@ -224,7 +224,7 @@ nsBoxFrame::Reflow(nsIPresContext& aPresContext, nscoord x = aReflowState.mComputedBorderPadding.left; nscoord y = aReflowState.mComputedBorderPadding.top; - nsRect rect(x,y,aReflowState.computedWidth,aReflowState.computedHeight); + nsRect rect(x,y,aReflowState.mComputedWidth,aReflowState.mComputedHeight); //--------------------------------------------------------- //------- handle incremental reflow -------------------- @@ -661,15 +661,15 @@ printf("\n"); reflowState.reason = reason; // tell the child what size they should be - reflowState.computedWidth = mSprings[spring].calculatedSize.width; - reflowState.computedHeight = mSprings[spring].calculatedSize.height; + reflowState.mComputedWidth = mSprings[spring].calculatedSize.width; + reflowState.mComputedHeight = mSprings[spring].calculatedSize.height; // only subrtact margin and border. - if (reflowState.computedWidth != NS_INTRINSICSIZE) - reflowState.computedWidth -= (total.left + total.right); + if (reflowState.mComputedWidth != NS_INTRINSICSIZE) + reflowState.mComputedWidth -= (total.left + total.right); - if (reflowState.computedHeight != NS_INTRINSICSIZE) - reflowState.computedHeight -= (total.top + total.bottom); + if (reflowState.mComputedHeight != NS_INTRINSICSIZE) + reflowState.mComputedHeight -= (total.top + total.bottom); // HTML frames do not implement nsIBox so unless they set both their width and height we do not know // what there preferred size is. We can assume a preferred width or height of 0 when flexable but when @@ -678,10 +678,10 @@ printf("\n"); if (mSprings[spring].flex == CONSTANT) { if (mHorizontal) { if (mSprings[spring].prefWidthIntrinsic) - reflowState.computedWidth = NS_INTRINSICSIZE; + reflowState.mComputedWidth = NS_INTRINSICSIZE; } else { if (mSprings[spring].prefHeightIntrinsic) - reflowState.computedHeight = NS_INTRINSICSIZE; + reflowState.mComputedHeight = NS_INTRINSICSIZE; } } @@ -691,7 +691,7 @@ printf("\n"); if (mHorizontal) { // if we could not get the height of the child because it did not implement nsIBox and // it did not provide a height via css and we are trying to lay it out with a height of 0 - if (mSprings[spring].prefHeightIntrinsic && reflowState.computedHeight != NS_INTRINSICSIZE) { + if (mSprings[spring].prefHeightIntrinsic && reflowState.mComputedHeight != NS_INTRINSICSIZE) { nscoord oldHeight = mSprings[spring].calculatedSize.height; mSprings[spring].calculatedSize.height = NS_INTRINSICSIZE; FlowChildAt(childFrame, aPresContext, desiredSize, aReflowState, aStatus, spring, incrementalChild); @@ -704,8 +704,8 @@ printf("\n"); desiredSize.height -= (total.top + total.bottom); // see if things are ok - if (reflowState.computedHeight < desiredSize.height) - reflowState.computedHeight = desiredSize.height; + if (reflowState.mComputedHeight < desiredSize.height) + reflowState.mComputedHeight = desiredSize.height; } diff --git a/mozilla/layout/xul/base/src/nsColorPickerFrame.cpp b/mozilla/layout/xul/base/src/nsColorPickerFrame.cpp index f93a0922b67..a612e300895 100644 --- a/mozilla/layout/xul/base/src/nsColorPickerFrame.cpp +++ b/mozilla/layout/xul/base/src/nsColorPickerFrame.cpp @@ -86,14 +86,14 @@ nsColorPickerFrame :: GetDesiredSize(nsIPresContext* aPresContext, const int ATTR_NOTSET = -1; nsSize styleSize; - if (NS_UNCONSTRAINEDSIZE != aReflowState.computedWidth) { - styleSize.width = aReflowState.computedWidth; + if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedWidth) { + styleSize.width = aReflowState.mComputedWidth; } else { styleSize.width = CSS_NOTSET; } - if (NS_UNCONSTRAINEDSIZE != aReflowState.computedHeight) { - styleSize.height = aReflowState.computedHeight; + if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedHeight) { + styleSize.height = aReflowState.mComputedHeight; } else { styleSize.height = CSS_NOTSET; diff --git a/mozilla/layout/xul/base/src/nsDeckFrame.cpp b/mozilla/layout/xul/base/src/nsDeckFrame.cpp index 2f6b7be0e84..eff2ab58100 100644 --- a/mozilla/layout/xul/base/src/nsDeckFrame.cpp +++ b/mozilla/layout/xul/base/src/nsDeckFrame.cpp @@ -221,19 +221,19 @@ nsDeckFrame::Reflow(nsIPresContext& aPresContext, } // get our available size - nsSize availableSize(aReflowState.computedWidth,aReflowState.computedHeight); + nsSize availableSize(aReflowState.mComputedWidth,aReflowState.mComputedHeight); // if the width or height are intrinsic then lay us our children out at our preferred size - if (aReflowState.computedWidth == NS_INTRINSICSIZE || aReflowState.computedHeight == NS_INTRINSICSIZE) + if (aReflowState.mComputedWidth == NS_INTRINSICSIZE || aReflowState.mComputedHeight == NS_INTRINSICSIZE) { // get our size nsBoxInfo ourSize; GetBoxInfo(aPresContext, aReflowState, ourSize); - if (aReflowState.computedWidth == NS_INTRINSICSIZE) + if (aReflowState.mComputedWidth == NS_INTRINSICSIZE) availableSize.width = ourSize.prefSize.width; - if (aReflowState.computedHeight == NS_INTRINSICSIZE) + if (aReflowState.mComputedHeight == NS_INTRINSICSIZE) availableSize.height = ourSize.prefSize.height; } @@ -360,12 +360,12 @@ nsDeckFrame::FlowChildAt(nsIFrame* childFrame, nsHTMLReflowState reflowState(aPresContext, aReflowState, childFrame, nsSize(NS_INTRINSICSIZE, NS_INTRINSICSIZE)); reflowState.reason = reason; - reflowState.computedWidth = size.width; - reflowState.computedHeight = size.height; + reflowState.mComputedWidth = size.width; + reflowState.mComputedHeight = size.height; // only subrtact margin and border. - reflowState.computedWidth -= (total.left + total.right); - reflowState.computedHeight -= (total.top + total.bottom); + reflowState.mComputedWidth -= (total.left + total.right); + reflowState.mComputedHeight -= (total.top + total.bottom); nsSize maxElementSize(NS_INTRINSICSIZE, NS_INTRINSICSIZE); diff --git a/mozilla/layout/xul/base/src/nsFontPickerFrame.cpp b/mozilla/layout/xul/base/src/nsFontPickerFrame.cpp index ddcae7a1992..26ad88ad5e3 100644 --- a/mozilla/layout/xul/base/src/nsFontPickerFrame.cpp +++ b/mozilla/layout/xul/base/src/nsFontPickerFrame.cpp @@ -86,14 +86,14 @@ nsFontPickerFrame :: GetDesiredSize(nsIPresContext* aPresContext, const int ATTR_NOTSET = -1; nsSize styleSize; - if (NS_UNCONSTRAINEDSIZE != aReflowState.computedWidth) { - styleSize.width = aReflowState.computedWidth; + if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedWidth) { + styleSize.width = aReflowState.mComputedWidth; } else { styleSize.width = CSS_NOTSET; } - if (NS_UNCONSTRAINEDSIZE != aReflowState.computedHeight) { - styleSize.height = aReflowState.computedHeight; + if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedHeight) { + styleSize.height = aReflowState.mComputedHeight; } else { styleSize.height = CSS_NOTSET; diff --git a/mozilla/layout/xul/base/src/nsProgressMeterFrame.cpp b/mozilla/layout/xul/base/src/nsProgressMeterFrame.cpp index b0948bcdd46..519e42dc649 100644 --- a/mozilla/layout/xul/base/src/nsProgressMeterFrame.cpp +++ b/mozilla/layout/xul/base/src/nsProgressMeterFrame.cpp @@ -625,12 +625,12 @@ nsProgressMeterFrame::GetDesiredSize(nsIPresContext* aPresContext, CalcSize(*aPresContext,aDesiredSize.width,aDesiredSize.height); // if the width is set use it - if (NS_INTRINSICSIZE != aReflowState.computedWidth) - aDesiredSize.width = aReflowState.computedWidth; + if (NS_INTRINSICSIZE != aReflowState.mComputedWidth) + aDesiredSize.width = aReflowState.mComputedWidth; // if the height is set use it - if (NS_INTRINSICSIZE != aReflowState.computedHeight) - aDesiredSize.height = aReflowState.computedHeight; + if (NS_INTRINSICSIZE != aReflowState.mComputedHeight) + aDesiredSize.height = aReflowState.mComputedHeight; } diff --git a/mozilla/layout/xul/base/src/nsSliderFrame.cpp b/mozilla/layout/xul/base/src/nsSliderFrame.cpp index 5c446fa19df..6adeb2da819 100644 --- a/mozilla/layout/xul/base/src/nsSliderFrame.cpp +++ b/mozilla/layout/xul/base/src/nsSliderFrame.cpp @@ -203,8 +203,8 @@ nsSliderFrame::ReflowThumb(nsIPresContext& aPresContext, thumbFrame, available); // always give the thumb as much size as it needs - thumbReflowState.computedWidth = computed.width; - thumbReflowState.computedHeight = computed.height; + thumbReflowState.mComputedWidth = computed.width; + thumbReflowState.mComputedHeight = computed.height; // subtract out the childs margin and border if computed const nsStyleSpacing* spacing; @@ -217,11 +217,11 @@ nsSliderFrame::ReflowThumb(nsIPresContext& aPresContext, spacing->GetBorderPadding(border); nsMargin total = margin + border; - if (thumbReflowState.computedWidth != NS_INTRINSICSIZE) - thumbReflowState.computedWidth -= total.left + total.right; + if (thumbReflowState.mComputedWidth != NS_INTRINSICSIZE) + thumbReflowState.mComputedWidth -= total.left + total.right; - if (thumbReflowState.computedHeight != NS_INTRINSICSIZE) - thumbReflowState.computedHeight -= total.top + total.bottom; + if (thumbReflowState.mComputedHeight != NS_INTRINSICSIZE) + thumbReflowState.mComputedHeight -= total.top + total.bottom; ReflowChild(thumbFrame, aPresContext, aDesiredSize, thumbReflowState, aStatus); @@ -260,8 +260,8 @@ nsSliderFrame::Reflow(nsIPresContext& aPresContext, nsHTMLReflowMetrics thumbSize(nsnull); - nsSize availableSize(isHorizontal ? NS_INTRINSICSIZE: aReflowState.computedWidth, isHorizontal ? aReflowState.computedHeight : NS_INTRINSICSIZE); - nsSize computedSize(isHorizontal ? NS_INTRINSICSIZE: aReflowState.computedWidth, isHorizontal ? aReflowState.computedHeight : NS_INTRINSICSIZE); + nsSize availableSize(isHorizontal ? NS_INTRINSICSIZE: aReflowState.mComputedWidth, isHorizontal ? aReflowState.mComputedHeight : NS_INTRINSICSIZE); + nsSize computedSize(isHorizontal ? NS_INTRINSICSIZE: aReflowState.mComputedWidth, isHorizontal ? aReflowState.mComputedHeight : NS_INTRINSICSIZE); ReflowThumb(aPresContext, thumbSize, aReflowState, aStatus, thumbFrame, availableSize, computedSize); @@ -279,19 +279,19 @@ nsSliderFrame::Reflow(nsIPresContext& aPresContext, aPresContext.GetScaledPixelsToTwips(&p2t); nscoord onePixel = NSIntPixelsToTwips(1, p2t); - if (aReflowState.computedHeight == NS_INTRINSICSIZE) + if (aReflowState.mComputedHeight == NS_INTRINSICSIZE) aDesiredSize.height = isHorizontal ? thumbSize.height : 200*onePixel; else { - aDesiredSize.height = aReflowState.computedHeight; + aDesiredSize.height = aReflowState.mComputedHeight; if (aDesiredSize.height < thumbSize.height) aDesiredSize.height = thumbSize.height; } // set the width to the computed or if intrinsic then the width of the thumb. - if (aReflowState.computedWidth == NS_INTRINSICSIZE) + if (aReflowState.mComputedWidth == NS_INTRINSICSIZE) aDesiredSize.width = isHorizontal ? 200*onePixel : thumbSize.width; else { - aDesiredSize.width = aReflowState.computedWidth; + aDesiredSize.width = aReflowState.mComputedWidth; if (aDesiredSize.width < thumbSize.width) aDesiredSize.width = thumbSize.width; } diff --git a/mozilla/layout/xul/base/src/nsSpinnerFrame.cpp b/mozilla/layout/xul/base/src/nsSpinnerFrame.cpp index e2dbede3e67..95b1f934191 100644 --- a/mozilla/layout/xul/base/src/nsSpinnerFrame.cpp +++ b/mozilla/layout/xul/base/src/nsSpinnerFrame.cpp @@ -86,14 +86,14 @@ nsSpinnerFrame :: GetDesiredSize(nsIPresContext* aPresContext, const int ATTR_NOTSET = -1; nsSize styleSize; - if (NS_UNCONSTRAINEDSIZE != aReflowState.computedWidth) { - styleSize.width = aReflowState.computedWidth; + if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedWidth) { + styleSize.width = aReflowState.mComputedWidth; } else { styleSize.width = CSS_NOTSET; } - if (NS_UNCONSTRAINEDSIZE != aReflowState.computedHeight) { - styleSize.height = aReflowState.computedHeight; + if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedHeight) { + styleSize.height = aReflowState.mComputedHeight; } else { styleSize.height = CSS_NOTSET; diff --git a/mozilla/layout/xul/base/src/nsTitledButtonFrame.cpp b/mozilla/layout/xul/base/src/nsTitledButtonFrame.cpp index dfb9dc62417..95a2a0f5e03 100644 --- a/mozilla/layout/xul/base/src/nsTitledButtonFrame.cpp +++ b/mozilla/layout/xul/base/src/nsTitledButtonFrame.cpp @@ -723,15 +723,15 @@ nsTitledButtonFrame::GetDesiredSize(nsIPresContext* aPresContext, aDesiredSize.height = info.prefSize.height; // if either the width or the height was not computed use our intrinsic size - if (aReflowState.computedWidth != NS_INTRINSICSIZE) - if (aReflowState.computedWidth > info.minSize.width) - aDesiredSize.width = aReflowState.computedWidth; + if (aReflowState.mComputedWidth != NS_INTRINSICSIZE) + if (aReflowState.mComputedWidth > info.minSize.width) + aDesiredSize.width = aReflowState.mComputedWidth; else aDesiredSize.width = info.minSize.width; - if (aReflowState.computedHeight != NS_INTRINSICSIZE) - if (aReflowState.computedHeight > info.minSize.height) - aDesiredSize.height = aReflowState.computedHeight; + if (aReflowState.mComputedHeight != NS_INTRINSICSIZE) + if (aReflowState.mComputedHeight > info.minSize.height) + aDesiredSize.height = aReflowState.mComputedHeight; else aDesiredSize.height = info.minSize.height; } diff --git a/mozilla/layout/xul/base/src/nsTreeRowGroupFrame.cpp b/mozilla/layout/xul/base/src/nsTreeRowGroupFrame.cpp index a4bb9f8dbc1..3333ec002b9 100644 --- a/mozilla/layout/xul/base/src/nsTreeRowGroupFrame.cpp +++ b/mozilla/layout/xul/base/src/nsTreeRowGroupFrame.cpp @@ -660,7 +660,7 @@ nsTreeRowGroupFrame::ReflowBeforeRowLayout(nsIPresContext& aPresContext, nsHTMLReflowState kidReflowState(aPresContext, aReflowState.reflowState, mScrollbar, kidAvailSize, aReason); - kidReflowState.computedHeight = kidAvailSize.height; + kidReflowState.mComputedHeight = kidAvailSize.height; rv = ReflowChild(mScrollbar, aPresContext, desiredSize, kidReflowState, aStatus); if (NS_FAILED(rv)) return rv; diff --git a/mozilla/layout/xul/base/src/nsTriStateCheckboxFrame.cpp b/mozilla/layout/xul/base/src/nsTriStateCheckboxFrame.cpp index be2dfbceb47..f685ee4dc7b 100644 --- a/mozilla/layout/xul/base/src/nsTriStateCheckboxFrame.cpp +++ b/mozilla/layout/xul/base/src/nsTriStateCheckboxFrame.cpp @@ -401,14 +401,14 @@ nsTriStateCheckboxFrame :: GetDesiredSize(nsIPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredLayoutSize) { nsSize styleSize; - if (NS_UNCONSTRAINEDSIZE != aReflowState.computedWidth) { - styleSize.width = aReflowState.computedWidth; + if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedWidth) { + styleSize.width = aReflowState.mComputedWidth; } else { styleSize.width = CSS_NOTSET; } - if (NS_UNCONSTRAINEDSIZE != aReflowState.computedHeight) { - styleSize.height = aReflowState.computedHeight; + if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedHeight) { + styleSize.height = aReflowState.mComputedHeight; } else { styleSize.height = CSS_NOTSET;