Bug 1053986 - Rename nsIFrame::GetMinSize to GetXULMinSize, and related methods. r=dholbert

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

MozReview-Commit-ID: Jhe3o3kIOe0
This commit is contained in:
L. David Baron
2016-04-20 21:28:31 -07:00
parent 2f53d7f019
commit 4419f3e86b
45 changed files with 91 additions and 91 deletions

View File

@@ -586,10 +586,10 @@ nsTextControlFrame::ReflowTextControlChild(nsIFrame* aKid,
}
nsSize
nsTextControlFrame::GetMinSize(nsBoxLayoutState& aState)
nsTextControlFrame::GetXULMinSize(nsBoxLayoutState& aState)
{
// XXXbz why? Why not the nsBoxFrame sizes?
return nsBox::GetMinSize(aState);
return nsBox::GetXULMinSize(aState);
}
bool

View File

@@ -62,7 +62,7 @@ public:
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus) override;
virtual nsSize GetMinSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULMinSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual bool IsCollapsed() override;
virtual bool IsLeaf() const override;

View File

@@ -697,7 +697,7 @@ nsContainerFrame::SyncWindowProperties(nsPresContext* aPresContext,
}
nsBoxLayoutState aState(aPresContext, aRC);
nsSize minSize = rootFrame->GetMinSize(aState);
nsSize minSize = rootFrame->GetXULMinSize(aState);
nsSize maxSize = rootFrame->GetMaxSize(aState);
SetSizeConstraints(aPresContext, windowWidget, minSize, maxSize);

View File

@@ -8729,7 +8729,7 @@ nsFrame::GetPrefSize(nsBoxLayoutState& aState)
}
nsSize
nsFrame::GetMinSize(nsBoxLayoutState& aState)
nsFrame::GetXULMinSize(nsBoxLayoutState& aState)
{
nsSize size(0,0);
DISPLAY_MIN_SIZE(this, size);

View File

@@ -409,7 +409,7 @@ public:
// Box layout methods
virtual nsSize GetPrefSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetMinSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULMinSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetMaxSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nscoord GetFlex() override;
virtual nscoord GetBoxAscent(nsBoxLayoutState& aBoxLayoutState) override;

View File

@@ -268,7 +268,7 @@ GetScrollbarMetrics(nsBoxLayoutState& aState, nsIFrame* aBox, nsSize* aMin,
"computations");
if (aMin) {
*aMin = aBox->GetMinSize(aState);
*aMin = aBox->GetXULMinSize(aState);
nsBox::AddMargin(aBox, *aMin);
if (aMin->width < 0) {
aMin->width = 0;
@@ -1429,7 +1429,7 @@ nsXULScrollFrame::GetPrefSize(nsBoxLayoutState& aState)
}
nsSize
nsXULScrollFrame::GetMinSize(nsBoxLayoutState& aState)
nsXULScrollFrame::GetXULMinSize(nsBoxLayoutState& aState)
{
#ifdef DEBUG_LAYOUT
PropagateDebug(aState);
@@ -1441,7 +1441,7 @@ nsXULScrollFrame::GetMinSize(nsBoxLayoutState& aState)
if (mHelper.mVScrollbarBox &&
styles.mVertical == NS_STYLE_OVERFLOW_SCROLL) {
nsSize vSize = mHelper.mVScrollbarBox->GetMinSize(aState);
nsSize vSize = mHelper.mVScrollbarBox->GetXULMinSize(aState);
AddMargin(mHelper.mVScrollbarBox, vSize);
min.width += vSize.width;
if (min.height < vSize.height)
@@ -1450,7 +1450,7 @@ nsXULScrollFrame::GetMinSize(nsBoxLayoutState& aState)
if (mHelper.mHScrollbarBox &&
styles.mHorizontal == NS_STYLE_OVERFLOW_SCROLL) {
nsSize hSize = mHelper.mHScrollbarBox->GetMinSize(aState);
nsSize hSize = mHelper.mHScrollbarBox->GetXULMinSize(aState);
AddMargin(mHelper.mHScrollbarBox, hSize);
min.height += hSize.height;
if (min.width < hSize.width)
@@ -4658,7 +4658,7 @@ nsXULScrollFrame::LayoutScrollArea(nsBoxLayoutState& aState,
mHelper.mScrollPort.Size());
int32_t flags = NS_FRAME_NO_MOVE_VIEW;
nsSize minSize = mHelper.mScrolledFrame->GetMinSize(aState);
nsSize minSize = mHelper.mScrolledFrame->GetXULMinSize(aState);
if (minSize.height > childRect.height)
childRect.height = minSize.height;
@@ -5324,7 +5324,7 @@ ScrollFrameHelper::LayoutScrollbars(nsBoxLayoutState& aState,
if (hasResizer) {
// if a resizer is present, get its size. Assume a default size of 15 pixels.
nscoord defaultSize = nsPresContext::CSSPixelsToAppUnits(15);
nsSize resizerMinSize = mResizerBox->GetMinSize(aState);
nsSize resizerMinSize = mResizerBox->GetXULMinSize(aState);
nscoord vScrollbarWidth = mVScrollbarBox ?
mVScrollbarBox->GetPrefSize(aState).width : defaultSize;

View File

@@ -1124,7 +1124,7 @@ public:
virtual void AppendAnonymousContentTo(nsTArray<nsIContent*>& aElements,
uint32_t aFilter) override;
virtual nsSize GetMinSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULMinSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetPrefSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetMaxSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nscoord GetBoxAscent(nsBoxLayoutState& aBoxLayoutState) override;

View File

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

View File

@@ -38,7 +38,7 @@ NS_QUERYFRAME_TAIL_INHERITING(nsFrame)
#endif
/* virtual */ nsSize
nsPlaceholderFrame::GetMinSize(nsBoxLayoutState& aBoxLayoutState)
nsPlaceholderFrame::GetXULMinSize(nsBoxLayoutState& aBoxLayoutState)
{
nsSize size(0, 0);
DISPLAY_MIN_SIZE(this, size);

View File

@@ -88,13 +88,13 @@ public:
}
// nsIFrame overrides
// We need to override GetMinSize and GetPrefSize because XUL uses
// We need to override GetXULMinSize and GetPrefSize 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 GetMinSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULMinSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetPrefSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetMaxSize(nsBoxLayoutState& aBoxLayoutState) override;

View File

@@ -926,7 +926,7 @@ nsGrid::GetMinRowHeight(nsBoxLayoutState& aState, int32_t aIndex, bool aIsHorizo
// ignore collapsed children
if (!child->IsCollapsed())
{
nsSize childSize = child->GetMinSize(aState);
nsSize childSize = child->GetXULMinSize(aState);
nsSprocketLayout::AddLargestSize(size, childSize, aIsHorizontal);
}
@@ -1001,7 +1001,7 @@ nsGrid::GetMaxRowHeight(nsBoxLayoutState& aState, int32_t aIndex, bool aIsHorizo
// ignore collapsed children
if (!child->IsCollapsed())
{
nsSize min = child->GetMinSize(aState);
nsSize min = child->GetXULMinSize(aState);
nsSize childSize = nsBox::BoundsCheckMinMax(min, child->GetMaxSize(aState));
nsSprocketLayout::AddLargestSize(size, childSize, aIsHorizontal);
}

View File

@@ -57,7 +57,7 @@ nsGridCell::GetPrefSize(nsBoxLayoutState& aState)
}
nsSize
nsGridCell::GetMinSize(nsBoxLayoutState& aState)
nsGridCell::GetXULMinSize(nsBoxLayoutState& aState)
{
nsSize sum(0, 0);
@@ -66,7 +66,7 @@ nsGridCell::GetMinSize(nsBoxLayoutState& aState)
// we are tall as the tallest child plus its top offset
if (mBoxInColumn) {
nsSize min = mBoxInColumn->GetMinSize(aState);
nsSize min = mBoxInColumn->GetXULMinSize(aState);
nsBox::AddMargin(mBoxInColumn, min);
nsGridLayout2::AddOffset(mBoxInColumn, min);
@@ -75,7 +75,7 @@ nsGridCell::GetMinSize(nsBoxLayoutState& aState)
}
if (mBoxInRow) {
nsSize min = mBoxInRow->GetMinSize(aState);
nsSize min = mBoxInRow->GetXULMinSize(aState);
nsBox::AddMargin(mBoxInRow, min);
nsGridLayout2::AddOffset(mBoxInRow, min);

View File

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

View File

@@ -93,9 +93,9 @@ nsGridLayout2::AddWidth(nsSize& aSize, nscoord aSize2, bool aIsHorizontal)
}
nsSize
nsGridLayout2::GetMinSize(nsIFrame* aBox, nsBoxLayoutState& aState)
nsGridLayout2::GetXULMinSize(nsIFrame* aBox, nsBoxLayoutState& aState)
{
nsSize minSize = nsStackLayout::GetMinSize(aBox, aState);
nsSize minSize = nsStackLayout::GetXULMinSize(aBox, aState);
// if there are no <rows> tags that will sum up our columns,
// sum up our columns here.

View File

@@ -39,7 +39,7 @@ public:
virtual nsIGridPart* GetParentGridPart(nsIFrame* aBox, nsIFrame** aParentBox) override {
NS_NOTREACHED("Should not be called"); return nullptr;
}
virtual nsSize GetMinSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) override;
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 void CountRowsColumns(nsIFrame* aBox, int32_t& aRowCount, int32_t& aComputedColumnCount) override { aRowCount++; }

View File

@@ -121,9 +121,9 @@ nsGridRowGroupLayout::GetMaxSize(nsIFrame* aBox, nsBoxLayoutState& aState)
}
nsSize
nsGridRowGroupLayout::GetMinSize(nsIFrame* aBox, nsBoxLayoutState& aState)
nsGridRowGroupLayout::GetXULMinSize(nsIFrame* aBox, nsBoxLayoutState& aState)
{
nsSize minSize = nsGridRowLayout::GetMinSize(aBox, aState);
nsSize minSize = nsGridRowLayout::GetXULMinSize(aBox, aState);
int32_t index = 0;
nsGrid* grid = GetGrid(aBox, &index);

View File

@@ -26,7 +26,7 @@ public:
friend already_AddRefed<nsBoxLayout> NS_NewGridRowGroupLayout();
virtual nsGridRowGroupLayout* CastToRowGroupLayout() override { return this; }
virtual nsSize GetMinSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULMinSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetPrefSize(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;

View File

@@ -53,14 +53,14 @@ nsGridRowLeafLayout::GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aState)
}
nsSize
nsGridRowLeafLayout::GetMinSize(nsIFrame* aBox, nsBoxLayoutState& aState)
nsGridRowLeafLayout::GetXULMinSize(nsIFrame* aBox, nsBoxLayoutState& aState)
{
int32_t index = 0;
nsGrid* grid = GetGrid(aBox, &index);
bool isHorizontal = IsHorizontal(aBox);
if (!grid)
return nsGridRowLayout::GetMinSize(aBox, aState);
return nsGridRowLayout::GetXULMinSize(aBox, aState);
else {
nsSize minSize = grid->GetMinRowSize(aState, index, isHorizontal);
AddBorderAndPadding(aBox, minSize);

View File

@@ -29,7 +29,7 @@ public:
friend already_AddRefed<nsBoxLayout> NS_NewGridRowLeafLayout();
virtual nsSize GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetMinSize(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;
NS_IMETHOD Layout(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) override;

View File

@@ -406,13 +406,13 @@ nsBox::GetPrefSize(nsBoxLayoutState& aState)
bool widthSet, heightSet;
nsIFrame::AddCSSPrefSize(this, pref, widthSet, heightSet);
nsSize minSize = GetMinSize(aState);
nsSize minSize = GetXULMinSize(aState);
nsSize maxSize = GetMaxSize(aState);
return BoundsCheck(minSize, pref, maxSize);
}
nsSize
nsBox::GetMinSize(nsBoxLayoutState& aState)
nsBox::GetXULMinSize(nsBoxLayoutState& aState)
{
NS_ASSERTION(aState.GetRenderingContext(), "must have rendering context");
@@ -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/GetMinSize methods that don't consider
// GetPrefSize/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/GetMinSize methods that don't consider
// GetPrefSize/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/GetMinSize methods that don't consider
// GetPrefSize/GetXULMinSize methods that don't consider
// (min-/max-/)(width/height) properties.)
const nsStyleCoord maxWidth = position->mMaxWidth;
if (maxWidth.ConvertsToLength()) {

View File

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

View File

@@ -590,11 +590,11 @@ nsBoxFrame::GetMinISize(nsRenderingContext *aRenderingContext)
DISPLAY_MIN_WIDTH(this, result);
nsBoxLayoutState state(PresContext(), aRenderingContext);
nsSize minSize = GetMinSize(state);
nsSize minSize = GetXULMinSize(state);
// GetMinSize returns border-box width, and we want to return content
// GetXULMinSize 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 GetMinSize added, which is the
// actually just want to subtract what GetXULMinSize added, which is the
// result of GetBorderAndPadding.
nsMargin bp;
GetBorderAndPadding(bp);
@@ -676,7 +676,7 @@ nsBoxFrame::Reflow(nsPresContext* aPresContext,
"computed inline size should always be computed");
if (computedSize.BSize(wm) == NS_INTRINSICSIZE) {
nsSize physicalPrefSize = GetPrefSize(state);
nsSize minSize = GetMinSize(state);
nsSize minSize = GetXULMinSize(state);
nsSize maxSize = GetMaxSize(state);
// XXXbz isn't GetPrefSize supposed to bounds-check for us?
physicalPrefSize = BoundsCheck(minSize, physicalPrefSize, maxSize);
@@ -778,7 +778,7 @@ nsBoxFrame::GetPrefSize(nsBoxLayoutState& aBoxLayoutState)
}
}
nsSize minSize = GetMinSize(aBoxLayoutState);
nsSize minSize = GetXULMinSize(aBoxLayoutState);
nsSize maxSize = GetMaxSize(aBoxLayoutState);
mPrefSize = BoundsCheck(minSize, size, maxSize);
@@ -807,7 +807,7 @@ nsBoxFrame::GetBoxAscent(nsBoxLayoutState& aBoxLayoutState)
}
nsSize
nsBoxFrame::GetMinSize(nsBoxLayoutState& aBoxLayoutState)
nsBoxFrame::GetXULMinSize(nsBoxLayoutState& aBoxLayoutState)
{
NS_ASSERTION(aBoxLayoutState.GetRenderingContext(),
"must have rendering context");
@@ -830,14 +830,14 @@ nsBoxFrame::GetMinSize(nsBoxLayoutState& aBoxLayoutState)
if (!nsIFrame::AddCSSMinSize(aBoxLayoutState, this, size, widthSet, heightSet))
{
if (mLayoutManager) {
nsSize layoutSize = mLayoutManager->GetMinSize(this, aBoxLayoutState);
nsSize layoutSize = mLayoutManager->GetXULMinSize(this, aBoxLayoutState);
if (!widthSet)
size.width = layoutSize.width;
if (!heightSet)
size.height = layoutSize.height;
}
else {
size = nsBox::GetMinSize(aBoxLayoutState);
size = nsBox::GetXULMinSize(aBoxLayoutState);
}
}
@@ -1787,7 +1787,7 @@ nsBoxFrame::DisplayDebugInfoFor(nsIFrame* aBox,
nsIFrame::AddCSSFlex (child, flexCSS);
nsSize prefSize = child->GetPrefSize(state);
nsSize minSize = child->GetMinSize(state);
nsSize minSize = child->GetXULMinSize(state);
nsSize maxSize = child->GetMaxSize(state);
nscoord flexSize = child->GetFlex();
nscoord ascentSize = child->GetBoxAscent(state);

View File

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

View File

@@ -43,7 +43,7 @@ nsBoxLayout::GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState)
}
nsSize
nsBoxLayout::GetMinSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState)
nsBoxLayout::GetXULMinSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState)
{
nsSize minSize (0,0);
AddBorderAndPadding(aBox, minSize);

View File

@@ -37,7 +37,7 @@ public:
NS_IMETHOD Layout(nsIFrame* aBox, nsBoxLayoutState& aState);
virtual nsSize GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);
virtual nsSize GetMinSize(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);
virtual void ChildrenInserted(nsIFrame* aBox, nsBoxLayoutState& aState,

View File

@@ -569,7 +569,7 @@ nsImageBoxFrame::GetPrefSize(nsBoxLayoutState& aState)
NS_ASSERTION(size.width != NS_INTRINSICSIZE && size.height != NS_INTRINSICSIZE,
"non-intrinsic size expected");
nsSize minSize = GetMinSize(aState);
nsSize minSize = GetXULMinSize(aState);
nsSize maxSize = GetMaxSize(aState);
if (!widthSet && !heightSet) {
@@ -623,7 +623,7 @@ nsImageBoxFrame::GetPrefSize(nsBoxLayoutState& aState)
}
nsSize
nsImageBoxFrame::GetMinSize(nsBoxLayoutState& aState)
nsImageBoxFrame::GetXULMinSize(nsBoxLayoutState& aState)
{
// An image can always scale down to (0,0).
nsSize size(0,0);

View File

@@ -48,7 +48,7 @@ public:
NS_DECL_FRAMEARENA_HELPERS
virtual nsSize GetPrefSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetMinSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULMinSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nscoord GetBoxAscent(nsBoxLayoutState& aBoxLayoutState) override;
virtual void MarkIntrinsicISizesDirty() override;

View File

@@ -131,11 +131,11 @@ nsLeafBoxFrame::GetMinISize(nsRenderingContext *aRenderingContext)
nsBoxLayoutState state(PresContext(), aRenderingContext);
WritingMode wm = GetWritingMode();
LogicalSize minSize(wm, GetMinSize(state));
LogicalSize minSize(wm, GetXULMinSize(state));
// GetMinSize returns border-box size, and we want to return content
// GetXULMinSize 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 GetMinSize added, which is the
// actually just want to subtract what GetXULMinSize added, which is the
// result of GetBorderAndPadding.
nsMargin bp;
GetBorderAndPadding(bp);
@@ -249,7 +249,7 @@ nsLeafBoxFrame::Reflow(nsPresContext* aPresContext,
// this happens sometimes. So lets handle it gracefully.
if (aReflowState.ComputedHeight() == 0) {
nsSize minSize = GetMinSize(state);
nsSize minSize = GetXULMinSize(state);
computedSize.height = minSize.height - m.top - m.bottom;
}
@@ -258,7 +258,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);
nsSize minSize = GetMinSize(state);
nsSize minSize = GetXULMinSize(state);
nsSize maxSize = GetMaxSize(state);
prefSize = BoundsCheck(minSize, prefSize, maxSize);
}
@@ -353,9 +353,9 @@ nsLeafBoxFrame::GetPrefSize(nsBoxLayoutState& aState)
}
/* virtual */ nsSize
nsLeafBoxFrame::GetMinSize(nsBoxLayoutState& aState)
nsLeafBoxFrame::GetXULMinSize(nsBoxLayoutState& aState)
{
return nsBox::GetMinSize(aState);
return nsBox::GetXULMinSize(aState);
}
/* virtual */ nsSize

View File

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

View File

@@ -47,9 +47,9 @@ nsListBoxLayout::GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState)
}
nsSize
nsListBoxLayout::GetMinSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState)
nsListBoxLayout::GetXULMinSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState)
{
nsSize minSize = nsGridRowGroupLayout::GetMinSize(aBox, aBoxLayoutState);
nsSize minSize = nsGridRowGroupLayout::GetXULMinSize(aBox, aBoxLayoutState);
nsListBoxBodyFrame* frame = static_cast<nsListBoxBodyFrame*>(aBox);
if (frame) {

View File

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

View File

@@ -716,9 +716,9 @@ nsMenuFrame::IsSizedToPopup(nsIContent* aContent, bool aRequireAlways)
}
nsSize
nsMenuFrame::GetMinSize(nsBoxLayoutState& aBoxLayoutState)
nsMenuFrame::GetXULMinSize(nsBoxLayoutState& aBoxLayoutState)
{
nsSize size = nsBoxFrame::GetMinSize(aBoxLayoutState);
nsSize size = nsBoxFrame::GetXULMinSize(aBoxLayoutState);
DISPLAY_MIN_SIZE(this, size);
if (IsSizedToPopup(mContent, true))
@@ -1391,7 +1391,7 @@ nsMenuFrame::GetPrefSize(nsBoxLayoutState& aState)
IsSizedToPopup(mContent, false) &&
SizeToPopup(aState, size)) {
// We now need to ensure that size is within the min - max range.
nsSize minSize = nsBoxFrame::GetMinSize(aState);
nsSize minSize = nsBoxFrame::GetXULMinSize(aState);
nsSize maxSize = GetMaxSize(aState);
size = BoundsCheck(minSize, size, maxSize);
}

View File

@@ -81,7 +81,7 @@ public:
NS_DECL_FRAMEARENA_HELPERS
NS_IMETHOD DoLayout(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetMinSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULMinSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetPrefSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual void Init(nsIContent* aContent,

View File

@@ -458,7 +458,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 minSize = GetMinSize(aState);
nsSize minSize = GetXULMinSize(aState);
nsSize maxSize = GetMaxSize(aState);
if (aSizedToPopup) {

View File

@@ -1343,12 +1343,12 @@ nsSliderFrame::GetPrefSize(nsBoxLayoutState& aState)
}
nsSize
nsSliderFrame::GetMinSize(nsBoxLayoutState& aState)
nsSliderFrame::GetXULMinSize(nsBoxLayoutState& aState)
{
EnsureOrient();
// our min size is just our borders and padding
return nsBox::GetMinSize(aState);
return nsBox::GetXULMinSize(aState);
}
nsSize

View File

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

View File

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

View File

@@ -321,7 +321,7 @@ nsSprocketLayout::Layout(nsIFrame* aBox, nsBoxLayoutState& aState)
// opposite axis.
if (!(frameState & NS_STATE_AUTO_STRETCH)) {
nsSize prefSize = child->GetPrefSize(aState);
nsSize minSize = child->GetMinSize(aState);
nsSize minSize = child->GetXULMinSize(aState);
nsSize maxSize = child->GetMaxSize(aState);
prefSize = nsBox::BoundsCheck(minSize, prefSize, maxSize);
@@ -462,7 +462,7 @@ nsSprocketLayout::Layout(nsIFrame* aBox, nsBoxLayoutState& aState)
if (sizeChanged) {
// Our size is different. Sanity check against our maximum allowed size to ensure
// we didn't exceed it.
nsSize minSize = child->GetMinSize(aState);
nsSize minSize = child->GetXULMinSize(aState);
nsSize maxSize = child->GetMaxSize(aState);
maxSize = nsBox::BoundsCheckMinMax(minSize, maxSize);
@@ -745,7 +745,7 @@ nsSprocketLayout::PopulateBoxSizes(nsIFrame* aBox, nsBoxLayoutState& aState, nsB
//if (flexes != 1) {
pref = child->GetPrefSize(aState);
minSize = child->GetMinSize(aState);
minSize = child->GetXULMinSize(aState);
maxSize = nsBox::BoundsCheckMinMax(minSize, child->GetMaxSize(aState));
ascent = child->GetBoxAscent(aState);
nsMargin margin;
@@ -1045,7 +1045,7 @@ nsSprocketLayout::ChildResized(nsIFrame* aBox,
// ok if the height changed then we need to reflow everyone but us at the new height
// so we will set the changed index to be us. And signal that we need a new pass.
nsSize min = aChild->GetMinSize(aState);
nsSize min = aChild->GetXULMinSize(aState);
nsSize max = nsBox::BoundsCheckMinMax(min, aChild->GetMaxSize(aState));
AddMargin(aChild, max);
@@ -1080,7 +1080,7 @@ nsSprocketLayout::ChildResized(nsIFrame* aBox,
}
if (childActualWidth > childLayoutWidth) {
nsSize min = aChild->GetMinSize(aState);
nsSize min = aChild->GetXULMinSize(aState);
nsSize max = nsBox::BoundsCheckMinMax(min, aChild->GetMaxSize(aState));
AddMargin(aChild, max);
@@ -1360,7 +1360,7 @@ nsSprocketLayout::GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aState)
}
nsSize
nsSprocketLayout::GetMinSize(nsIFrame* aBox, nsBoxLayoutState& aState)
nsSprocketLayout::GetXULMinSize(nsIFrame* aBox, nsBoxLayoutState& aState)
{
nsSize minSize (0, 0);
bool isHorizontal = IsHorizontal(aBox);
@@ -1382,7 +1382,7 @@ nsSprocketLayout::GetMinSize(nsIFrame* aBox, nsBoxLayoutState& aState)
// ignore collapsed children
if (!child->IsCollapsed())
{
nsSize min = child->GetMinSize(aState);
nsSize min = child->GetXULMinSize(aState);
nsSize pref(0,0);
// if the child is not flexible then
@@ -1452,7 +1452,7 @@ nsSprocketLayout::GetMaxSize(nsIFrame* aBox, nsBoxLayoutState& aState)
if (!child->IsCollapsed())
{
// if completely redefined don't even ask our child for its size.
nsSize min = child->GetMinSize(aState);
nsSize min = child->GetXULMinSize(aState);
nsSize max = nsBox::BoundsCheckMinMax(min, child->GetMaxSize(aState));
AddMargin(child, max);

View File

@@ -71,7 +71,7 @@ public:
NS_IMETHOD Layout(nsIFrame* aBox, nsBoxLayoutState& aState) override;
virtual nsSize GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetMinSize(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

@@ -85,14 +85,14 @@ nsStackLayout::GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aState)
}
nsSize
nsStackLayout::GetMinSize(nsIFrame* aBox, nsBoxLayoutState& aState)
nsStackLayout::GetXULMinSize(nsIFrame* aBox, nsBoxLayoutState& aState)
{
nsSize minSize (0, 0);
nsIFrame* child = nsBox::GetChildBox(aBox);
while (child) {
if (child->StyleXUL()->mStretchStack) {
nsSize min = child->GetMinSize(aState);
nsSize min = child->GetXULMinSize(aState);
AddMargin(child, min);
nsMargin offset;
@@ -118,7 +118,7 @@ nsStackLayout::GetMaxSize(nsIFrame* aBox, nsBoxLayoutState& aState)
nsIFrame* child = nsBox::GetChildBox(aBox);
while (child) {
if (child->StyleXUL()->mStretchStack) {
nsSize min = child->GetMinSize(aState);
nsSize min = child->GetXULMinSize(aState);
nsSize max = child->GetMaxSize(aState);
max = nsBox::BoundsCheckMinMax(min, max);
@@ -298,7 +298,7 @@ nsStackLayout::Layout(nsIFrame* aBox, nsBoxLayoutState& aState)
//
// Margins on the child are also included in the edge offsets
if (offsetSpecified) {
nsSize min = child->GetMinSize(aState);
nsSize min = child->GetXULMinSize(aState);
nsSize max = child->GetMaxSize(aState);
if (offsetSpecified & SPECIFIED_LEFT) {
childRect.x = clientRect.x + offset.left + margin.left;

View File

@@ -35,7 +35,7 @@ public:
NS_IMETHOD Layout(nsIFrame* aBox, nsBoxLayoutState& aState) override;
virtual nsSize GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetMinSize(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

@@ -1126,7 +1126,7 @@ nsTextBoxFrame::GetPrefSize(nsBoxLayoutState& aBoxLayoutState)
* Ok return our dimensions
*/
nsSize
nsTextBoxFrame::GetMinSize(nsBoxLayoutState& aBoxLayoutState)
nsTextBoxFrame::GetXULMinSize(nsBoxLayoutState& aBoxLayoutState)
{
CalcTextSize(aBoxLayoutState);

View File

@@ -20,7 +20,7 @@ public:
NS_DECL_FRAMEARENA_HELPERS
virtual nsSize GetPrefSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetMinSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULMinSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nscoord GetBoxAscent(nsBoxLayoutState& aBoxLayoutState) override;
NS_IMETHOD DoLayout(nsBoxLayoutState& aBoxLayoutState) override;
virtual void MarkIntrinsicISizesDirty() override;

View File

@@ -183,7 +183,7 @@ nsTreeBodyFrame::Init(nsIContent* aContent,
}
nsSize
nsTreeBodyFrame::GetMinSize(nsBoxLayoutState& aBoxLayoutState)
nsTreeBodyFrame::GetXULMinSize(nsBoxLayoutState& aBoxLayoutState)
{
EnsureView();

View File

@@ -124,7 +124,7 @@ public:
void ManageReflowCallback(const nsRect& aRect, nscoord aHorzWidth);
virtual nsSize GetMinSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULMinSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual void SetBounds(nsBoxLayoutState& aBoxLayoutState, const nsRect& aRect,
bool aRemoveOverflowArea = false) override;