Bug 1053986 - Rename nsIFrame::SetBounds to SetXULBounds. r=dholbert

This is a manual subset of changes written with sed, over .h and .cpp
files in layout/, with additional manual indentation fixes.

MozReview-Commit-ID: weRWGmQLjh
This commit is contained in:
L. David Baron 2016-04-20 21:28:32 -07:00
parent 633e18a890
commit 867eb820ad
14 changed files with 36 additions and 35 deletions

View File

@ -1445,7 +1445,7 @@ protected:
if (!mHelper.IsLTR()) {
aRect.x = mHelper.mScrollPort.XMost() - aScrollPosition.x - aRect.width;
}
mHelper.mScrolledFrame->SetBounds(aState, aRect, aRemoveOverflowAreas);
mHelper.mScrolledFrame->SetXULBounds(aState, aRect, aRemoveOverflowAreas);
}
private:

View File

@ -2906,8 +2906,8 @@ public:
// area. It's enough to just call Layout or SyncLayout on the
// box. You can pass true to aRemoveOverflowArea as a
// convenience.
virtual void SetBounds(nsBoxLayoutState& aBoxLayoutState, const nsRect& aRect,
bool aRemoveOverflowAreas = false) = 0;
virtual void SetXULBounds(nsBoxLayoutState& aBoxLayoutState, const nsRect& aRect,
bool aRemoveOverflowAreas = false) = 0;
nsresult Layout(nsBoxLayoutState& aBoxLayoutState);
// Box methods. Note that these do NOT just get the CSS border, padding,
// etc. They also talk to nsITheme.

View File

@ -230,9 +230,9 @@ nsIFrame::GetClientRect(nsRect& aClientRect)
}
void
nsBox::SetBounds(nsBoxLayoutState& aState, const nsRect& aRect, bool aRemoveOverflowAreas)
nsBox::SetXULBounds(nsBoxLayoutState& aState, const nsRect& aRect, bool aRemoveOverflowAreas)
{
NS_BOX_ASSERTION(this, aRect.width >=0 && aRect.height >= 0, "SetBounds Size < 0");
NS_BOX_ASSERTION(this, aRect.width >=0 && aRect.height >= 0, "SetXULBounds Size < 0");
nsRect rect(mRect);

View File

@ -29,8 +29,8 @@ public:
virtual bool IsXULCollapsed() override;
virtual void SetBounds(nsBoxLayoutState& aBoxLayoutState, const nsRect& aRect,
bool aRemoveOverflowAreas = false) override;
virtual void SetXULBounds(nsBoxLayoutState& aBoxLayoutState, const nsRect& aRect,
bool aRemoveOverflowAreas = false) override;
virtual nsresult GetBorder(nsMargin& aBorderAndPadding) override;
virtual nsresult GetPadding(nsMargin& aBorderAndPadding) override;

View File

@ -703,7 +703,7 @@ nsBoxFrame::Reflow(nsPresContext* aPresContext,
nsSize physicalSize = computedSize.GetPhysicalSize(wm);
nsRect r(mRect.x, mRect.y, physicalSize.width, physicalSize.height);
SetBounds(state, r);
SetXULBounds(state, r);
// layout our children
Layout(state);
@ -1924,7 +1924,7 @@ nsBoxFrame::LayoutChildAt(nsBoxLayoutState& aState, nsIFrame* aBox, const nsRect
{
// get the current rect
nsRect oldRect(aBox->GetRect());
aBox->SetBounds(aState, aRect);
aBox->SetXULBounds(aState, aRect);
bool layout = NS_SUBTREE_DIRTY(aBox);

View File

@ -298,7 +298,7 @@ nsLeafBoxFrame::Reflow(nsPresContext* aPresContext,
nsRect r(mRect.x, mRect.y, computedSize.width, computedSize.height);
SetBounds(state, r);
SetXULBounds(state, r);
// layout our children
Layout(state);
@ -308,7 +308,7 @@ nsLeafBoxFrame::Reflow(nsPresContext* aPresContext,
aDesiredSize.Height() = mRect.height;
aDesiredSize.SetBlockStartAscent(GetXULBoxAscent(state));
// the overflow rect is set in SetBounds() above
// the overflow rect is set in SetXULBounds() above
aDesiredSize.mOverflowAreas = GetOverflowAreas();
#ifdef DO_NOISY_REFLOW

View File

@ -161,7 +161,7 @@ nsListBoxLayout::LayoutInternal(nsIFrame* aBox, nsBoxLayoutState& aState)
childRect.height = rowHeight;
childRect.Deflate(margin);
box->SetBounds(aState, childRect);
box->SetXULBounds(aState, childRect);
box->Layout(aState);
} else {
// if the child did not need to be relayed out. Then its easy.
@ -175,7 +175,7 @@ nsListBoxLayout::LayoutInternal(nsIFrame* aBox, nsBoxLayoutState& aState)
redrawStart = newPos;
childRect.y = newPos;
box->SetBounds(aState, childRect);
box->SetXULBounds(aState, childRect);
}
// Ok now the available size gets smaller and we move the

View File

@ -469,7 +469,7 @@ nsMenuPopupFrame::LayoutPopup(nsBoxLayoutState& aState, nsIFrame* aParentMenu,
// if the size changed then set the bounds to be the preferred size
bool sizeChanged = (mPrefSize != prefSize);
if (sizeChanged) {
SetBounds(aState, nsRect(0, 0, prefSize.width, prefSize.height), false);
SetXULBounds(aState, nsRect(0, 0, prefSize.width, prefSize.height), false);
mPrefSize = prefSize;
}
@ -1524,7 +1524,7 @@ nsMenuPopupFrame::SetPopupPosition(nsIFrame* aAnchorFrame, bool aIsMove, bool aS
if (aSizedToPopup) {
nsBoxLayoutState state(PresContext());
// XXXndeakin can parentSize.width still extend outside?
SetBounds(state, mRect);
SetXULBounds(state, mRect);
}
return NS_OK;

View File

@ -455,7 +455,7 @@ nsSprocketLayout::Layout(nsIFrame* aBox, nsBoxLayoutState& aState)
// If our old rect is different, then we know our size changed and we cache that fact
// in the |sizeChanged| variable.
child->SetBounds(aState, childRect);
child->SetXULBounds(aState, childRect);
bool sizeChanged = (childRect.width != oldRect.width ||
childRect.height != oldRect.height);
@ -474,7 +474,7 @@ nsSprocketLayout::Layout(nsIFrame* aBox, nsBoxLayoutState& aState)
childRect.height = maxSize.height;
// set it again
child->SetBounds(aState, childRect);
child->SetXULBounds(aState, childRect);
}
// If we already determined that layout was required or if our size has changed, then
@ -550,7 +550,7 @@ nsSprocketLayout::Layout(nsIFrame* aBox, nsBoxLayoutState& aState)
if (childRect.width >= margin.left + margin.right && childRect.height >= margin.top + margin.bottom)
childRect.Deflate(margin);
child->SetBounds(aState, newChildRect);
child->SetXULBounds(aState, newChildRect);
// If we are the first box that changed size, then we don't need to do a second pass
if (count == 0)
@ -608,7 +608,7 @@ nsSprocketLayout::Layout(nsIFrame* aBox, nsBoxLayoutState& aState)
if (tmpClientRect.height > originalSize.height)
bounds.height = tmpClientRect.height;
aBox->SetBounds(aState, bounds);
aBox->SetXULBounds(aState, bounds);
}
}
@ -628,7 +628,7 @@ nsSprocketLayout::Layout(nsIFrame* aBox, nsBoxLayoutState& aState)
nsRect childRect(child->GetRect());
childRect.x += (x - origX);
childRect.y += (y - origY);
child->SetBounds(aState, childRect);
child->SetXULBounds(aState, childRect);
child = nsBox::GetNextBox(child);
}
}
@ -1003,7 +1003,7 @@ nsSprocketLayout::AlignChildren(nsIFrame* aBox,
}
if (childRect.TopLeft() != child->GetPosition()) {
child->SetBounds(aState, childRect);
child->SetXULBounds(aState, childRect);
}
child = nsBox::GetNextBox(child);
@ -1135,7 +1135,7 @@ nsSprocketLayout::ChildResized(nsIFrame* aBox,
if (rect.width >= margin.left + margin.right && rect.height >= margin.top + margin.bottom)
rect.Deflate(margin);
aChild->SetBounds(aState, rect);
aChild->SetXULBounds(aState, rect);
aChild->Layout(aState);
}

View File

@ -336,7 +336,7 @@ nsStackLayout::Layout(nsIFrame* aBox, nsBoxLayoutState& aState)
}
// Now place the child.
child->SetBounds(aState, childRect);
child->SetXULBounds(aState, childRect);
// Flow the child.
child->Layout(aState);
@ -377,7 +377,7 @@ nsStackLayout::Layout(nsIFrame* aBox, nsBoxLayoutState& aState)
if (clientRect.height > bounds.height)
bounds.height = clientRect.height;
aBox->SetBounds(aState, bounds);
aBox->SetXULBounds(aState, bounds);
}
return NS_OK;

View File

@ -404,14 +404,14 @@ nsTreeBodyFrame::ManageReflowCallback(const nsRect& aRect, nscoord aHorzWidth)
}
void
nsTreeBodyFrame::SetBounds(nsBoxLayoutState& aBoxLayoutState, const nsRect& aRect,
bool aRemoveOverflowArea)
nsTreeBodyFrame::SetXULBounds(nsBoxLayoutState& aBoxLayoutState, const nsRect& aRect,
bool aRemoveOverflowArea)
{
nscoord horzWidth = CalcHorzWidth(GetScrollParts());
ManageReflowCallback(aRect, horzWidth);
mHorzWidth = horzWidth;
nsLeafBoxFrame::SetBounds(aBoxLayoutState, aRect, aRemoveOverflowArea);
nsLeafBoxFrame::SetXULBounds(aBoxLayoutState, aRect, aRemoveOverflowArea);
}

View File

@ -125,8 +125,8 @@ public:
void ManageReflowCallback(const nsRect& aRect, nscoord aHorzWidth);
virtual nsSize GetXULMinSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual void SetBounds(nsBoxLayoutState& aBoxLayoutState, const nsRect& aRect,
bool aRemoveOverflowArea = false) override;
virtual void SetXULBounds(nsBoxLayoutState& aBoxLayoutState, const nsRect& aRect,
bool aRemoveOverflowArea = false) override;
// nsIReflowCallback
virtual bool ReflowFinished() override;

View File

@ -143,12 +143,13 @@ nsTreeColFrame::AttributeChanged(int32_t aNameSpaceID,
}
void
nsTreeColFrame::SetBounds(nsBoxLayoutState& aBoxLayoutState,
const nsRect& aRect,
bool aRemoveOverflowArea) {
nsTreeColFrame::SetXULBounds(nsBoxLayoutState& aBoxLayoutState,
const nsRect& aRect,
bool aRemoveOverflowArea)
{
nscoord oldWidth = mRect.width;
nsBoxFrame::SetBounds(aBoxLayoutState, aRect, aRemoveOverflowArea);
nsBoxFrame::SetXULBounds(aBoxLayoutState, aRect, aRemoveOverflowArea);
if (mRect.width != oldWidth) {
nsITreeBoxObject* treeBoxObject = GetTreeBoxObject();
if (treeBoxObject) {

View File

@ -33,8 +33,8 @@ public:
nsIAtom* aAttribute,
int32_t aModType) override;
virtual void SetBounds(nsBoxLayoutState& aBoxLayoutState, const nsRect& aRect,
bool aRemoveOverflowArea = false) override;
virtual void SetXULBounds(nsBoxLayoutState& aBoxLayoutState, const nsRect& aRect,
bool aRemoveOverflowArea = false) override;
friend nsIFrame* NS_NewTreeColFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext);