Bug 473390 part 10. Move various XUL nsIBoxLayout stuff out of the frame constructor into frame creation functions, and make the XUL frame creation functions have the right signature to fit into the new world. r+sr=roc

This commit is contained in:
Boris Zbarsky 2009-01-19 13:31:33 -05:00
Родитель c3e14cc5f6
Коммит 2594aa5be8
22 изменённых файлов: 133 добавлений и 144 удалений

Просмотреть файл

@ -284,13 +284,13 @@ nsIFrame*
NS_NewThumbFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewDeckFrame (nsIPresShell* aPresShell, nsStyleContext* aContext, nsIBoxLayout* aLayoutManager = nsnull);
NS_NewDeckFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewLeafBoxFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewStackFrame (nsIPresShell* aPresShell, nsStyleContext* aContext, nsIBoxLayout* aLayoutManager = nsnull);
NS_NewStackFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewProgressMeterFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
@ -328,17 +328,10 @@ NS_NewTreeBodyFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
// grid
nsresult
NS_NewGridLayout2 ( nsIPresShell* aPresShell, nsIBoxLayout** aNewLayout );
nsresult
NS_NewGridRowLeafLayout ( nsIPresShell* aPresShell, nsIBoxLayout** aNewLayout );
nsIFrame*
NS_NewGridRowLeafFrame (nsIPresShell* aPresShell, nsStyleContext* aContext, PRBool aIsRoot, nsIBoxLayout* aLayout);
nsresult
NS_NewGridRowGroupLayout ( nsIPresShell* aPresShell, nsIBoxLayout** aNewLayout );
NS_NewGridRowLeafFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewGridRowGroupFrame (nsIPresShell* aPresShell, nsStyleContext* aContext, PRBool aIsRoot, nsIBoxLayout* aLayout);
nsresult
NS_NewListBoxLayout ( nsIPresShell* aPresShell, nsCOMPtr<nsIBoxLayout>& aNewLayout );
NS_NewGridRowGroupFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
// end grid
@ -5440,7 +5433,6 @@ nsCSSFrameConstructor::ConstructXULFrame(nsFrameConstructorState& aState,
PRInt32 aNameSpaceID,
nsStyleContext* aStyleContext,
nsFrameItems& aFrameItems,
PRBool aXBLBaseTag,
PRBool aHasPseudoParent,
PRBool* aHaltProcessing)
{
@ -5541,9 +5533,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsFrameConstructorState& aState,
// XXX we should probably be calling ConstructBlock here to handle
// things like columns etc
if (aTag == nsGkAtoms::label) {
newFrame = NS_NewXULLabelFrame(mPresShell, aStyleContext,
NS_BLOCK_FLOAT_MGR |
NS_BLOCK_MARGIN_ROOT);
newFrame = NS_NewXULLabelFrame(mPresShell, aStyleContext);
} else {
newFrame = NS_NewBlockFrame(mPresShell, aStyleContext,
NS_BLOCK_FLOAT_MGR |
@ -5558,13 +5548,14 @@ nsCSSFrameConstructor::ConstructXULFrame(nsFrameConstructorState& aState,
// Menu Construction
else if (aTag == nsGkAtoms::menu ||
aTag == nsGkAtoms::menuitem ||
aTag == nsGkAtoms::menubutton) {
// A derived class box frame
// that has custom reflow to prevent menu children
// from becoming part of the flow.
newFrame = NS_NewMenuFrame(mPresShell, aStyleContext,
(aTag != nsGkAtoms::menuitem));
newFrame = NS_NewMenuFrame(mPresShell, aStyleContext);
}
else if (aTag == nsGkAtoms::menuitem) {
newFrame = NS_NewMenuItemFrame(mPresShell, aStyleContext);
}
else if (aTag == nsGkAtoms::menubar) {
#ifdef XP_MACOSX
@ -5648,7 +5639,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsFrameConstructorState& aState,
if (display->mDisplay == NS_STYLE_DISPLAY_INLINE_BOX ||
display->mDisplay == NS_STYLE_DISPLAY_BOX) {
newFrame = NS_NewBoxFrame(mPresShell, aStyleContext, PR_FALSE, nsnull);
newFrame = NS_NewBoxFrame(mPresShell, aStyleContext);
// Boxes can scroll.
mayBeScrollable = PR_TRUE;
@ -5667,44 +5658,24 @@ nsCSSFrameConstructor::ConstructXULFrame(nsFrameConstructorState& aState,
// ------- Begin Rows/Columns ---------
else if (display->mDisplay == NS_STYLE_DISPLAY_GRID_GROUP) {
nsCOMPtr<nsIBoxLayout> layout;
if (isXULNS && aTag == nsGkAtoms::listboxbody) {
NS_NewListBoxLayout(mPresShell, layout);
newFrame = NS_NewListBoxBodyFrame(mPresShell, aStyleContext, PR_FALSE, layout);
newFrame = NS_NewListBoxBodyFrame(mPresShell, aStyleContext);
}
else
{
NS_NewGridRowGroupLayout(mPresShell, getter_AddRefs(layout));
newFrame = NS_NewGridRowGroupFrame(mPresShell, aStyleContext, PR_FALSE, layout);
newFrame = NS_NewGridRowGroupFrame(mPresShell, aStyleContext);
}
// Boxes can scroll.
if (display->IsScrollableOverflow()) {
// set the top to be the newly created scrollframe
BuildScrollFrame(aState, aContent, aStyleContext, newFrame,
aParentFrame, topFrame, aStyleContext);
// we have a scrollframe so the parent becomes the scroll frame.
aParentFrame = newFrame->GetParent();
primaryFrameSet = PR_TRUE;
frameHasBeenInitialized = PR_TRUE;
}
mayBeScrollable = PR_TRUE;
} //------- End Grid ------
// ------- Begin Row/Column ---------
else if (display->mDisplay == NS_STYLE_DISPLAY_GRID_LINE) {
nsCOMPtr<nsIBoxLayout> layout;
NS_NewGridRowLeafLayout(mPresShell, getter_AddRefs(layout));
if (isXULNS && aTag == nsGkAtoms::listitem)
newFrame = NS_NewListItemFrame(mPresShell, aStyleContext, PR_FALSE, layout);
newFrame = NS_NewListItemFrame(mPresShell, aStyleContext);
else
newFrame = NS_NewGridRowLeafFrame(mPresShell, aStyleContext, PR_FALSE, layout);
newFrame = NS_NewGridRowLeafFrame(mPresShell, aStyleContext);
// Boxes can scroll.
mayBeScrollable = PR_TRUE;
@ -7042,7 +7013,7 @@ nsCSSFrameConstructor::ConstructFrameInternal( nsFrameConstructorState& aState,
rv = ConstructXULFrame(aState, aContent, adjParentFrame, aTag,
aNameSpaceID, styleContext,
*frameItems, aXBLBaseTag, pseudoParent,
*frameItems, pseudoParent,
&haltProcessing);
if (haltProcessing) {
@ -9881,7 +9852,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext,
#ifdef MOZ_XUL
} else if (nsGkAtoms::XULLabelFrame == frameType) {
newFrame = NS_NewXULLabelFrame(shell, styleContext, 0);
newFrame = NS_NewXULLabelFrame(shell, styleContext);
if (newFrame) {
newFrame->Init(content, aParentFrame, aFrame);

Просмотреть файл

@ -847,7 +847,6 @@ private:
PRInt32 aNameSpaceID,
nsStyleContext* aStyleContext,
nsFrameItems& aFrameItems,
PRBool aXBLBaseTag,
PRBool aHasPseudoParent,
PRBool* aHaltProcessing);

Просмотреть файл

@ -48,16 +48,21 @@
#include "nsBoxLayoutState.h"
#include "nsGridLayout2.h"
nsIFrame*
NS_NewGridRowGroupFrame (nsIPresShell* aPresShell,
nsStyleContext* aContext,
PRBool aIsRoot,
nsIBoxLayout* aLayoutManager)
{
return
new (aPresShell) nsGridRowGroupFrame (aPresShell, aContext, aIsRoot, aLayoutManager);
}
nsresult
NS_NewGridRowGroupLayout(nsIPresShell* aPresShell, nsIBoxLayout** aNewLayout);
nsIFrame*
NS_NewGridRowGroupFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext)
{
nsCOMPtr<nsIBoxLayout> layout;
NS_NewGridRowGroupLayout(aPresShell, getter_AddRefs(layout));
if (!layout) {
return nsnull;
}
return new (aPresShell) nsGridRowGroupFrame(aPresShell, aContext, layout);
}
/**

Просмотреть файл

@ -58,10 +58,6 @@ class nsGridRowGroupFrame : public nsBoxFrame
{
public:
friend nsIFrame* NS_NewGridRowGroupFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext,
nsIBoxLayout* aLayoutManager);
#ifdef NS_DEBUG
NS_IMETHOD GetFrameName(nsAString& aResult) const
{
@ -71,9 +67,8 @@ public:
nsGridRowGroupFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext,
PRBool aIsRoot,
nsIBoxLayout* aLayoutManager):
nsBoxFrame(aPresShell, aContext, aIsRoot, aLayoutManager) {}
nsBoxFrame(aPresShell, aContext, PR_FALSE, aLayoutManager) {}
virtual nscoord GetFlex(nsBoxLayoutState& aBoxLayoutState);

Просмотреть файл

@ -48,13 +48,21 @@
#include "nsBoxLayoutState.h"
#include "nsGridLayout2.h"
nsresult
NS_NewGridRowLeafLayout(nsIPresShell* aPresShell, nsIBoxLayout** aNewLayout);
nsIFrame*
NS_NewGridRowLeafFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext,
PRBool aIsRoot,
nsIBoxLayout* aLayoutManager)
nsStyleContext* aContext)
{
return new (aPresShell) nsGridRowLeafFrame (aPresShell, aContext, aIsRoot, aLayoutManager);
nsCOMPtr<nsIBoxLayout> layout;
NS_NewGridRowLeafLayout(aPresShell, getter_AddRefs(layout));
if (!layout) {
return nsnull;
}
return new (aPresShell) nsGridRowLeafFrame(aPresShell, aContext, PR_FALSE,
layout);
}
/*

Просмотреть файл

@ -60,8 +60,7 @@ class nsGridRowLeafFrame : public nsBoxFrame
public:
friend nsIFrame* NS_NewGridRowLeafFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext,
nsIBoxLayout* aLayoutManager);
nsStyleContext* aContext);
#ifdef NS_DEBUG
NS_IMETHOD GetFrameName(nsAString& aResult) const

Просмотреть файл

@ -130,6 +130,12 @@ NS_NewBoxFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRBool aIsRoo
return new (aPresShell) nsBoxFrame(aPresShell, aContext, aIsRoot, aLayoutManager);
} // NS_NewBoxFrame
nsIFrame*
NS_NewBoxFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsBoxFrame(aPresShell, aContext);
}
nsBoxFrame::nsBoxFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext,
PRBool aIsRoot,

Просмотреть файл

@ -66,8 +66,10 @@ class nsBoxLayoutState;
nsIFrame* NS_NewBoxFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext,
PRBool aIsRoot = PR_FALSE,
nsIBoxLayout* aLayoutManager = nsnull);
PRBool aIsRoot,
nsIBoxLayout* aLayoutManager);
nsIFrame* NS_NewBoxFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext);
class nsBoxFrame : public nsContainerFrame
{
@ -77,6 +79,8 @@ public:
nsStyleContext* aContext,
PRBool aIsRoot,
nsIBoxLayout* aLayoutManager);
friend nsIFrame* NS_NewBoxFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext);
// 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.
@ -172,7 +176,7 @@ public:
virtual ~nsBoxFrame();
nsBoxFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRBool aIsRoot = nsnull, nsIBoxLayout* aLayoutManager = nsnull);
nsBoxFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRBool aIsRoot = PR_FALSE, nsIBoxLayout* aLayoutManager = nsnull);
// if aIsPopup is true, then the view is for a popup. In this case,
// the view is added a child of the root view, and is initially hidden

Просмотреть файл

@ -58,24 +58,17 @@
#include "nsDisplayList.h"
nsIFrame*
NS_NewDeckFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsIBoxLayout* aLayoutManager)
NS_NewDeckFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsDeckFrame(aPresShell, aContext, aLayoutManager);
return new (aPresShell) nsDeckFrame(aPresShell, aContext);
} // NS_NewDeckFrame
nsDeckFrame::nsDeckFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext,
nsIBoxLayout* aLayoutManager)
nsDeckFrame::nsDeckFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
: nsBoxFrame(aPresShell, aContext), mIndex(0)
{
// if no layout manager specified us the static sprocket layout
nsCOMPtr<nsIBoxLayout> layout = aLayoutManager;
if (!layout) {
NS_NewStackLayout(aPresShell, layout);
}
nsCOMPtr<nsIBoxLayout> layout;
NS_NewStackLayout(aPresShell, layout);
SetLayoutManager(layout);
}

Просмотреть файл

@ -53,8 +53,7 @@ class nsDeckFrame : public nsBoxFrame
public:
friend nsIFrame* NS_NewDeckFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext,
nsIBoxLayout* aLayoutManager);
nsStyleContext* aContext);
NS_IMETHOD AttributeChanged(PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
@ -87,9 +86,7 @@ public:
}
#endif
nsDeckFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext,
nsIBoxLayout* aLayout = nsnull);
nsDeckFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
protected:

Просмотреть файл

@ -172,9 +172,8 @@ NS_IMPL_ISUPPORTS1(nsListScrollSmoother, nsITimerCallback)
nsListBoxBodyFrame::nsListBoxBodyFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext,
PRBool aIsRoot,
nsIBoxLayout* aLayoutManager)
: nsBoxFrame(aPresShell, aContext, aIsRoot, aLayoutManager),
: nsBoxFrame(aPresShell, aContext, PR_FALSE, aLayoutManager),
mRowCount(-1),
mRowHeight(0),
mRowHeightWasSet(PR_FALSE),
@ -1497,10 +1496,17 @@ nsListBoxBodyFrame::RemoveChildFrame(nsBoxLayoutState &aState,
// Creation Routines ///////////////////////////////////////////////////////////////////////
nsresult
NS_NewListBoxLayout ( nsIPresShell* aPresShell, nsCOMPtr<nsIBoxLayout>& aNewLayout );
nsIFrame*
NS_NewListBoxBodyFrame(nsIPresShell* aPresShell, nsStyleContext* aContext,
PRBool aIsRoot, nsIBoxLayout* aLayoutManager)
NS_NewListBoxBodyFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return
new (aPresShell) nsListBoxBodyFrame(aPresShell, aContext, aIsRoot, aLayoutManager);
nsCOMPtr<nsIBoxLayout> layout;
NS_NewListBoxLayout(aPresShell, layout);
if (!layout) {
return nsnull;
}
return new (aPresShell) nsListBoxBodyFrame(aPresShell, aContext, layout);
}

Просмотреть файл

@ -53,15 +53,14 @@
class nsListScrollSmoother;
nsIFrame* NS_NewListBoxBodyFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext,
PRBool aIsRoot = PR_FALSE,
nsIBoxLayout* aLayoutManager = nsnull);
nsStyleContext* aContext);
class nsListBoxBodyFrame : public nsBoxFrame,
public nsIScrollbarMediator,
public nsIReflowCallback
{
nsListBoxBodyFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRBool aIsRoot = nsnull, nsIBoxLayout* aLayoutManager = nsnull);
nsListBoxBodyFrame(nsIPresShell* aPresShell, nsStyleContext* aContext,
nsIBoxLayout* aLayoutManager);
virtual ~nsListBoxBodyFrame();
public:
@ -80,9 +79,7 @@ public:
nsresult GetIndexOfItem(nsIDOMElement *aItem, PRInt32 *aResult);
friend nsIFrame* NS_NewListBoxBodyFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext,
PRBool aIsRoot,
nsIBoxLayout* aLayoutManager);
nsStyleContext* aContext);
// nsIFrame
NS_IMETHOD Init(nsIContent* aContent,

Просмотреть файл

@ -43,6 +43,7 @@
#include "nsINameSpaceManager.h"
#include "nsGkAtoms.h"
#include "nsDisplayList.h"
#include "nsIBoxLayout.h"
nsListItemFrame::nsListItemFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext,
@ -84,9 +85,18 @@ nsListItemFrame::BuildDisplayListForChildren(nsDisplayListBuilder* aBuilder,
// Creation Routine ///////////////////////////////////////////////////////////////////////
nsresult
NS_NewGridRowLeafLayout(nsIPresShell* aPresShell, nsIBoxLayout** aNewLayout);
nsIFrame*
NS_NewListItemFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRBool aIsRoot, nsIBoxLayout* aLayoutManager)
NS_NewListItemFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsListItemFrame(aPresShell, aContext, aIsRoot, aLayoutManager);
nsCOMPtr<nsIBoxLayout> layout;
NS_NewGridRowLeafLayout(aPresShell, getter_AddRefs(layout));
if (!layout) {
return nsnull;
}
return new (aPresShell) nsListItemFrame(aPresShell, aContext, PR_FALSE, layout);
} // NS_NewListItemFrame

Просмотреть файл

@ -41,17 +41,13 @@
#include "nsGridRowLeafFrame.h"
nsIFrame* NS_NewListItemFrame(nsIPresShell* aPresShell,
nsStyleContext *aContext,
PRBool aIsRoot = PR_FALSE,
nsIBoxLayout* aLayoutManager = nsnull);
nsStyleContext *aContext);
class nsListItemFrame : public nsGridRowLeafFrame
{
public:
friend nsIFrame* NS_NewListItemFrame(nsIPresShell* aPresShell,
nsStyleContext *aContext,
PRBool aIsRoot,
nsIBoxLayout* aLayoutManager);
nsStyleContext *aContext);
// overridden so that children of listitems don't handle mouse events,
// unless allowevents="true" is specified on the listitem

Просмотреть файл

@ -153,21 +153,32 @@ private:
};
//
// NS_NewMenuFrame
// NS_NewMenuFrame and NS_NewMenuItemFrame
//
// Wrapper for creating a new menu popup container
// Wrappers for creating a new menu popup container
//
nsIFrame*
NS_NewMenuFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFlags)
NS_NewMenuFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
nsMenuFrame* it = new (aPresShell) nsMenuFrame (aPresShell, aContext);
if ((it != nsnull) && aFlags)
if (it)
it->SetIsMenu(PR_TRUE);
return it;
}
nsIFrame*
NS_NewMenuItemFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
nsMenuFrame* it = new (aPresShell) nsMenuFrame (aPresShell, aContext);
if (it)
it->SetIsMenu(PR_FALSE);
return it;
}
NS_QUERYFRAME_HEAD(nsMenuFrame)
NS_QUERYFRAME_ENTRY(nsIMenuFrame)
NS_QUERYFRAME_ENTRY(nsIScrollableViewProvider)

Просмотреть файл

@ -59,7 +59,8 @@
#include "nsIContent.h"
#include "nsIScrollableViewProvider.h"
nsIFrame* NS_NewMenuFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFlags);
nsIFrame* NS_NewMenuFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame* NS_NewMenuItemFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
class nsMenuBarFrame;
class nsIScrollableView;

Просмотреть файл

@ -55,21 +55,16 @@
#include "nsDisplayList.h"
nsIFrame*
NS_NewStackFrame (nsIPresShell* aPresShell, nsStyleContext* aContext, nsIBoxLayout* aLayoutManager)
NS_NewStackFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsStackFrame(aPresShell, aContext, aLayoutManager);
return new (aPresShell) nsStackFrame(aPresShell, aContext);
} // NS_NewStackFrame
nsStackFrame::nsStackFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsIBoxLayout* aLayoutManager):
nsStackFrame::nsStackFrame(nsIPresShell* aPresShell, nsStyleContext* aContext):
nsBoxFrame(aPresShell, aContext)
{
// if no layout manager specified us the stack layout
nsCOMPtr<nsIBoxLayout> layout = aLayoutManager;
if (layout == nsnull) {
NS_NewStackLayout(aPresShell, layout);
}
nsCOMPtr<nsIBoxLayout> layout;
NS_NewStackLayout(aPresShell, layout);
SetLayoutManager(layout);
}

Просмотреть файл

@ -52,7 +52,8 @@ class nsStackFrame : public nsBoxFrame
{
public:
friend nsIFrame* NS_NewStackFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsIBoxLayout* aLayout = nsnull);
friend nsIFrame* NS_NewStackFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext);
#ifdef NS_DEBUG
NS_IMETHOD GetFrameName(nsAString& aResult) const
@ -66,7 +67,7 @@ public:
const nsDisplayListSet& aLists);
protected:
nsStackFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsIBoxLayout* aLayout = nsnull);
nsStackFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
}; // class nsStackFrame

Просмотреть файл

@ -43,12 +43,12 @@
#include "nsIEventStateManager.h"
nsIFrame*
NS_NewXULLabelFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFlags)
NS_NewXULLabelFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
nsXULLabelFrame* it = new (aPresShell) nsXULLabelFrame(aContext);
if (it != nsnull)
it->SetFlags(aFlags);
if (it)
it->SetFlags(NS_BLOCK_FLOAT_MGR | NS_BLOCK_MARGIN_ROOT);
return it;
}

Просмотреть файл

@ -49,7 +49,8 @@
class nsXULLabelFrame : public nsBlockFrame
{
public:
friend nsIFrame* NS_NewXULLabelFrame(nsIPresShell* aPresShell, nsStyleContext *aContext, PRUint32 aFlags);
friend nsIFrame* NS_NewXULLabelFrame(nsIPresShell* aPresShell,
nsStyleContext *aContext);
// nsIFrame
NS_IMETHOD Init(nsIContent* aContent,
@ -80,6 +81,6 @@ protected:
};
nsIFrame*
NS_NewXULLabelFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFlags);
NS_NewXULLabelFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
#endif /* !defined(nsXULLabelFrame_h_) */

Просмотреть файл

@ -59,10 +59,9 @@
// Creates a new col frame
//
nsIFrame*
NS_NewTreeColFrame(nsIPresShell* aPresShell, nsStyleContext* aContext,
PRBool aIsRoot, nsIBoxLayout* aLayoutManager)
NS_NewTreeColFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsTreeColFrame(aPresShell, aContext, aIsRoot, aLayoutManager);
return new (aPresShell) nsTreeColFrame(aPresShell, aContext);
} // NS_NewTreeColFrame
// Destructor

Просмотреть файл

@ -41,18 +41,14 @@
class nsITreeBoxObject;
nsIFrame* NS_NewTreeColFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext,
PRBool aIsRoot = PR_FALSE,
nsIBoxLayout* aLayoutManager = nsnull);
nsStyleContext* aContext);
class nsTreeColFrame : public nsBoxFrame
{
public:
nsTreeColFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext,
PRBool aIsRoot = nsnull,
nsIBoxLayout* aLayoutManager = nsnull):
nsBoxFrame(aPresShell, aContext, aIsRoot, aLayoutManager) {}
nsStyleContext* aContext):
nsBoxFrame(aPresShell, aContext) {}
NS_IMETHOD Init(nsIContent* aContent,
nsIFrame* aParent,
@ -71,9 +67,8 @@ public:
virtual void SetBounds(nsBoxLayoutState& aBoxLayoutState, const nsRect& aRect,
PRBool aRemoveOverflowArea = PR_FALSE);
friend nsIFrame* NS_NewTreeColFrame(nsIPresShell* aPresShell,
PRBool aIsRoot,
nsIBoxLayout* aLayoutManager);
friend nsIFrame* NS_NewTreeColFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext);
protected:
virtual ~nsTreeColFrame();