Skip to content

Commit

Permalink
Bug 1053986 - Rename nsIFrame::IsBoxFrame to IsXULBoxFrame. r=dholbert
Browse files Browse the repository at this point in the history
Written purely with sed, over .h and .cpp files in layout/.

But with additional manual changes in accessible/.

MozReview-Commit-ID: W0wUPoQsVH
  • Loading branch information
dbaron committed Apr 21, 2016
1 parent f8384ec commit 7bfe0e2
Show file tree
Hide file tree
Showing 14 changed files with 36 additions and 36 deletions.
4 changes: 2 additions & 2 deletions accessible/generic/Accessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,9 @@ Accessible::NativeState()

// XXX we should look at layout for non XUL box frames, but need to decide
// how that interacts with ARIA.
if (HasOwnContent() && mContent->IsXULElement() && frame->IsBoxFrame()) {
if (HasOwnContent() && mContent->IsXULElement() && frame->IsXULBoxFrame()) {
const nsStyleXUL* xulStyle = frame->StyleXUL();
if (xulStyle && frame->IsBoxFrame()) {
if (xulStyle && frame->IsXULBoxFrame()) {
// In XUL all boxes are either vertical or horizontal
if (xulStyle->mBoxOrient == NS_STYLE_BOX_ORIENT_VERTICAL)
state |= states::VERTICAL;
Expand Down
2 changes: 1 addition & 1 deletion layout/base/RestyleManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ static bool
HasBoxAncestor(nsIFrame* aFrame)
{
for (nsIFrame* f = aFrame; f; f = f->GetParent()) {
if (f->IsBoxFrame()) {
if (f->IsXULBoxFrame()) {
return true;
}
}
Expand Down
16 changes: 8 additions & 8 deletions layout/base/nsCSSFrameConstructor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ static bool
ShouldSuppressFloatingOfDescendants(nsIFrame* aFrame)
{
return aFrame->IsFrameOfType(nsIFrame::eMathML) ||
aFrame->IsBoxFrame() ||
aFrame->IsXULBoxFrame() ||
::IsFlexOrGridContainer(aFrame);
}

Expand Down Expand Up @@ -8297,7 +8297,7 @@ nsCSSFrameConstructor::ContentRemoved(nsIContent* aContainer,
// (If we're in the XUL block-wrapping situation, parentFrame is the
// wrapper frame.)
nsIFrame* grandparentFrame = parentFrame->GetParent();
if (grandparentFrame && grandparentFrame->IsBoxFrame() &&
if (grandparentFrame && grandparentFrame->IsXULBoxFrame() &&
(grandparentFrame->GetStateBits() & NS_STATE_BOX_WRAPS_KIDS_IN_BLOCK) &&
// check if this frame is the only one needing wrapping
aChild == AnyKidsNeedBlockParent(parentFrame->PrincipalChildList().FirstChild()) &&
Expand Down Expand Up @@ -10697,7 +10697,7 @@ nsCSSFrameConstructor::ProcessChildren(nsFrameConstructorState& aState,

ConstructFramesFromItemList(aState, itemsToConstruct, aFrame, aFrameItems);

NS_ASSERTION(!aAllowBlockStyles || !aFrame->IsBoxFrame(),
NS_ASSERTION(!aAllowBlockStyles || !aFrame->IsXULBoxFrame(),
"can't be both block and box");

if (haveFirstLetterStyle) {
Expand All @@ -10710,15 +10710,15 @@ nsCSSFrameConstructor::ProcessChildren(nsFrameConstructorState& aState,

// We might end up with first-line frames that change
// AnyKidsNeedBlockParent() without changing itemsToConstruct, but that
// should never happen for cases whan aFrame->IsBoxFrame().
NS_ASSERTION(!haveFirstLineStyle || !aFrame->IsBoxFrame(),
// should never happen for cases whan aFrame->IsXULBoxFrame().
NS_ASSERTION(!haveFirstLineStyle || !aFrame->IsXULBoxFrame(),
"Shouldn't have first-line style if we're a box");
NS_ASSERTION(!aFrame->IsBoxFrame() ||
NS_ASSERTION(!aFrame->IsXULBoxFrame() ||
itemsToConstruct.AnyItemsNeedBlockParent() ==
(AnyKidsNeedBlockParent(aFrameItems.FirstChild()) != nullptr),
"Something went awry in our block parent calculations");

if (aFrame->IsBoxFrame() && itemsToConstruct.AnyItemsNeedBlockParent()) {
if (aFrame->IsXULBoxFrame() && itemsToConstruct.AnyItemsNeedBlockParent()) {
// XXXbz we could do this on the FrameConstructionItemList level,
// no? And if we cared we could look through the item list
// instead of groveling through the framelist here..
Expand Down Expand Up @@ -12055,7 +12055,7 @@ nsCSSFrameConstructor::WipeContainingBlock(nsFrameConstructorState& aState,

// Situation #1 is a XUL frame that contains frames that are required
// to be wrapped in blocks.
if (aFrame->IsBoxFrame() &&
if (aFrame->IsXULBoxFrame() &&
!(aFrame->GetStateBits() & NS_STATE_BOX_WRAPS_KIDS_IN_BLOCK) &&
aItems.AnyItemsNeedBlockParent()) {
RecreateFramesForContent(aFrame->GetContent(), true,
Expand Down
2 changes: 1 addition & 1 deletion layout/base/nsDisplayList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1930,7 +1930,7 @@ void nsDisplayList::DeleteAll() {
static bool
GetMouseThrough(const nsIFrame* aFrame)
{
if (!aFrame->IsBoxFrame())
if (!aFrame->IsXULBoxFrame())
return false;

const nsIFrame* frame = aFrame;
Expand Down
8 changes: 4 additions & 4 deletions layout/generic/nsFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ static bool
IsBoxWrapped(const nsIFrame* aFrame)
{
return aFrame->GetParent() &&
aFrame->GetParent()->IsBoxFrame() &&
!aFrame->IsBoxFrame();
aFrame->GetParent()->IsXULBoxFrame() &&
!aFrame->IsXULBoxFrame();
}

// Formerly the nsIFrameDebug interface
Expand Down Expand Up @@ -494,7 +494,7 @@ IsFontSizeInflationContainer(nsIFrame* aFrame,
nsGkAtoms::optgroup,
nsGkAtoms::select) ||
content->IsInNativeAnonymousSubtree()))) &&
!(aFrame->IsBoxFrame() && aFrame->GetParent()->IsBoxFrame());
!(aFrame->IsXULBoxFrame() && aFrame->GetParent()->IsXULBoxFrame());
NS_ASSERTION(!aFrame->IsFrameOfType(nsIFrame::eLineParticipant) ||
isInline ||
// br frames and mathml frames report being line
Expand Down Expand Up @@ -5881,7 +5881,7 @@ nsFrame::UpdateOverflow()
nsOverflowAreas overflowAreas(rect, rect);

if (!DoesClipChildren() &&
!(IsCollapsed() && (IsBoxFrame() || ::IsBoxWrapped(this)))) {
!(IsCollapsed() && (IsXULBoxFrame() || ::IsBoxWrapped(this)))) {
nsLayoutUtils::UnionChildOverflow(this, overflowAreas);
}

Expand Down
6 changes: 3 additions & 3 deletions layout/generic/nsGfxScrollFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5294,7 +5294,7 @@ ScrollFrameHelper::LayoutScrollbars(nsBoxLayoutState& aState,

// place the scrollcorner
if (mScrollCornerBox || mResizerBox) {
NS_PRECONDITION(!mScrollCornerBox || mScrollCornerBox->IsBoxFrame(), "Must be a box frame!");
NS_PRECONDITION(!mScrollCornerBox || mScrollCornerBox->IsXULBoxFrame(), "Must be a box frame!");

nsRect r(0, 0, 0, 0);
if (aContentArea.x != mScrollPort.x || scrollbarOnLeft) {
Expand Down Expand Up @@ -5351,7 +5351,7 @@ ScrollFrameHelper::LayoutScrollbars(nsBoxLayoutState& aState,
nsPresContext* presContext = mScrolledFrame->PresContext();
nsRect vRect;
if (mVScrollbarBox) {
NS_PRECONDITION(mVScrollbarBox->IsBoxFrame(), "Must be a box frame!");
NS_PRECONDITION(mVScrollbarBox->IsXULBoxFrame(), "Must be a box frame!");
vRect = mScrollPort;
if (overlayScrollBarsWithZoom) {
vRect.height = NSToCoordRound(res * scrollPortClampingSize.height);
Expand All @@ -5368,7 +5368,7 @@ ScrollFrameHelper::LayoutScrollbars(nsBoxLayoutState& aState,

nsRect hRect;
if (mHScrollbarBox) {
NS_PRECONDITION(mHScrollbarBox->IsBoxFrame(), "Must be a box frame!");
NS_PRECONDITION(mHScrollbarBox->IsXULBoxFrame(), "Must be a box frame!");
hRect = mScrollPort;
if (overlayScrollBarsWithZoom) {
hRect.width = NSToCoordRound(res * scrollPortClampingSize.width);
Expand Down
2 changes: 1 addition & 1 deletion layout/generic/nsHTMLReflowState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ nsHTMLReflowState::InitResizeFlags(nsPresContext* aPresContext, nsIAtom* aFrameT
mStylePosition->MaxBSizeDependsOnContainer(wm) ||
mStylePosition->OffsetHasPercent(wm.PhysicalSide(eLogicalSideBStart)) ||
mStylePosition->mOffset.GetBEndUnit(wm) != eStyleUnit_Auto ||
frame->IsBoxFrame();
frame->IsXULBoxFrame();

if (mStyleText->mLineHeight.GetUnit() == eStyleUnit_Enumerated) {
NS_ASSERTION(mStyleText->mLineHeight.GetIntValue() ==
Expand Down
2 changes: 1 addition & 1 deletion layout/generic/nsIFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -2850,7 +2850,7 @@ class nsIFrame : public nsQueryFrame
// BOX LAYOUT METHODS
// These methods have been migrated from nsIBox and are in the process of
// being refactored. DO NOT USE OUTSIDE OF XUL.
bool IsBoxFrame() const
bool IsXULBoxFrame() const
{
return IsFrameOfType(nsIFrame::eXULBox);
}
Expand Down
6 changes: 3 additions & 3 deletions layout/xul/nsBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -926,21 +926,21 @@ nsBox::GetChildBox(const nsIFrame* aFrame)
{
// box layout ends at box-wrapped frames, so don't allow these frames
// to report child boxes.
return aFrame->IsBoxFrame() ? aFrame->PrincipalChildList().FirstChild() : nullptr;
return aFrame->IsXULBoxFrame() ? aFrame->PrincipalChildList().FirstChild() : nullptr;
}

/*static*/ nsIFrame*
nsBox::GetNextBox(const nsIFrame* aFrame)
{
return aFrame->GetParent() &&
aFrame->GetParent()->IsBoxFrame() ? aFrame->GetNextSibling() : nullptr;
aFrame->GetParent()->IsXULBoxFrame() ? aFrame->GetNextSibling() : nullptr;
}

/*static*/ nsIFrame*
nsBox::GetParentBox(const nsIFrame* aFrame)
{
return aFrame->GetParent() &&
aFrame->GetParent()->IsBoxFrame() ? aFrame->GetParent() : nullptr;
aFrame->GetParent()->IsXULBoxFrame() ? aFrame->GetParent() : nullptr;
}

#ifdef DEBUG_LAYOUT
Expand Down
12 changes: 6 additions & 6 deletions layout/xul/nsListBoxBodyFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1130,15 +1130,15 @@ nsListBoxBodyFrame::GetFirstItemBox(int32_t aOffset, bool* aCreated)
mBottomFrame = mTopFrame;

if (mTopFrame) {
return mTopFrame->IsBoxFrame() ? mTopFrame : nullptr;
return mTopFrame->IsXULBoxFrame() ? mTopFrame : nullptr;
}

// top frame was cleared out
mTopFrame = GetFirstFrame();
mBottomFrame = mTopFrame;

if (mTopFrame && mRowsToPrepend <= 0) {
return mTopFrame->IsBoxFrame() ? mTopFrame : nullptr;
return mTopFrame->IsXULBoxFrame() ? mTopFrame : nullptr;
}

// At this point, we either have no frames at all,
Expand Down Expand Up @@ -1168,7 +1168,7 @@ nsListBoxBodyFrame::GetFirstItemBox(int32_t aOffset, bool* aCreated)
return GetFirstItemBox(++aOffset, aCreated);
}
if (existingFrame) {
return existingFrame->IsBoxFrame() ? existingFrame : nullptr;
return existingFrame->IsXULBoxFrame() ? existingFrame : nullptr;
}

// Either append the new frame, or prepend it (at index 0)
Expand All @@ -1187,7 +1187,7 @@ nsListBoxBodyFrame::GetFirstItemBox(int32_t aOffset, bool* aCreated)

mBottomFrame = mTopFrame;

return mTopFrame->IsBoxFrame() ? mTopFrame : nullptr;
return mTopFrame->IsXULBoxFrame() ? mTopFrame : nullptr;
} else
return GetFirstItemBox(++aOffset, 0);
}
Expand Down Expand Up @@ -1252,10 +1252,10 @@ nsListBoxBodyFrame::GetNextItemBox(nsIFrame* aBox, int32_t aOffset,

mBottomFrame = result;

NS_ASSERTION(!result->IsBoxFrame() || result->GetParent() == this,
NS_ASSERTION(!result->IsXULBoxFrame() || result->GetParent() == this,
"returning frame that is not in childlist");

return result->IsBoxFrame() ? result : nullptr;
return result->IsXULBoxFrame() ? result : nullptr;
}

bool
Expand Down
2 changes: 1 addition & 1 deletion layout/xul/nsMenuFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ nsMenuFrame::SetDebug(nsBoxLayoutState& aState, nsIFrame* aList, bool aDebug)
return NS_OK;

while (aList) {
if (aList->IsBoxFrame())
if (aList->IsXULBoxFrame())
aList->SetDebug(aState, aDebug);

aList = aList->GetNextSibling();
Expand Down
2 changes: 1 addition & 1 deletion layout/xul/nsSliderFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ nsSliderFrame::GetScrollbar()
if (scrollbar == nullptr)
return this;

return scrollbar->IsBoxFrame() ? scrollbar : this;
return scrollbar->IsXULBoxFrame() ? scrollbar : this;
}

void
Expand Down
4 changes: 2 additions & 2 deletions layout/xul/nsSplitterFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ nsSplitterFrame::Init(nsIContent* aContent,
// on splitter content, then re-resolve style
// XXXbz this is pretty messed up, since this can change whether we should
// have a frame at all. This really needs a better solution.
if (aParent && aParent->IsBoxFrame()) {
if (aParent && aParent->IsXULBoxFrame()) {
if (!aParent->IsHorizontal()) {
if (!nsContentUtils::HasNonEmptyAttr(aContent, kNameSpaceID_None,
nsGkAtoms::orient)) {
Expand Down Expand Up @@ -839,7 +839,7 @@ nsSplitterFrameInner::UpdateState()
}

if ((SupportsCollapseDirection(Before) || SupportsCollapseDirection(After)) &&
mOuter->GetParent()->IsBoxFrame()) {
mOuter->GetParent()->IsXULBoxFrame()) {
// Find the splitter's immediate sibling.
nsIFrame* splitterSibling;
if (newState == CollapsedBefore || mState == CollapsedBefore) {
Expand Down
4 changes: 2 additions & 2 deletions layout/xul/nsStackLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ nsStackLayout::GetOffset(nsIFrame* aChild, nsMargin& aOffset)

// As an optimization, we cache the fact that we are not positioned to avoid
// wasting time fetching attributes.
if (aChild->IsBoxFrame() &&
if (aChild->IsXULBoxFrame() &&
(aChild->GetStateBits() & NS_STATE_STACK_NOT_POSITIONED))
return 0;

Expand Down Expand Up @@ -241,7 +241,7 @@ nsStackLayout::GetOffset(nsIFrame* aChild, nsMargin& aOffset)
}
}

if (!offsetSpecified && aChild->IsBoxFrame()) {
if (!offsetSpecified && aChild->IsXULBoxFrame()) {
// If no offset was specified at all, then we cache this fact to avoid requerying
// CSS or the content model.
aChild->AddStateBits(NS_STATE_STACK_NOT_POSITIONED);
Expand Down

0 comments on commit 7bfe0e2

Please sign in to comment.