Bug 1053986 - Rename nsIFrame::GetBoxAscent to GetXULBoxAscent. r?dholbert
Written purely with sed, over .h and .cpp files in layout/.
MozReview-Commit-ID: EDkbMQKqPg6
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -8792,17 +8792,17 @@ nsFrame::GetXULFlex()
return metrics->mFlex;
metrics->mFlex = nsBox::GetXULFlex();
return metrics->mFlex;
}
nscoord
-nsFrame::GetBoxAscent(nsBoxLayoutState& aState)
+nsFrame::GetXULBoxAscent(nsBoxLayoutState& aState)
{
nsBoxLayoutMetrics *metrics = BoxMetrics();
if (!DoesNeedRecalc(metrics->mAscent))
return metrics->mAscent;
if (IsCollapsed()) {
metrics->mAscent = 0;
} else {
--- a/layout/generic/nsFrame.h
+++ b/layout/generic/nsFrame.h
@@ -407,17 +407,17 @@ public:
// in this function assumes there is no child frame that can be targeted.
virtual ContentOffsets CalcContentOffsetsFromFramePoint(nsPoint aPoint);
// Box layout methods
virtual nsSize GetXULPrefSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULMinSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULMaxSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nscoord GetXULFlex() override;
- virtual nscoord GetBoxAscent(nsBoxLayoutState& aBoxLayoutState) override;
+ virtual nscoord GetXULBoxAscent(nsBoxLayoutState& aBoxLayoutState) override;
// We compute and store the HTML content's overflow area. So don't
// try to compute it in the box code.
virtual bool ComputesOwnOverflowArea() override { return true; }
//--------------------------------------------------
// Additional methods
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -1375,22 +1375,22 @@ nsXULScrollFrame::GetPadding(nsMargin& a
nsIAtom*
nsXULScrollFrame::GetType() const
{
return nsGkAtoms::scrollFrame;
}
nscoord
-nsXULScrollFrame::GetBoxAscent(nsBoxLayoutState& aState)
+nsXULScrollFrame::GetXULBoxAscent(nsBoxLayoutState& aState)
{
if (!mHelper.mScrolledFrame)
return 0;
- nscoord ascent = mHelper.mScrolledFrame->GetBoxAscent(aState);
+ nscoord ascent = mHelper.mScrolledFrame->GetXULBoxAscent(aState);
nsMargin m(0,0,0,0);
GetBorderAndPadding(m);
ascent += m.top;
GetMargin(m);
ascent += m.top;
return ascent;
}
--- a/layout/generic/nsGfxScrollFrame.h
+++ b/layout/generic/nsGfxScrollFrame.h
@@ -1122,17 +1122,17 @@ public:
// nsIAnonymousContentCreator
virtual nsresult CreateAnonymousContent(nsTArray<ContentInfo>& aElements) override;
virtual void AppendAnonymousContentTo(nsTArray<nsIContent*>& aElements,
uint32_t aFilter) override;
virtual nsSize GetXULMinSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULPrefSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULMaxSize(nsBoxLayoutState& aBoxLayoutState) override;
- virtual nscoord GetBoxAscent(nsBoxLayoutState& aBoxLayoutState) override;
+ virtual nscoord GetXULBoxAscent(nsBoxLayoutState& aBoxLayoutState) override;
NS_IMETHOD DoLayout(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsresult GetPadding(nsMargin& aPadding) override;
virtual bool GetBorderRadii(const nsSize& aFrameSize, const nsSize& aBorderArea,
Sides aSkipSides, nscoord aRadii[8]) const override {
return mHelper.GetBorderRadii(aFrameSize, aBorderArea, aSkipSides, aRadii);
}
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -2894,17 +2894,17 @@ public:
* being scrolled. Usually it's (0,0).
*/
virtual nsSize GetXULMinSizeForScrollArea(nsBoxLayoutState& aBoxLayoutState) = 0;
// Implemented in nsBox, used in nsBoxFrame
uint32_t GetXULOrdinal();
virtual nscoord GetXULFlex() = 0;
- virtual nscoord GetBoxAscent(nsBoxLayoutState& aBoxLayoutState) = 0;
+ virtual nscoord GetXULBoxAscent(nsBoxLayoutState& aBoxLayoutState) = 0;
virtual bool IsCollapsed() = 0;
// This does not alter the overflow area. If the caller is changing
// the box size, the caller is responsible for updating the overflow
// 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;
--- a/layout/xul/nsBox.cpp
+++ b/layout/xul/nsBox.cpp
@@ -477,17 +477,17 @@ nsIFrame::GetXULOrdinal()
ordinal = value.ToInteger(&error);
}
}
return ordinal;
}
nscoord
-nsBox::GetBoxAscent(nsBoxLayoutState& aState)
+nsBox::GetXULBoxAscent(nsBoxLayoutState& aState)
{
if (IsCollapsed())
return 0;
return GetXULPrefSize(aState).height;
}
bool
--- a/layout/xul/nsBox.h
+++ b/layout/xul/nsBox.h
@@ -18,17 +18,17 @@ public:
friend class nsIFrame;
static void Shutdown();
virtual nsSize GetXULPrefSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULMinSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULMaxSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nscoord GetXULFlex() override;
- virtual nscoord GetBoxAscent(nsBoxLayoutState& aBoxLayoutState) override;
+ virtual nscoord GetXULBoxAscent(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULMinSizeForScrollArea(nsBoxLayoutState& aBoxLayoutState) override;
virtual bool IsCollapsed() override;
virtual void SetBounds(nsBoxLayoutState& aBoxLayoutState, const nsRect& aRect,
bool aRemoveOverflowAreas = false) override;
--- a/layout/xul/nsBoxFrame.cpp
+++ b/layout/xul/nsBoxFrame.cpp
@@ -712,17 +712,17 @@ nsBoxFrame::Reflow(nsPresContext*
// get the ascent
LogicalSize boxSize = GetLogicalSize(wm);
nscoord ascent = boxSize.BSize(wm);
// getting the ascent could be a lot of work. Don't get it if
// we are the root. The viewport doesn't care about it.
if (!(mState & NS_STATE_IS_ROOT)) {
- ascent = GetBoxAscent(state);
+ ascent = GetXULBoxAscent(state);
}
aDesiredSize.SetSize(wm, boxSize);
aDesiredSize.SetBlockStartAscent(ascent);
aDesiredSize.mOverflowAreas = GetOverflowAreas();
#ifdef DO_NOISY_REFLOW
@@ -781,32 +781,32 @@ nsBoxFrame::GetXULPrefSize(nsBoxLayoutSt
nsSize minSize = GetXULMinSize(aBoxLayoutState);
nsSize maxSize = GetXULMaxSize(aBoxLayoutState);
mPrefSize = BoundsCheck(minSize, size, maxSize);
return mPrefSize;
}
nscoord
-nsBoxFrame::GetBoxAscent(nsBoxLayoutState& aBoxLayoutState)
+nsBoxFrame::GetXULBoxAscent(nsBoxLayoutState& aBoxLayoutState)
{
if (!DoesNeedRecalc(mAscent))
return mAscent;
#ifdef DEBUG_LAYOUT
PropagateDebug(aBoxLayoutState);
#endif
if (IsCollapsed())
return 0;
if (mLayoutManager)
mAscent = mLayoutManager->GetAscent(this, aBoxLayoutState);
else
- mAscent = nsBox::GetBoxAscent(aBoxLayoutState);
+ mAscent = nsBox::GetXULBoxAscent(aBoxLayoutState);
return mAscent;
}
nsSize
nsBoxFrame::GetXULMinSize(nsBoxLayoutState& aBoxLayoutState)
{
NS_ASSERTION(aBoxLayoutState.GetRenderingContext(),
@@ -929,17 +929,17 @@ nsBoxFrame::DoLayout(nsBoxLayoutState& a
desiredSize.Height() = mRect.height;
// get the ascent (cribbed from ::Reflow)
nscoord ascent = mRect.height;
// getting the ascent could be a lot of work. Don't get it if
// we are the root. The viewport doesn't care about it.
if (!(mState & NS_STATE_IS_ROOT)) {
- ascent = GetBoxAscent(aState);
+ ascent = GetXULBoxAscent(aState);
}
desiredSize.SetBlockStartAscent(ascent);
desiredSize.mOverflowAreas = GetOverflowAreas();
AddStateBits(NS_FRAME_IN_REFLOW);
// Set up a |reflowStatus| to pass into ReflowAbsoluteFrames
// (just a dummy value; hopefully that's OK)
nsReflowStatus reflowStatus = NS_FRAME_COMPLETE;
@@ -1785,17 +1785,17 @@ nsBoxFrame::DisplayDebugInfoFor(nsIFrame
nsIFrame::AddCSSMinSize (state, child, minSizeCSS, widthSet, heightSet);
nsIFrame::AddCSSMaxSize (child, maxSizeCSS, widthSet, heightSet);
nsIFrame::AddCSSFlex (child, flexCSS);
nsSize prefSize = child->GetXULPrefSize(state);
nsSize minSize = child->GetXULMinSize(state);
nsSize maxSize = child->GetXULMaxSize(state);
nscoord flexSize = child->GetXULFlex();
- nscoord ascentSize = child->GetBoxAscent(state);
+ nscoord ascentSize = child->GetXULBoxAscent(state);
char min[100];
char pref[100];
char max[100];
char calc[100];
char flex[100];
char ascent[100];
--- a/layout/xul/nsBoxFrame.h
+++ b/layout/xul/nsBoxFrame.h
@@ -60,17 +60,17 @@ public:
virtual nsBoxLayout* GetLayoutManager() override { return mLayoutManager; }
virtual nsresult RelayoutChildAtOrdinal(nsIFrame* aChild) override;
virtual nsSize GetXULPrefSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULMinSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULMaxSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nscoord GetXULFlex() override;
- virtual nscoord GetBoxAscent(nsBoxLayoutState& aBoxLayoutState) override;
+ virtual nscoord GetXULBoxAscent(nsBoxLayoutState& aBoxLayoutState) override;
#ifdef DEBUG_LAYOUT
virtual nsresult SetDebug(nsBoxLayoutState& aBoxLayoutState, bool aDebug) override;
virtual nsresult GetDebug(bool& aDebug) override;
#endif
virtual Valignment GetVAlign() const override { return mValign; }
virtual Halignment GetHAlign() const override { return mHalign; }
NS_IMETHOD DoLayout(nsBoxLayoutState& aBoxLayoutState) override;
--- a/layout/xul/nsImageBoxFrame.cpp
+++ b/layout/xul/nsImageBoxFrame.cpp
@@ -630,17 +630,17 @@ nsImageBoxFrame::GetXULMinSize(nsBoxLayo
DISPLAY_MIN_SIZE(this, size);
AddBorderAndPadding(size);
bool widthSet, heightSet;
nsIFrame::AddCSSMinSize(aState, this, size, widthSet, heightSet);
return size;
}
nscoord
-nsImageBoxFrame::GetBoxAscent(nsBoxLayoutState& aState)
+nsImageBoxFrame::GetXULBoxAscent(nsBoxLayoutState& aState)
{
return GetXULPrefSize(aState).height;
}
nsIAtom*
nsImageBoxFrame::GetType() const
{
return nsGkAtoms::imageBoxFrame;
--- a/layout/xul/nsImageBoxFrame.h
+++ b/layout/xul/nsImageBoxFrame.h
@@ -44,17 +44,17 @@ public:
typedef mozilla::layers::ImageContainer ImageContainer;
typedef mozilla::layers::LayerManager LayerManager;
friend class nsDisplayXULImage;
NS_DECL_FRAMEARENA_HELPERS
virtual nsSize GetXULPrefSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULMinSize(nsBoxLayoutState& aBoxLayoutState) override;
- virtual nscoord GetBoxAscent(nsBoxLayoutState& aBoxLayoutState) override;
+ virtual nscoord GetXULBoxAscent(nsBoxLayoutState& aBoxLayoutState) override;
virtual void MarkIntrinsicISizesDirty() override;
nsresult Notify(imgIRequest *aRequest, int32_t aType, const nsIntRect* aData);
friend nsIFrame* NS_NewImageBoxFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
virtual void Init(nsIContent* aContent,
nsContainerFrame* aParent,
--- a/layout/xul/nsLeafBoxFrame.cpp
+++ b/layout/xul/nsLeafBoxFrame.cpp
@@ -301,17 +301,17 @@ nsLeafBoxFrame::Reflow(nsPresContext*
SetBounds(state, r);
// layout our children
Layout(state);
// ok our child could have gotten bigger. So lets get its bounds
aDesiredSize.Width() = mRect.width;
aDesiredSize.Height() = mRect.height;
- aDesiredSize.SetBlockStartAscent(GetBoxAscent(state));
+ aDesiredSize.SetBlockStartAscent(GetXULBoxAscent(state));
// the overflow rect is set in SetBounds() above
aDesiredSize.mOverflowAreas = GetOverflowAreas();
#ifdef DO_NOISY_REFLOW
{
printf("%p ** nsLBF(done) W:%d H:%d ", this, aDesiredSize.Width(), aDesiredSize.Height());
@@ -366,19 +366,19 @@ nsLeafBoxFrame::GetXULMaxSize(nsBoxLayou
/* virtual */ nscoord
nsLeafBoxFrame::GetXULFlex()
{
return nsBox::GetXULFlex();
}
/* virtual */ nscoord
-nsLeafBoxFrame::GetBoxAscent(nsBoxLayoutState& aState)
+nsLeafBoxFrame::GetXULBoxAscent(nsBoxLayoutState& aState)
{
- return nsBox::GetBoxAscent(aState);
+ return nsBox::GetXULBoxAscent(aState);
}
/* virtual */ void
nsLeafBoxFrame::MarkIntrinsicISizesDirty()
{
// Don't call base class method, since everything it does is within an
// IsXULBoxWrapped check.
}
--- a/layout/xul/nsLeafBoxFrame.h
+++ b/layout/xul/nsLeafBoxFrame.h
@@ -15,17 +15,17 @@ public:
NS_DECL_FRAMEARENA_HELPERS
friend nsIFrame* NS_NewLeafBoxFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
virtual nsSize GetXULPrefSize(nsBoxLayoutState& aState) override;
virtual nsSize GetXULMinSize(nsBoxLayoutState& aState) override;
virtual nsSize GetXULMaxSize(nsBoxLayoutState& aState) override;
virtual nscoord GetXULFlex() override;
- virtual nscoord GetBoxAscent(nsBoxLayoutState& aState) override;
+ virtual nscoord GetXULBoxAscent(nsBoxLayoutState& aState) override;
virtual nsIAtom* GetType() const override;
virtual bool IsFrameOfType(uint32_t aFlags) const override
{
// This is bogus, but it's what we've always done.
// Note that nsLeafFrame is also eReplacedContainsBlock.
return nsLeafFrame::IsFrameOfType(aFlags &
~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock | nsIFrame::eXULBox));
--- a/layout/xul/nsSprocketLayout.cpp
+++ b/layout/xul/nsSprocketLayout.cpp
@@ -742,17 +742,17 @@ nsSprocketLayout::PopulateBoxSizes(nsIFr
if (!collapsed) {
// only one flexible child? Cool we will just make its preferred size
// 0 then and not even have to ask for it.
//if (flexes != 1) {
pref = child->GetXULPrefSize(aState);
minSize = child->GetXULMinSize(aState);
maxSize = nsBox::BoundsCheckMinMax(minSize, child->GetXULMaxSize(aState));
- ascent = child->GetBoxAscent(aState);
+ ascent = child->GetXULBoxAscent(aState);
nsMargin margin;
child->GetMargin(margin);
ascent += margin.top;
//}
pref = nsBox::BoundsCheck(minSize, pref, maxSize);
AddMargin(child, pref);
@@ -933,17 +933,17 @@ nsSprocketLayout::AlignChildren(nsIFrame
nsIFrame::Halignment halign;
nsIFrame::Valignment valign;
nscoord maxAscent;
bool isLTR;
if (isHorizontal) {
valign = aBox->GetVAlign();
if (valign == nsBoxFrame::vAlign_BaseLine) {
- maxAscent = aBox->GetBoxAscent(aState);
+ maxAscent = aBox->GetXULBoxAscent(aState);
}
} else {
isLTR = GetFrameDirection(aBox) == NS_STYLE_DIRECTION_LTR;
halign = aBox->GetHAlign();
}
nsIFrame* child = nsBox::GetChildBox(aBox);
while (child) {
@@ -968,17 +968,17 @@ nsSprocketLayout::AlignChildren(nsIFrame
y = (startAlign + endAlign) / 2;
break;
case nsBoxFrame::vAlign_Bottom:
y = endAlign;
break;
case nsBoxFrame::vAlign_BaseLine:
// Alignments don't force the box to grow (only sizes do),
// so keep the children within the box.
- y = maxAscent - child->GetBoxAscent(aState);
+ y = maxAscent - child->GetXULBoxAscent(aState);
y = std::max(startAlign, y);
y = std::min(y, endAlign);
break;
}
childRect.y = y;
} else { // vertical box
@@ -1508,17 +1508,17 @@ nsSprocketLayout::GetAscent(nsIFrame* aB
nsIFrame* child = nsBox::GetChildBox(aBox);
while (child)
{
// ignore collapsed children
//if (!child->IsCollapsed())
//{
// if completely redefined don't even ask our child for its size.
- nscoord ascent = child->GetBoxAscent(aState);
+ nscoord ascent = child->GetXULBoxAscent(aState);
nsMargin margin;
child->GetMargin(margin);
ascent += margin.top;
if (isHorizontal)
{
if (ascent > vAscent)
--- a/layout/xul/nsStackLayout.cpp
+++ b/layout/xul/nsStackLayout.cpp
@@ -142,17 +142,17 @@ nsStackLayout::GetXULMaxSize(nsIFrame* a
nscoord
nsStackLayout::GetAscent(nsIFrame* aBox, nsBoxLayoutState& aState)
{
nscoord vAscent = 0;
nsIFrame* child = nsBox::GetChildBox(aBox);
while (child) {
- nscoord ascent = child->GetBoxAscent(aState);
+ nscoord ascent = child->GetXULBoxAscent(aState);
nsMargin margin;
child->GetMargin(margin);
ascent += margin.top;
if (ascent > vAscent)
vAscent = ascent;
child = nsBox::GetNextBox(child);
}
--- a/layout/xul/nsTextBoxFrame.cpp
+++ b/layout/xul/nsTextBoxFrame.cpp
@@ -1145,17 +1145,17 @@ nsTextBoxFrame::GetXULMinSize(nsBoxLayou
AddBorderAndPadding(size);
bool widthSet, heightSet;
nsIFrame::AddCSSMinSize(aBoxLayoutState, this, size, widthSet, heightSet);
return size;
}
nscoord
-nsTextBoxFrame::GetBoxAscent(nsBoxLayoutState& aBoxLayoutState)
+nsTextBoxFrame::GetXULBoxAscent(nsBoxLayoutState& aBoxLayoutState)
{
CalcTextSize(aBoxLayoutState);
nscoord ascent = mAscent;
nsMargin m(0,0,0,0);
GetBorderAndPadding(m);
--- a/layout/xul/nsTextBoxFrame.h
+++ b/layout/xul/nsTextBoxFrame.h
@@ -16,17 +16,17 @@ class nsTextBoxFrame : public nsLeafBoxF
{
public:
NS_DECL_QUERYFRAME_TARGET(nsTextBoxFrame)
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS
virtual nsSize GetXULPrefSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULMinSize(nsBoxLayoutState& aBoxLayoutState) override;
- virtual nscoord GetBoxAscent(nsBoxLayoutState& aBoxLayoutState) override;
+ virtual nscoord GetXULBoxAscent(nsBoxLayoutState& aBoxLayoutState) override;
NS_IMETHOD DoLayout(nsBoxLayoutState& aBoxLayoutState) override;
virtual void MarkIntrinsicISizesDirty() override;
enum CroppingStyle { CropNone, CropLeft, CropRight, CropCenter, CropAuto };
friend nsIFrame* NS_NewTextBoxFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
virtual void Init(nsIContent* aContent,