Bug 508665 - part 12, Move nsIFrame::GetChildBox/GetNextBox/GetParentBox to XUL where they came from. r=roc

This commit is contained in:
Mats Palmgren 2014-05-24 22:20:41 +00:00
parent 1a5be6456f
commit e409f1edc9
19 changed files with 122 additions and 109 deletions

View File

@ -1445,7 +1445,7 @@ GetMouseThrough(const nsIFrame* aFrame)
} else if (frame->GetStateBits() & NS_FRAME_MOUSE_THROUGH_NEVER) {
return false;
}
frame = frame->GetParentBox();
frame = nsBox::GetParentBox(frame);
}
return false;
}

View File

@ -2658,20 +2658,6 @@ NS_PTR_TO_INT32(frame->Properties().Get(nsIFrame::ParagraphDepthProperty()))
virtual void SetBounds(nsBoxLayoutState& aBoxLayoutState, const nsRect& aRect,
bool aRemoveOverflowAreas = false) = 0;
NS_HIDDEN_(nsresult) Layout(nsBoxLayoutState& aBoxLayoutState);
nsIFrame* GetChildBox() const
{
// box layout ends at box-wrapped frames, so don't allow these frames
// to report child boxes.
return IsBoxFrame() ? GetFirstPrincipalChild() : nullptr;
}
nsIFrame* GetNextBox() const
{
return (mParent && mParent->IsBoxFrame()) ? mNextSibling : nullptr;
}
nsIFrame* GetParentBox() const
{
return (mParent && mParent->IsBoxFrame()) ? mParent : nullptr;
}
// Box methods. Note that these do NOT just get the CSS border, padding,
// etc. They also talk to nsITheme.
virtual nsresult GetBorderAndPadding(nsMargin& aBorderAndPadding);

View File

@ -255,7 +255,7 @@ nsGrid::FindRowsAndColumns(nsIFrame** aRows, nsIFrame** aColumns)
nsIFrame* child = nullptr;
// if we have <grid></grid> then mBox will be null (bug 125689)
if (mBox)
child = mBox->GetChildBox();
child = nsBox::GetChildBox(mBox);
while(child)
{
@ -287,7 +287,7 @@ nsGrid::FindRowsAndColumns(nsIFrame** aRows, nsIFrame** aColumns)
child = oldBox;
}
child = child->GetNextBox();
child = nsBox::GetNextBox(child);
}
}
@ -419,7 +419,7 @@ nsGrid::PopulateCellMap(nsGridRow* aRows, nsGridRow* aColumns, int32_t aRowCount
child = row->mBox;
if (child) {
child = child->GetChildBox();
child = nsBox::GetChildBox(child);
j = 0;
@ -438,7 +438,7 @@ nsGrid::PopulateCellMap(nsGridRow* aRows, nsGridRow* aColumns, int32_t aRowCount
else
GetCellAt(i,j)->SetBoxInColumn(child);
child = child->GetNextBox();
child = nsBox::GetNextBox(child);
j++;
}
@ -1115,13 +1115,13 @@ nsGrid::GetRowFlex(nsBoxLayoutState& aState, int32_t aIndex, bool aIsHorizontal)
// the grid. 3) Then we are not flexible
box = GetScrollBox(box);
nsIFrame* parent = box->GetParentBox();
nsIFrame* parent = nsBox::GetParentBox(box);
nsIFrame* parentsParent=nullptr;
while(parent)
{
parent = GetScrollBox(parent);
parentsParent = parent->GetParentBox();
parentsParent = nsBox::GetParentBox(parent);
// if our parents parent is not a grid
// the get its flex. If its 0 then we are
@ -1248,7 +1248,7 @@ nsGrid::GetScrollBox(nsIFrame* aChild)
return nullptr;
// get parent
nsIFrame* parent = aChild->GetParentBox();
nsIFrame* parent = nsBox::GetParentBox(aChild);
// walk up until we find a scrollframe or a part
// if it's a scrollframe return it.
@ -1265,7 +1265,7 @@ nsGrid::GetScrollBox(nsIFrame* aChild)
if (parentGridRow)
break;
parent = parent->GetParentBox();
parent = nsBox::GetParentBox(parent);
}
return aChild;

View File

@ -48,11 +48,11 @@ nsGridRowGroupFrame::GetFlex(nsBoxLayoutState& aState)
// ok we are flexible add up our children
nscoord totalFlex = 0;
nsIFrame* child = GetChildBox();
nsIFrame* child = nsBox::GetChildBox(this);
while (child)
{
totalFlex += child->GetFlex(aState);
child = child->GetNextBox();
child = GetNextBox(child);
}
mFlex = totalFlex;

View File

@ -18,6 +18,7 @@
#include "nsGridRowGroupLayout.h"
#include "nsCOMPtr.h"
#include "nsIScrollableFrame.h"
#include "nsBox.h"
#include "nsBoxLayoutState.h"
#include "nsGridLayout2.h"
#include "nsGridRow.h"
@ -156,7 +157,7 @@ nsGridRowGroupLayout::DirtyRows(nsIFrame* aBox, nsBoxLayoutState& aState)
// calling MarkIntrinsicWidthsDirty for every row group.
aState.PresShell()->FrameNeedsReflow(aBox, nsIPresShell::eTreeChange,
NS_FRAME_IS_DIRTY);
nsIFrame* child = aBox->GetChildBox();
nsIFrame* child = nsBox::GetChildBox(aBox);
while(child) {
@ -168,7 +169,7 @@ nsGridRowGroupLayout::DirtyRows(nsIFrame* aBox, nsBoxLayoutState& aState)
if (monument)
monument->DirtyRows(deepChild, aState);
child = child->GetNextBox();
child = nsBox::GetNextBox(child);
}
}
}
@ -180,7 +181,7 @@ nsGridRowGroupLayout::CountRowsColumns(nsIFrame* aBox, int32_t& aRowCount, int32
if (aBox) {
int32_t startCount = aRowCount;
nsIFrame* child = aBox->GetChildBox();
nsIFrame* child = nsBox::GetChildBox(aBox);
while(child) {
@ -190,12 +191,12 @@ nsGridRowGroupLayout::CountRowsColumns(nsIFrame* aBox, int32_t& aRowCount, int32
nsIGridPart* monument = nsGrid::GetPartFromBox(deepChild);
if (monument) {
monument->CountRowsColumns(deepChild, aRowCount, aComputedColumnCount);
child = child->GetNextBox();
child = nsBox::GetNextBox(child);
deepChild = child;
continue;
}
child = child->GetNextBox();
child = nsBox::GetNextBox(child);
// if not a monument. Then count it. It will be a bogus row
aRowCount++;
@ -215,7 +216,7 @@ nsGridRowGroupLayout::BuildRows(nsIFrame* aBox, nsGridRow* aRows)
int32_t rowCount = 0;
if (aBox) {
nsIFrame* child = aBox->GetChildBox();
nsIFrame* child = nsBox::GetChildBox(aBox);
while(child) {
@ -225,14 +226,14 @@ nsGridRowGroupLayout::BuildRows(nsIFrame* aBox, nsGridRow* aRows)
nsIGridPart* monument = nsGrid::GetPartFromBox(deepChild);
if (monument) {
rowCount += monument->BuildRows(deepChild, &aRows[rowCount]);
child = child->GetNextBox();
child = nsBox::GetNextBox(child);
deepChild = child;
continue;
}
aRows[rowCount].Init(child, true);
child = child->GetNextBox();
child = nsBox::GetNextBox(child);
// if not a monument. Then count it. It will be a bogus row
rowCount++;

View File

@ -60,7 +60,7 @@ nsGridRowLayout::GetParentGridPart(nsIFrame* aBox, nsIFrame** aParentBox)
// get the parent
if (aBox)
aBox = aBox->GetParentBox();
aBox = nsBox::GetParentBox(aBox);
if (aBox)
{
@ -89,7 +89,7 @@ nsGridRowLayout::GetGrid(nsIFrame* aBox, int32_t* aIndex, nsGridRowLayout* aRequ
}
int32_t index = -1;
nsIFrame* child = aBox->GetChildBox();
nsIFrame* child = nsBox::GetChildBox(aBox);
int32_t count = 0;
while(child)
{
@ -108,7 +108,7 @@ nsGridRowLayout::GetGrid(nsIFrame* aBox, int32_t* aIndex, nsGridRowLayout* aRequ
} else
count++;
child = child->GetNextBox();
child = nsBox::GetNextBox(child);
}
// if we didn't find ourselves then the tree isn't properly formed yet
@ -143,10 +143,10 @@ nsGridRowLayout::GetTotalMargin(nsIFrame* aBox, bool aIsHorizontal)
aBox = nsGrid::GetScrollBox(aBox);
// see if we have a next to see if we are last
nsIFrame* next = aBox->GetNextBox();
nsIFrame* next = nsBox::GetNextBox(aBox);
// get the parent first child to see if we are first
nsIFrame* child = parent->GetChildBox();
nsIFrame* child = nsBox::GetChildBox(parent);
margin = part->GetTotalMargin(parent, aIsHorizontal);

View File

@ -114,7 +114,7 @@ nsGridRowLeafLayout::PopulateBoxSizes(nsIFrame* aBox, nsBoxLayoutState& aState,
nsBoxSize* start = nullptr;
nsBoxSize* last = nullptr;
nsBoxSize* current = nullptr;
nsIFrame* child = aBox->GetChildBox();
nsIFrame* child = nsBox::GetChildBox(aBox);
for (int i=0; i < count; i++)
{
column = grid->GetColumnAt(i,isHorizontal);
@ -206,7 +206,7 @@ nsGridRowLeafLayout::PopulateBoxSizes(nsIFrame* aBox, nsBoxLayoutState& aState,
}
if (child && !column->mIsBogus)
child = child->GetNextBox();
child = nsBox::GetNextBox(child);
}
aBoxSizes = start;
@ -299,12 +299,12 @@ void
nsGridRowLeafLayout::CountRowsColumns(nsIFrame* aBox, int32_t& aRowCount, int32_t& aComputedColumnCount)
{
if (aBox) {
nsIFrame* child = aBox->GetChildBox();
nsIFrame* child = nsBox::GetChildBox(aBox);
// count the children
int32_t columnCount = 0;
while(child) {
child = child->GetNextBox();
child = nsBox::GetNextBox(child);
columnCount++;
}

View File

@ -139,7 +139,7 @@ nsBox::BeginLayout(nsBoxLayoutState& aState)
// If the parent is dirty, all the children are dirty (nsHTMLReflowState
// does this too).
nsIFrame* box;
for (box = GetChildBox(); box; box = box->GetNextBox())
for (box = GetChildBox(this); box; box = GetNextBox(box))
box->AddStateBits(NS_FRAME_IS_DIRTY);
}
@ -925,6 +925,28 @@ nsBox::BoundsCheck(const nsSize& aMinSize, const nsSize& aPrefSize, const nsSize
BoundsCheck(aMinSize.height, aPrefSize.height, aMaxSize.height));
}
/*static*/ nsIFrame*
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->GetFirstPrincipalChild() : nullptr;
}
/*static*/ nsIFrame*
nsBox::GetNextBox(const nsIFrame* aFrame)
{
return aFrame->GetParent() &&
aFrame->GetParent()->IsBoxFrame() ? aFrame->GetNextSibling() : nullptr;
}
/*static*/ nsIFrame*
nsBox::GetParentBox(const nsIFrame* aFrame)
{
return aFrame->GetParent() &&
aFrame->GetParent()->IsBoxFrame() ? aFrame->GetParent() : nullptr;
}
#ifdef DEBUG_LAYOUT
nsresult
nsBox::SetDebug(nsBoxLayoutState& aState, bool aDebug)
@ -940,7 +962,7 @@ nsBox::GetDebugBoxAt( const nsPoint& aPoint,
if (!thisRect.Contains(aPoint))
return NS_ERROR_FAILURE;
nsIFrame* child = GetChildBox();
nsIFrame* child = nsBox::GetChildBox(this);
nsIFrame* hit = nullptr;
*aBox = nullptr;
@ -950,7 +972,7 @@ nsBox::GetDebugBoxAt( const nsPoint& aPoint,
if (NS_SUCCEEDED(rv) && hit) {
*aBox = hit;
}
child = child->GetNextBox();
child = GetNextBox(child);
}
// found a child

View File

@ -77,6 +77,10 @@ rollbox.
static nsSize BoundsCheck(const nsSize& aMinSize, const nsSize& aPrefSize, const nsSize& aMaxSize);
static nscoord BoundsCheck(nscoord aMinSize, nscoord aPrefSize, nscoord aMaxSize);
static nsIFrame* GetChildBox(const nsIFrame* aFrame);
static nsIFrame* GetNextBox(const nsIFrame* aFrame);
static nsIFrame* GetParentBox(const nsIFrame* aFrame);
protected:
#ifdef DEBUG_LAYOUT

View File

@ -1225,7 +1225,7 @@ nsBoxFrame::AttributeChanged(int32_t aNameSpaceID,
}
else if (aAttribute == nsGkAtoms::ordinal) {
nsBoxLayoutState state(PresContext());
nsIFrame* parent = GetParentBox();
nsIFrame* parent = GetParentBox(this);
// If our parent is not a box, there's not much we can do... but in that
// case our ordinal doesn't matter anyway, so that's ok.
// Also don't bother with popup frames since they are kept on the
@ -1478,7 +1478,7 @@ nsBoxFrame::PaintXULDebugOverlay(nsRenderingContext& aRenderingContext,
nscoord onePixel = GetPresContext()->IntScaledPixelsToTwips(1);
kid = GetChildBox();
kid = nsBox::GetChildBox(this);
while (nullptr != kid) {
bool isHorizontal = IsHorizontal();
@ -1516,7 +1516,7 @@ nsBoxFrame::PaintXULDebugOverlay(nsRenderingContext& aRenderingContext,
DrawSpacer(GetPresContext(), aRenderingContext, isHorizontal, flex, x, y, borderSize, spacerSize);
}
kid = kid->GetNextBox();
kid = GetNextBox(kid);
}
}
#endif
@ -1733,7 +1733,7 @@ nsBoxFrame::DisplayDebugInfoFor(nsIFrame* aBox,
//printf("%%%%%% inside box %%%%%%%\n");
int count = 0;
nsIFrame* child = aBox->GetChildBox();
nsIFrame* child = nsBox::GetChildBox(aBox);
nsMargin m;
nsMargin m2;
@ -1822,7 +1822,7 @@ nsBoxFrame::DisplayDebugInfoFor(nsIFrame* aBox,
return NS_OK;
}
child = child->GetNextBox();
child = GetNextBox(child);
count++;
}
} else {
@ -1836,11 +1836,11 @@ nsBoxFrame::DisplayDebugInfoFor(nsIFrame* aBox,
void
nsBoxFrame::SetDebugOnChildList(nsBoxLayoutState& aState, nsIFrame* aChild, bool aDebug)
{
nsIFrame* child = GetChildBox();
nsIFrame* child = nsBox::GetChildBox(this);
while (child)
{
child->SetDebug(aState, aDebug);
child = child->GetNextBox();
child = GetNextBox(child);
}
}
@ -1957,7 +1957,7 @@ nsBoxFrame::RelayoutChildAtOrdinal(nsBoxLayoutState& aState, nsIFrame* aChild)
newPrevSib = child;
}
child = child->GetNextBox();
child = GetNextBox(child);
}
if (aChild->GetPrevSibling() == newPrevSib) {

View File

@ -182,7 +182,7 @@ nsDeckFrame::DoLayout(nsBoxLayoutState& aState)
nsresult rv = nsBoxFrame::DoLayout(aState);
// run though each child. Hide all but the selected one
nsIFrame* box = GetChildBox();
nsIFrame* box = nsBox::GetChildBox(this);
nscoord count = 0;
while (box)
@ -191,7 +191,7 @@ nsDeckFrame::DoLayout(nsBoxLayoutState& aState)
if (count != mIndex)
HideBox(box);
box = box->GetNextBox();
box = GetNextBox(box);
count++;
}

View File

@ -208,21 +208,21 @@ nsIFrame*
nsGroupBoxFrame::GetCaptionBox(nsPresContext* aPresContext, nsRect& aCaptionRect)
{
// first child is our grouped area
nsIFrame* box = GetChildBox();
nsIFrame* box = nsBox::GetChildBox(this);
// no area fail.
if (!box)
return nullptr;
// get the first child in the grouped area, that is the caption
box = box->GetChildBox();
box = nsBox::GetChildBox(box);
// nothing in the area? fail
if (!box)
return nullptr;
// now get the caption itself. It is in the caption frame.
nsIFrame* child = box->GetChildBox();
nsIFrame* child = nsBox::GetChildBox(box);
if (child) {
// convert to our coordinates.

View File

@ -136,7 +136,7 @@ nsListBoxLayout::LayoutInternal(nsIFrame* aBox, nsBoxLayoutState& aState)
}
// run through all our currently created children
nsIFrame* box = body->GetChildBox();
nsIFrame* box = nsBox::GetChildBox(body);
// if the reason is resize or initial we must relayout.
nscoord rowHeight = body->GetRowHeightAppUnits();
@ -185,7 +185,7 @@ nsListBoxLayout::LayoutInternal(nsIFrame* aBox, nsBoxLayoutState& aState)
yOffset += size;
availableHeight -= size;
box = box->GetNextBox();
box = nsBox::GetNextBox(box);
}
// We have enough available height left to add some more rows

View File

@ -406,7 +406,7 @@ nsMenuPopupFrame::LayoutPopup(nsBoxLayoutState& aState, nsIFrame* aParentMenu,
// if the popup has just been opened, make sure the scrolled window is at 0,0
if (mIsOpenChanged) {
nsIScrollableFrame *scrollframe = do_QueryFrame(GetChildBox());
nsIScrollableFrame *scrollframe = do_QueryFrame(nsBox::GetChildBox(this));
if (scrollframe) {
nsWeakFrame weakFrame(this);
scrollframe->ScrollTo(nsPoint(0,0), nsIScrollableFrame::INSTANT);

View File

@ -10,7 +10,7 @@
#include "nsIContent.h"
#include "nsIDOMElement.h"
#include "nsPresContext.h"
#include "nsIFrame.h"
#include "nsBox.h"
#include "nsIScrollableFrame.h"
using namespace mozilla;
@ -101,7 +101,7 @@ static nsIFrame* GetScrolledBox(nsBoxObject* aScrollBox) {
nsIFrame* scrolledFrame = scrollFrame->GetScrolledFrame();
if (!scrolledFrame)
return nullptr;
return scrolledFrame->GetChildBox();
return nsBox::GetChildBox(scrolledFrame);
}
/* void scrollByIndex (in long dindexes); */
@ -117,7 +117,7 @@ NS_IMETHODIMP nsScrollBoxObject::ScrollByIndex(int32_t dindexes)
nsRect rect;
// now get the scrolled boxes first child.
nsIFrame* child = scrolledBox->GetChildBox();
nsIFrame* child = nsBox::GetChildBox(scrolledBox);
bool horiz = scrolledBox->IsHorizontal();
nsPoint cp = sf->GetScrollPosition();
@ -156,7 +156,7 @@ NS_IMETHODIMP nsScrollBoxObject::ScrollByIndex(int32_t dindexes)
break;
}
}
child = child->GetNextBox();
child = nsBox::GetNextBox(child);
curIndex++;
}
@ -167,7 +167,7 @@ NS_IMETHODIMP nsScrollBoxObject::ScrollByIndex(int32_t dindexes)
if (dindexes > 0) {
while(child) {
child = child->GetNextBox();
child = nsBox::GetNextBox(child);
if (child)
rect = child->GetRect();
count++;
@ -176,14 +176,14 @@ NS_IMETHODIMP nsScrollBoxObject::ScrollByIndex(int32_t dindexes)
}
} else if (dindexes < 0) {
child = scrolledBox->GetChildBox();
child = nsBox::GetChildBox(scrolledBox);
while(child) {
rect = child->GetRect();
if (count >= curIndex + dindexes)
break;
count++;
child = child->GetNextBox();
child = nsBox::GetNextBox(child);
}
}

View File

@ -303,7 +303,7 @@ nsSliderFrame::BuildDisplayListForChildren(nsDisplayListBuilder* aBuilder,
const nsDisplayListSet& aLists)
{
// if we are too small to have a thumb don't paint it.
nsIFrame* thumb = GetChildBox();
nsIFrame* thumb = nsBox::GetChildBox(this);
if (thumb) {
nsRect thumbRect(thumb->GetRect());
@ -325,7 +325,7 @@ NS_IMETHODIMP
nsSliderFrame::DoLayout(nsBoxLayoutState& aState)
{
// get the thumb should be our only child
nsIFrame* thumbBox = GetChildBox();
nsIFrame* thumbBox = nsBox::GetChildBox(this);
if (!thumbBox) {
SyncLayout(aState);

View File

@ -305,7 +305,7 @@ nsSplitterFrame::DoLayout(nsBoxLayoutState& aState)
{
if (GetStateBits() & NS_FRAME_FIRST_REFLOW)
{
mInner->mParentBox = GetParentBox();
mInner->mParentBox = nsBox::GetParentBox(this);
mInner->UpdateState();
}
@ -316,7 +316,7 @@ nsSplitterFrame::DoLayout(nsBoxLayoutState& aState)
void
nsSplitterFrame::GetInitialOrientation(bool& aIsHorizontal)
{
nsIFrame* box = GetParentBox();
nsIFrame* box = nsBox::GetParentBox(this);
if (box) {
aIsHorizontal = !box->IsHorizontal();
}
@ -614,7 +614,7 @@ nsSplitterFrameInner::MouseDown(nsIDOMEvent* aMouseEvent)
nsGkAtoms::_true, eCaseMatters))
return NS_OK;
mParentBox = mOuter->GetParentBox();
mParentBox = nsBox::GetParentBox(mOuter);
if (!mParentBox)
return NS_OK;
@ -656,7 +656,7 @@ nsSplitterFrameInner::MouseDown(nsIDOMEvent* aMouseEvent)
mChildInfosBeforeCount = 0;
mChildInfosAfterCount = 0;
nsIFrame* childBox = mParentBox->GetChildBox();
nsIFrame* childBox = nsBox::GetChildBox(mParentBox);
while (nullptr != childBox)
{
@ -711,7 +711,7 @@ nsSplitterFrameInner::MouseDown(nsIDOMEvent* aMouseEvent)
}
}
childBox = childBox->GetNextBox();
childBox = nsBox::GetNextBox(childBox);
count++;
}
@ -899,13 +899,13 @@ nsSplitterFrameInner::AdjustChildren(nsPresContext* aPresContext)
static nsIFrame* GetChildBoxForContent(nsIFrame* aParentBox, nsIContent* aContent)
{
nsIFrame* childBox = aParentBox->GetChildBox();
nsIFrame* childBox = nsBox::GetChildBox(aParentBox);
while (nullptr != childBox) {
if (childBox->GetContent() == aContent) {
return childBox;
}
childBox = childBox->GetNextBox();
childBox = nsBox::GetNextBox(childBox);
}
return nullptr;
}
@ -920,11 +920,11 @@ nsSplitterFrameInner::AdjustChildren(nsPresContext* aPresContext, nsSplitterInfo
nscoord onePixel = nsPresContext::CSSPixelsToAppUnits(1);
// first set all the widths.
nsIFrame* child = mOuter->GetChildBox();
nsIFrame* child = nsBox::GetChildBox(mOuter);
while(child)
{
SetPreferredSize(state, child, onePixel, aIsHorizontal, nullptr);
child = child->GetNextBox();
child = nsBox::GetNextBox(child);
}
// now set our changed widths.

View File

@ -173,11 +173,11 @@ nsSprocketLayout::Layout(nsIFrame* aBox, nsBoxLayoutState& aState)
// See if we are collapsed. If we are, then simply iterate over all our
// children and give them a rect of 0 width and height.
if (aBox->IsCollapsed()) {
nsIFrame* child = aBox->GetChildBox();
nsIFrame* child = nsBox::GetChildBox(aBox);
while(child)
{
nsBoxFrame::LayoutChildAt(aState, child, nsRect(0,0,0,0));
child = child->GetNextBox();
child = nsBox::GetNextBox(child);
}
return NS_OK;
}
@ -302,7 +302,7 @@ nsSprocketLayout::Layout(nsIFrame* aBox, nsBoxLayoutState& aState)
nsComputedBoxSize* childComputedBoxSize = computedBoxSizes;
nsBoxSize* childBoxSize = boxSizes;
nsIFrame* child = aBox->GetChildBox();
nsIFrame* child = nsBox::GetChildBox(aBox);
int32_t count = 0;
while (child || (childBoxSize && childBoxSize->bogus))
@ -556,7 +556,7 @@ nsSprocketLayout::Layout(nsIFrame* aBox, nsBoxLayoutState& aState)
childComputedBoxSize = childComputedBoxSize->next;
childBoxSize = childBoxSize->next;
child = child->GetNextBox();
child = nsBox::GetNextBox(child);
count++;
}
@ -611,7 +611,7 @@ nsSprocketLayout::Layout(nsIFrame* aBox, nsBoxLayoutState& aState)
// we really did have to change the positions because of packing (typically for 'center'
// or 'end' pack values).
if (x != origX || y != origY) {
nsIFrame* child = aBox->GetChildBox();
nsIFrame* child = nsBox::GetChildBox(aBox);
// reposition all our children
while (child)
@ -620,7 +620,7 @@ nsSprocketLayout::Layout(nsIFrame* aBox, nsBoxLayoutState& aState)
childRect.x += (x - origX);
childRect.y += (y - origY);
child->SetBounds(aState, childRect);
child = child->GetNextBox();
child = nsBox::GetNextBox(child);
}
}
@ -668,7 +668,7 @@ nsSprocketLayout::PopulateBoxSizes(nsIFrame* aBox, nsBoxLayoutState& aState, nsB
// so we can just optimize it out this way.
// set flexes
nsIFrame* child = aBox->GetChildBox();
nsIFrame* child = nsBox::GetChildBox(aBox);
aFlexes = 0;
nsBoxSize* currentBox = nullptr;
@ -705,12 +705,12 @@ nsSprocketLayout::PopulateBoxSizes(nsIFrame* aBox, nsBoxLayoutState& aState, nsB
if (flex > 0)
aFlexes++;
child = child->GetNextBox();
child = GetNextBox(child);
}
#endif
// get pref, min, max
child = aBox->GetChildBox();
child = nsBox::GetChildBox(aBox);
currentBox = aBoxSizes;
nsBoxSize* last = nullptr;
@ -829,7 +829,7 @@ nsSprocketLayout::PopulateBoxSizes(nsIFrame* aBox, nsBoxLayoutState& aState, nsB
currentBox->collapsed = collapsed;
aFlexes += currentBox->flex;
child = child->GetNextBox();
child = nsBox::GetNextBox(child);
last = currentBox;
currentBox = currentBox->next;
@ -936,7 +936,7 @@ nsSprocketLayout::AlignChildren(nsIFrame* aBox,
halign = aBox->GetHAlign();
}
nsIFrame* child = aBox->GetChildBox();
nsIFrame* child = nsBox::GetChildBox(aBox);
while (child) {
nsMargin margin;
@ -997,7 +997,7 @@ nsSprocketLayout::AlignChildren(nsIFrame* aBox,
child->SetBounds(aState, childRect);
}
child = child->GetNextBox();
child = nsBox::GetNextBox(child);
}
}
@ -1305,7 +1305,7 @@ nsSprocketLayout::GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aState)
// run through all the children and get their min, max, and preferred sizes
// return us the size of the box
nsIFrame* child = aBox->GetChildBox();
nsIFrame* child = nsBox::GetChildBox(aBox);
nsFrameState frameState = nsFrameState(0);
GetFrameState(aBox, frameState);
bool isEqual = !!(frameState & NS_STATE_EQUAL_SIZE);
@ -1334,7 +1334,7 @@ nsSprocketLayout::GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aState)
count++;
}
child = child->GetNextBox();
child = nsBox::GetNextBox(child);
}
if (isEqual) {
@ -1362,7 +1362,7 @@ nsSprocketLayout::GetMinSize(nsIFrame* aBox, nsBoxLayoutState& aState)
// run through all the children and get their min, max, and preferred sizes
// return us the size of the box
nsIFrame* child = aBox->GetChildBox();
nsIFrame* child = nsBox::GetChildBox(aBox);
nsFrameState frameState = nsFrameState(0);
GetFrameState(aBox, frameState);
bool isEqual = !!(frameState & NS_STATE_EQUAL_SIZE);
@ -1402,7 +1402,7 @@ nsSprocketLayout::GetMinSize(nsIFrame* aBox, nsBoxLayoutState& aState)
count++;
}
child = child->GetNextBox();
child = nsBox::GetNextBox(child);
}
@ -1431,7 +1431,7 @@ nsSprocketLayout::GetMaxSize(nsIFrame* aBox, nsBoxLayoutState& aState)
// run through all the children and get their min, max, and preferred sizes
// return us the size of the box
nsIFrame* child = aBox->GetChildBox();
nsIFrame* child = nsBox::GetChildBox(aBox);
nsFrameState frameState = nsFrameState(0);
GetFrameState(aBox, frameState);
bool isEqual = !!(frameState & NS_STATE_EQUAL_SIZE);
@ -1462,7 +1462,7 @@ nsSprocketLayout::GetMaxSize(nsIFrame* aBox, nsBoxLayoutState& aState)
count++;
}
child = child->GetNextBox();
child = nsBox::GetNextBox(child);
}
if (isEqual) {
@ -1496,7 +1496,7 @@ nsSprocketLayout::GetAscent(nsIFrame* aBox, nsBoxLayoutState& aState)
// run through all the children and get their min, max, and preferred sizes
// return us the size of the box
nsIFrame* child = aBox->GetChildBox();
nsIFrame* child = nsBox::GetChildBox(aBox);
while (child)
{
@ -1520,7 +1520,7 @@ nsSprocketLayout::GetAscent(nsIFrame* aBox, nsBoxLayoutState& aState)
}
//}
child = child->GetNextBox();
child = nsBox::GetNextBox(child);
}
nsMargin borderPadding;

View File

@ -63,7 +63,7 @@ nsStackLayout::GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aState)
{
nsSize prefSize (0, 0);
nsIFrame* child = aBox->GetChildBox();
nsIFrame* child = nsBox::GetChildBox(aBox);
while (child) {
if (child->StyleXUL()->mStretchStack) {
nsSize pref = child->GetPrefSize(aState);
@ -76,7 +76,7 @@ nsStackLayout::GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aState)
AddLargestSize(prefSize, pref);
}
child = child->GetNextBox();
child = nsBox::GetNextBox(child);
}
AddBorderAndPadding(aBox, prefSize);
@ -89,7 +89,7 @@ nsStackLayout::GetMinSize(nsIFrame* aBox, nsBoxLayoutState& aState)
{
nsSize minSize (0, 0);
nsIFrame* child = aBox->GetChildBox();
nsIFrame* child = nsBox::GetChildBox(aBox);
while (child) {
if (child->StyleXUL()->mStretchStack) {
nsSize min = child->GetMinSize(aState);
@ -102,7 +102,7 @@ nsStackLayout::GetMinSize(nsIFrame* aBox, nsBoxLayoutState& aState)
AddLargestSize(minSize, min);
}
child = child->GetNextBox();
child = nsBox::GetNextBox(child);
}
AddBorderAndPadding(aBox, minSize);
@ -115,7 +115,7 @@ nsStackLayout::GetMaxSize(nsIFrame* aBox, nsBoxLayoutState& aState)
{
nsSize maxSize (NS_INTRINSICSIZE, NS_INTRINSICSIZE);
nsIFrame* child = aBox->GetChildBox();
nsIFrame* child = nsBox::GetChildBox(aBox);
while (child) {
if (child->StyleXUL()->mStretchStack) {
nsSize min = child->GetMinSize(aState);
@ -131,7 +131,7 @@ nsStackLayout::GetMaxSize(nsIFrame* aBox, nsBoxLayoutState& aState)
AddSmallestSize(maxSize, max);
}
child = child->GetNextBox();
child = nsBox::GetNextBox(child);
}
AddBorderAndPadding(aBox, maxSize);
@ -145,7 +145,7 @@ nsStackLayout::GetAscent(nsIFrame* aBox, nsBoxLayoutState& aState)
{
nscoord vAscent = 0;
nsIFrame* child = aBox->GetChildBox();
nsIFrame* child = nsBox::GetChildBox(aBox);
while (child) {
nscoord ascent = child->GetBoxAscent(aState);
nsMargin margin;
@ -154,7 +154,7 @@ nsStackLayout::GetAscent(nsIFrame* aBox, nsBoxLayoutState& aState)
if (ascent > vAscent)
vAscent = ascent;
child = child->GetNextBox();
child = nsBox::GetNextBox(child);
}
return vAscent;
@ -260,7 +260,7 @@ nsStackLayout::Layout(nsIFrame* aBox, nsBoxLayoutState& aState)
bool grow;
do {
nsIFrame* child = aBox->GetChildBox();
nsIFrame* child = nsBox::GetChildBox(aBox);
grow = false;
while (child)
@ -357,7 +357,7 @@ nsStackLayout::Layout(nsIFrame* aBox, nsBoxLayoutState& aState)
}
}
child = child->GetNextBox();
child = nsBox::GetNextBox(child);
}
} while (grow);