mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
[Bug 780439] Kill off the remains of nsIBox r=roc
This commit is contained in:
parent
fe804d085c
commit
a8ba5502f2
@ -25,6 +25,7 @@
|
||||
#include "nsEventStates.h"
|
||||
#include "mozilla/TimeStamp.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsIFrame.h"
|
||||
|
||||
class nsIPresShell;
|
||||
class nsIDocShell;
|
||||
|
@ -7615,7 +7615,7 @@ nsFrame::GetPrefSize(nsBoxLayoutState& aState)
|
||||
|
||||
// get our size in CSS.
|
||||
bool widthSet, heightSet;
|
||||
bool completelyRedefined = nsIBox::AddCSSPrefSize(this, size, widthSet, heightSet);
|
||||
bool completelyRedefined = nsIFrame::AddCSSPrefSize(this, size, widthSet, heightSet);
|
||||
|
||||
// Refresh our caches with new sizes.
|
||||
if (!completelyRedefined) {
|
||||
@ -7652,7 +7652,7 @@ nsFrame::GetMinSize(nsBoxLayoutState& aState)
|
||||
// get our size in CSS.
|
||||
bool widthSet, heightSet;
|
||||
bool completelyRedefined =
|
||||
nsIBox::AddCSSMinSize(aState, this, size, widthSet, heightSet);
|
||||
nsIFrame::AddCSSMinSize(aState, this, size, widthSet, heightSet);
|
||||
|
||||
// Refresh our caches with new sizes.
|
||||
if (!completelyRedefined) {
|
||||
@ -7815,7 +7815,7 @@ nsFrame::BoxReflow(nsBoxLayoutState& aState,
|
||||
|
||||
//printf("width=%d, height=%d\n", aWidth, aHeight);
|
||||
/*
|
||||
nsIBox* parent;
|
||||
nsIFrame* parent;
|
||||
GetParentBox(&parent);
|
||||
|
||||
// if (parent->GetStateBits() & NS_STATE_CURRENTLY_IN_DEBUG)
|
||||
|
@ -306,7 +306,7 @@ static nsSize ComputeInsideBorderSize(ScrollReflowState* aState,
|
||||
}
|
||||
|
||||
static void
|
||||
GetScrollbarMetrics(nsBoxLayoutState& aState, nsIBox* aBox, nsSize* aMin,
|
||||
GetScrollbarMetrics(nsBoxLayoutState& aState, nsIFrame* aBox, nsSize* aMin,
|
||||
nsSize* aPref, bool aVertical)
|
||||
{
|
||||
NS_ASSERTION(aState.GetRenderingContext(),
|
||||
@ -1200,7 +1200,7 @@ nsXULScrollFrame::GetPrefSize(nsBoxLayoutState& aState)
|
||||
|
||||
AddBorderAndPadding(pref);
|
||||
bool widthSet, heightSet;
|
||||
nsIBox::AddCSSPrefSize(this, pref, widthSet, heightSet);
|
||||
nsIFrame::AddCSSPrefSize(this, pref, widthSet, heightSet);
|
||||
return pref;
|
||||
}
|
||||
|
||||
@ -1235,7 +1235,7 @@ nsXULScrollFrame::GetMinSize(nsBoxLayoutState& aState)
|
||||
|
||||
AddBorderAndPadding(min);
|
||||
bool widthSet, heightSet;
|
||||
nsIBox::AddCSSMinSize(aState, this, min, widthSet, heightSet);
|
||||
nsIFrame::AddCSSMinSize(aState, this, min, widthSet, heightSet);
|
||||
return min;
|
||||
}
|
||||
|
||||
@ -1250,7 +1250,7 @@ nsXULScrollFrame::GetMaxSize(nsBoxLayoutState& aState)
|
||||
|
||||
AddBorderAndPadding(maxSize);
|
||||
bool widthSet, heightSet;
|
||||
nsIBox::AddCSSMaxSize(this, maxSize, widthSet, heightSet);
|
||||
nsIFrame::AddCSSMaxSize(this, maxSize, widthSet, heightSet);
|
||||
return maxSize;
|
||||
}
|
||||
|
||||
@ -3952,7 +3952,7 @@ nsGfxScrollFrameInner::GetActualScrollbarSizes() const
|
||||
}
|
||||
|
||||
void
|
||||
nsGfxScrollFrameInner::SetScrollbarVisibility(nsIBox* aScrollbar, bool aVisible)
|
||||
nsGfxScrollFrameInner::SetScrollbarVisibility(nsIFrame* aScrollbar, bool aVisible)
|
||||
{
|
||||
nsScrollbarFrame* scrollbar = do_QueryFrame(aScrollbar);
|
||||
if (scrollbar) {
|
||||
@ -3966,7 +3966,7 @@ nsGfxScrollFrameInner::SetScrollbarVisibility(nsIBox* aScrollbar, bool aVisible)
|
||||
}
|
||||
|
||||
nscoord
|
||||
nsGfxScrollFrameInner::GetCoordAttribute(nsIBox* aBox, nsIAtom* aAtom,
|
||||
nsGfxScrollFrameInner::GetCoordAttribute(nsIFrame* aBox, nsIAtom* aAtom,
|
||||
nscoord aDefaultValue,
|
||||
nscoord* aRangeStart,
|
||||
nscoord* aRangeLength)
|
||||
|
@ -122,7 +122,7 @@ public:
|
||||
nscoord aIncrement);
|
||||
static void SetScrollbarEnabled(nsIContent* aContent, nscoord aMaxPos);
|
||||
void SetCoordAttribute(nsIContent* aContent, nsIAtom* aAtom, nscoord aSize);
|
||||
nscoord GetCoordAttribute(nsIBox* aFrame, nsIAtom* aAtom, nscoord aDefaultValue,
|
||||
nscoord GetCoordAttribute(nsIFrame* aFrame, nsIAtom* aAtom, nscoord aDefaultValue,
|
||||
nscoord* aRangeStart, nscoord* aRangeLength);
|
||||
|
||||
// Update scrollbar curpos attributes to reflect current scroll position
|
||||
@ -178,7 +178,7 @@ public:
|
||||
void RestoreState(nsPresState* aState);
|
||||
|
||||
nsIFrame* GetScrolledFrame() const { return mScrolledFrame; }
|
||||
nsIBox* GetScrollbarBox(bool aVertical) const {
|
||||
nsIFrame* GetScrollbarBox(bool aVertical) const {
|
||||
return aVertical ? mVScrollbarBox : mHScrollbarBox;
|
||||
}
|
||||
|
||||
@ -189,7 +189,7 @@ public:
|
||||
mListeners.RemoveElement(aListener);
|
||||
}
|
||||
|
||||
static void SetScrollbarVisibility(nsIBox* aScrollbar, bool aVisible);
|
||||
static void SetScrollbarVisibility(nsIFrame* aScrollbar, bool aVisible);
|
||||
|
||||
/**
|
||||
* GetScrolledRect is designed to encapsulate deciding which
|
||||
@ -265,11 +265,11 @@ public:
|
||||
nsRevocableEventPtr<ScrollEvent> mScrollEvent;
|
||||
nsRevocableEventPtr<AsyncScrollPortEvent> mAsyncScrollPortEvent;
|
||||
nsRevocableEventPtr<ScrolledAreaEvent> mScrolledAreaEvent;
|
||||
nsIBox* mHScrollbarBox;
|
||||
nsIBox* mVScrollbarBox;
|
||||
nsIFrame* mHScrollbarBox;
|
||||
nsIFrame* mVScrollbarBox;
|
||||
nsIFrame* mScrolledFrame;
|
||||
nsIBox* mScrollCornerBox;
|
||||
nsIBox* mResizerBox;
|
||||
nsIFrame* mScrollCornerBox;
|
||||
nsIFrame* mResizerBox;
|
||||
nsContainerFrame* mOuter;
|
||||
nsRefPtr<AsyncScroll> mAsyncScroll;
|
||||
nsAutoPtr<mozilla::ScrollbarActivity> mScrollbarActivity;
|
||||
@ -493,7 +493,7 @@ public:
|
||||
virtual void RemoveScrollPositionListener(nsIScrollPositionListener* aListener) {
|
||||
mInner.RemoveScrollPositionListener(aListener);
|
||||
}
|
||||
virtual nsIBox* GetScrollbarBox(bool aVertical) {
|
||||
virtual nsIFrame* GetScrollbarBox(bool aVertical) {
|
||||
return mInner.GetScrollbarBox(aVertical);
|
||||
}
|
||||
virtual void CurPosAttributeChanged(nsIContent* aChild) {
|
||||
@ -738,7 +738,7 @@ public:
|
||||
virtual void RemoveScrollPositionListener(nsIScrollPositionListener* aListener) {
|
||||
mInner.RemoveScrollPositionListener(aListener);
|
||||
}
|
||||
virtual nsIBox* GetScrollbarBox(bool aVertical) {
|
||||
virtual nsIFrame* GetScrollbarBox(bool aVertical) {
|
||||
return mInner.GetScrollbarBox(aVertical);
|
||||
}
|
||||
virtual void CurPosAttributeChanged(nsIContent* aChild) {
|
||||
|
@ -89,8 +89,6 @@ class Layer;
|
||||
}
|
||||
}
|
||||
|
||||
typedef class nsIFrame nsIBox;
|
||||
|
||||
/**
|
||||
* Indication of how the frame can be split. This is used when doing runaround
|
||||
* of floats, and when pulling up child frames from a next-in-flow.
|
||||
@ -2677,17 +2675,17 @@ 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);
|
||||
nsIBox* GetChildBox() const
|
||||
nsIFrame* GetChildBox() const
|
||||
{
|
||||
// box layout ends at box-wrapped frames, so don't allow these frames
|
||||
// to report child boxes.
|
||||
return IsBoxFrame() ? GetFirstPrincipalChild() : nullptr;
|
||||
}
|
||||
nsIBox* GetNextBox() const
|
||||
nsIFrame* GetNextBox() const
|
||||
{
|
||||
return (mParent && mParent->IsBoxFrame()) ? mNextSibling : nullptr;
|
||||
}
|
||||
nsIBox* GetParentBox() const
|
||||
nsIFrame* GetParentBox() const
|
||||
{
|
||||
return (mParent && mParent->IsBoxFrame()) ? mParent : nullptr;
|
||||
}
|
||||
@ -2709,7 +2707,7 @@ NS_PTR_TO_INT32(frame->Properties().Get(nsIFrame::ParagraphDepthProperty()))
|
||||
bool IsNormalDirection() const { return (mState & NS_STATE_IS_DIRECTION_NORMAL) != 0; }
|
||||
|
||||
NS_HIDDEN_(nsresult) Redraw(nsBoxLayoutState& aState, const nsRect* aRect = nullptr);
|
||||
NS_IMETHOD RelayoutChildAtOrdinal(nsBoxLayoutState& aState, nsIBox* aChild)=0;
|
||||
NS_IMETHOD RelayoutChildAtOrdinal(nsBoxLayoutState& aState, nsIFrame* aChild)=0;
|
||||
// XXX take this out after we've branched
|
||||
virtual bool GetMouseThrough() const { return false; }
|
||||
|
||||
@ -2726,11 +2724,11 @@ NS_PTR_TO_INT32(frame->Properties().Get(nsIFrame::ParagraphDepthProperty()))
|
||||
*/
|
||||
virtual bool HasTerminalNewline() const;
|
||||
|
||||
static bool AddCSSPrefSize(nsIBox* aBox, nsSize& aSize, bool& aWidth, bool& aHeightSet);
|
||||
static bool AddCSSMinSize(nsBoxLayoutState& aState, nsIBox* aBox,
|
||||
nsSize& aSize, bool& aWidth, bool& aHeightSet);
|
||||
static bool AddCSSMaxSize(nsIBox* aBox, nsSize& aSize, bool& aWidth, bool& aHeightSet);
|
||||
static bool AddCSSFlex(nsBoxLayoutState& aState, nsIBox* aBox, nscoord& aFlex);
|
||||
static bool AddCSSPrefSize(nsIFrame* aBox, nsSize& aSize, bool& aWidth, bool& aHeightSet);
|
||||
static bool AddCSSMinSize(nsBoxLayoutState& aState, nsIFrame* aBox,
|
||||
nsSize& aSize, bool& aWidth, bool& aHeightSet);
|
||||
static bool AddCSSMaxSize(nsIFrame* aBox, nsSize& aSize, bool& aWidth, bool& aHeightSet);
|
||||
static bool AddCSSFlex(nsBoxLayoutState& aState, nsIFrame* aBox, nscoord& aFlex);
|
||||
|
||||
// END OF BOX LAYOUT METHODS
|
||||
// The above methods have been migrated from nsIBox and are in the process of
|
||||
|
@ -13,12 +13,12 @@
|
||||
#include "nsISupports.h"
|
||||
#include "nsCoord.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsIFrame.h" // to get nsIBox, which is a typedef
|
||||
|
||||
#define NS_DEFAULT_VERTICAL_SCROLL_DISTANCE 3
|
||||
|
||||
class nsBoxLayoutState;
|
||||
class nsIScrollPositionListener;
|
||||
class nsIFrame;
|
||||
|
||||
/**
|
||||
* Interface for frames that are scrollable. This interface exposes
|
||||
@ -179,7 +179,7 @@ public:
|
||||
* setting up a scrollbar mediator if you want to redirect scrollbar
|
||||
* input.
|
||||
*/
|
||||
virtual nsIBox* GetScrollbarBox(bool aVertical) = 0;
|
||||
virtual nsIFrame* GetScrollbarBox(bool aVertical) = 0;
|
||||
|
||||
/**
|
||||
* Internal method used by scrollbars to notify their scrolling
|
||||
|
@ -246,20 +246,20 @@ nsGrid::FreeMap()
|
||||
* finds the first <rows> and <columns> tags in the <grid> tag
|
||||
*/
|
||||
void
|
||||
nsGrid::FindRowsAndColumns(nsIBox** aRows, nsIBox** aColumns)
|
||||
nsGrid::FindRowsAndColumns(nsIFrame** aRows, nsIFrame** aColumns)
|
||||
{
|
||||
*aRows = nullptr;
|
||||
*aColumns = nullptr;
|
||||
|
||||
// find the boxes that contain our rows and columns
|
||||
nsIBox* child = nullptr;
|
||||
nsIFrame* child = nullptr;
|
||||
// if we have <grid></grid> then mBox will be null (bug 125689)
|
||||
if (mBox)
|
||||
child = mBox->GetChildBox();
|
||||
|
||||
while(child)
|
||||
{
|
||||
nsIBox* oldBox = child;
|
||||
nsIFrame* oldBox = child;
|
||||
nsIScrollableFrame *scrollFrame = do_QueryFrame(child);
|
||||
if (scrollFrame) {
|
||||
nsIFrame* scrolledFrame = scrollFrame->GetScrolledFrame();
|
||||
@ -297,7 +297,7 @@ nsGrid::FindRowsAndColumns(nsIBox** aRows, nsIBox** aColumns)
|
||||
* of cells in each row.
|
||||
*/
|
||||
void
|
||||
nsGrid::CountRowsColumns(nsIBox* aRowBox, PRInt32& aRowCount, PRInt32& aComputedColumnCount)
|
||||
nsGrid::CountRowsColumns(nsIFrame* aRowBox, PRInt32& aRowCount, PRInt32& aComputedColumnCount)
|
||||
{
|
||||
aRowCount = 0;
|
||||
aComputedColumnCount = 0;
|
||||
@ -314,7 +314,7 @@ nsGrid::CountRowsColumns(nsIBox* aRowBox, PRInt32& aRowCount, PRInt32& aComputed
|
||||
* Given the number of rows create nsGridRow objects for them and full them out.
|
||||
*/
|
||||
void
|
||||
nsGrid::BuildRows(nsIBox* aBox, PRInt32 aRowCount, nsGridRow** aRows, bool aIsHorizontal)
|
||||
nsGrid::BuildRows(nsIFrame* aBox, PRInt32 aRowCount, nsGridRow** aRows, bool aIsHorizontal)
|
||||
{
|
||||
// if no rows then return null
|
||||
if (aRowCount == 0) {
|
||||
@ -410,7 +410,7 @@ nsGrid::PopulateCellMap(nsGridRow* aRows, nsGridRow* aColumns, PRInt32 aRowCount
|
||||
|
||||
for(PRInt32 i=0; i < aRowCount; i++)
|
||||
{
|
||||
nsIBox* child = nullptr;
|
||||
nsIFrame* child = nullptr;
|
||||
nsGridRow* row = &aRows[i];
|
||||
|
||||
// skip bogus rows. They have no cells
|
||||
@ -451,7 +451,7 @@ nsGrid::PopulateCellMap(nsGridRow* aRows, nsGridRow* aColumns, PRInt32 aRowCount
|
||||
* will get recalculated and get a layout.
|
||||
*/
|
||||
void
|
||||
nsGrid::DirtyRows(nsIBox* aRowBox, nsBoxLayoutState& aState)
|
||||
nsGrid::DirtyRows(nsIFrame* aRowBox, nsBoxLayoutState& aState)
|
||||
{
|
||||
// make sure we prevent others from dirtying things.
|
||||
mMarkingDirty = true;
|
||||
@ -560,7 +560,7 @@ nsGrid::GetMaxRowSize(nsBoxLayoutState& aState, PRInt32 aRowIndex, bool aIsHoriz
|
||||
|
||||
// static
|
||||
nsIGridPart*
|
||||
nsGrid::GetPartFromBox(nsIBox* aBox)
|
||||
nsGrid::GetPartFromBox(nsIFrame* aBox)
|
||||
{
|
||||
if (!aBox)
|
||||
return nullptr;
|
||||
@ -570,7 +570,7 @@ nsGrid::GetPartFromBox(nsIBox* aBox)
|
||||
}
|
||||
|
||||
nsMargin
|
||||
nsGrid::GetBoxTotalMargin(nsIBox* aBox, bool aIsHorizontal)
|
||||
nsGrid::GetBoxTotalMargin(nsIFrame* aBox, bool aIsHorizontal)
|
||||
{
|
||||
nsMargin margin(0,0,0,0);
|
||||
// walk the boxes parent chain getting the border/padding/margin of our parent rows
|
||||
@ -662,7 +662,7 @@ nsGrid::GetRowOffsets(nsBoxLayoutState& aState, PRInt32 aIndex, nscoord& aTop, n
|
||||
}
|
||||
|
||||
// first get the rows top and bottom border and padding
|
||||
nsIBox* box = row->GetBox();
|
||||
nsIFrame* box = row->GetBox();
|
||||
|
||||
// add up all the padding
|
||||
nsMargin margin(0,0,0,0);
|
||||
@ -735,7 +735,7 @@ nsGrid::GetRowOffsets(nsBoxLayoutState& aState, PRInt32 aIndex, nscoord& aTop, n
|
||||
nsMargin totalChildBorderPadding(0,0,0,0);
|
||||
|
||||
nsGridRow* column = GetColumnAt(i,aIsHorizontal);
|
||||
nsIBox* box = column->GetBox();
|
||||
nsIFrame* box = column->GetBox();
|
||||
|
||||
if (box)
|
||||
{
|
||||
@ -821,14 +821,14 @@ nsGrid::GetPrefRowHeight(nsBoxLayoutState& aState, PRInt32 aIndex, bool aIsHoriz
|
||||
if (row->IsPrefSet())
|
||||
return row->mPref;
|
||||
|
||||
nsIBox* box = row->mBox;
|
||||
nsIFrame* box = row->mBox;
|
||||
|
||||
// set in CSS?
|
||||
if (box)
|
||||
{
|
||||
bool widthSet, heightSet;
|
||||
nsSize cssSize(-1, -1);
|
||||
nsIBox::AddCSSPrefSize(box, cssSize, widthSet, heightSet);
|
||||
nsIFrame::AddCSSPrefSize(box, cssSize, widthSet, heightSet);
|
||||
|
||||
row->mPref = GET_HEIGHT(cssSize, aIsHorizontal);
|
||||
|
||||
@ -898,13 +898,13 @@ nsGrid::GetMinRowHeight(nsBoxLayoutState& aState, PRInt32 aIndex, bool aIsHorizo
|
||||
if (row->IsMinSet())
|
||||
return row->mMin;
|
||||
|
||||
nsIBox* box = row->mBox;
|
||||
nsIFrame* box = row->mBox;
|
||||
|
||||
// set in CSS?
|
||||
if (box) {
|
||||
bool widthSet, heightSet;
|
||||
nsSize cssSize(-1, -1);
|
||||
nsIBox::AddCSSMinSize(aState, box, cssSize, widthSet, heightSet);
|
||||
nsIFrame::AddCSSMinSize(aState, box, cssSize, widthSet, heightSet);
|
||||
|
||||
row->mMin = GET_HEIGHT(cssSize, aIsHorizontal);
|
||||
|
||||
@ -973,13 +973,13 @@ nsGrid::GetMaxRowHeight(nsBoxLayoutState& aState, PRInt32 aIndex, bool aIsHorizo
|
||||
if (row->IsMaxSet())
|
||||
return row->mMax;
|
||||
|
||||
nsIBox* box = row->mBox;
|
||||
nsIFrame* box = row->mBox;
|
||||
|
||||
// set in CSS?
|
||||
if (box) {
|
||||
bool widthSet, heightSet;
|
||||
nsSize cssSize(-1, -1);
|
||||
nsIBox::AddCSSMaxSize(box, cssSize, widthSet, heightSet);
|
||||
nsIFrame::AddCSSMaxSize(box, cssSize, widthSet, heightSet);
|
||||
|
||||
row->mMax = GET_HEIGHT(cssSize, aIsHorizontal);
|
||||
|
||||
@ -1036,7 +1036,7 @@ nsGrid::GetMaxRowHeight(nsBoxLayoutState& aState, PRInt32 aIndex, bool aIsHorizo
|
||||
}
|
||||
|
||||
bool
|
||||
nsGrid::IsGrid(nsIBox* aBox)
|
||||
nsGrid::IsGrid(nsIFrame* aBox)
|
||||
{
|
||||
nsIGridPart* part = GetPartFromBox(aBox);
|
||||
if (!part)
|
||||
@ -1065,7 +1065,7 @@ nsGrid::GetRowFlex(nsBoxLayoutState& aState, PRInt32 aIndex, bool aIsHorizontal)
|
||||
if (row->IsFlexSet())
|
||||
return row->mFlex;
|
||||
|
||||
nsIBox* box = row->mBox;
|
||||
nsIFrame* box = row->mBox;
|
||||
row->mFlex = 0;
|
||||
|
||||
if (box) {
|
||||
@ -1115,8 +1115,8 @@ nsGrid::GetRowFlex(nsBoxLayoutState& aState, PRInt32 aIndex, bool aIsHorizontal)
|
||||
// the grid. 3) Then we are not flexible
|
||||
|
||||
box = GetScrollBox(box);
|
||||
nsIBox* parent = box->GetParentBox();
|
||||
nsIBox* parentsParent=nullptr;
|
||||
nsIFrame* parent = box->GetParentBox();
|
||||
nsIFrame* parentsParent=nullptr;
|
||||
|
||||
while(parent)
|
||||
{
|
||||
@ -1129,7 +1129,7 @@ nsGrid::GetRowFlex(nsBoxLayoutState& aState, PRInt32 aIndex, bool aIsHorizontal)
|
||||
if (parentsParent) {
|
||||
if (!IsGrid(parentsParent)) {
|
||||
nscoord flex = parent->GetFlex(aState);
|
||||
nsIBox::AddCSSFlex(aState, parent, flex);
|
||||
nsIFrame::AddCSSFlex(aState, parent, flex);
|
||||
if (flex == 0) {
|
||||
row->mFlex = 0;
|
||||
return row->mFlex;
|
||||
@ -1143,7 +1143,7 @@ nsGrid::GetRowFlex(nsBoxLayoutState& aState, PRInt32 aIndex, bool aIsHorizontal)
|
||||
|
||||
// get the row flex.
|
||||
row->mFlex = box->GetFlex(aState);
|
||||
nsIBox::AddCSSFlex(aState, box, row->mFlex);
|
||||
nsIFrame::AddCSSFlex(aState, box, row->mFlex);
|
||||
}
|
||||
|
||||
return row->mFlex;
|
||||
@ -1223,8 +1223,8 @@ nsGrid::RowAddedOrRemoved(nsBoxLayoutState& aState, PRInt32 aIndex, bool aIsHori
|
||||
* Scrollframes are tranparent. If this is given a scrollframe is will return the
|
||||
* frame inside. If there is no scrollframe it does nothing.
|
||||
*/
|
||||
nsIBox*
|
||||
nsGrid::GetScrolledBox(nsIBox* aChild)
|
||||
nsIFrame*
|
||||
nsGrid::GetScrolledBox(nsIFrame* aChild)
|
||||
{
|
||||
// first see if it is a scrollframe. If so walk down into it and get the scrolled child
|
||||
nsIScrollableFrame *scrollFrame = do_QueryFrame(aChild);
|
||||
@ -1241,14 +1241,14 @@ nsGrid::GetScrolledBox(nsIBox* aChild)
|
||||
* Scrollframes are tranparent. If this is given a child in a scrollframe is will return the
|
||||
* scrollframe ourside it. If there is no scrollframe it does nothing.
|
||||
*/
|
||||
nsIBox*
|
||||
nsGrid::GetScrollBox(nsIBox* aChild)
|
||||
nsIFrame*
|
||||
nsGrid::GetScrollBox(nsIFrame* aChild)
|
||||
{
|
||||
if (!aChild)
|
||||
return nullptr;
|
||||
|
||||
// get parent
|
||||
nsIBox* parent = aChild->GetParentBox();
|
||||
nsIFrame* parent = aChild->GetParentBox();
|
||||
|
||||
// walk up until we find a scrollframe or a part
|
||||
// if it's a scrollframe return it.
|
||||
|
@ -55,7 +55,7 @@ public:
|
||||
|
||||
void RowAddedOrRemoved(nsBoxLayoutState& aBoxLayoutState, PRInt32 aIndex, bool aIsHorizontal = true);
|
||||
void CellAddedOrRemoved(nsBoxLayoutState& aBoxLayoutState, PRInt32 aIndex, bool aIsHorizontal = true);
|
||||
void DirtyRows(nsIBox* aRowBox, nsBoxLayoutState& aState);
|
||||
void DirtyRows(nsIFrame* aRowBox, nsBoxLayoutState& aState);
|
||||
#ifdef DEBUG_grid
|
||||
void PrintCellMap();
|
||||
#endif
|
||||
@ -63,16 +63,16 @@ public:
|
||||
PRInt32 GetExtraRowCount(bool aIsHorizontal = true);
|
||||
|
||||
// accessors
|
||||
void SetBox(nsIBox* aBox) { mBox = aBox; }
|
||||
nsIBox* GetBox() { return mBox; }
|
||||
nsIBox* GetRowsBox() { return mRowsBox; }
|
||||
nsIBox* GetColumnsBox() { return mColumnsBox; }
|
||||
void SetBox(nsIFrame* aBox) { mBox = aBox; }
|
||||
nsIFrame* GetBox() { return mBox; }
|
||||
nsIFrame* GetRowsBox() { return mRowsBox; }
|
||||
nsIFrame* GetColumnsBox() { return mColumnsBox; }
|
||||
PRInt32 GetRowCount(PRInt32 aIsHorizontal = true);
|
||||
PRInt32 GetColumnCount(PRInt32 aIsHorizontal = true);
|
||||
|
||||
static nsIBox* GetScrolledBox(nsIBox* aChild);
|
||||
static nsIBox* GetScrollBox(nsIBox* aChild);
|
||||
static nsIGridPart* GetPartFromBox(nsIBox* aBox);
|
||||
static nsIFrame* GetScrolledBox(nsIFrame* aChild);
|
||||
static nsIFrame* GetScrollBox(nsIFrame* aChild);
|
||||
static nsIGridPart* GetPartFromBox(nsIFrame* aBox);
|
||||
void GetFirstAndLastRow(nsBoxLayoutState& aState,
|
||||
PRInt32& aFirstIndex,
|
||||
PRInt32& aLastIndex,
|
||||
@ -82,20 +82,20 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
nsMargin GetBoxTotalMargin(nsIBox* aBox, bool aIsHorizontal = true);
|
||||
nsMargin GetBoxTotalMargin(nsIFrame* aBox, bool aIsHorizontal = true);
|
||||
|
||||
void FreeMap();
|
||||
void FindRowsAndColumns(nsIBox** aRows, nsIBox** aColumns);
|
||||
void BuildRows(nsIBox* aBox, PRInt32 aSize, nsGridRow** aColumnsRows, bool aIsHorizontal = true);
|
||||
void FindRowsAndColumns(nsIFrame** aRows, nsIFrame** aColumns);
|
||||
void BuildRows(nsIFrame* aBox, PRInt32 aSize, nsGridRow** aColumnsRows, bool aIsHorizontal = true);
|
||||
nsGridCell* BuildCellMap(PRInt32 aRows, PRInt32 aColumns);
|
||||
void PopulateCellMap(nsGridRow* aRows, nsGridRow* aColumns, PRInt32 aRowCount, PRInt32 aColumnCount, bool aIsHorizontal = true);
|
||||
void CountRowsColumns(nsIBox* aBox, PRInt32& aRowCount, PRInt32& aComputedColumnCount);
|
||||
void CountRowsColumns(nsIFrame* aBox, PRInt32& aRowCount, PRInt32& aComputedColumnCount);
|
||||
void SetLargestSize(nsSize& aSize, nscoord aHeight, bool aIsHorizontal = true);
|
||||
void SetSmallestSize(nsSize& aSize, nscoord aHeight, bool aIsHorizontal = true);
|
||||
bool IsGrid(nsIBox* aBox);
|
||||
bool IsGrid(nsIFrame* aBox);
|
||||
|
||||
// the box that implement the <grid> tag
|
||||
nsIBox* mBox;
|
||||
nsIFrame* mBox;
|
||||
|
||||
// an array of row object
|
||||
nsGridRow* mRows;
|
||||
@ -104,10 +104,10 @@ private:
|
||||
nsGridRow* mColumns;
|
||||
|
||||
// the first in the <grid> that implements the <rows> tag.
|
||||
nsIBox* mRowsBox;
|
||||
nsIFrame* mRowsBox;
|
||||
|
||||
// the first in the <grid> that implements the <columns> tag.
|
||||
nsIBox* mColumnsBox;
|
||||
nsIFrame* mColumnsBox;
|
||||
|
||||
// a flag that is false tells us to rebuild the who grid
|
||||
bool mNeedsRebuild;
|
||||
|
@ -16,7 +16,6 @@
|
||||
class nsBoxLayoutState;
|
||||
struct nsSize;
|
||||
class nsIFrame;
|
||||
typedef class nsIFrame nsIBox;
|
||||
|
||||
/*
|
||||
* Grid cell is what makes up the cellmap in the grid. Each GridCell contains
|
||||
@ -38,14 +37,14 @@ public:
|
||||
bool IsCollapsed();
|
||||
|
||||
// accessors
|
||||
nsIBox* GetBoxInColumn() { return mBoxInColumn; }
|
||||
nsIBox* GetBoxInRow() { return mBoxInRow; }
|
||||
void SetBoxInRow(nsIBox* aBox) { mBoxInRow = aBox; }
|
||||
void SetBoxInColumn(nsIBox* aBox) { mBoxInColumn = aBox; }
|
||||
nsIFrame* GetBoxInColumn() { return mBoxInColumn; }
|
||||
nsIFrame* GetBoxInRow() { return mBoxInRow; }
|
||||
void SetBoxInRow(nsIFrame* aBox) { mBoxInRow = aBox; }
|
||||
void SetBoxInColumn(nsIFrame* aBox) { mBoxInColumn = aBox; }
|
||||
|
||||
private:
|
||||
nsIBox* mBoxInColumn;
|
||||
nsIBox* mBoxInRow;
|
||||
nsIFrame* mBoxInColumn;
|
||||
nsIFrame* mBoxInRow;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -34,7 +34,7 @@ nsGridLayout2::nsGridLayout2(nsIPresShell* aPresShell):nsStackLayout()
|
||||
|
||||
// static
|
||||
void
|
||||
nsGridLayout2::AddOffset(nsBoxLayoutState& aState, nsIBox* aChild, nsSize& aSize)
|
||||
nsGridLayout2::AddOffset(nsBoxLayoutState& aState, nsIFrame* aChild, nsSize& aSize)
|
||||
{
|
||||
nsMargin offset;
|
||||
GetOffset(aState, aChild, offset);
|
||||
@ -43,7 +43,7 @@ nsGridLayout2::AddOffset(nsBoxLayoutState& aState, nsIBox* aChild, nsSize& aSize
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsGridLayout2::Layout(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState)
|
||||
nsGridLayout2::Layout(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState)
|
||||
{
|
||||
// XXX This should be set a better way!
|
||||
mGrid.SetBox(aBox);
|
||||
@ -57,7 +57,7 @@ nsGridLayout2::Layout(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState)
|
||||
}
|
||||
|
||||
void
|
||||
nsGridLayout2::IntrinsicWidthsDirty(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState)
|
||||
nsGridLayout2::IntrinsicWidthsDirty(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState)
|
||||
{
|
||||
nsStackLayout::IntrinsicWidthsDirty(aBox, aBoxLayoutState);
|
||||
// XXXldb We really don't need to do all the work that NeedsRebuild
|
||||
@ -67,7 +67,7 @@ nsGridLayout2::IntrinsicWidthsDirty(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutSt
|
||||
}
|
||||
|
||||
nsGrid*
|
||||
nsGridLayout2::GetGrid(nsIBox* aBox, PRInt32* aIndex, nsGridRowLayout* aRequestor)
|
||||
nsGridLayout2::GetGrid(nsIFrame* aBox, PRInt32* aIndex, nsGridRowLayout* aRequestor)
|
||||
{
|
||||
// XXX This should be set a better way!
|
||||
mGrid.SetBox(aBox);
|
||||
@ -89,15 +89,15 @@ nsGridLayout2::AddWidth(nsSize& aSize, nscoord aSize2, bool aIsHorizontal)
|
||||
}
|
||||
|
||||
nsSize
|
||||
nsGridLayout2::GetMinSize(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
nsGridLayout2::GetMinSize(nsIFrame* aBox, nsBoxLayoutState& aState)
|
||||
{
|
||||
nsSize minSize = nsStackLayout::GetMinSize(aBox, aState);
|
||||
|
||||
// if there are no <rows> tags that will sum up our columns,
|
||||
// sum up our columns here.
|
||||
nsSize total(0,0);
|
||||
nsIBox* rowsBox = mGrid.GetRowsBox();
|
||||
nsIBox* columnsBox = mGrid.GetColumnsBox();
|
||||
nsIFrame* rowsBox = mGrid.GetRowsBox();
|
||||
nsIFrame* columnsBox = mGrid.GetColumnsBox();
|
||||
if (!rowsBox || !columnsBox) {
|
||||
if (!rowsBox) {
|
||||
// max height is the sum of our rows
|
||||
@ -128,15 +128,15 @@ nsGridLayout2::GetMinSize(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
}
|
||||
|
||||
nsSize
|
||||
nsGridLayout2::GetPrefSize(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
nsGridLayout2::GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aState)
|
||||
{
|
||||
nsSize pref = nsStackLayout::GetPrefSize(aBox, aState);
|
||||
|
||||
// if there are no <rows> tags that will sum up our columns,
|
||||
// sum up our columns here.
|
||||
nsSize total(0,0);
|
||||
nsIBox* rowsBox = mGrid.GetRowsBox();
|
||||
nsIBox* columnsBox = mGrid.GetColumnsBox();
|
||||
nsIFrame* rowsBox = mGrid.GetRowsBox();
|
||||
nsIFrame* columnsBox = mGrid.GetColumnsBox();
|
||||
if (!rowsBox || !columnsBox) {
|
||||
if (!rowsBox) {
|
||||
// max height is the sum of our rows
|
||||
@ -167,15 +167,15 @@ nsGridLayout2::GetPrefSize(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
}
|
||||
|
||||
nsSize
|
||||
nsGridLayout2::GetMaxSize(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
nsGridLayout2::GetMaxSize(nsIFrame* aBox, nsBoxLayoutState& aState)
|
||||
{
|
||||
nsSize maxSize = nsStackLayout::GetMaxSize(aBox, aState);
|
||||
|
||||
// if there are no <rows> tags that will sum up our columns,
|
||||
// sum up our columns here.
|
||||
nsSize total(NS_INTRINSICSIZE, NS_INTRINSICSIZE);
|
||||
nsIBox* rowsBox = mGrid.GetRowsBox();
|
||||
nsIBox* columnsBox = mGrid.GetColumnsBox();
|
||||
nsIFrame* rowsBox = mGrid.GetRowsBox();
|
||||
nsIFrame* columnsBox = mGrid.GetColumnsBox();
|
||||
if (!rowsBox || !columnsBox) {
|
||||
if (!rowsBox) {
|
||||
total.height = 0;
|
||||
@ -208,7 +208,7 @@ nsGridLayout2::GetMaxSize(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
}
|
||||
|
||||
PRInt32
|
||||
nsGridLayout2::BuildRows(nsIBox* aBox, nsGridRow* aRows)
|
||||
nsGridLayout2::BuildRows(nsIFrame* aBox, nsGridRow* aRows)
|
||||
{
|
||||
if (aBox) {
|
||||
aRows[0].Init(aBox, true);
|
||||
@ -218,37 +218,37 @@ nsGridLayout2::BuildRows(nsIBox* aBox, nsGridRow* aRows)
|
||||
}
|
||||
|
||||
nsMargin
|
||||
nsGridLayout2::GetTotalMargin(nsIBox* aBox, bool aIsHorizontal)
|
||||
nsGridLayout2::GetTotalMargin(nsIFrame* aBox, bool aIsHorizontal)
|
||||
{
|
||||
nsMargin margin(0,0,0,0);
|
||||
return margin;
|
||||
}
|
||||
|
||||
void
|
||||
nsGridLayout2::ChildrenInserted(nsIBox* aBox, nsBoxLayoutState& aState,
|
||||
nsIBox* aPrevBox,
|
||||
nsGridLayout2::ChildrenInserted(nsIFrame* aBox, nsBoxLayoutState& aState,
|
||||
nsIFrame* aPrevBox,
|
||||
const nsFrameList::Slice& aNewChildren)
|
||||
{
|
||||
mGrid.NeedsRebuild(aState);
|
||||
}
|
||||
|
||||
void
|
||||
nsGridLayout2::ChildrenAppended(nsIBox* aBox, nsBoxLayoutState& aState,
|
||||
nsGridLayout2::ChildrenAppended(nsIFrame* aBox, nsBoxLayoutState& aState,
|
||||
const nsFrameList::Slice& aNewChildren)
|
||||
{
|
||||
mGrid.NeedsRebuild(aState);
|
||||
}
|
||||
|
||||
void
|
||||
nsGridLayout2::ChildrenRemoved(nsIBox* aBox, nsBoxLayoutState& aState,
|
||||
nsIBox* aChildList)
|
||||
nsGridLayout2::ChildrenRemoved(nsIFrame* aBox, nsBoxLayoutState& aState,
|
||||
nsIFrame* aChildList)
|
||||
{
|
||||
mGrid.NeedsRebuild(aState);
|
||||
}
|
||||
|
||||
void
|
||||
nsGridLayout2::ChildrenSet(nsIBox* aBox, nsBoxLayoutState& aState,
|
||||
nsIBox* aChildList)
|
||||
nsGridLayout2::ChildrenSet(nsIFrame* aBox, nsBoxLayoutState& aState,
|
||||
nsIFrame* aChildList)
|
||||
{
|
||||
mGrid.NeedsRebuild(aState);
|
||||
}
|
||||
|
@ -9,9 +9,10 @@
|
||||
|
||||
#include "nsStackLayout.h"
|
||||
#include "nsIGridPart.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsCoord.h"
|
||||
#include "nsGrid.h"
|
||||
|
||||
class nsIPresContext;
|
||||
class nsGridRowGroupLayout;
|
||||
class nsGridRowLayout;
|
||||
class nsGridRow;
|
||||
@ -30,36 +31,36 @@ public:
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
NS_IMETHOD Layout(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual void IntrinsicWidthsDirty(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
NS_IMETHOD Layout(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual void IntrinsicWidthsDirty(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
|
||||
virtual nsGridRowGroupLayout* CastToRowGroupLayout() { return nullptr; }
|
||||
virtual nsGridLayout2* CastToGridLayout() { return this; }
|
||||
virtual nsGrid* GetGrid(nsIBox* aBox, PRInt32* aIndex, nsGridRowLayout* aRequestor=nullptr);
|
||||
virtual nsIGridPart* GetParentGridPart(nsIBox* aBox, nsIBox** aParentBox) {
|
||||
virtual nsGrid* GetGrid(nsIFrame* aBox, PRInt32* aIndex, nsGridRowLayout* aRequestor=nullptr);
|
||||
virtual nsIGridPart* GetParentGridPart(nsIFrame* aBox, nsIFrame** aParentBox) {
|
||||
NS_NOTREACHED("Should not be called"); return nullptr;
|
||||
}
|
||||
virtual nsSize GetMinSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nsSize GetMaxSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nsSize GetPrefSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual void CountRowsColumns(nsIBox* aBox, PRInt32& aRowCount, PRInt32& aComputedColumnCount) { aRowCount++; }
|
||||
virtual void DirtyRows(nsIBox* aBox, nsBoxLayoutState& aState) { }
|
||||
virtual PRInt32 BuildRows(nsIBox* aBox, nsGridRow* aRows);
|
||||
virtual nsMargin GetTotalMargin(nsIBox* aBox, bool aIsHorizontal);
|
||||
virtual nsSize GetMinSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nsSize GetMaxSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nsSize GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual void CountRowsColumns(nsIFrame* aBox, PRInt32& aRowCount, PRInt32& aComputedColumnCount) { aRowCount++; }
|
||||
virtual void DirtyRows(nsIFrame* aBox, nsBoxLayoutState& aState) { }
|
||||
virtual PRInt32 BuildRows(nsIFrame* aBox, nsGridRow* aRows);
|
||||
virtual nsMargin GetTotalMargin(nsIFrame* aBox, bool aIsHorizontal);
|
||||
virtual Type GetType() { return eGrid; }
|
||||
virtual void ChildrenInserted(nsIBox* aBox, nsBoxLayoutState& aState,
|
||||
nsIBox* aPrevBox,
|
||||
virtual void ChildrenInserted(nsIFrame* aBox, nsBoxLayoutState& aState,
|
||||
nsIFrame* aPrevBox,
|
||||
const nsFrameList::Slice& aNewChildren);
|
||||
virtual void ChildrenAppended(nsIBox* aBox, nsBoxLayoutState& aState,
|
||||
virtual void ChildrenAppended(nsIFrame* aBox, nsBoxLayoutState& aState,
|
||||
const nsFrameList::Slice& aNewChildren);
|
||||
virtual void ChildrenRemoved(nsIBox* aBox, nsBoxLayoutState& aState,
|
||||
nsIBox* aChildList);
|
||||
virtual void ChildrenSet(nsIBox* aBox, nsBoxLayoutState& aState,
|
||||
nsIBox* aChildList);
|
||||
virtual void ChildrenRemoved(nsIFrame* aBox, nsBoxLayoutState& aState,
|
||||
nsIFrame* aChildList);
|
||||
virtual void ChildrenSet(nsIFrame* aBox, nsBoxLayoutState& aState,
|
||||
nsIFrame* aChildList);
|
||||
|
||||
virtual nsIGridPart* AsGridPart() { return this; }
|
||||
|
||||
static void AddOffset(nsBoxLayoutState& aState, nsIBox* aChild, nsSize& aSize);
|
||||
static void AddOffset(nsBoxLayoutState& aState, nsIFrame* aChild, nsSize& aSize);
|
||||
|
||||
protected:
|
||||
|
||||
|
@ -30,7 +30,7 @@ nsGridRow::nsGridRow():mIsBogus(false),
|
||||
}
|
||||
|
||||
void
|
||||
nsGridRow::Init(nsIBox* aBox, bool aIsBogus)
|
||||
nsGridRow::Init(nsIFrame* aBox, bool aIsBogus)
|
||||
{
|
||||
mBox = aBox;
|
||||
mIsBogus = aIsBogus;
|
||||
|
@ -18,7 +18,6 @@
|
||||
class nsGridLayout2;
|
||||
class nsBoxLayoutState;
|
||||
class nsIFrame;
|
||||
typedef class nsIFrame nsIBox;
|
||||
|
||||
/**
|
||||
* The row (or column) data structure in the grid cellmap.
|
||||
@ -28,11 +27,11 @@ class nsGridRow
|
||||
public:
|
||||
nsGridRow();
|
||||
~nsGridRow();
|
||||
|
||||
void Init(nsIBox* aBox, bool aIsBogus);
|
||||
|
||||
void Init(nsIFrame* aBox, bool aIsBogus);
|
||||
|
||||
// accessors
|
||||
nsIBox* GetBox() { return mBox; }
|
||||
nsIFrame* GetBox() { return mBox; }
|
||||
bool IsPrefSet() { return (mPref != -1); }
|
||||
bool IsMinSet() { return (mMin != -1); }
|
||||
bool IsMaxSet() { return (mMax != -1); }
|
||||
@ -43,7 +42,7 @@ public:
|
||||
public:
|
||||
|
||||
bool mIsBogus;
|
||||
nsIBox* mBox;
|
||||
nsIFrame* mBox;
|
||||
nscoord mFlex;
|
||||
nscoord mPref;
|
||||
nscoord mMin;
|
||||
|
@ -52,7 +52,7 @@ nsGridRowGroupFrame::GetFlex(nsBoxLayoutState& aState)
|
||||
|
||||
// ok we are flexible add up our children
|
||||
nscoord totalFlex = 0;
|
||||
nsIBox* child = GetChildBox();
|
||||
nsIFrame* child = GetChildBox();
|
||||
while (child)
|
||||
{
|
||||
totalFlex += child->GetFlex(aState);
|
||||
|
@ -39,7 +39,7 @@ nsGridRowGroupLayout::~nsGridRowGroupLayout()
|
||||
}
|
||||
|
||||
void
|
||||
nsGridRowGroupLayout::ChildAddedOrRemoved(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
nsGridRowGroupLayout::ChildAddedOrRemoved(nsIFrame* aBox, nsBoxLayoutState& aState)
|
||||
{
|
||||
PRInt32 index = 0;
|
||||
nsGrid* grid = GetGrid(aBox, &index);
|
||||
@ -61,7 +61,7 @@ nsGridRowGroupLayout::AddWidth(nsSize& aSize, nscoord aSize2, bool aIsHorizontal
|
||||
}
|
||||
|
||||
nsSize
|
||||
nsGridRowGroupLayout::GetPrefSize(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
nsGridRowGroupLayout::GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aState)
|
||||
{
|
||||
nsSize vpref = nsGridRowLayout::GetPrefSize(aBox, aState);
|
||||
|
||||
@ -95,7 +95,7 @@ nsGridRowGroupLayout::GetPrefSize(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
}
|
||||
|
||||
nsSize
|
||||
nsGridRowGroupLayout::GetMaxSize(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
nsGridRowGroupLayout::GetMaxSize(nsIFrame* aBox, nsBoxLayoutState& aState)
|
||||
{
|
||||
nsSize maxSize = nsGridRowLayout::GetMaxSize(aBox, aState);
|
||||
|
||||
@ -121,7 +121,7 @@ nsGridRowGroupLayout::GetMaxSize(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
}
|
||||
|
||||
nsSize
|
||||
nsGridRowGroupLayout::GetMinSize(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
nsGridRowGroupLayout::GetMinSize(nsIFrame* aBox, nsBoxLayoutState& aState)
|
||||
{
|
||||
nsSize minSize = nsGridRowLayout::GetMinSize(aBox, aState);
|
||||
|
||||
@ -149,7 +149,7 @@ nsGridRowGroupLayout::GetMinSize(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
* Run down through our children dirtying them recursively.
|
||||
*/
|
||||
void
|
||||
nsGridRowGroupLayout::DirtyRows(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
nsGridRowGroupLayout::DirtyRows(nsIFrame* aBox, nsBoxLayoutState& aState)
|
||||
{
|
||||
if (aBox) {
|
||||
// mark us dirty
|
||||
@ -157,12 +157,12 @@ nsGridRowGroupLayout::DirtyRows(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
// calling MarkIntrinsicWidthsDirty for every row group.
|
||||
aState.PresShell()->FrameNeedsReflow(aBox, nsIPresShell::eTreeChange,
|
||||
NS_FRAME_IS_DIRTY);
|
||||
nsIBox* child = aBox->GetChildBox();
|
||||
nsIFrame* child = aBox->GetChildBox();
|
||||
|
||||
while(child) {
|
||||
|
||||
// walk into scrollframes
|
||||
nsIBox* deepChild = nsGrid::GetScrolledBox(child);
|
||||
nsIFrame* deepChild = nsGrid::GetScrolledBox(child);
|
||||
|
||||
// walk into other monuments
|
||||
nsIGridPart* monument = nsGrid::GetPartFromBox(deepChild);
|
||||
@ -176,17 +176,17 @@ nsGridRowGroupLayout::DirtyRows(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
|
||||
|
||||
void
|
||||
nsGridRowGroupLayout::CountRowsColumns(nsIBox* aBox, PRInt32& aRowCount, PRInt32& aComputedColumnCount)
|
||||
nsGridRowGroupLayout::CountRowsColumns(nsIFrame* aBox, PRInt32& aRowCount, PRInt32& aComputedColumnCount)
|
||||
{
|
||||
if (aBox) {
|
||||
PRInt32 startCount = aRowCount;
|
||||
|
||||
nsIBox* child = aBox->GetChildBox();
|
||||
nsIFrame* child = aBox->GetChildBox();
|
||||
|
||||
while(child) {
|
||||
|
||||
// first see if it is a scrollframe. If so walk down into it and get the scrolled child
|
||||
nsIBox* deepChild = nsGrid::GetScrolledBox(child);
|
||||
nsIFrame* deepChild = nsGrid::GetScrolledBox(child);
|
||||
|
||||
nsIGridPart* monument = nsGrid::GetPartFromBox(deepChild);
|
||||
if (monument) {
|
||||
@ -211,17 +211,17 @@ nsGridRowGroupLayout::CountRowsColumns(nsIBox* aBox, PRInt32& aRowCount, PRInt32
|
||||
* Fill out the given row structure recursively
|
||||
*/
|
||||
PRInt32
|
||||
nsGridRowGroupLayout::BuildRows(nsIBox* aBox, nsGridRow* aRows)
|
||||
nsGridRowGroupLayout::BuildRows(nsIFrame* aBox, nsGridRow* aRows)
|
||||
{
|
||||
PRInt32 rowCount = 0;
|
||||
|
||||
if (aBox) {
|
||||
nsIBox* child = aBox->GetChildBox();
|
||||
nsIFrame* child = aBox->GetChildBox();
|
||||
|
||||
while(child) {
|
||||
|
||||
// first see if it is a scrollframe. If so walk down into it and get the scrolled child
|
||||
nsIBox* deepChild = nsGrid::GetScrolledBox(child);
|
||||
nsIFrame* deepChild = nsGrid::GetScrolledBox(child);
|
||||
|
||||
nsIGridPart* monument = nsGrid::GetPartFromBox(deepChild);
|
||||
if (monument) {
|
||||
@ -244,7 +244,7 @@ nsGridRowGroupLayout::BuildRows(nsIBox* aBox, nsGridRow* aRows)
|
||||
}
|
||||
|
||||
nsMargin
|
||||
nsGridRowGroupLayout::GetTotalMargin(nsIBox* aBox, bool aIsHorizontal)
|
||||
nsGridRowGroupLayout::GetTotalMargin(nsIFrame* aBox, bool aIsHorizontal)
|
||||
{
|
||||
// group have border and padding added to the total margin
|
||||
|
||||
|
@ -25,13 +25,13 @@ public:
|
||||
friend already_AddRefed<nsBoxLayout> NS_NewGridRowGroupLayout();
|
||||
|
||||
virtual nsGridRowGroupLayout* CastToRowGroupLayout() { return this; }
|
||||
virtual nsSize GetMinSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nsSize GetPrefSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nsSize GetMaxSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual void CountRowsColumns(nsIBox* aBox, PRInt32& aRowCount, PRInt32& aComputedColumnCount);
|
||||
virtual void DirtyRows(nsIBox* aBox, nsBoxLayoutState& aState);
|
||||
virtual PRInt32 BuildRows(nsIBox* aBox, nsGridRow* aRows);
|
||||
virtual nsMargin GetTotalMargin(nsIBox* aBox, bool aIsHorizontal);
|
||||
virtual nsSize GetMinSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nsSize GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nsSize GetMaxSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual void CountRowsColumns(nsIFrame* aBox, PRInt32& aRowCount, PRInt32& aComputedColumnCount);
|
||||
virtual void DirtyRows(nsIFrame* aBox, nsBoxLayoutState& aState);
|
||||
virtual PRInt32 BuildRows(nsIFrame* aBox, nsGridRow* aRows);
|
||||
virtual nsMargin GetTotalMargin(nsIFrame* aBox, bool aIsHorizontal);
|
||||
virtual PRInt32 GetRowCount() { return mRowCount; }
|
||||
virtual Type GetType() { return eRowGroup; }
|
||||
|
||||
@ -39,7 +39,7 @@ protected:
|
||||
nsGridRowGroupLayout();
|
||||
virtual ~nsGridRowGroupLayout();
|
||||
|
||||
virtual void ChildAddedOrRemoved(nsIBox* aBox, nsBoxLayoutState& aState);
|
||||
virtual void ChildAddedOrRemoved(nsIFrame* aBox, nsBoxLayoutState& aState);
|
||||
static void AddWidth(nsSize& aSize, nscoord aSize2, bool aIsHorizontal);
|
||||
|
||||
private:
|
||||
|
@ -22,34 +22,34 @@ nsGridRowLayout::nsGridRowLayout():nsSprocketLayout()
|
||||
}
|
||||
|
||||
void
|
||||
nsGridRowLayout::ChildrenInserted(nsIBox* aBox, nsBoxLayoutState& aState,
|
||||
nsIBox* aPrevBox,
|
||||
nsGridRowLayout::ChildrenInserted(nsIFrame* aBox, nsBoxLayoutState& aState,
|
||||
nsIFrame* aPrevBox,
|
||||
const nsFrameList::Slice& aNewChildren)
|
||||
{
|
||||
ChildAddedOrRemoved(aBox, aState);
|
||||
}
|
||||
|
||||
void
|
||||
nsGridRowLayout::ChildrenAppended(nsIBox* aBox, nsBoxLayoutState& aState,
|
||||
nsGridRowLayout::ChildrenAppended(nsIFrame* aBox, nsBoxLayoutState& aState,
|
||||
const nsFrameList::Slice& aNewChildren)
|
||||
{
|
||||
ChildAddedOrRemoved(aBox, aState);
|
||||
}
|
||||
|
||||
void
|
||||
nsGridRowLayout::ChildrenRemoved(nsIBox* aBox, nsBoxLayoutState& aState, nsIBox* aChildList)
|
||||
nsGridRowLayout::ChildrenRemoved(nsIFrame* aBox, nsBoxLayoutState& aState, nsIFrame* aChildList)
|
||||
{
|
||||
ChildAddedOrRemoved(aBox, aState);
|
||||
}
|
||||
|
||||
void
|
||||
nsGridRowLayout::ChildrenSet(nsIBox* aBox, nsBoxLayoutState& aState, nsIBox* aChildList)
|
||||
nsGridRowLayout::ChildrenSet(nsIFrame* aBox, nsBoxLayoutState& aState, nsIFrame* aChildList)
|
||||
{
|
||||
ChildAddedOrRemoved(aBox, aState);
|
||||
}
|
||||
|
||||
nsIGridPart*
|
||||
nsGridRowLayout::GetParentGridPart(nsIBox* aBox, nsIBox** aParentBox)
|
||||
nsGridRowLayout::GetParentGridPart(nsIFrame* aBox, nsIFrame** aParentBox)
|
||||
{
|
||||
// go up and find our parent gridRow. Skip and non gridRow
|
||||
// parents.
|
||||
@ -76,12 +76,12 @@ nsGridRowLayout::GetParentGridPart(nsIBox* aBox, nsIBox** aParentBox)
|
||||
|
||||
|
||||
nsGrid*
|
||||
nsGridRowLayout::GetGrid(nsIBox* aBox, PRInt32* aIndex, nsGridRowLayout* aRequestor)
|
||||
nsGridRowLayout::GetGrid(nsIFrame* aBox, PRInt32* aIndex, nsGridRowLayout* aRequestor)
|
||||
{
|
||||
|
||||
if (aRequestor == nullptr)
|
||||
{
|
||||
nsIBox* parentBox; // nsIBox is implemented by nsIFrame and is not refcounted.
|
||||
nsIFrame* parentBox; // nsIFrame is implemented by nsIFrame and is not refcounted.
|
||||
nsIGridPart* parent = GetParentGridPart(aBox, &parentBox);
|
||||
if (parent)
|
||||
return parent->GetGrid(parentBox, aIndex, this);
|
||||
@ -89,12 +89,12 @@ nsGridRowLayout::GetGrid(nsIBox* aBox, PRInt32* aIndex, nsGridRowLayout* aReques
|
||||
}
|
||||
|
||||
PRInt32 index = -1;
|
||||
nsIBox* child = aBox->GetChildBox();
|
||||
nsIFrame* child = aBox->GetChildBox();
|
||||
PRInt32 count = 0;
|
||||
while(child)
|
||||
{
|
||||
// if there is a scrollframe walk inside it to its child
|
||||
nsIBox* childBox = nsGrid::GetScrolledBox(child);
|
||||
nsIFrame* childBox = nsGrid::GetScrolledBox(child);
|
||||
|
||||
nsBoxLayout* layout = childBox->GetLayoutManager();
|
||||
nsIGridPart* gridRow = nsGrid::GetPartFromBox(childBox);
|
||||
@ -121,7 +121,7 @@ nsGridRowLayout::GetGrid(nsIBox* aBox, PRInt32* aIndex, nsGridRowLayout* aReques
|
||||
|
||||
(*aIndex) += index;
|
||||
|
||||
nsIBox* parentBox; // nsIBox is implemented by nsIFrame and is not refcounted.
|
||||
nsIFrame* parentBox; // nsIFrame is implemented by nsIFrame and is not refcounted.
|
||||
nsIGridPart* parent = GetParentGridPart(aBox, &parentBox);
|
||||
if (parent)
|
||||
return parent->GetGrid(parentBox, aIndex, this);
|
||||
@ -130,11 +130,11 @@ nsGridRowLayout::GetGrid(nsIBox* aBox, PRInt32* aIndex, nsGridRowLayout* aReques
|
||||
}
|
||||
|
||||
nsMargin
|
||||
nsGridRowLayout::GetTotalMargin(nsIBox* aBox, bool aIsHorizontal)
|
||||
nsGridRowLayout::GetTotalMargin(nsIFrame* aBox, bool aIsHorizontal)
|
||||
{
|
||||
// get our parents margin
|
||||
nsMargin margin(0,0,0,0);
|
||||
nsIBox* parent = nullptr;
|
||||
nsIFrame* parent = nullptr;
|
||||
nsIGridPart* part = GetParentGridPart(aBox, &parent);
|
||||
if (part && parent) {
|
||||
// if we are the first or last child walk upward and add margins.
|
||||
@ -143,10 +143,10 @@ nsGridRowLayout::GetTotalMargin(nsIBox* aBox, bool aIsHorizontal)
|
||||
aBox = nsGrid::GetScrollBox(aBox);
|
||||
|
||||
// see if we have a next to see if we are last
|
||||
nsIBox* next = aBox->GetNextBox();
|
||||
nsIFrame* next = aBox->GetNextBox();
|
||||
|
||||
// get the parent first child to see if we are first
|
||||
nsIBox* child = parent->GetChildBox();
|
||||
nsIFrame* child = parent->GetChildBox();
|
||||
|
||||
margin = part->GetTotalMargin(parent, aIsHorizontal);
|
||||
|
||||
|
@ -35,21 +35,21 @@ public:
|
||||
|
||||
virtual nsGridRowGroupLayout* CastToRowGroupLayout() { return nullptr; }
|
||||
virtual nsGridLayout2* CastToGridLayout() { return nullptr; }
|
||||
virtual nsGrid* GetGrid(nsIBox* aBox, PRInt32* aIndex, nsGridRowLayout* aRequestor=nullptr);
|
||||
virtual nsIGridPart* GetParentGridPart(nsIBox* aBox, nsIBox** aParentBox);
|
||||
virtual void ChildrenInserted(nsIBox* aBox, nsBoxLayoutState& aState,
|
||||
nsIBox* aPrevBox,
|
||||
virtual nsGrid* GetGrid(nsIFrame* aBox, PRInt32* aIndex, nsGridRowLayout* aRequestor=nullptr);
|
||||
virtual nsIGridPart* GetParentGridPart(nsIFrame* aBox, nsIFrame** aParentBox);
|
||||
virtual void ChildrenInserted(nsIFrame* aBox, nsBoxLayoutState& aState,
|
||||
nsIFrame* aPrevBox,
|
||||
const nsFrameList::Slice& aNewChildren);
|
||||
virtual void ChildrenAppended(nsIBox* aBox, nsBoxLayoutState& aState,
|
||||
virtual void ChildrenAppended(nsIFrame* aBox, nsBoxLayoutState& aState,
|
||||
const nsFrameList::Slice& aNewChildren);
|
||||
virtual void ChildrenRemoved(nsIBox* aBox, nsBoxLayoutState& aState, nsIBox* aChildList);
|
||||
virtual void ChildrenSet(nsIBox* aBox, nsBoxLayoutState& aState, nsIBox* aChildList);
|
||||
virtual nsMargin GetTotalMargin(nsIBox* aBox, bool aIsHorizontal);
|
||||
virtual void ChildrenRemoved(nsIFrame* aBox, nsBoxLayoutState& aState, nsIFrame* aChildList);
|
||||
virtual void ChildrenSet(nsIFrame* aBox, nsBoxLayoutState& aState, nsIFrame* aChildList);
|
||||
virtual nsMargin GetTotalMargin(nsIFrame* aBox, bool aIsHorizontal);
|
||||
|
||||
virtual nsIGridPart* AsGridPart() { return this; }
|
||||
|
||||
protected:
|
||||
virtual void ChildAddedOrRemoved(nsIBox* aBox, nsBoxLayoutState& aState)=0;
|
||||
virtual void ChildAddedOrRemoved(nsIFrame* aBox, nsBoxLayoutState& aState)=0;
|
||||
|
||||
nsGridRowLayout();
|
||||
};
|
||||
|
@ -35,7 +35,7 @@ nsGridRowLeafLayout::~nsGridRowLeafLayout()
|
||||
}
|
||||
|
||||
nsSize
|
||||
nsGridRowLeafLayout::GetPrefSize(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
nsGridRowLeafLayout::GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aState)
|
||||
{
|
||||
PRInt32 index = 0;
|
||||
nsGrid* grid = GetGrid(aBox, &index);
|
||||
@ -53,7 +53,7 @@ nsGridRowLeafLayout::GetPrefSize(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
}
|
||||
|
||||
nsSize
|
||||
nsGridRowLeafLayout::GetMinSize(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
nsGridRowLeafLayout::GetMinSize(nsIFrame* aBox, nsBoxLayoutState& aState)
|
||||
{
|
||||
PRInt32 index = 0;
|
||||
nsGrid* grid = GetGrid(aBox, &index);
|
||||
@ -69,7 +69,7 @@ nsGridRowLeafLayout::GetMinSize(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
}
|
||||
|
||||
nsSize
|
||||
nsGridRowLeafLayout::GetMaxSize(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
nsGridRowLeafLayout::GetMaxSize(nsIFrame* aBox, nsBoxLayoutState& aState)
|
||||
{
|
||||
PRInt32 index = 0;
|
||||
nsGrid* grid = GetGrid(aBox, &index);
|
||||
@ -88,7 +88,7 @@ nsGridRowLeafLayout::GetMaxSize(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
/** If a child is added or removed or changes size
|
||||
*/
|
||||
void
|
||||
nsGridRowLeafLayout::ChildAddedOrRemoved(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
nsGridRowLeafLayout::ChildAddedOrRemoved(nsIFrame* aBox, nsBoxLayoutState& aState)
|
||||
{
|
||||
PRInt32 index = 0;
|
||||
nsGrid* grid = GetGrid(aBox, &index);
|
||||
@ -99,7 +99,7 @@ nsGridRowLeafLayout::ChildAddedOrRemoved(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
}
|
||||
|
||||
void
|
||||
nsGridRowLeafLayout::PopulateBoxSizes(nsIBox* aBox, nsBoxLayoutState& aState, nsBoxSize*& aBoxSizes, nscoord& aMinSize, nscoord& aMaxSize, PRInt32& aFlexes)
|
||||
nsGridRowLeafLayout::PopulateBoxSizes(nsIFrame* aBox, nsBoxLayoutState& aState, nsBoxSize*& aBoxSizes, nscoord& aMinSize, nscoord& aMaxSize, PRInt32& aFlexes)
|
||||
{
|
||||
PRInt32 index = 0;
|
||||
nsGrid* grid = GetGrid(aBox, &index);
|
||||
@ -114,7 +114,7 @@ nsGridRowLeafLayout::PopulateBoxSizes(nsIBox* aBox, nsBoxLayoutState& aState, ns
|
||||
nsBoxSize* start = nullptr;
|
||||
nsBoxSize* last = nullptr;
|
||||
nsBoxSize* current = nullptr;
|
||||
nsIBox* child = aBox->GetChildBox();
|
||||
nsIFrame* child = aBox->GetChildBox();
|
||||
for (int i=0; i < count; i++)
|
||||
{
|
||||
column = grid->GetColumnAt(i,isHorizontal);
|
||||
@ -132,7 +132,7 @@ nsGridRowLeafLayout::PopulateBoxSizes(nsIBox* aBox, nsBoxLayoutState& aState, ns
|
||||
nscoord left = 0;
|
||||
nscoord right = 0;
|
||||
grid->GetRowOffsets(aState, i, left, right, !isHorizontal); // GetColumnOffsets
|
||||
nsIBox* box = column->GetBox();
|
||||
nsIFrame* box = column->GetBox();
|
||||
bool collapsed = false;
|
||||
nscoord topMargin = column->mTopMargin;
|
||||
nscoord bottomMargin = column->mBottomMargin;
|
||||
@ -216,7 +216,7 @@ nsGridRowLeafLayout::PopulateBoxSizes(nsIBox* aBox, nsBoxLayoutState& aState, ns
|
||||
}
|
||||
|
||||
void
|
||||
nsGridRowLeafLayout::ComputeChildSizes(nsIBox* aBox,
|
||||
nsGridRowLeafLayout::ComputeChildSizes(nsIFrame* aBox,
|
||||
nsBoxLayoutState& aState,
|
||||
nscoord& aGivenSize,
|
||||
nsBoxSize* aBoxSizes,
|
||||
@ -229,10 +229,10 @@ nsGridRowLeafLayout::ComputeChildSizes(nsIBox* aBox,
|
||||
|
||||
// go up the parent chain looking for scrollframes
|
||||
nscoord diff = 0;
|
||||
nsIBox* parentBox;
|
||||
nsIFrame* parentBox;
|
||||
(void)GetParentGridPart(aBox, &parentBox);
|
||||
while (parentBox) {
|
||||
nsIBox* scrollbox = nsGrid::GetScrollBox(parentBox);
|
||||
nsIFrame* scrollbox = nsGrid::GetScrollBox(parentBox);
|
||||
nsIScrollableFrame *scrollable = do_QueryFrame(scrollbox);
|
||||
if (scrollable) {
|
||||
// Don't call GetActualScrollbarSizes here because it's not safe
|
||||
@ -278,13 +278,13 @@ nsGridRowLeafLayout::ComputeChildSizes(nsIBox* aBox,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsGridRowLeafLayout::Layout(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState)
|
||||
nsGridRowLeafLayout::Layout(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState)
|
||||
{
|
||||
return nsGridRowLayout::Layout(aBox, aBoxLayoutState);
|
||||
}
|
||||
|
||||
void
|
||||
nsGridRowLeafLayout::DirtyRows(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
nsGridRowLeafLayout::DirtyRows(nsIFrame* aBox, nsBoxLayoutState& aState)
|
||||
{
|
||||
if (aBox) {
|
||||
// mark us dirty
|
||||
@ -296,10 +296,10 @@ nsGridRowLeafLayout::DirtyRows(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
}
|
||||
|
||||
void
|
||||
nsGridRowLeafLayout::CountRowsColumns(nsIBox* aBox, PRInt32& aRowCount, PRInt32& aComputedColumnCount)
|
||||
nsGridRowLeafLayout::CountRowsColumns(nsIFrame* aBox, PRInt32& aRowCount, PRInt32& aComputedColumnCount)
|
||||
{
|
||||
if (aBox) {
|
||||
nsIBox* child = aBox->GetChildBox();
|
||||
nsIFrame* child = aBox->GetChildBox();
|
||||
|
||||
// count the children
|
||||
PRInt32 columnCount = 0;
|
||||
@ -317,8 +317,8 @@ nsGridRowLeafLayout::CountRowsColumns(nsIBox* aBox, PRInt32& aRowCount, PRInt32&
|
||||
}
|
||||
|
||||
PRInt32
|
||||
nsGridRowLeafLayout::BuildRows(nsIBox* aBox, nsGridRow* aRows)
|
||||
{
|
||||
nsGridRowLeafLayout::BuildRows(nsIFrame* aBox, nsGridRow* aRows)
|
||||
{
|
||||
if (aBox) {
|
||||
aRows[0].Init(aBox, false);
|
||||
return 1;
|
||||
|
@ -27,29 +27,31 @@ public:
|
||||
|
||||
friend already_AddRefed<nsBoxLayout> NS_NewGridRowLeafLayout();
|
||||
|
||||
virtual nsSize GetPrefSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nsSize GetMinSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nsSize GetMaxSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual void ChildAddedOrRemoved(nsIBox* aBox, nsBoxLayoutState& aState);
|
||||
NS_IMETHOD Layout(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual void CountRowsColumns(nsIBox* aBox, PRInt32& aRowCount, PRInt32& aComputedColumnCount);
|
||||
virtual void DirtyRows(nsIBox* aBox, nsBoxLayoutState& aState);
|
||||
virtual PRInt32 BuildRows(nsIBox* aBox, nsGridRow* aRows);
|
||||
virtual nsSize GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nsSize GetMinSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nsSize GetMaxSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual void ChildAddedOrRemoved(nsIFrame* aBox, nsBoxLayoutState& aState);
|
||||
NS_IMETHOD Layout(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual void CountRowsColumns(nsIFrame* aBox, PRInt32& aRowCount, PRInt32& aComputedColumnCount);
|
||||
virtual void DirtyRows(nsIFrame* aBox, nsBoxLayoutState& aState);
|
||||
virtual PRInt32 BuildRows(nsIFrame* aBox, nsGridRow* aRows);
|
||||
virtual Type GetType() { return eRowLeaf; }
|
||||
|
||||
protected:
|
||||
|
||||
virtual void PopulateBoxSizes(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState, nsBoxSize*& aBoxSizes, nscoord& aMinSize, nscoord& aMaxSize, PRInt32& aFlexes);
|
||||
virtual void ComputeChildSizes(nsIBox* aBox,
|
||||
nsBoxLayoutState& aState,
|
||||
nscoord& aGivenSize,
|
||||
nsBoxSize* aBoxSizes,
|
||||
nsComputedBoxSize*& aComputedBoxSizes);
|
||||
virtual void PopulateBoxSizes(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState,
|
||||
nsBoxSize*& aBoxSizes, nscoord& aMinSize,
|
||||
nscoord& aMaxSize, PRInt32& aFlexes);
|
||||
virtual void ComputeChildSizes(nsIFrame* aBox,
|
||||
nsBoxLayoutState& aState,
|
||||
nscoord& aGivenSize,
|
||||
nsBoxSize* aBoxSizes,
|
||||
nsComputedBoxSize*& aComputedBoxSizes);
|
||||
|
||||
|
||||
nsGridRowLeafLayout();
|
||||
virtual ~nsGridRowLeafLayout();
|
||||
//virtual void AddBorderAndPadding(nsIBox* aBox, nsSize& aSize);
|
||||
//virtual void AddBorderAndPadding(nsIFrame* aBox, nsSize& aSize);
|
||||
|
||||
private:
|
||||
|
||||
|
@ -49,7 +49,7 @@ public:
|
||||
* grids.)
|
||||
* @return The grid of which aBox (a row, row group, or grid) is a part.
|
||||
*/
|
||||
virtual nsGrid* GetGrid(nsIBox* aBox, PRInt32* aIndex, nsGridRowLayout* aRequestor=nullptr)=0;
|
||||
virtual nsGrid* GetGrid(nsIFrame* aBox, PRInt32* aIndex, nsGridRowLayout* aRequestor=nullptr)=0;
|
||||
|
||||
/**
|
||||
* @param aBox [IN] The other half of the |this| parameter, i.e., the box
|
||||
@ -59,7 +59,7 @@ public:
|
||||
* row group).
|
||||
* @returns The layout manager for aParentBox.
|
||||
*/
|
||||
virtual nsIGridPart* GetParentGridPart(nsIBox* aBox, nsIBox** aParentBox) = 0;
|
||||
virtual nsIGridPart* GetParentGridPart(nsIFrame* aBox, nsIFrame** aParentBox) = 0;
|
||||
|
||||
/**
|
||||
* @param aBox [IN] The other half of the |this| parameter, i.e., the box
|
||||
@ -67,10 +67,10 @@ public:
|
||||
* @param aRowCount [INOUT] Row count
|
||||
* @param aComputedColumnCount [INOUT] Column count
|
||||
*/
|
||||
virtual void CountRowsColumns(nsIBox* aBox, PRInt32& aRowCount, PRInt32& aComputedColumnCount)=0;
|
||||
virtual void DirtyRows(nsIBox* aBox, nsBoxLayoutState& aState)=0;
|
||||
virtual PRInt32 BuildRows(nsIBox* aBox, nsGridRow* aRows)=0;
|
||||
virtual nsMargin GetTotalMargin(nsIBox* aBox, bool aIsHorizontal)=0;
|
||||
virtual void CountRowsColumns(nsIFrame* aBox, PRInt32& aRowCount, PRInt32& aComputedColumnCount)=0;
|
||||
virtual void DirtyRows(nsIFrame* aBox, nsBoxLayoutState& aState)=0;
|
||||
virtual PRInt32 BuildRows(nsIFrame* aBox, nsGridRow* aRows)=0;
|
||||
virtual nsMargin GetTotalMargin(nsIFrame* aBox, bool aIsHorizontal)=0;
|
||||
virtual PRInt32 GetRowCount() { return 1; }
|
||||
|
||||
/**
|
||||
|
@ -203,7 +203,7 @@ nsBox::Shutdown()
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBox::RelayoutChildAtOrdinal(nsBoxLayoutState& aState, nsIBox* aChild)
|
||||
nsBox::RelayoutChildAtOrdinal(nsBoxLayoutState& aState, nsIFrame* aChild)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
@ -405,7 +405,7 @@ nsBox::GetPrefSize(nsBoxLayoutState& aState)
|
||||
|
||||
AddBorderAndPadding(pref);
|
||||
bool widthSet, heightSet;
|
||||
nsIBox::AddCSSPrefSize(this, pref, widthSet, heightSet);
|
||||
nsIFrame::AddCSSPrefSize(this, pref, widthSet, heightSet);
|
||||
|
||||
nsSize minSize = GetMinSize(aState);
|
||||
nsSize maxSize = GetMaxSize(aState);
|
||||
@ -425,7 +425,7 @@ nsBox::GetMinSize(nsBoxLayoutState& aState)
|
||||
|
||||
AddBorderAndPadding(min);
|
||||
bool widthSet, heightSet;
|
||||
nsIBox::AddCSSMinSize(aState, this, min, widthSet, heightSet);
|
||||
nsIFrame::AddCSSMinSize(aState, this, min, widthSet, heightSet);
|
||||
return min;
|
||||
}
|
||||
|
||||
@ -448,7 +448,7 @@ nsBox::GetMaxSize(nsBoxLayoutState& aState)
|
||||
|
||||
AddBorderAndPadding(maxSize);
|
||||
bool widthSet, heightSet;
|
||||
nsIBox::AddCSSMaxSize(this, maxSize, widthSet, heightSet);
|
||||
nsIFrame::AddCSSMaxSize(this, maxSize, widthSet, heightSet);
|
||||
return maxSize;
|
||||
}
|
||||
|
||||
@ -457,7 +457,7 @@ nsBox::GetFlex(nsBoxLayoutState& aState)
|
||||
{
|
||||
nscoord flex = 0;
|
||||
|
||||
nsIBox::AddCSSFlex(aState, this, flex);
|
||||
nsIFrame::AddCSSFlex(aState, this, flex);
|
||||
|
||||
return flex;
|
||||
}
|
||||
@ -604,7 +604,7 @@ nsIFrame::Redraw(nsBoxLayoutState& aState,
|
||||
}
|
||||
|
||||
bool
|
||||
nsIBox::AddCSSPrefSize(nsIBox* aBox, nsSize& aSize, bool &aWidthSet, bool &aHeightSet)
|
||||
nsIFrame::AddCSSPrefSize(nsIFrame* aBox, nsSize& aSize, bool &aWidthSet, bool &aHeightSet)
|
||||
{
|
||||
aWidthSet = false;
|
||||
aHeightSet = false;
|
||||
@ -677,7 +677,7 @@ nsIBox::AddCSSPrefSize(nsIBox* aBox, nsSize& aSize, bool &aWidthSet, bool &aHeig
|
||||
|
||||
|
||||
bool
|
||||
nsIBox::AddCSSMinSize(nsBoxLayoutState& aState, nsIBox* aBox, nsSize& aSize,
|
||||
nsIFrame::AddCSSMinSize(nsBoxLayoutState& aState, nsIFrame* aBox, nsSize& aSize,
|
||||
bool &aWidthSet, bool &aHeightSet)
|
||||
{
|
||||
aWidthSet = false;
|
||||
@ -787,7 +787,7 @@ nsIBox::AddCSSMinSize(nsBoxLayoutState& aState, nsIBox* aBox, nsSize& aSize,
|
||||
}
|
||||
|
||||
bool
|
||||
nsIBox::AddCSSMaxSize(nsIBox* aBox, nsSize& aSize, bool &aWidthSet, bool &aHeightSet)
|
||||
nsIFrame::AddCSSMaxSize(nsIFrame* aBox, nsSize& aSize, bool &aWidthSet, bool &aHeightSet)
|
||||
{
|
||||
aWidthSet = false;
|
||||
aHeightSet = false;
|
||||
@ -846,7 +846,7 @@ nsIBox::AddCSSMaxSize(nsIBox* aBox, nsSize& aSize, bool &aWidthSet, bool &aHeigh
|
||||
}
|
||||
|
||||
bool
|
||||
nsIBox::AddCSSFlex(nsBoxLayoutState& aState, nsIBox* aBox, nscoord& aFlex)
|
||||
nsIFrame::AddCSSFlex(nsBoxLayoutState& aState, nsIFrame* aBox, nscoord& aFlex)
|
||||
{
|
||||
bool flexSet = false;
|
||||
|
||||
@ -882,7 +882,7 @@ nsBox::AddBorderAndPadding(nsSize& aSize)
|
||||
}
|
||||
|
||||
void
|
||||
nsBox::AddBorderAndPadding(nsIBox* aBox, nsSize& aSize)
|
||||
nsBox::AddBorderAndPadding(nsIFrame* aBox, nsSize& aSize)
|
||||
{
|
||||
nsMargin borderPadding(0,0,0,0);
|
||||
aBox->GetBorderAndPadding(borderPadding);
|
||||
@ -890,7 +890,7 @@ nsBox::AddBorderAndPadding(nsIBox* aBox, nsSize& aSize)
|
||||
}
|
||||
|
||||
void
|
||||
nsBox::AddMargin(nsIBox* aChild, nsSize& aSize)
|
||||
nsBox::AddMargin(nsIFrame* aChild, nsSize& aSize)
|
||||
{
|
||||
nsMargin margin(0,0,0,0);
|
||||
aChild->GetMargin(margin);
|
||||
@ -942,14 +942,14 @@ nsBox::SetDebug(nsBoxLayoutState& aState, bool aDebug)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBox::GetDebugBoxAt( const nsPoint& aPoint,
|
||||
nsIBox** aBox)
|
||||
nsIFrame** aBox)
|
||||
{
|
||||
nsRect thisRect(nsPoint(0,0), GetSize());
|
||||
if (!thisRect.Contains(aPoint))
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsIBox* child = GetChildBox();
|
||||
nsIBox* hit = nullptr;
|
||||
nsIFrame* child = GetChildBox();
|
||||
nsIFrame* hit = nullptr;
|
||||
|
||||
*aBox = nullptr;
|
||||
while (nullptr != child) {
|
||||
|
@ -42,10 +42,10 @@ public:
|
||||
virtual Valignment GetVAlign() const { return vAlign_Top; }
|
||||
virtual Halignment GetHAlign() const { return hAlign_Left; }
|
||||
|
||||
NS_IMETHOD RelayoutChildAtOrdinal(nsBoxLayoutState& aState, nsIBox* aChild);
|
||||
NS_IMETHOD RelayoutChildAtOrdinal(nsBoxLayoutState& aState, nsIFrame* aChild);
|
||||
|
||||
#ifdef DEBUG_LAYOUT
|
||||
NS_IMETHOD GetDebugBoxAt(const nsPoint& aPoint, nsIBox** aBox);
|
||||
NS_IMETHOD GetDebugBoxAt(const nsPoint& aPoint, nsIFrame** aBox);
|
||||
NS_IMETHOD GetDebug(bool& aDebug);
|
||||
NS_IMETHOD SetDebug(nsBoxLayoutState& aState, bool aDebug);
|
||||
|
||||
@ -72,8 +72,8 @@ rollbox.
|
||||
|
||||
void AddBorderAndPadding(nsSize& aSize);
|
||||
|
||||
static void AddBorderAndPadding(nsIBox* aBox, nsSize& aSize);
|
||||
static void AddMargin(nsIBox* aChild, nsSize& aSize);
|
||||
static void AddBorderAndPadding(nsIFrame* aBox, nsSize& aSize);
|
||||
static void AddMargin(nsIFrame* aChild, nsSize& aSize);
|
||||
static void AddMargin(nsSize& aSize, const nsMargin& aMargin);
|
||||
|
||||
static nsSize BoundsCheckMinMax(const nsSize& aMinSize, const nsSize& aMaxSize);
|
||||
|
@ -80,7 +80,7 @@ using namespace mozilla;
|
||||
|
||||
#ifdef DEBUG_LAYOUT
|
||||
bool nsBoxFrame::gDebug = false;
|
||||
nsIBox* nsBoxFrame::mDebugChild = nullptr;
|
||||
nsIFrame* nsBoxFrame::mDebugChild = nullptr;
|
||||
#endif
|
||||
|
||||
nsIFrame*
|
||||
@ -759,7 +759,7 @@ nsBoxFrame::GetPrefSize(nsBoxLayoutState& aBoxLayoutState)
|
||||
|
||||
// if the size was not completely redefined in CSS then ask our children
|
||||
bool widthSet, heightSet;
|
||||
if (!nsIBox::AddCSSPrefSize(this, size, widthSet, heightSet))
|
||||
if (!nsIFrame::AddCSSPrefSize(this, size, widthSet, heightSet))
|
||||
{
|
||||
if (mLayoutManager) {
|
||||
nsSize layoutSize = mLayoutManager->GetPrefSize(this, aBoxLayoutState);
|
||||
@ -822,7 +822,7 @@ nsBoxFrame::GetMinSize(nsBoxLayoutState& aBoxLayoutState)
|
||||
|
||||
// if the size was not completely redefined in CSS then ask our children
|
||||
bool widthSet, heightSet;
|
||||
if (!nsIBox::AddCSSMinSize(aBoxLayoutState, this, size, widthSet, heightSet))
|
||||
if (!nsIFrame::AddCSSMinSize(aBoxLayoutState, this, size, widthSet, heightSet))
|
||||
{
|
||||
if (mLayoutManager) {
|
||||
nsSize layoutSize = mLayoutManager->GetMinSize(this, aBoxLayoutState);
|
||||
@ -862,7 +862,7 @@ nsBoxFrame::GetMaxSize(nsBoxLayoutState& aBoxLayoutState)
|
||||
|
||||
// if the size was not completely redefined in CSS then ask our children
|
||||
bool widthSet, heightSet;
|
||||
if (!nsIBox::AddCSSMaxSize(this, size, widthSet, heightSet))
|
||||
if (!nsIFrame::AddCSSMaxSize(this, size, widthSet, heightSet))
|
||||
{
|
||||
if (mLayoutManager) {
|
||||
nsSize layoutSize = mLayoutManager->GetMaxSize(this, aBoxLayoutState);
|
||||
@ -1226,7 +1226,7 @@ nsBoxFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
||||
}
|
||||
else if (aAttribute == nsGkAtoms::ordinal) {
|
||||
nsBoxLayoutState state(PresContext());
|
||||
nsIBox* parent = GetParentBox();
|
||||
nsIFrame* parent = GetParentBox();
|
||||
// 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
|
||||
@ -1713,7 +1713,7 @@ nsBoxFrame::GetValue(nsPresContext* aPresContext, PRInt32 a, PRInt32 b, char* ch
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsBoxFrame::DisplayDebugInfoFor(nsIBox* aBox,
|
||||
nsBoxFrame::DisplayDebugInfoFor(nsIFrame* aBox,
|
||||
nsPoint& aPoint)
|
||||
{
|
||||
nsBoxLayoutState state(GetPresContext());
|
||||
@ -1736,7 +1736,7 @@ nsBoxFrame::DisplayDebugInfoFor(nsIBox* aBox,
|
||||
//printf("%%%%%% inside box %%%%%%%\n");
|
||||
|
||||
int count = 0;
|
||||
nsIBox* child = aBox->GetChildBox();
|
||||
nsIFrame* child = aBox->GetChildBox();
|
||||
|
||||
nsMargin m;
|
||||
nsMargin m2;
|
||||
@ -1783,10 +1783,10 @@ nsBoxFrame::DisplayDebugInfoFor(nsIBox* aBox,
|
||||
nscoord flexCSS = NS_INTRINSICSIZE;
|
||||
|
||||
bool widthSet, heightSet;
|
||||
nsIBox::AddCSSPrefSize(child, prefSizeCSS, widthSet, heightSet);
|
||||
nsIBox::AddCSSMinSize (state, child, minSizeCSS, widthSet, heightSet);
|
||||
nsIBox::AddCSSMaxSize (child, maxSizeCSS, widthSet, heightSet);
|
||||
nsIBox::AddCSSFlex (state, child, flexCSS);
|
||||
nsIFrame::AddCSSPrefSize(child, prefSizeCSS, widthSet, heightSet);
|
||||
nsIFrame::AddCSSMinSize (state, child, minSizeCSS, widthSet, heightSet);
|
||||
nsIFrame::AddCSSMaxSize (child, maxSizeCSS, widthSet, heightSet);
|
||||
nsIFrame::AddCSSFlex (state, child, flexCSS);
|
||||
|
||||
nsSize prefSize = child->GetPrefSize(state);
|
||||
nsSize minSize = child->GetMinSize(state);
|
||||
@ -1837,9 +1837,9 @@ nsBoxFrame::DisplayDebugInfoFor(nsIBox* aBox,
|
||||
}
|
||||
|
||||
void
|
||||
nsBoxFrame::SetDebugOnChildList(nsBoxLayoutState& aState, nsIBox* aChild, bool aDebug)
|
||||
nsBoxFrame::SetDebugOnChildList(nsBoxLayoutState& aState, nsIFrame* aChild, bool aDebug)
|
||||
{
|
||||
nsIBox* child = GetChildBox();
|
||||
nsIFrame* child = GetChildBox();
|
||||
while (child)
|
||||
{
|
||||
child->SetDebug(aState, aDebug);
|
||||
@ -1848,7 +1848,7 @@ nsBoxFrame::SetDebugOnChildList(nsBoxLayoutState& aState, nsIBox* aChild, bool a
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsBoxFrame::GetFrameSizeWithMargin(nsIBox* aBox, nsSize& aSize)
|
||||
nsBoxFrame::GetFrameSizeWithMargin(nsIFrame* aBox, nsSize& aSize)
|
||||
{
|
||||
nsRect rect(aBox->GetRect());
|
||||
nsMargin margin(0,0,0,0);
|
||||
@ -2024,7 +2024,7 @@ nsBoxFrame::CheckBoxOrder(nsBoxLayoutState& aState)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsBoxFrame::LayoutChildAt(nsBoxLayoutState& aState, nsIBox* aBox, const nsRect& aRect)
|
||||
nsBoxFrame::LayoutChildAt(nsBoxLayoutState& aState, nsIFrame* aBox, const nsRect& aRect)
|
||||
{
|
||||
// get the current rect
|
||||
nsRect oldRect(aBox->GetRect());
|
||||
@ -2040,7 +2040,7 @@ nsBoxFrame::LayoutChildAt(nsBoxLayoutState& aState, nsIBox* aBox, const nsRect&
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBoxFrame::RelayoutChildAtOrdinal(nsBoxLayoutState& aState, nsIBox* aChild)
|
||||
nsBoxFrame::RelayoutChildAtOrdinal(nsBoxLayoutState& aState, nsIFrame* aChild)
|
||||
{
|
||||
if (!SupportsOrdinalsInChildren())
|
||||
return NS_OK;
|
||||
|
@ -58,11 +58,10 @@ public:
|
||||
// gets the rect inside our border and debug border. If you wish to paint inside a box
|
||||
// call this method to get the rect so you don't draw on the debug border or outer border.
|
||||
|
||||
// ------ nsIBox -------------
|
||||
virtual void SetLayoutManager(nsBoxLayout* aLayout) { mLayoutManager = aLayout; }
|
||||
virtual nsBoxLayout* GetLayoutManager() { return mLayoutManager; }
|
||||
|
||||
NS_IMETHOD RelayoutChildAtOrdinal(nsBoxLayoutState& aState, nsIBox* aChild);
|
||||
NS_IMETHOD RelayoutChildAtOrdinal(nsBoxLayoutState& aState, nsIFrame* aChild);
|
||||
|
||||
virtual nsSize GetPrefSize(nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nsSize GetMinSize(nsBoxLayoutState& aBoxLayoutState);
|
||||
@ -162,12 +161,12 @@ public:
|
||||
const nsDisplayListSet& aLists);
|
||||
|
||||
#ifdef DEBUG_LAYOUT
|
||||
virtual void SetDebugOnChildList(nsBoxLayoutState& aState, nsIBox* aChild, bool aDebug);
|
||||
nsresult DisplayDebugInfoFor(nsIBox* aBox,
|
||||
virtual void SetDebugOnChildList(nsBoxLayoutState& aState, nsIFrame* aChild, bool aDebug);
|
||||
nsresult DisplayDebugInfoFor(nsIFrame* aBox,
|
||||
nsPoint& aPoint);
|
||||
#endif
|
||||
|
||||
static nsresult LayoutChildAt(nsBoxLayoutState& aState, nsIBox* aBox, const nsRect& aRect);
|
||||
static nsresult LayoutChildAt(nsBoxLayoutState& aState, nsIFrame* aBox, const nsRect& aRect);
|
||||
|
||||
/**
|
||||
* Utility method to redirect events on descendants to this frame.
|
||||
@ -233,7 +232,7 @@ private:
|
||||
void GetDebugPadding(nsMargin& aInset);
|
||||
void GetDebugMargin(nsMargin& aInset);
|
||||
|
||||
nsresult GetFrameSizeWithMargin(nsIBox* aBox, nsSize& aSize);
|
||||
nsresult GetFrameSizeWithMargin(nsIFrame* aBox, nsSize& aSize);
|
||||
|
||||
void PixelMarginToTwips(nsPresContext* aPresContext, nsMargin& aMarginPixels);
|
||||
|
||||
@ -253,7 +252,7 @@ private:
|
||||
|
||||
#ifdef DEBUG_LAYOUT
|
||||
static bool gDebug;
|
||||
static nsIBox* mDebugChild;
|
||||
static nsIFrame* mDebugChild;
|
||||
#endif
|
||||
|
||||
}; // class nsBoxFrame
|
||||
|
@ -16,13 +16,13 @@
|
||||
#include "nsBoxLayout.h"
|
||||
|
||||
void
|
||||
nsBoxLayout::AddBorderAndPadding(nsIBox* aBox, nsSize& aSize)
|
||||
nsBoxLayout::AddBorderAndPadding(nsIFrame* aBox, nsSize& aSize)
|
||||
{
|
||||
nsBox::AddBorderAndPadding(aBox, aSize);
|
||||
}
|
||||
|
||||
void
|
||||
nsBoxLayout::AddMargin(nsIBox* aBox, nsSize& aSize)
|
||||
nsBoxLayout::AddMargin(nsIFrame* aBox, nsSize& aSize)
|
||||
{
|
||||
nsBox::AddMargin(aBox, aSize);
|
||||
}
|
||||
@ -34,7 +34,7 @@ nsBoxLayout::AddMargin(nsSize& aSize, const nsMargin& aMargin)
|
||||
}
|
||||
|
||||
nsSize
|
||||
nsBoxLayout::GetPrefSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState)
|
||||
nsBoxLayout::GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState)
|
||||
{
|
||||
nsSize pref (0, 0);
|
||||
AddBorderAndPadding(aBox, pref);
|
||||
@ -43,7 +43,7 @@ nsBoxLayout::GetPrefSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState)
|
||||
}
|
||||
|
||||
nsSize
|
||||
nsBoxLayout::GetMinSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState)
|
||||
nsBoxLayout::GetMinSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState)
|
||||
{
|
||||
nsSize minSize (0,0);
|
||||
AddBorderAndPadding(aBox, minSize);
|
||||
@ -51,7 +51,7 @@ nsBoxLayout::GetMinSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState)
|
||||
}
|
||||
|
||||
nsSize
|
||||
nsBoxLayout::GetMaxSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState)
|
||||
nsBoxLayout::GetMaxSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState)
|
||||
{
|
||||
//AddBorderAndPadding () never changes maxSize (NS_INTRINSICSIZE)
|
||||
//AddBorderAndPadding(aBox, maxSize);
|
||||
@ -60,13 +60,13 @@ nsBoxLayout::GetMaxSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState)
|
||||
|
||||
|
||||
nscoord
|
||||
nsBoxLayout::GetAscent(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState)
|
||||
nsBoxLayout::GetAscent(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBoxLayout::Layout(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState)
|
||||
nsBoxLayout::Layout(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -7,7 +7,13 @@
|
||||
#define nsBoxLayout_h___
|
||||
|
||||
#include "nsISupports.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsCoord.h"
|
||||
#include "nsFrameList.h"
|
||||
|
||||
class nsIFrame;
|
||||
class nsBoxLayoutState;
|
||||
struct nsSize;
|
||||
struct nsMargin;
|
||||
|
||||
#define NS_BOX_LAYOUT_IID \
|
||||
{ 0x09d522a7, 0x304c, 0x4137, \
|
||||
@ -26,23 +32,23 @@ public:
|
||||
|
||||
NS_DECLARE_STATIC_IID_ACCESSOR(NS_BOX_LAYOUT_IID)
|
||||
|
||||
NS_IMETHOD Layout(nsIBox* aBox, nsBoxLayoutState& aState);
|
||||
NS_IMETHOD Layout(nsIFrame* aBox, nsBoxLayoutState& aState);
|
||||
|
||||
virtual nsSize GetPrefSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nsSize GetMinSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nsSize GetMaxSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nscoord GetAscent(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual void ChildrenInserted(nsIBox* aBox, nsBoxLayoutState& aState,
|
||||
nsIBox* aPrevBox,
|
||||
virtual nsSize GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nsSize GetMinSize(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,
|
||||
nsIFrame* aPrevBox,
|
||||
const nsFrameList::Slice& aNewChildren) {}
|
||||
virtual void ChildrenAppended(nsIBox* aBox, nsBoxLayoutState& aState,
|
||||
virtual void ChildrenAppended(nsIFrame* aBox, nsBoxLayoutState& aState,
|
||||
const nsFrameList::Slice& aNewChildren) {}
|
||||
virtual void ChildrenRemoved(nsIBox* aBox, nsBoxLayoutState& aState, nsIBox* aChildList) {}
|
||||
virtual void ChildrenSet(nsIBox* aBox, nsBoxLayoutState& aState, nsIBox* aChildList) {}
|
||||
virtual void IntrinsicWidthsDirty(nsIBox* aBox, nsBoxLayoutState& aState) {}
|
||||
virtual void ChildrenRemoved(nsIFrame* aBox, nsBoxLayoutState& aState, nsIFrame* aChildList) {}
|
||||
virtual void ChildrenSet(nsIFrame* aBox, nsBoxLayoutState& aState, nsIFrame* aChildList) {}
|
||||
virtual void IntrinsicWidthsDirty(nsIFrame* aBox, nsBoxLayoutState& aState) {}
|
||||
|
||||
virtual void AddBorderAndPadding(nsIBox* aBox, nsSize& aSize);
|
||||
virtual void AddMargin(nsIBox* aChild, nsSize& aSize);
|
||||
virtual void AddBorderAndPadding(nsIFrame* aBox, nsSize& aSize);
|
||||
virtual void AddMargin(nsIFrame* aChild, nsSize& aSize);
|
||||
virtual void AddMargin(nsSize& aSize, const nsMargin& aMargin);
|
||||
|
||||
virtual nsIGridPart* AsGridPart() { return nullptr; }
|
||||
|
@ -83,7 +83,7 @@ nsDeckFrame::Init(nsIContent* aContent,
|
||||
}
|
||||
|
||||
void
|
||||
nsDeckFrame::HideBox(nsIBox* aBox)
|
||||
nsDeckFrame::HideBox(nsIFrame* aBox)
|
||||
{
|
||||
nsIPresShell::ClearMouseCapture(aBox);
|
||||
}
|
||||
@ -100,7 +100,7 @@ nsDeckFrame::IndexChanged()
|
||||
InvalidateOverflowRect();
|
||||
|
||||
// hide the currently showing box
|
||||
nsIBox* currentBox = GetSelectedBox();
|
||||
nsIFrame* currentBox = GetSelectedBox();
|
||||
if (currentBox) // only hide if it exists
|
||||
HideBox(currentBox);
|
||||
|
||||
@ -152,7 +152,7 @@ nsDeckFrame::BuildDisplayListForChildren(nsDisplayListBuilder* aBuilder,
|
||||
const nsDisplayListSet& aLists)
|
||||
{
|
||||
// only paint the selected box
|
||||
nsIBox* box = GetSelectedBox();
|
||||
nsIFrame* box = GetSelectedBox();
|
||||
if (!box)
|
||||
return NS_OK;
|
||||
|
||||
@ -174,7 +174,7 @@ nsDeckFrame::DoLayout(nsBoxLayoutState& aState)
|
||||
nsresult rv = nsBoxFrame::DoLayout(aState);
|
||||
|
||||
// run though each child. Hide all but the selected one
|
||||
nsIBox* box = GetChildBox();
|
||||
nsIFrame* box = GetChildBox();
|
||||
|
||||
nscoord count = 0;
|
||||
while (box)
|
||||
|
@ -61,7 +61,7 @@ protected:
|
||||
|
||||
void IndexChanged();
|
||||
PRInt32 GetSelectedIndex();
|
||||
void HideBox(nsIBox* aBox);
|
||||
void HideBox(nsIFrame* aBox);
|
||||
|
||||
private:
|
||||
|
||||
|
@ -43,7 +43,7 @@ public:
|
||||
virtual bool GetInitialVAlignment(Valignment& aValign) { aValign = vAlign_Top; return true; }
|
||||
virtual bool GetInitialAutoStretch(bool& aStretch) { aStretch = true; return true; }
|
||||
|
||||
nsIBox* GetCaptionBox(nsPresContext* aPresContext, nsRect& aCaptionRect);
|
||||
nsIFrame* GetCaptionBox(nsPresContext* aPresContext, nsRect& aCaptionRect);
|
||||
};
|
||||
|
||||
/*
|
||||
@ -133,7 +133,7 @@ nsGroupBoxFrame::PaintBorderBackground(nsRenderingContext& aRenderingContext,
|
||||
nsPresContext* presContext = PresContext();
|
||||
|
||||
nsRect groupRect;
|
||||
nsIBox* groupBox = GetCaptionBox(presContext, groupRect);
|
||||
nsIFrame* groupBox = GetCaptionBox(presContext, groupRect);
|
||||
|
||||
if (groupBox) {
|
||||
// if the border is smaller than the legend. Move the border down
|
||||
@ -207,11 +207,11 @@ nsGroupBoxFrame::PaintBorderBackground(nsRenderingContext& aRenderingContext,
|
||||
}
|
||||
}
|
||||
|
||||
nsIBox*
|
||||
nsIFrame*
|
||||
nsGroupBoxFrame::GetCaptionBox(nsPresContext* aPresContext, nsRect& aCaptionRect)
|
||||
{
|
||||
// first child is our grouped area
|
||||
nsIBox* box = GetChildBox();
|
||||
nsIFrame* box = GetChildBox();
|
||||
|
||||
// no area fail.
|
||||
if (!box)
|
||||
@ -225,7 +225,7 @@ nsGroupBoxFrame::GetCaptionBox(nsPresContext* aPresContext, nsRect& aCaptionRect
|
||||
return nullptr;
|
||||
|
||||
// now get the caption itself. It is in the caption frame.
|
||||
nsIBox* child = box->GetChildBox();
|
||||
nsIFrame* child = box->GetChildBox();
|
||||
|
||||
if (child) {
|
||||
// convert to our coordinates.
|
||||
|
@ -439,7 +439,7 @@ nsImageBoxFrame::GetPrefSize(nsBoxLayoutState& aState)
|
||||
size.height += borderPadding.TopBottom();
|
||||
|
||||
bool widthSet, heightSet;
|
||||
nsIBox::AddCSSPrefSize(this, size, widthSet, heightSet);
|
||||
nsIFrame::AddCSSPrefSize(this, size, widthSet, heightSet);
|
||||
NS_ASSERTION(size.width != NS_INTRINSICSIZE && size.height != NS_INTRINSICSIZE,
|
||||
"non-intrinsic size expected");
|
||||
|
||||
@ -504,7 +504,7 @@ nsImageBoxFrame::GetMinSize(nsBoxLayoutState& aState)
|
||||
DISPLAY_MIN_SIZE(this, size);
|
||||
AddBorderAndPadding(size);
|
||||
bool widthSet, heightSet;
|
||||
nsIBox::AddCSSMinSize(aState, this, size, widthSet, heightSet);
|
||||
nsIFrame::AddCSSMinSize(aState, this, size, widthSet, heightSet);
|
||||
return size;
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,6 @@ class nsImageBoxFrame : public nsLeafBoxFrame
|
||||
public:
|
||||
NS_DECL_FRAMEARENA_HELPERS
|
||||
|
||||
// nsIBox
|
||||
virtual nsSize GetPrefSize(nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nsSize GetMinSize(nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nscoord GetBoxAscent(nsBoxLayoutState& aBoxLayoutState);
|
||||
@ -52,8 +51,6 @@ public:
|
||||
|
||||
friend nsIFrame* NS_NewImageBoxFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
||||
|
||||
// nsIBox frame interface
|
||||
|
||||
NS_IMETHOD Init(nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame* asPrevInFlow);
|
||||
|
@ -184,7 +184,7 @@ nsListBoxBodyFrame::Init(nsIContent* aContent,
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
nsIScrollableFrame* scrollFrame = nsLayoutUtils::GetScrollableFrameFor(this);
|
||||
if (scrollFrame) {
|
||||
nsIBox* verticalScrollbar = scrollFrame->GetScrollbarBox(true);
|
||||
nsIFrame* verticalScrollbar = scrollFrame->GetScrollbarBox(true);
|
||||
nsScrollbarFrame* scrollbarFrame = do_QueryFrame(verticalScrollbar);
|
||||
if (scrollbarFrame) {
|
||||
scrollbarFrame->SetScrollbarMediatorContent(GetContent());
|
||||
@ -235,8 +235,6 @@ nsListBoxBodyFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
||||
|
||||
}
|
||||
|
||||
/////////// nsIBox ///////////////
|
||||
|
||||
/* virtual */ void
|
||||
nsListBoxBodyFrame::MarkIntrinsicWidthsDirty()
|
||||
{
|
||||
@ -995,7 +993,7 @@ nsListBoxBodyFrame::CreateRows()
|
||||
|
||||
// get the first tree box. If there isn't one create one.
|
||||
bool created = false;
|
||||
nsIBox* box = GetFirstItemBox(0, &created);
|
||||
nsIFrame* box = GetFirstItemBox(0, &created);
|
||||
nscoord rowHeight = GetRowHeightAppUnits();
|
||||
while (box) {
|
||||
if (created && mRowsToPrepend > 0)
|
||||
@ -1088,10 +1086,10 @@ IsListItemChild(nsListBoxBodyFrame* aParent, nsIContent* aChild,
|
||||
}
|
||||
|
||||
//
|
||||
// Get the nsIBox for the first visible listitem, and if none exists,
|
||||
// Get the nsIFrame for the first visible listitem, and if none exists,
|
||||
// create one.
|
||||
//
|
||||
nsIBox*
|
||||
nsIFrame*
|
||||
nsListBoxBodyFrame::GetFirstItemBox(PRInt32 aOffset, bool* aCreated)
|
||||
{
|
||||
if (aCreated)
|
||||
@ -1101,7 +1099,7 @@ nsListBoxBodyFrame::GetFirstItemBox(PRInt32 aOffset, bool* aCreated)
|
||||
mBottomFrame = mTopFrame;
|
||||
|
||||
if (mTopFrame) {
|
||||
return mTopFrame->IsBoxFrame() ? static_cast<nsIBox*>(mTopFrame) : nullptr;
|
||||
return mTopFrame->IsBoxFrame() ? mTopFrame : nullptr;
|
||||
}
|
||||
|
||||
// top frame was cleared out
|
||||
@ -1109,7 +1107,7 @@ nsListBoxBodyFrame::GetFirstItemBox(PRInt32 aOffset, bool* aCreated)
|
||||
mBottomFrame = mTopFrame;
|
||||
|
||||
if (mTopFrame && mRowsToPrepend <= 0) {
|
||||
return mTopFrame->IsBoxFrame() ? static_cast<nsIBox*>(mTopFrame) : nullptr;
|
||||
return mTopFrame->IsBoxFrame() ? mTopFrame : nullptr;
|
||||
}
|
||||
|
||||
// At this point, we either have no frames at all,
|
||||
@ -1159,7 +1157,7 @@ nsListBoxBodyFrame::GetFirstItemBox(PRInt32 aOffset, bool* aCreated)
|
||||
|
||||
mBottomFrame = mTopFrame;
|
||||
|
||||
return mTopFrame->IsBoxFrame() ? static_cast<nsIBox*>(mTopFrame) : nullptr;
|
||||
return mTopFrame->IsBoxFrame() ? mTopFrame : nullptr;
|
||||
} else
|
||||
return GetFirstItemBox(++aOffset, 0);
|
||||
}
|
||||
@ -1168,11 +1166,11 @@ nsListBoxBodyFrame::GetFirstItemBox(PRInt32 aOffset, bool* aCreated)
|
||||
}
|
||||
|
||||
//
|
||||
// Get the nsIBox for the next visible listitem after aBox, and if none
|
||||
// Get the nsIFrame for the next visible listitem after aBox, and if none
|
||||
// exists, create one.
|
||||
//
|
||||
nsIBox*
|
||||
nsListBoxBodyFrame::GetNextItemBox(nsIBox* aBox, PRInt32 aOffset,
|
||||
nsIFrame*
|
||||
nsListBoxBodyFrame::GetNextItemBox(nsIFrame* aBox, PRInt32 aOffset,
|
||||
bool* aCreated)
|
||||
{
|
||||
if (aCreated)
|
||||
|
@ -63,7 +63,6 @@ public:
|
||||
virtual bool ReflowFinished();
|
||||
virtual void ReflowCallbackCanceled();
|
||||
|
||||
// nsIBox
|
||||
NS_IMETHOD DoLayout(nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual void MarkIntrinsicWidthsDirty();
|
||||
|
||||
@ -98,8 +97,8 @@ public:
|
||||
void CreateRows();
|
||||
void DestroyRows(PRInt32& aRowsToLose);
|
||||
void ReverseDestroyRows(PRInt32& aRowsToLose);
|
||||
nsIBox* GetFirstItemBox(PRInt32 aOffset, bool* aCreated);
|
||||
nsIBox* GetNextItemBox(nsIBox* aBox, PRInt32 aOffset, bool* aCreated);
|
||||
nsIFrame* GetFirstItemBox(PRInt32 aOffset, bool* aCreated);
|
||||
nsIFrame* GetNextItemBox(nsIFrame* aBox, PRInt32 aOffset, bool* aCreated);
|
||||
bool ContinueReflow(nscoord height);
|
||||
NS_IMETHOD ListBoxAppendFrames(nsFrameList& aFrameList);
|
||||
NS_IMETHOD ListBoxInsertFrames(nsIFrame* aPrevFrame, nsFrameList& aFrameList);
|
||||
|
@ -21,7 +21,7 @@ nsListBoxLayout::nsListBoxLayout() : nsGridRowGroupLayout()
|
||||
////////// nsBoxLayout //////////////
|
||||
|
||||
nsSize
|
||||
nsListBoxLayout::GetPrefSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState)
|
||||
nsListBoxLayout::GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState)
|
||||
{
|
||||
nsSize pref = nsGridRowGroupLayout::GetPrefSize(aBox, aBoxLayoutState);
|
||||
|
||||
@ -47,7 +47,7 @@ nsListBoxLayout::GetPrefSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState)
|
||||
}
|
||||
|
||||
nsSize
|
||||
nsListBoxLayout::GetMinSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState)
|
||||
nsListBoxLayout::GetMinSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState)
|
||||
{
|
||||
nsSize minSize = nsGridRowGroupLayout::GetMinSize(aBox, aBoxLayoutState);
|
||||
|
||||
@ -73,7 +73,7 @@ nsListBoxLayout::GetMinSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState)
|
||||
}
|
||||
|
||||
nsSize
|
||||
nsListBoxLayout::GetMaxSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState)
|
||||
nsListBoxLayout::GetMaxSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState)
|
||||
{
|
||||
nsSize maxSize = nsGridRowGroupLayout::GetMaxSize(aBox, aBoxLayoutState);
|
||||
|
||||
@ -93,7 +93,7 @@ nsListBoxLayout::GetMaxSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsListBoxLayout::Layout(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
nsListBoxLayout::Layout(nsIFrame* aBox, nsBoxLayoutState& aState)
|
||||
{
|
||||
return LayoutInternal(aBox, aState);
|
||||
}
|
||||
@ -105,7 +105,7 @@ nsListBoxLayout::Layout(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
* Called to layout our our children. Does no frame construction
|
||||
*/
|
||||
NS_IMETHODIMP
|
||||
nsListBoxLayout::LayoutInternal(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
nsListBoxLayout::LayoutInternal(nsIFrame* aBox, nsBoxLayoutState& aState)
|
||||
{
|
||||
PRInt32 redrawStart = -1;
|
||||
|
||||
@ -136,7 +136,7 @@ nsListBoxLayout::LayoutInternal(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
}
|
||||
|
||||
// run through all our currently created children
|
||||
nsIBox* box = body->GetChildBox();
|
||||
nsIFrame* box = body->GetChildBox();
|
||||
|
||||
// if the reason is resize or initial we must relayout.
|
||||
nscoord rowHeight = body->GetRowHeightAppUnits();
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "nsGridRowGroupLayout.h"
|
||||
|
||||
class nsIFrame;
|
||||
typedef class nsIFrame nsIBox;
|
||||
typedef class nsIFrame nsIFrame;
|
||||
class nsBoxLayoutState;
|
||||
|
||||
class nsListBoxLayout : public nsGridRowGroupLayout
|
||||
@ -18,13 +18,13 @@ public:
|
||||
nsListBoxLayout();
|
||||
|
||||
// nsBoxLayout
|
||||
NS_IMETHOD Layout(nsIBox* aBox, nsBoxLayoutState& aState);
|
||||
virtual nsSize GetPrefSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nsSize GetMinSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nsSize GetMaxSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
NS_IMETHOD Layout(nsIFrame* aBox, nsBoxLayoutState& aState);
|
||||
virtual nsSize GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nsSize GetMinSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nsSize GetMaxSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
|
||||
protected:
|
||||
NS_IMETHOD LayoutInternal(nsIBox* aBox, nsBoxLayoutState& aState);
|
||||
NS_IMETHOD LayoutInternal(nsIFrame* aBox, nsBoxLayoutState& aState);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -3,7 +3,6 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsBoxFrame.h"
|
||||
#include "nsGridRowLeafFrame.h"
|
||||
|
||||
nsIFrame* NS_NewListItemFrame(nsIPresShell* aPresShell,
|
||||
@ -23,9 +22,8 @@ public:
|
||||
const nsRect& aDirtyRect,
|
||||
const nsDisplayListSet& aLists);
|
||||
|
||||
// nsIBox
|
||||
virtual nsSize GetPrefSize(nsBoxLayoutState& aState);
|
||||
|
||||
|
||||
protected:
|
||||
nsListItemFrame(nsIPresShell* aPresShell,
|
||||
nsStyleContext *aContext,
|
||||
|
@ -1338,7 +1338,7 @@ nsMenuFrame::SizeToPopup(nsBoxLayoutState& aState, nsSize& aSize)
|
||||
if (!IsCollapsed()) {
|
||||
bool widthSet, heightSet;
|
||||
nsSize tmpSize(-1, 0);
|
||||
nsIBox::AddCSSPrefSize(this, tmpSize, widthSet, heightSet);
|
||||
nsIFrame::AddCSSPrefSize(this, tmpSize, widthSet, heightSet);
|
||||
if (!widthSet && GetFlex(aState) == 0) {
|
||||
nsMenuPopupFrame* popupFrame = GetPopup();
|
||||
if (!popupFrame)
|
||||
|
@ -82,7 +82,6 @@ public:
|
||||
NS_DECL_QUERYFRAME
|
||||
NS_DECL_FRAMEARENA_HELPERS
|
||||
|
||||
// nsIBox
|
||||
NS_IMETHOD DoLayout(nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nsSize GetMinSize(nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nsSize GetPrefSize(nsBoxLayoutState& aBoxLayoutState);
|
||||
|
@ -35,7 +35,6 @@ public:
|
||||
NS_IMETHOD SetInitialChildList(ChildListID aListID,
|
||||
nsFrameList& aChildList);
|
||||
|
||||
// nsIBox
|
||||
NS_IMETHOD DoLayout(nsBoxLayoutState& aBoxLayoutState);
|
||||
|
||||
// Used to destroy our popup frames.
|
||||
|
@ -48,7 +48,7 @@ PRInt32 nsSliderFrame::gSnapMultiplier;
|
||||
#undef DEBUG_SLIDER
|
||||
|
||||
static already_AddRefed<nsIContent>
|
||||
GetContentOfBox(nsIBox *aBox)
|
||||
GetContentOfBox(nsIFrame *aBox)
|
||||
{
|
||||
nsIContent* content = aBox->GetContent();
|
||||
NS_IF_ADDREF(content);
|
||||
@ -238,7 +238,7 @@ nsSliderFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
||||
aAttribute == nsGkAtoms::maxpos) {
|
||||
// bounds check it.
|
||||
|
||||
nsIBox* scrollbarBox = GetScrollbar();
|
||||
nsIFrame* scrollbarBox = GetScrollbar();
|
||||
nsCOMPtr<nsIContent> scrollbar;
|
||||
scrollbar = GetContentOfBox(scrollbarBox);
|
||||
PRInt32 current = GetCurrentPosition(scrollbar);
|
||||
@ -310,7 +310,7 @@ nsSliderFrame::BuildDisplayListForChildren(nsDisplayListBuilder* aBuilder,
|
||||
const nsDisplayListSet& aLists)
|
||||
{
|
||||
// if we are too small to have a thumb don't paint it.
|
||||
nsIBox* thumb = GetChildBox();
|
||||
nsIFrame* thumb = GetChildBox();
|
||||
|
||||
if (thumb) {
|
||||
nsRect thumbRect(thumb->GetRect());
|
||||
@ -332,7 +332,7 @@ NS_IMETHODIMP
|
||||
nsSliderFrame::DoLayout(nsBoxLayoutState& aState)
|
||||
{
|
||||
// get the thumb should be our only child
|
||||
nsIBox* thumbBox = GetChildBox();
|
||||
nsIFrame* thumbBox = GetChildBox();
|
||||
|
||||
if (!thumbBox) {
|
||||
SyncLayout(aState);
|
||||
@ -355,7 +355,7 @@ nsSliderFrame::DoLayout(nsBoxLayoutState& aState)
|
||||
GetClientRect(clientRect);
|
||||
|
||||
// get the scrollbar
|
||||
nsIBox* scrollbarBox = GetScrollbar();
|
||||
nsIFrame* scrollbarBox = GetScrollbar();
|
||||
nsCOMPtr<nsIContent> scrollbar;
|
||||
scrollbar = GetContentOfBox(scrollbarBox);
|
||||
|
||||
@ -430,7 +430,7 @@ nsSliderFrame::HandleEvent(nsPresContext* aPresContext,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsIBox* scrollbarBox = GetScrollbar();
|
||||
nsIFrame* scrollbarBox = GetScrollbar();
|
||||
nsCOMPtr<nsIContent> scrollbar;
|
||||
scrollbar = GetContentOfBox(scrollbarBox);
|
||||
bool isHorizontal = IsHorizontal();
|
||||
@ -604,7 +604,7 @@ nsSliderFrame::GetScrollToClick()
|
||||
#endif
|
||||
}
|
||||
|
||||
nsIBox*
|
||||
nsIFrame*
|
||||
nsSliderFrame::GetScrollbar()
|
||||
{
|
||||
// if we are in a scrollbar then return the scrollbar's content node
|
||||
@ -624,7 +624,7 @@ nsSliderFrame::PageUpDown(nscoord change)
|
||||
// on a page up or down get our page increment. We get this by getting the scrollbar we are in and
|
||||
// asking it for the current position and the page increment. If we are not in a scrollbar we will
|
||||
// get the values from our own node.
|
||||
nsIBox* scrollbarBox = GetScrollbar();
|
||||
nsIFrame* scrollbarBox = GetScrollbar();
|
||||
nsCOMPtr<nsIContent> scrollbar;
|
||||
scrollbar = GetContentOfBox(scrollbarBox);
|
||||
|
||||
@ -652,7 +652,7 @@ nsresult
|
||||
nsSliderFrame::CurrentPositionChanged(nsPresContext* aPresContext,
|
||||
bool aImmediateRedraw)
|
||||
{
|
||||
nsIBox* scrollbarBox = GetScrollbar();
|
||||
nsIFrame* scrollbarBox = GetScrollbar();
|
||||
nsCOMPtr<nsIContent> scrollbar;
|
||||
scrollbar = GetContentOfBox(scrollbarBox);
|
||||
|
||||
@ -784,7 +784,7 @@ nsSliderFrame::SetCurrentPositionInternal(nsIContent* aScrollbar, PRInt32 aNewPo
|
||||
bool aImmediateRedraw)
|
||||
{
|
||||
nsCOMPtr<nsIContent> scrollbar = aScrollbar;
|
||||
nsIBox* scrollbarBox = GetScrollbar();
|
||||
nsIFrame* scrollbarBox = GetScrollbar();
|
||||
|
||||
mUserChanged = true;
|
||||
|
||||
@ -897,7 +897,7 @@ nsSliderFrame::StartDrag(nsIDOMEvent* aEvent)
|
||||
|
||||
newpos -= (thumbLength/2);
|
||||
|
||||
nsIBox* scrollbarBox = GetScrollbar();
|
||||
nsIFrame* scrollbarBox = GetScrollbar();
|
||||
scrollbar = GetContentOfBox(scrollbarBox);
|
||||
}
|
||||
|
||||
@ -1080,7 +1080,7 @@ nsSliderFrame::GetMaxSize(nsBoxLayoutState& aState)
|
||||
void
|
||||
nsSliderFrame::EnsureOrient()
|
||||
{
|
||||
nsIBox* scrollbarBox = GetScrollbar();
|
||||
nsIFrame* scrollbarBox = GetScrollbar();
|
||||
|
||||
bool isHorizontal = (scrollbarBox->GetStateBits() & NS_STATE_IS_HORIZONTAL) != 0;
|
||||
if (isHorizontal)
|
||||
|
@ -52,7 +52,6 @@ public:
|
||||
}
|
||||
#endif
|
||||
|
||||
// nsIBox
|
||||
virtual nsSize GetPrefSize(nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nsSize GetMinSize(nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nsSize GetMaxSize(nsBoxLayoutState& aBoxLayoutState);
|
||||
@ -127,7 +126,7 @@ public:
|
||||
private:
|
||||
|
||||
bool GetScrollToClick();
|
||||
nsIBox* GetScrollbar();
|
||||
nsIFrame* GetScrollbar();
|
||||
|
||||
void PageUpDown(nscoord change);
|
||||
void SetCurrentThumbPosition(nsIContent* aScrollbar, nscoord aNewPos, bool aIsSmooth,
|
||||
|
@ -105,13 +105,13 @@ public:
|
||||
bool SupportsCollapseDirection(CollapseDirection aDirection);
|
||||
|
||||
void EnsureOrient();
|
||||
void SetPreferredSize(nsBoxLayoutState& aState, nsIBox* aChildBox, nscoord aOnePixel, bool aIsHorizontal, nscoord* aSize);
|
||||
void SetPreferredSize(nsBoxLayoutState& aState, nsIFrame* aChildBox, nscoord aOnePixel, bool aIsHorizontal, nscoord* aSize);
|
||||
|
||||
nsSplitterFrame* mOuter;
|
||||
bool mDidDrag;
|
||||
nscoord mDragStart;
|
||||
nscoord mCurrentPos;
|
||||
nsIBox* mParentBox;
|
||||
nsIFrame* mParentBox;
|
||||
bool mPressed;
|
||||
nsSplitterInfo* mChildInfosBefore;
|
||||
nsSplitterInfo* mChildInfosAfter;
|
||||
@ -319,7 +319,7 @@ nsSplitterFrame::DoLayout(nsBoxLayoutState& aState)
|
||||
void
|
||||
nsSplitterFrame::GetInitialOrientation(bool& aIsHorizontal)
|
||||
{
|
||||
nsIBox* box = GetParentBox();
|
||||
nsIFrame* box = GetParentBox();
|
||||
if (box) {
|
||||
aIsHorizontal = !box->IsHorizontal();
|
||||
}
|
||||
@ -662,7 +662,7 @@ nsSplitterFrameInner::MouseDown(nsIDOMEvent* aMouseEvent)
|
||||
mChildInfosBeforeCount = 0;
|
||||
mChildInfosAfterCount = 0;
|
||||
|
||||
nsIBox* childBox = mParentBox->GetChildBox();
|
||||
nsIFrame* childBox = mParentBox->GetChildBox();
|
||||
|
||||
while (nullptr != childBox)
|
||||
{
|
||||
@ -907,9 +907,9 @@ nsSplitterFrameInner::AdjustChildren(nsPresContext* aPresContext)
|
||||
aPresContext->PresShell()->FlushPendingNotifications(Flush_Display);
|
||||
}
|
||||
|
||||
static nsIBox* GetChildBoxForContent(nsIBox* aParentBox, nsIContent* aContent)
|
||||
static nsIFrame* GetChildBoxForContent(nsIFrame* aParentBox, nsIContent* aContent)
|
||||
{
|
||||
nsIBox* childBox = aParentBox->GetChildBox();
|
||||
nsIFrame* childBox = aParentBox->GetChildBox();
|
||||
|
||||
while (nullptr != childBox) {
|
||||
if (childBox->GetContent() == aContent) {
|
||||
@ -930,7 +930,7 @@ nsSplitterFrameInner::AdjustChildren(nsPresContext* aPresContext, nsSplitterInfo
|
||||
nscoord onePixel = nsPresContext::CSSPixelsToAppUnits(1);
|
||||
|
||||
// first set all the widths.
|
||||
nsIBox* child = mOuter->GetChildBox();
|
||||
nsIFrame* child = mOuter->GetChildBox();
|
||||
while(child)
|
||||
{
|
||||
SetPreferredSize(state, child, onePixel, aIsHorizontal, nullptr);
|
||||
@ -941,7 +941,7 @@ nsSplitterFrameInner::AdjustChildren(nsPresContext* aPresContext, nsSplitterInfo
|
||||
for (int i=0; i < aCount; i++)
|
||||
{
|
||||
nscoord pref = aChildInfos[i].changed;
|
||||
nsIBox* childBox = GetChildBoxForContent(mParentBox, aChildInfos[i].childElem);
|
||||
nsIFrame* childBox = GetChildBoxForContent(mParentBox, aChildInfos[i].childElem);
|
||||
|
||||
if (childBox) {
|
||||
SetPreferredSize(state, childBox, onePixel, aIsHorizontal, &pref);
|
||||
@ -950,7 +950,7 @@ nsSplitterFrameInner::AdjustChildren(nsPresContext* aPresContext, nsSplitterInfo
|
||||
}
|
||||
|
||||
void
|
||||
nsSplitterFrameInner::SetPreferredSize(nsBoxLayoutState& aState, nsIBox* aChildBox, nscoord aOnePixel, bool aIsHorizontal, nscoord* aSize)
|
||||
nsSplitterFrameInner::SetPreferredSize(nsBoxLayoutState& aState, nsIFrame* aChildBox, nscoord aOnePixel, bool aIsHorizontal, nscoord* aSize)
|
||||
{
|
||||
nsRect rect(aChildBox->GetRect());
|
||||
nscoord pref = 0;
|
||||
|
@ -52,25 +52,25 @@ nsSprocketLayout::nsSprocketLayout()
|
||||
}
|
||||
|
||||
bool
|
||||
nsSprocketLayout::IsHorizontal(nsIBox* aBox)
|
||||
nsSprocketLayout::IsHorizontal(nsIFrame* aBox)
|
||||
{
|
||||
return (aBox->GetStateBits() & NS_STATE_IS_HORIZONTAL) != 0;
|
||||
}
|
||||
|
||||
void
|
||||
nsSprocketLayout::GetFrameState(nsIBox* aBox, nsFrameState& aState)
|
||||
nsSprocketLayout::GetFrameState(nsIFrame* aBox, nsFrameState& aState)
|
||||
{
|
||||
aState = aBox->GetStateBits();
|
||||
}
|
||||
|
||||
static PRUint8
|
||||
GetFrameDirection(nsIBox* aBox)
|
||||
GetFrameDirection(nsIFrame* aBox)
|
||||
{
|
||||
return aBox->GetStyleVisibility()->mDirection;
|
||||
}
|
||||
|
||||
static void
|
||||
HandleBoxPack(nsIBox* aBox, const nsFrameState& aFrameState, nscoord& aX, nscoord& aY,
|
||||
HandleBoxPack(nsIFrame* aBox, const nsFrameState& aFrameState, nscoord& aX, nscoord& aY,
|
||||
const nsRect& aOriginalRect, const nsRect& aClientRect)
|
||||
{
|
||||
// In the normal direction we lay out our kids in the positive direction (e.g., |x| will get
|
||||
@ -112,8 +112,8 @@ HandleBoxPack(nsIBox* aBox, const nsFrameState& aFrameState, nscoord& aX, nscoor
|
||||
}
|
||||
|
||||
// Get our pack/alignment information.
|
||||
nsIBox::Halignment halign = aBox->GetHAlign();
|
||||
nsIBox::Valignment valign = aBox->GetVAlign();
|
||||
nsIFrame::Halignment halign = aBox->GetHAlign();
|
||||
nsIFrame::Valignment valign = aBox->GetVAlign();
|
||||
|
||||
// The following code handles box PACKING. Packing comes into play in the case where the computed size for
|
||||
// all of our children (now stored in our client rect) is smaller than the size available for
|
||||
@ -166,12 +166,12 @@ HandleBoxPack(nsIBox* aBox, const nsFrameState& aFrameState, nscoord& aX, nscoor
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSprocketLayout::Layout(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
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()) {
|
||||
nsIBox* child = aBox->GetChildBox();
|
||||
nsIFrame* child = aBox->GetChildBox();
|
||||
while(child)
|
||||
{
|
||||
nsBoxFrame::LayoutChildAt(aState, child, nsRect(0,0,0,0));
|
||||
@ -301,7 +301,7 @@ nsSprocketLayout::Layout(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
nsComputedBoxSize* childComputedBoxSize = computedBoxSizes;
|
||||
nsBoxSize* childBoxSize = boxSizes;
|
||||
|
||||
nsIBox* child = aBox->GetChildBox();
|
||||
nsIFrame* child = aBox->GetChildBox();
|
||||
|
||||
PRInt32 count = 0;
|
||||
while (child || (childBoxSize && childBoxSize->bogus))
|
||||
@ -617,7 +617,7 @@ nsSprocketLayout::Layout(nsIBox* 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) {
|
||||
nsIBox* child = aBox->GetChildBox();
|
||||
nsIFrame* child = aBox->GetChildBox();
|
||||
|
||||
// reposition all our children
|
||||
while (child)
|
||||
@ -645,7 +645,7 @@ nsSprocketLayout::Layout(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
}
|
||||
|
||||
void
|
||||
nsSprocketLayout::PopulateBoxSizes(nsIBox* aBox, nsBoxLayoutState& aState, nsBoxSize*& aBoxSizes, nscoord& aMinSize, nscoord& aMaxSize, PRInt32& aFlexes)
|
||||
nsSprocketLayout::PopulateBoxSizes(nsIFrame* aBox, nsBoxLayoutState& aState, nsBoxSize*& aBoxSizes, nscoord& aMinSize, nscoord& aMaxSize, PRInt32& aFlexes)
|
||||
{
|
||||
// used for the equal size flag
|
||||
nscoord biggestPrefWidth = 0;
|
||||
@ -678,7 +678,7 @@ nsSprocketLayout::PopulateBoxSizes(nsIBox* aBox, nsBoxLayoutState& aState, nsBox
|
||||
// so we can just optimize it out this way.
|
||||
|
||||
// set flexes
|
||||
nsIBox* child = aBox->GetChildBox();
|
||||
nsIFrame* child = aBox->GetChildBox();
|
||||
|
||||
aFlexes = 0;
|
||||
nsBoxSize* currentBox = nullptr;
|
||||
@ -889,7 +889,7 @@ nsSprocketLayout::PopulateBoxSizes(nsIBox* aBox, nsBoxLayoutState& aState, nsBox
|
||||
}
|
||||
|
||||
void
|
||||
nsSprocketLayout::ComputeChildsNextPosition(nsIBox* aBox,
|
||||
nsSprocketLayout::ComputeChildsNextPosition(nsIFrame* aBox,
|
||||
const nscoord& aCurX,
|
||||
const nscoord& aCurY,
|
||||
nscoord& aNextX,
|
||||
@ -918,7 +918,7 @@ nsSprocketLayout::ComputeChildsNextPosition(nsIBox* aBox,
|
||||
}
|
||||
|
||||
void
|
||||
nsSprocketLayout::AlignChildren(nsIBox* aBox,
|
||||
nsSprocketLayout::AlignChildren(nsIFrame* aBox,
|
||||
nsBoxLayoutState& aState,
|
||||
bool* aNeedsRedraw)
|
||||
{
|
||||
@ -932,8 +932,8 @@ nsSprocketLayout::AlignChildren(nsIBox* aBox,
|
||||
"Only AlignChildren() with non-stretch alignment");
|
||||
|
||||
// These are only calculated if needed
|
||||
nsIBox::Halignment halign;
|
||||
nsIBox::Valignment valign;
|
||||
nsIFrame::Halignment halign;
|
||||
nsIFrame::Valignment valign;
|
||||
nscoord maxAscent;
|
||||
bool isLTR;
|
||||
|
||||
@ -947,7 +947,7 @@ nsSprocketLayout::AlignChildren(nsIBox* aBox,
|
||||
halign = aBox->GetHAlign();
|
||||
}
|
||||
|
||||
nsIBox* child = aBox->GetChildBox();
|
||||
nsIFrame* child = aBox->GetChildBox();
|
||||
while (child) {
|
||||
|
||||
nsMargin margin;
|
||||
@ -1014,9 +1014,9 @@ nsSprocketLayout::AlignChildren(nsIBox* aBox,
|
||||
}
|
||||
|
||||
void
|
||||
nsSprocketLayout::ChildResized(nsIBox* aBox,
|
||||
nsSprocketLayout::ChildResized(nsIFrame* aBox,
|
||||
nsBoxLayoutState& aState,
|
||||
nsIBox* aChild,
|
||||
nsIFrame* aChild,
|
||||
nsBoxSize* aChildBoxSize,
|
||||
nsComputedBoxSize* aChildComputedSize,
|
||||
nsBoxSize* aBoxSizes,
|
||||
@ -1154,7 +1154,7 @@ nsSprocketLayout::InvalidateComputedSizes(nsComputedBoxSize* aComputedBoxSizes)
|
||||
}
|
||||
|
||||
void
|
||||
nsSprocketLayout::ComputeChildSizes(nsIBox* aBox,
|
||||
nsSprocketLayout::ComputeChildSizes(nsIFrame* aBox,
|
||||
nsBoxLayoutState& aState,
|
||||
nscoord& aGivenSize,
|
||||
nsBoxSize* aBoxSizes,
|
||||
@ -1307,7 +1307,7 @@ nsSprocketLayout::ComputeChildSizes(nsIBox* aBox,
|
||||
|
||||
|
||||
nsSize
|
||||
nsSprocketLayout::GetPrefSize(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
nsSprocketLayout::GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aState)
|
||||
{
|
||||
nsSize vpref (0, 0);
|
||||
bool isHorizontal = IsHorizontal(aBox);
|
||||
@ -1317,7 +1317,7 @@ nsSprocketLayout::GetPrefSize(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
// run through all the children and get their min, max, and preferred sizes
|
||||
// return us the size of the box
|
||||
|
||||
nsIBox* child = aBox->GetChildBox();
|
||||
nsIFrame* child = aBox->GetChildBox();
|
||||
nsFrameState frameState = 0;
|
||||
GetFrameState(aBox, frameState);
|
||||
bool isEqual = !!(frameState & NS_STATE_EQUAL_SIZE);
|
||||
@ -1363,7 +1363,7 @@ nsSprocketLayout::GetPrefSize(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
}
|
||||
|
||||
nsSize
|
||||
nsSprocketLayout::GetMinSize(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
nsSprocketLayout::GetMinSize(nsIFrame* aBox, nsBoxLayoutState& aState)
|
||||
{
|
||||
nsSize minSize (0, 0);
|
||||
bool isHorizontal = IsHorizontal(aBox);
|
||||
@ -1374,7 +1374,7 @@ nsSprocketLayout::GetMinSize(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
// run through all the children and get their min, max, and preferred sizes
|
||||
// return us the size of the box
|
||||
|
||||
nsIBox* child = aBox->GetChildBox();
|
||||
nsIFrame* child = aBox->GetChildBox();
|
||||
nsFrameState frameState = 0;
|
||||
GetFrameState(aBox, frameState);
|
||||
bool isEqual = !!(frameState & NS_STATE_EQUAL_SIZE);
|
||||
@ -1432,7 +1432,7 @@ nsSprocketLayout::GetMinSize(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
}
|
||||
|
||||
nsSize
|
||||
nsSprocketLayout::GetMaxSize(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
nsSprocketLayout::GetMaxSize(nsIFrame* aBox, nsBoxLayoutState& aState)
|
||||
{
|
||||
|
||||
bool isHorizontal = IsHorizontal(aBox);
|
||||
@ -1443,7 +1443,7 @@ nsSprocketLayout::GetMaxSize(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
// run through all the children and get their min, max, and preferred sizes
|
||||
// return us the size of the box
|
||||
|
||||
nsIBox* child = aBox->GetChildBox();
|
||||
nsIFrame* child = aBox->GetChildBox();
|
||||
nsFrameState frameState = 0;
|
||||
GetFrameState(aBox, frameState);
|
||||
bool isEqual = !!(frameState & NS_STATE_EQUAL_SIZE);
|
||||
@ -1499,7 +1499,7 @@ nsSprocketLayout::GetMaxSize(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
|
||||
|
||||
nscoord
|
||||
nsSprocketLayout::GetAscent(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
nsSprocketLayout::GetAscent(nsIFrame* aBox, nsBoxLayoutState& aState)
|
||||
{
|
||||
nscoord vAscent = 0;
|
||||
|
||||
@ -1508,7 +1508,7 @@ nsSprocketLayout::GetAscent(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
// run through all the children and get their min, max, and preferred sizes
|
||||
// return us the size of the box
|
||||
|
||||
nsIBox* child = aBox->GetChildBox();
|
||||
nsIFrame* child = aBox->GetChildBox();
|
||||
|
||||
while (child)
|
||||
{
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
#include "nsBoxLayout.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIFrame.h"
|
||||
|
||||
class nsBoxSize
|
||||
{
|
||||
@ -66,16 +67,16 @@ public:
|
||||
friend nsresult NS_NewSprocketLayout(nsIPresShell* aPresShell, nsCOMPtr<nsBoxLayout>& aNewLayout);
|
||||
static void Shutdown();
|
||||
|
||||
NS_IMETHOD Layout(nsIBox* aBox, nsBoxLayoutState& aState);
|
||||
NS_IMETHOD Layout(nsIFrame* aBox, nsBoxLayoutState& aState);
|
||||
|
||||
virtual nsSize GetPrefSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nsSize GetMinSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nsSize GetMaxSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nscoord GetAscent(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nsSize GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nsSize GetMinSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nsSize GetMaxSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nscoord GetAscent(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
|
||||
nsSprocketLayout();
|
||||
|
||||
static bool IsHorizontal(nsIBox* aBox);
|
||||
static bool IsHorizontal(nsIFrame* aBox);
|
||||
|
||||
static void SetLargestSize(nsSize& aSize1, const nsSize& aSize2, bool aIsHorizontal);
|
||||
static void SetSmallestSize(nsSize& aSize1, const nsSize& aSize2, bool aIsHorizontal);
|
||||
@ -87,16 +88,16 @@ public:
|
||||
protected:
|
||||
|
||||
|
||||
void ComputeChildsNextPosition(nsIBox* aBox,
|
||||
void ComputeChildsNextPosition(nsIFrame* aBox,
|
||||
const nscoord& aCurX,
|
||||
const nscoord& aCurY,
|
||||
nscoord& aNextX,
|
||||
nscoord& aNextY,
|
||||
const nsRect& aChildSize);
|
||||
|
||||
void ChildResized(nsIBox* aBox,
|
||||
void ChildResized(nsIFrame* aBox,
|
||||
nsBoxLayoutState& aState,
|
||||
nsIBox* aChild,
|
||||
nsIFrame* aChild,
|
||||
nsBoxSize* aChildBoxSize,
|
||||
nsComputedBoxSize* aChildComputedBoxSize,
|
||||
nsBoxSize* aBoxSizes,
|
||||
@ -107,24 +108,26 @@ protected:
|
||||
PRInt32 aFlexes,
|
||||
bool& aFinished);
|
||||
|
||||
void AlignChildren(nsIBox* aBox,
|
||||
void AlignChildren(nsIFrame* aBox,
|
||||
nsBoxLayoutState& aState,
|
||||
bool* aNeedsRedraw);
|
||||
|
||||
virtual void ComputeChildSizes(nsIBox* aBox,
|
||||
virtual void ComputeChildSizes(nsIFrame* aBox,
|
||||
nsBoxLayoutState& aState,
|
||||
nscoord& aGivenSize,
|
||||
nsBoxSize* aBoxSizes,
|
||||
nsComputedBoxSize*& aComputedBoxSizes);
|
||||
|
||||
|
||||
virtual void PopulateBoxSizes(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState, nsBoxSize*& aBoxSizes, nscoord& aMinSize, nscoord& aMaxSize, PRInt32& aFlexes);
|
||||
virtual void PopulateBoxSizes(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState,
|
||||
nsBoxSize*& aBoxSizes, nscoord& aMinSize,
|
||||
nscoord& aMaxSize, PRInt32& aFlexes);
|
||||
|
||||
virtual void InvalidateComputedSizes(nsComputedBoxSize* aComputedBoxSizes);
|
||||
|
||||
virtual bool GetDefaultFlex(PRInt32& aFlex);
|
||||
|
||||
virtual void GetFrameState(nsIBox* aBox, nsFrameState& aState);
|
||||
virtual void GetFrameState(nsIFrame* aBox, nsFrameState& aState);
|
||||
|
||||
private:
|
||||
|
||||
|
@ -59,11 +59,11 @@ nsStackLayout::nsStackLayout()
|
||||
*/
|
||||
|
||||
nsSize
|
||||
nsStackLayout::GetPrefSize(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
nsStackLayout::GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aState)
|
||||
{
|
||||
nsSize prefSize (0, 0);
|
||||
|
||||
nsIBox* child = aBox->GetChildBox();
|
||||
nsIFrame* child = aBox->GetChildBox();
|
||||
while (child) {
|
||||
if (child->GetStyleXUL()->mStretchStack) {
|
||||
nsSize pref = child->GetPrefSize(aState);
|
||||
@ -85,11 +85,11 @@ nsStackLayout::GetPrefSize(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
}
|
||||
|
||||
nsSize
|
||||
nsStackLayout::GetMinSize(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
nsStackLayout::GetMinSize(nsIFrame* aBox, nsBoxLayoutState& aState)
|
||||
{
|
||||
nsSize minSize (0, 0);
|
||||
|
||||
nsIBox* child = aBox->GetChildBox();
|
||||
nsIFrame* child = aBox->GetChildBox();
|
||||
while (child) {
|
||||
if (child->GetStyleXUL()->mStretchStack) {
|
||||
nsSize min = child->GetMinSize(aState);
|
||||
@ -111,11 +111,11 @@ nsStackLayout::GetMinSize(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
}
|
||||
|
||||
nsSize
|
||||
nsStackLayout::GetMaxSize(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
nsStackLayout::GetMaxSize(nsIFrame* aBox, nsBoxLayoutState& aState)
|
||||
{
|
||||
nsSize maxSize (NS_INTRINSICSIZE, NS_INTRINSICSIZE);
|
||||
|
||||
nsIBox* child = aBox->GetChildBox();
|
||||
nsIFrame* child = aBox->GetChildBox();
|
||||
while (child) {
|
||||
if (child->GetStyleXUL()->mStretchStack) {
|
||||
nsSize min = child->GetMinSize(aState);
|
||||
@ -141,11 +141,11 @@ nsStackLayout::GetMaxSize(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
|
||||
|
||||
nscoord
|
||||
nsStackLayout::GetAscent(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
nsStackLayout::GetAscent(nsIFrame* aBox, nsBoxLayoutState& aState)
|
||||
{
|
||||
nscoord vAscent = 0;
|
||||
|
||||
nsIBox* child = aBox->GetChildBox();
|
||||
nsIFrame* child = aBox->GetChildBox();
|
||||
while (child) {
|
||||
nscoord ascent = child->GetBoxAscent(aState);
|
||||
nsMargin margin;
|
||||
@ -161,7 +161,7 @@ nsStackLayout::GetAscent(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
}
|
||||
|
||||
PRUint8
|
||||
nsStackLayout::GetOffset(nsBoxLayoutState& aState, nsIBox* aChild, nsMargin& aOffset)
|
||||
nsStackLayout::GetOffset(nsBoxLayoutState& aState, nsIFrame* aChild, nsMargin& aOffset)
|
||||
{
|
||||
aOffset = nsMargin(0, 0, 0, 0);
|
||||
|
||||
@ -252,7 +252,7 @@ nsStackLayout::GetOffset(nsBoxLayoutState& aState, nsIBox* aChild, nsMargin& aOf
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsStackLayout::Layout(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
nsStackLayout::Layout(nsIFrame* aBox, nsBoxLayoutState& aState)
|
||||
{
|
||||
nsRect clientRect;
|
||||
aBox->GetClientRect(clientRect);
|
||||
@ -260,7 +260,7 @@ nsStackLayout::Layout(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
bool grow;
|
||||
|
||||
do {
|
||||
nsIBox* child = aBox->GetChildBox();
|
||||
nsIFrame* child = aBox->GetChildBox();
|
||||
grow = false;
|
||||
|
||||
while (child)
|
||||
|
@ -16,6 +16,9 @@
|
||||
|
||||
#include "nsBoxLayout.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsCoord.h"
|
||||
|
||||
class nsIPresShell;
|
||||
|
||||
nsresult NS_NewStackLayout(nsIPresShell* aPresShell, nsCOMPtr<nsBoxLayout>& aNewLayout);
|
||||
|
||||
@ -28,18 +31,18 @@ public:
|
||||
|
||||
nsStackLayout();
|
||||
|
||||
NS_IMETHOD Layout(nsIBox* aBox, nsBoxLayoutState& aState);
|
||||
NS_IMETHOD Layout(nsIFrame* aBox, nsBoxLayoutState& aState);
|
||||
|
||||
virtual nsSize GetPrefSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nsSize GetMinSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nsSize GetMaxSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nscoord GetAscent(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nsSize GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nsSize GetMinSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nsSize GetMaxSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nscoord GetAscent(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);
|
||||
|
||||
// get the child offsets for aChild and set them in aMargin. Returns a
|
||||
// bitfield mask of the SPECIFIED_LEFT, SPECIFIED_RIGHT, SPECIFIED_TOP and
|
||||
// SPECIFIED_BOTTOM offsets indicating which sides have been specified by
|
||||
// attributes.
|
||||
static PRUint8 GetOffset(nsBoxLayoutState& aState, nsIBox* aChild, nsMargin& aMargin);
|
||||
// attributes.
|
||||
static PRUint8 GetOffset(nsBoxLayoutState& aState, nsIFrame* aChild, nsMargin& aMargin);
|
||||
|
||||
private:
|
||||
static nsBoxLayout* gInstance;
|
||||
|
@ -1031,7 +1031,7 @@ nsTextBoxFrame::GetPrefSize(nsBoxLayoutState& aBoxLayoutState)
|
||||
|
||||
AddBorderAndPadding(size);
|
||||
bool widthSet, heightSet;
|
||||
nsIBox::AddCSSPrefSize(this, size, widthSet, heightSet);
|
||||
nsIFrame::AddCSSPrefSize(this, size, widthSet, heightSet);
|
||||
|
||||
return size;
|
||||
}
|
||||
@ -1053,7 +1053,7 @@ nsTextBoxFrame::GetMinSize(nsBoxLayoutState& aBoxLayoutState)
|
||||
|
||||
AddBorderAndPadding(size);
|
||||
bool widthSet, heightSet;
|
||||
nsIBox::AddCSSMinSize(aBoxLayoutState, this, size, widthSet, heightSet);
|
||||
nsIFrame::AddCSSMinSize(aBoxLayoutState, this, size, widthSet, heightSet);
|
||||
|
||||
return size;
|
||||
}
|
||||
|
@ -16,7 +16,6 @@ class nsTextBoxFrame : public nsTextBoxFrameSuper
|
||||
public:
|
||||
NS_DECL_FRAMEARENA_HELPERS
|
||||
|
||||
// nsIBox
|
||||
virtual nsSize GetPrefSize(nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nsSize GetMinSize(nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual nscoord GetBoxAscent(nsBoxLayoutState& aBoxLayoutState);
|
||||
|
@ -217,7 +217,7 @@ nsTreeBodyFrame::GetMinSize(nsBoxLayoutState& aBoxLayoutState)
|
||||
|
||||
AddBorderAndPadding(min);
|
||||
bool widthSet, heightSet;
|
||||
nsIBox::AddCSSMinSize(aBoxLayoutState, this, min, widthSet, heightSet);
|
||||
nsIFrame::AddCSSMinSize(aBoxLayoutState, this, min, widthSet, heightSet);
|
||||
|
||||
return min;
|
||||
}
|
||||
|
@ -101,7 +101,6 @@ public:
|
||||
nsresult EndUpdateBatch();
|
||||
nsresult ClearStyleAndImageCaches();
|
||||
|
||||
// nsIBox
|
||||
virtual nsSize GetMinSize(nsBoxLayoutState& aBoxLayoutState);
|
||||
virtual void SetBounds(nsBoxLayoutState& aBoxLayoutState, const nsRect& aRect,
|
||||
bool aRemoveOverflowArea = false);
|
||||
|
Loading…
Reference in New Issue
Block a user