Bug 1053986 - Rename nsIFrame::GetPrefSize to GetXULPrefSize, and related methods. r=dholbert

Written purely with sed, over .h and .cpp files in layout/.

MozReview-Commit-ID: yvcAZ8rndu
This commit is contained in:
L. David Baron
2016-04-20 21:28:31 -07:00
parent 4419f3e86b
commit 0527201e1d
46 changed files with 102 additions and 102 deletions

View File

@@ -477,7 +477,7 @@ nsTextControlFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext,
aCBSize, aAvailableISize,
aMargin, aBorder,
aPadding, aShrinkWrap);
// Disabled when there's inflation; see comment in GetPrefSize.
// Disabled when there's inflation; see comment in GetXULPrefSize.
MOZ_ASSERT(inflation != 1.0f ||
ancestorAutoSize.ISize(aWM) == autoSize.ISize(aWM),
"Incorrect size computed by ComputeAutoSize?");

View File

@@ -8693,7 +8693,7 @@ nsFrame::GetLineIterator()
}
nsSize
nsFrame::GetPrefSize(nsBoxLayoutState& aState)
nsFrame::GetXULPrefSize(nsBoxLayoutState& aState)
{
nsSize size(0,0);
DISPLAY_PREF_SIZE(this, size);

View File

@@ -408,7 +408,7 @@ public:
virtual ContentOffsets CalcContentOffsetsFromFramePoint(nsPoint aPoint);
// Box layout methods
virtual nsSize GetPrefSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULPrefSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULMinSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetMaxSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nscoord GetFlex() override;

View File

@@ -279,7 +279,7 @@ GetScrollbarMetrics(nsBoxLayoutState& aState, nsIFrame* aBox, nsSize* aMin,
}
if (aPref) {
*aPref = aBox->GetPrefSize(aState);
*aPref = aBox->GetXULPrefSize(aState);
nsBox::AddMargin(aBox, *aPref);
if (aPref->width < 0) {
aPref->width = 0;
@@ -1038,7 +1038,7 @@ ScrollFrameHelper::GetDesiredScrollbarSizes(nsBoxLayoutState* aState)
nsMargin result(0, 0, 0, 0);
if (mVScrollbarBox) {
nsSize size = mVScrollbarBox->GetPrefSize(*aState);
nsSize size = mVScrollbarBox->GetXULPrefSize(*aState);
nsBox::AddMargin(mVScrollbarBox, size);
if (IsScrollbarOnRight())
result.left = size.width;
@@ -1047,7 +1047,7 @@ ScrollFrameHelper::GetDesiredScrollbarSizes(nsBoxLayoutState* aState)
}
if (mHScrollbarBox) {
nsSize size = mHScrollbarBox->GetPrefSize(*aState);
nsSize size = mHScrollbarBox->GetXULPrefSize(*aState);
nsBox::AddMargin(mHScrollbarBox, size);
// We don't currently support any scripts that would require a scrollbar
// at the top. (Are there any?)
@@ -1396,13 +1396,13 @@ nsXULScrollFrame::GetBoxAscent(nsBoxLayoutState& aState)
}
nsSize
nsXULScrollFrame::GetPrefSize(nsBoxLayoutState& aState)
nsXULScrollFrame::GetXULPrefSize(nsBoxLayoutState& aState)
{
#ifdef DEBUG_LAYOUT
PropagateDebug(aState);
#endif
nsSize pref = mHelper.mScrolledFrame->GetPrefSize(aState);
nsSize pref = mHelper.mScrolledFrame->GetXULPrefSize(aState);
ScrollbarStyles styles = GetScrollbarStyles();
@@ -1410,14 +1410,14 @@ nsXULScrollFrame::GetPrefSize(nsBoxLayoutState& aState)
if (mHelper.mVScrollbarBox &&
styles.mVertical == NS_STYLE_OVERFLOW_SCROLL) {
nsSize vSize = mHelper.mVScrollbarBox->GetPrefSize(aState);
nsSize vSize = mHelper.mVScrollbarBox->GetXULPrefSize(aState);
nsBox::AddMargin(mHelper.mVScrollbarBox, vSize);
pref.width += vSize.width;
}
if (mHelper.mHScrollbarBox &&
styles.mHorizontal == NS_STYLE_OVERFLOW_SCROLL) {
nsSize hSize = mHelper.mHScrollbarBox->GetPrefSize(aState);
nsSize hSize = mHelper.mHScrollbarBox->GetXULPrefSize(aState);
nsBox::AddMargin(mHelper.mHScrollbarBox, hSize);
pref.height += hSize.height;
}
@@ -4580,7 +4580,7 @@ nsXULScrollFrame::AddRemoveScrollbar(nsBoxLayoutState& aState,
if (mHelper.mNeverHasHorizontalScrollbar || !mHelper.mHScrollbarBox)
return false;
nsSize hSize = mHelper.mHScrollbarBox->GetPrefSize(aState);
nsSize hSize = mHelper.mHScrollbarBox->GetXULPrefSize(aState);
nsBox::AddMargin(mHelper.mHScrollbarBox, hSize);
mHelper.SetScrollbarVisibility(mHelper.mHScrollbarBox, aAdd);
@@ -4599,7 +4599,7 @@ nsXULScrollFrame::AddRemoveScrollbar(nsBoxLayoutState& aState,
if (mHelper.mNeverHasVerticalScrollbar || !mHelper.mVScrollbarBox)
return false;
nsSize vSize = mHelper.mVScrollbarBox->GetPrefSize(aState);
nsSize vSize = mHelper.mVScrollbarBox->GetXULPrefSize(aState);
nsBox::AddMargin(mHelper.mVScrollbarBox, vSize);
mHelper.SetScrollbarVisibility(mHelper.mVScrollbarBox, aAdd);
@@ -5327,14 +5327,14 @@ ScrollFrameHelper::LayoutScrollbars(nsBoxLayoutState& aState,
nsSize resizerMinSize = mResizerBox->GetXULMinSize(aState);
nscoord vScrollbarWidth = mVScrollbarBox ?
mVScrollbarBox->GetPrefSize(aState).width : defaultSize;
mVScrollbarBox->GetXULPrefSize(aState).width : defaultSize;
r.width = std::max(std::max(r.width, vScrollbarWidth), resizerMinSize.width);
if (aContentArea.x == mScrollPort.x && !scrollbarOnLeft) {
r.x = aContentArea.XMost() - r.width;
}
nscoord hScrollbarHeight = mHScrollbarBox ?
mHScrollbarBox->GetPrefSize(aState).height : defaultSize;
mHScrollbarBox->GetXULPrefSize(aState).height : defaultSize;
r.height = std::max(std::max(r.height, hScrollbarHeight), resizerMinSize.height);
if (aContentArea.y == mScrollPort.y) {
r.y = aContentArea.YMost() - r.height;

View File

@@ -1125,7 +1125,7 @@ public:
uint32_t aFilter) override;
virtual nsSize GetXULMinSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetPrefSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULPrefSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetMaxSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nscoord GetBoxAscent(nsBoxLayoutState& aBoxLayoutState) override;

View File

@@ -2880,7 +2880,7 @@ public:
* @param[in] aBoxLayoutState The desired state to calculate for
* @return The preferred size
*/
virtual nsSize GetPrefSize(nsBoxLayoutState& aBoxLayoutState) = 0;
virtual nsSize GetXULPrefSize(nsBoxLayoutState& aBoxLayoutState) = 0;
/**
* This calculates the maximum size for a box based on its state

View File

@@ -46,7 +46,7 @@ nsPlaceholderFrame::GetXULMinSize(nsBoxLayoutState& aBoxLayoutState)
}
/* virtual */ nsSize
nsPlaceholderFrame::GetPrefSize(nsBoxLayoutState& aBoxLayoutState)
nsPlaceholderFrame::GetXULPrefSize(nsBoxLayoutState& aBoxLayoutState)
{
nsSize size(0, 0);
DISPLAY_PREF_SIZE(this, size);

View File

@@ -88,14 +88,14 @@ public:
}
// nsIFrame overrides
// We need to override GetXULMinSize and GetPrefSize because XUL uses
// We need to override GetXULMinSize and GetXULPrefSize because XUL uses
// placeholders not within lines.
virtual void AddInlineMinISize(nsRenderingContext* aRenderingContext,
InlineMinISizeData* aData) override;
virtual void AddInlinePrefISize(nsRenderingContext* aRenderingContext,
InlinePrefISizeData* aData) override;
virtual nsSize GetXULMinSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetPrefSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULPrefSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetMaxSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual void Reflow(nsPresContext* aPresContext,

View File

@@ -567,7 +567,7 @@ nsVideoFrame::GetVideoIntrinsicSize(nsRenderingContext *aRenderingContext)
// Ask the controls frame what its preferred height is
nsBoxLayoutState boxState(PresContext(), aRenderingContext, 0);
nscoord prefHeight = mFrames.LastChild()->GetPrefSize(boxState).height;
nscoord prefHeight = mFrames.LastChild()->GetXULPrefSize(boxState).height;
return nsSize(nsPresContext::CSSPixelsToAppUnits(size.width), prefHeight);
}

View File

@@ -826,7 +826,7 @@ nsGrid::GetPrefRowHeight(nsBoxLayoutState& aState, int32_t aIndex, bool aIsHoriz
nsSize size(0,0);
if (box)
{
size = box->GetPrefSize(aState);
size = box->GetXULPrefSize(aState);
nsBox::AddMargin(box, size);
nsGridLayout2::AddOffset(box, size);
}
@@ -851,7 +851,7 @@ nsGrid::GetPrefRowHeight(nsBoxLayoutState& aState, int32_t aIndex, bool aIsHoriz
// ignore collapsed children
if (!child->IsCollapsed())
{
nsSize childSize = child->GetPrefSize(aState);
nsSize childSize = child->GetXULPrefSize(aState);
nsSprocketLayout::AddLargestSize(size, childSize, aIsHorizontal);
}
@@ -901,7 +901,7 @@ nsGrid::GetMinRowHeight(nsBoxLayoutState& aState, int32_t aIndex, bool aIsHorizo
{
nsSize size(0,0);
if (box) {
size = box->GetPrefSize(aState);
size = box->GetXULPrefSize(aState);
nsBox::AddMargin(box, size);
nsGridLayout2::AddOffset(box, size);
}
@@ -976,7 +976,7 @@ nsGrid::GetMaxRowHeight(nsBoxLayoutState& aState, int32_t aIndex, bool aIsHorizo
{
nsSize size(NS_INTRINSICSIZE,NS_INTRINSICSIZE);
if (box) {
size = box->GetPrefSize(aState);
size = box->GetXULPrefSize(aState);
nsBox::AddMargin(box, size);
nsGridLayout2::AddOffset(box, size);
}

View File

@@ -27,7 +27,7 @@ nsGridCell::~nsGridCell()
}
nsSize
nsGridCell::GetPrefSize(nsBoxLayoutState& aState)
nsGridCell::GetXULPrefSize(nsBoxLayoutState& aState)
{
nsSize sum(0,0);
@@ -36,7 +36,7 @@ nsGridCell::GetPrefSize(nsBoxLayoutState& aState)
// we are tall as the tallest child plus its top offset
if (mBoxInColumn) {
nsSize pref = mBoxInColumn->GetPrefSize(aState);
nsSize pref = mBoxInColumn->GetXULPrefSize(aState);
nsBox::AddMargin(mBoxInColumn, pref);
nsGridLayout2::AddOffset(mBoxInColumn, pref);
@@ -45,7 +45,7 @@ nsGridCell::GetPrefSize(nsBoxLayoutState& aState)
}
if (mBoxInRow) {
nsSize pref = mBoxInRow->GetPrefSize(aState);
nsSize pref = mBoxInRow->GetXULPrefSize(aState);
nsBox::AddMargin(mBoxInRow, pref);
nsGridLayout2::AddOffset(mBoxInRow, pref);

View File

@@ -33,7 +33,7 @@ public:
nsGridCell();
~nsGridCell();
nsSize GetPrefSize(nsBoxLayoutState& aBoxLayoutState);
nsSize GetXULPrefSize(nsBoxLayoutState& aBoxLayoutState);
nsSize GetXULMinSize(nsBoxLayoutState& aBoxLayoutState);
nsSize GetMaxSize(nsBoxLayoutState& aBoxLayoutState);
bool IsCollapsed();

View File

@@ -132,9 +132,9 @@ nsGridLayout2::GetXULMinSize(nsIFrame* aBox, nsBoxLayoutState& aState)
}
nsSize
nsGridLayout2::GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aState)
nsGridLayout2::GetXULPrefSize(nsIFrame* aBox, nsBoxLayoutState& aState)
{
nsSize pref = nsStackLayout::GetPrefSize(aBox, aState);
nsSize pref = nsStackLayout::GetXULPrefSize(aBox, aState);
// if there are no <rows> tags that will sum up our columns,
// sum up our columns here.

View File

@@ -41,7 +41,7 @@ public:
}
virtual nsSize GetXULMinSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetMaxSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) override;
virtual void CountRowsColumns(nsIFrame* aBox, int32_t& aRowCount, int32_t& aComputedColumnCount) override { aRowCount++; }
virtual void DirtyRows(nsIFrame* aBox, nsBoxLayoutState& aState) override { }
virtual int32_t BuildRows(nsIFrame* aBox, nsGridRow* aRows) override;

View File

@@ -61,9 +61,9 @@ nsGridRowGroupLayout::AddWidth(nsSize& aSize, nscoord aSize2, bool aIsHorizontal
}
nsSize
nsGridRowGroupLayout::GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aState)
nsGridRowGroupLayout::GetXULPrefSize(nsIFrame* aBox, nsBoxLayoutState& aState)
{
nsSize vpref = nsGridRowLayout::GetPrefSize(aBox, aState);
nsSize vpref = nsGridRowLayout::GetXULPrefSize(aBox, aState);
/* It is possible that we could have some extra columns. This is when less columns in XUL were

View File

@@ -27,7 +27,7 @@ public:
virtual nsGridRowGroupLayout* CastToRowGroupLayout() override { return this; }
virtual nsSize GetXULMinSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetMaxSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) override;
virtual void CountRowsColumns(nsIFrame* aBox, int32_t& aRowCount, int32_t& aComputedColumnCount) override;
virtual void DirtyRows(nsIFrame* aBox, nsBoxLayoutState& aState) override;

View File

@@ -35,7 +35,7 @@ nsGridRowLeafLayout::~nsGridRowLeafLayout()
}
nsSize
nsGridRowLeafLayout::GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aState)
nsGridRowLeafLayout::GetXULPrefSize(nsIFrame* aBox, nsBoxLayoutState& aState)
{
int32_t index = 0;
nsGrid* grid = GetGrid(aBox, &index);
@@ -44,7 +44,7 @@ nsGridRowLeafLayout::GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aState)
// If we are not in a grid. Then we just work like a box. But if we are in a grid
// ask the grid for our size.
if (!grid) {
return nsGridRowLayout::GetPrefSize(aBox, aState);
return nsGridRowLayout::GetXULPrefSize(aBox, aState);
}
else {
return grid->GetPrefRowSize(aState, index, isHorizontal);

View File

@@ -28,7 +28,7 @@ public:
friend already_AddRefed<nsBoxLayout> NS_NewGridRowLeafLayout();
virtual nsSize GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULMinSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetMaxSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) override;
virtual void ChildAddedOrRemoved(nsIFrame* aBox, nsBoxLayoutState& aState) override;

View File

@@ -392,7 +392,7 @@ nsBox::DoesNeedRecalc(nscoord aCoord)
}
nsSize
nsBox::GetPrefSize(nsBoxLayoutState& aState)
nsBox::GetXULPrefSize(nsBoxLayoutState& aState)
{
NS_ASSERTION(aState.GetRenderingContext(), "must have rendering context");
@@ -487,7 +487,7 @@ nsBox::GetBoxAscent(nsBoxLayoutState& aState)
if (IsCollapsed())
return 0;
return GetPrefSize(aState).height;
return GetXULPrefSize(aState).height;
}
bool
@@ -606,7 +606,7 @@ nsIFrame::AddCSSPrefSize(nsIFrame* aBox, nsSize& aSize, bool &aWidthSet, bool &a
// see if the width or height was specifically set
// XXX Handle eStyleUnit_Enumerated?
// (Handling the eStyleUnit_Enumerated types requires
// GetPrefSize/GetXULMinSize methods that don't consider
// GetXULPrefSize/GetXULMinSize methods that don't consider
// (min-/max-/)(width/height) properties.)
const nsStyleCoord &width = position->mWidth;
if (width.GetUnit() == eStyleUnit_Coord) {
@@ -718,7 +718,7 @@ nsIFrame::AddCSSMinSize(nsBoxLayoutState& aState, nsIFrame* aBox, nsSize& aSize,
}
// XXX Handle eStyleUnit_Enumerated?
// (Handling the eStyleUnit_Enumerated types requires
// GetPrefSize/GetXULMinSize methods that don't consider
// GetXULPrefSize/GetXULMinSize methods that don't consider
// (min-/max-/)(width/height) properties.
// calc() with percentage is treated like '0' (unset)
@@ -787,7 +787,7 @@ nsIFrame::AddCSSMaxSize(nsIFrame* aBox, nsSize& aSize, bool &aWidthSet, bool &aH
// see if the width or height was specifically set
// XXX Handle eStyleUnit_Enumerated?
// (Handling the eStyleUnit_Enumerated types requires
// GetPrefSize/GetXULMinSize methods that don't consider
// GetXULPrefSize/GetXULMinSize methods that don't consider
// (min-/max-/)(width/height) properties.)
const nsStyleCoord maxWidth = position->mMaxWidth;
if (maxWidth.ConvertsToLength()) {

View File

@@ -19,7 +19,7 @@ public:
static void Shutdown();
virtual nsSize GetPrefSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULPrefSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULMinSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetMaxSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nscoord GetFlex() override;

View File

@@ -612,11 +612,11 @@ nsBoxFrame::GetPrefISize(nsRenderingContext *aRenderingContext)
DISPLAY_PREF_WIDTH(this, result);
nsBoxLayoutState state(PresContext(), aRenderingContext);
nsSize prefSize = GetPrefSize(state);
nsSize prefSize = GetXULPrefSize(state);
// GetPrefSize returns border-box width, and we want to return content
// GetXULPrefSize returns border-box width, and we want to return content
// width. Since Reflow uses the reflow state's border and padding, we
// actually just want to subtract what GetPrefSize added, which is the
// actually just want to subtract what GetXULPrefSize added, which is the
// result of GetBorderAndPadding.
nsMargin bp;
GetBorderAndPadding(bp);
@@ -675,10 +675,10 @@ nsBoxFrame::Reflow(nsPresContext* aPresContext,
NS_ASSERTION(computedSize.ISize(wm) != NS_INTRINSICSIZE,
"computed inline size should always be computed");
if (computedSize.BSize(wm) == NS_INTRINSICSIZE) {
nsSize physicalPrefSize = GetPrefSize(state);
nsSize physicalPrefSize = GetXULPrefSize(state);
nsSize minSize = GetXULMinSize(state);
nsSize maxSize = GetMaxSize(state);
// XXXbz isn't GetPrefSize supposed to bounds-check for us?
// XXXbz isn't GetXULPrefSize supposed to bounds-check for us?
physicalPrefSize = BoundsCheck(minSize, physicalPrefSize, maxSize);
prefSize = LogicalSize(wm, physicalPrefSize);
}
@@ -744,7 +744,7 @@ nsBoxFrame::Reflow(nsPresContext* aPresContext,
}
nsSize
nsBoxFrame::GetPrefSize(nsBoxLayoutState& aBoxLayoutState)
nsBoxFrame::GetXULPrefSize(nsBoxLayoutState& aBoxLayoutState)
{
NS_ASSERTION(aBoxLayoutState.GetRenderingContext(),
"must have rendering context");
@@ -767,14 +767,14 @@ nsBoxFrame::GetPrefSize(nsBoxLayoutState& aBoxLayoutState)
if (!nsIFrame::AddCSSPrefSize(this, size, widthSet, heightSet))
{
if (mLayoutManager) {
nsSize layoutSize = mLayoutManager->GetPrefSize(this, aBoxLayoutState);
nsSize layoutSize = mLayoutManager->GetXULPrefSize(this, aBoxLayoutState);
if (!widthSet)
size.width = layoutSize.width;
if (!heightSet)
size.height = layoutSize.height;
}
else {
size = nsBox::GetPrefSize(aBoxLayoutState);
size = nsBox::GetXULPrefSize(aBoxLayoutState);
}
}
@@ -1786,7 +1786,7 @@ nsBoxFrame::DisplayDebugInfoFor(nsIFrame* aBox,
nsIFrame::AddCSSMaxSize (child, maxSizeCSS, widthSet, heightSet);
nsIFrame::AddCSSFlex (child, flexCSS);
nsSize prefSize = child->GetPrefSize(state);
nsSize prefSize = child->GetXULPrefSize(state);
nsSize minSize = child->GetXULMinSize(state);
nsSize maxSize = child->GetMaxSize(state);
nscoord flexSize = child->GetFlex();

View File

@@ -61,7 +61,7 @@ public:
virtual nsresult RelayoutChildAtOrdinal(nsIFrame* aChild) override;
virtual nsSize GetPrefSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULPrefSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULMinSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetMaxSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nscoord GetFlex() override;

View File

@@ -34,7 +34,7 @@ nsBoxLayout::AddMargin(nsSize& aSize, const nsMargin& aMargin)
}
nsSize
nsBoxLayout::GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState)
nsBoxLayout::GetXULPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState)
{
nsSize pref (0, 0);
AddBorderAndPadding(aBox, pref);

View File

@@ -36,7 +36,7 @@ public:
NS_IMETHOD Layout(nsIFrame* aBox, nsBoxLayoutState& aState);
virtual nsSize GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);
virtual nsSize GetXULPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);
virtual nsSize GetXULMinSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);
virtual nsSize GetMaxSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);
virtual nscoord GetAscent(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);

View File

@@ -545,7 +545,7 @@ nsImageBoxFrame::GetImageSize()
* Ok return our dimensions
*/
nsSize
nsImageBoxFrame::GetPrefSize(nsBoxLayoutState& aState)
nsImageBoxFrame::GetXULPrefSize(nsBoxLayoutState& aState)
{
nsSize size(0,0);
DISPLAY_PREF_SIZE(this, size);
@@ -637,7 +637,7 @@ nsImageBoxFrame::GetXULMinSize(nsBoxLayoutState& aState)
nscoord
nsImageBoxFrame::GetBoxAscent(nsBoxLayoutState& aState)
{
return GetPrefSize(aState).height;
return GetXULPrefSize(aState).height;
}
nsIAtom*

View File

@@ -47,7 +47,7 @@ public:
friend class nsDisplayXULImage;
NS_DECL_FRAMEARENA_HELPERS
virtual nsSize GetPrefSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULPrefSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULMinSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nscoord GetBoxAscent(nsBoxLayoutState& aBoxLayoutState) override;
virtual void MarkIntrinsicISizesDirty() override;

View File

@@ -153,11 +153,11 @@ nsLeafBoxFrame::GetPrefISize(nsRenderingContext *aRenderingContext)
nsBoxLayoutState state(PresContext(), aRenderingContext);
WritingMode wm = GetWritingMode();
LogicalSize prefSize(wm, GetPrefSize(state));
LogicalSize prefSize(wm, GetXULPrefSize(state));
// GetPrefSize returns border-box size, and we want to return content
// GetXULPrefSize returns border-box size, and we want to return content
// inline-size. Since Reflow uses the reflow state's border and padding, we
// actually just want to subtract what GetPrefSize added, which is the
// actually just want to subtract what GetXULPrefSize added, which is the
// result of GetBorderAndPadding.
nsMargin bp;
GetBorderAndPadding(bp);
@@ -257,7 +257,7 @@ nsLeafBoxFrame::Reflow(nsPresContext* aPresContext,
// if we are told to layout intrinic then get our preferred size.
if (computedSize.width == NS_INTRINSICSIZE || computedSize.height == NS_INTRINSICSIZE) {
prefSize = GetPrefSize(state);
prefSize = GetXULPrefSize(state);
nsSize minSize = GetXULMinSize(state);
nsSize maxSize = GetMaxSize(state);
prefSize = BoundsCheck(minSize, prefSize, maxSize);
@@ -347,9 +347,9 @@ nsLeafBoxFrame::CharacterDataChanged(CharacterDataChangeInfo* aInfo)
}
/* virtual */ nsSize
nsLeafBoxFrame::GetPrefSize(nsBoxLayoutState& aState)
nsLeafBoxFrame::GetXULPrefSize(nsBoxLayoutState& aState)
{
return nsBox::GetPrefSize(aState);
return nsBox::GetXULPrefSize(aState);
}
/* virtual */ nsSize

View File

@@ -16,7 +16,7 @@ public:
friend nsIFrame* NS_NewLeafBoxFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
virtual nsSize GetPrefSize(nsBoxLayoutState& aState) override;
virtual nsSize GetXULPrefSize(nsBoxLayoutState& aState) override;
virtual nsSize GetXULMinSize(nsBoxLayoutState& aState) override;
virtual nsSize GetMaxSize(nsBoxLayoutState& aState) override;
virtual nscoord GetFlex() override;

View File

@@ -268,7 +268,7 @@ nsListBoxBodyFrame::DoLayout(nsBoxLayoutState& aBoxLayoutState)
childFrame = childFrame->GetNextSibling();
}
nsSize prefSize = mLayoutManager->GetPrefSize(this, aBoxLayoutState);
nsSize prefSize = mLayoutManager->GetXULPrefSize(this, aBoxLayoutState);
NS_FOR_FRAME_OVERFLOW_TYPES(otype) {
nsRect& o = overflow.Overflow(otype);
o.height = std::max(o.height, prefSize.height);
@@ -293,7 +293,7 @@ nsListBoxBodyFrame::GetMinSizeForScrollArea(nsBoxLayoutState& aBoxLayoutState)
nsSize result(0, 0);
if (nsContentUtils::HasNonEmptyAttr(GetContent(), kNameSpaceID_None,
nsGkAtoms::sizemode)) {
result = GetPrefSize(aBoxLayoutState);
result = GetXULPrefSize(aBoxLayoutState);
result.height = 0;
nsIScrollableFrame* scrollFrame = nsLayoutUtils::GetScrollableFrameFor(this);
if (scrollFrame &&
@@ -307,9 +307,9 @@ nsListBoxBodyFrame::GetMinSizeForScrollArea(nsBoxLayoutState& aBoxLayoutState)
}
nsSize
nsListBoxBodyFrame::GetPrefSize(nsBoxLayoutState& aBoxLayoutState)
nsListBoxBodyFrame::GetXULPrefSize(nsBoxLayoutState& aBoxLayoutState)
{
nsSize pref = nsBoxFrame::GetPrefSize(aBoxLayoutState);
nsSize pref = nsBoxFrame::GetXULPrefSize(aBoxLayoutState);
int32_t size = GetFixedRowSize();
if (size > -1)

View File

@@ -88,7 +88,7 @@ public:
virtual void MarkIntrinsicISizesDirty() override;
virtual nsSize GetMinSizeForScrollArea(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetPrefSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULPrefSize(nsBoxLayoutState& aBoxLayoutState) override;
// size calculation
int32_t GetRowCount();

View File

@@ -21,9 +21,9 @@ nsListBoxLayout::nsListBoxLayout() : nsGridRowGroupLayout()
////////// nsBoxLayout //////////////
nsSize
nsListBoxLayout::GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState)
nsListBoxLayout::GetXULPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState)
{
nsSize pref = nsGridRowGroupLayout::GetPrefSize(aBox, aBoxLayoutState);
nsSize pref = nsGridRowGroupLayout::GetXULPrefSize(aBox, aBoxLayoutState);
nsListBoxBodyFrame* frame = static_cast<nsListBoxBodyFrame*>(aBox);
if (frame) {
@@ -155,7 +155,7 @@ nsListBoxLayout::LayoutInternal(nsIFrame* aBox, nsBoxLayoutState& aState)
childRect.y = yOffset;
childRect.width = clientRect.width;
nsSize size = box->GetPrefSize(aState);
nsSize size = box->GetXULPrefSize(aState);
body->SetRowHeight(size.height);
childRect.height = rowHeight;

View File

@@ -20,7 +20,7 @@ public:
// nsBoxLayout
NS_IMETHOD Layout(nsIFrame* aBox, nsBoxLayoutState& aState) override;
virtual nsSize GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULMinSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetMaxSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) override;

View File

@@ -26,9 +26,9 @@ nsListItemFrame::~nsListItemFrame()
}
nsSize
nsListItemFrame::GetPrefSize(nsBoxLayoutState& aState)
nsListItemFrame::GetXULPrefSize(nsBoxLayoutState& aState)
{
nsSize size = nsBoxFrame::GetPrefSize(aState);
nsSize size = nsBoxFrame::GetXULPrefSize(aState);
DISPLAY_PREF_SIZE(this, size);
// guarantee that our preferred height doesn't exceed the standard

View File

@@ -23,7 +23,7 @@ public:
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
virtual nsSize GetPrefSize(nsBoxLayoutState& aState) override;
virtual nsSize GetXULPrefSize(nsBoxLayoutState& aState) override;
protected:
explicit nsListItemFrame(nsStyleContext *aContext,

View File

@@ -1350,7 +1350,7 @@ nsMenuFrame::SizeToPopup(nsBoxLayoutState& aState, nsSize& aSize)
nsMenuPopupFrame* popupFrame = GetPopup();
if (!popupFrame)
return false;
tmpSize = popupFrame->GetPrefSize(aState);
tmpSize = popupFrame->GetXULPrefSize(aState);
// Produce a size such that:
// (1) the menu and its popup can be the same width
@@ -1380,9 +1380,9 @@ nsMenuFrame::SizeToPopup(nsBoxLayoutState& aState, nsSize& aSize)
}
nsSize
nsMenuFrame::GetPrefSize(nsBoxLayoutState& aState)
nsMenuFrame::GetXULPrefSize(nsBoxLayoutState& aState)
{
nsSize size = nsBoxFrame::GetPrefSize(aState);
nsSize size = nsBoxFrame::GetXULPrefSize(aState);
DISPLAY_PREF_SIZE(this, size);
// If we are using sizetopopup="always" then

View File

@@ -82,7 +82,7 @@ public:
NS_IMETHOD DoLayout(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULMinSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetPrefSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULPrefSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual void Init(nsIContent* aContent,
nsContainerFrame* aParent,

View File

@@ -457,7 +457,7 @@ nsMenuPopupFrame::LayoutPopup(nsBoxLayoutState& aState, nsIFrame* aParentMenu,
// get the preferred, minimum and maximum size. If the menu is sized to the
// popup, then the popup's width is the menu's width.
nsSize prefSize = GetPrefSize(aState);
nsSize prefSize = GetXULPrefSize(aState);
nsSize minSize = GetXULMinSize(aState);
nsSize maxSize = GetMaxSize(aState);

View File

@@ -418,7 +418,7 @@ nsSliderFrame::DoLayout(nsBoxLayoutState& aState)
scrollbar = GetContentOfBox(scrollbarBox);
// get the thumb's pref size
nsSize thumbSize = thumbBox->GetPrefSize(aState);
nsSize thumbSize = thumbBox->GetXULPrefSize(aState);
if (IsHorizontal())
thumbSize.height = clientRect.height;
@@ -1336,10 +1336,10 @@ nsSliderFrame::DestroyFrom(nsIFrame* aDestructRoot)
}
nsSize
nsSliderFrame::GetPrefSize(nsBoxLayoutState& aState)
nsSliderFrame::GetXULPrefSize(nsBoxLayoutState& aState)
{
EnsureOrient();
return nsBoxFrame::GetPrefSize(aState);
return nsBoxFrame::GetXULPrefSize(aState);
}
nsSize

View File

@@ -55,7 +55,7 @@ public:
}
#endif
virtual nsSize GetPrefSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULPrefSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULMinSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetMaxSize(nsBoxLayoutState& aBoxLayoutState) override;
NS_IMETHOD DoLayout(nsBoxLayoutState& aBoxLayoutState) override;

View File

@@ -668,7 +668,7 @@ nsSplitterFrameInner::MouseDown(nsIDOMEvent* aMouseEvent)
// skip over any splitters
if (atom != nsGkAtoms::splitter) {
nsSize prefSize = childBox->GetPrefSize(state);
nsSize prefSize = childBox->GetXULPrefSize(state);
nsSize minSize = childBox->GetXULMinSize(state);
nsSize maxSize = nsBox::BoundsCheckMinMax(minSize, childBox->GetMaxSize(state));
prefSize = nsBox::BoundsCheck(minSize, prefSize, maxSize);

View File

@@ -320,7 +320,7 @@ nsSprocketLayout::Layout(nsIFrame* aBox, nsBoxLayoutState& aState)
// ALIGN is not stretch, however, then we also need to know the child's size along the
// opposite axis.
if (!(frameState & NS_STATE_AUTO_STRETCH)) {
nsSize prefSize = child->GetPrefSize(aState);
nsSize prefSize = child->GetXULPrefSize(aState);
nsSize minSize = child->GetXULMinSize(aState);
nsSize maxSize = child->GetMaxSize(aState);
prefSize = nsBox::BoundsCheck(minSize, prefSize, maxSize);
@@ -744,7 +744,7 @@ nsSprocketLayout::PopulateBoxSizes(nsIFrame* aBox, nsBoxLayoutState& aState, nsB
// 0 then and not even have to ask for it.
//if (flexes != 1) {
pref = child->GetPrefSize(aState);
pref = child->GetXULPrefSize(aState);
minSize = child->GetXULMinSize(aState);
maxSize = nsBox::BoundsCheckMinMax(minSize, child->GetMaxSize(aState));
ascent = child->GetBoxAscent(aState);
@@ -1304,7 +1304,7 @@ nsSprocketLayout::ComputeChildSizes(nsIFrame* aBox,
nsSize
nsSprocketLayout::GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aState)
nsSprocketLayout::GetXULPrefSize(nsIFrame* aBox, nsBoxLayoutState& aState)
{
nsSize vpref (0, 0);
bool isHorizontal = IsHorizontal(aBox);
@@ -1325,7 +1325,7 @@ nsSprocketLayout::GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aState)
// ignore collapsed children
if (!child->IsCollapsed())
{
nsSize pref = child->GetPrefSize(aState);
nsSize pref = child->GetXULPrefSize(aState);
AddMargin(child, pref);
if (isEqual) {
@@ -1388,7 +1388,7 @@ nsSprocketLayout::GetXULMinSize(nsIFrame* aBox, nsBoxLayoutState& aState)
// if the child is not flexible then
// its min size is its pref size.
if (child->GetFlex() == 0) {
pref = child->GetPrefSize(aState);
pref = child->GetXULPrefSize(aState);
if (isHorizontal)
min.width = pref.width;
else

View File

@@ -70,7 +70,7 @@ public:
NS_IMETHOD Layout(nsIFrame* aBox, nsBoxLayoutState& aState) override;
virtual nsSize GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULMinSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetMaxSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) override;
virtual nscoord GetAscent(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) override;

View File

@@ -59,14 +59,14 @@ nsStackLayout::nsStackLayout()
*/
nsSize
nsStackLayout::GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aState)
nsStackLayout::GetXULPrefSize(nsIFrame* aBox, nsBoxLayoutState& aState)
{
nsSize prefSize (0, 0);
nsIFrame* child = nsBox::GetChildBox(aBox);
while (child) {
if (child->StyleXUL()->mStretchStack) {
nsSize pref = child->GetPrefSize(aState);
nsSize pref = child->GetXULPrefSize(aState);
AddMargin(child, pref);
nsMargin offset;
@@ -307,12 +307,12 @@ nsStackLayout::Layout(nsIFrame* aBox, nsBoxLayoutState& aState)
childRect.width = clamped(width, min.width, max.width);
}
else {
nscoord width = child->GetPrefSize(aState).width;
nscoord width = child->GetXULPrefSize(aState).width;
childRect.width = clamped(width, min.width, max.width);
}
}
else if (offsetSpecified & SPECIFIED_RIGHT) {
nscoord width = child->GetPrefSize(aState).width;
nscoord width = child->GetXULPrefSize(aState).width;
childRect.width = clamped(width, min.width, max.width);
childRect.x = clientRect.XMost() - offset.right - margin.right - childRect.width;
}
@@ -324,12 +324,12 @@ nsStackLayout::Layout(nsIFrame* aBox, nsBoxLayoutState& aState)
childRect.height = clamped(height, min.height, max.height);
}
else {
nscoord height = child->GetPrefSize(aState).height;
nscoord height = child->GetXULPrefSize(aState).height;
childRect.height = clamped(height, min.height, max.height);
}
}
else if (offsetSpecified & SPECIFIED_BOTTOM) {
nscoord height = child->GetPrefSize(aState).height;
nscoord height = child->GetXULPrefSize(aState).height;
childRect.height = clamped(height, min.height, max.height);
childRect.y = clientRect.YMost() - offset.bottom - margin.bottom - childRect.height;
}

View File

@@ -34,7 +34,7 @@ public:
NS_IMETHOD Layout(nsIFrame* aBox, nsBoxLayoutState& aState) override;
virtual nsSize GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULMinSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetMaxSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) override;
virtual nscoord GetAscent(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) override;

View File

@@ -1108,7 +1108,7 @@ nsTextBoxFrame::CalcDrawRect(nsRenderingContext &aRenderingContext)
* Ok return our dimensions
*/
nsSize
nsTextBoxFrame::GetPrefSize(nsBoxLayoutState& aBoxLayoutState)
nsTextBoxFrame::GetXULPrefSize(nsBoxLayoutState& aBoxLayoutState)
{
CalcTextSize(aBoxLayoutState);

View File

@@ -19,7 +19,7 @@ public:
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS
virtual nsSize GetPrefSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULPrefSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULMinSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nscoord GetBoxAscent(nsBoxLayoutState& aBoxLayoutState) override;
NS_IMETHOD DoLayout(nsBoxLayoutState& aBoxLayoutState) override;