Bug 330934. Set a nsIFrame's stylecontext in its constructor, to ensure that there's always one available for GetPresContext() to use even if Init hasn't been called. Patch by Marc Liddell, r+sr=roc

This commit is contained in:
roc+@cs.cmu.edu
2006-03-26 21:30:36 +00:00
parent e3449c5928
commit 54d3415318
228 changed files with 1576 additions and 1768 deletions

View File

@@ -76,9 +76,9 @@
// Wrapper for creating a new menu Bar container
//
nsIFrame*
NS_NewMenuBarFrame(nsIPresShell* aPresShell)
NS_NewMenuBarFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsMenuBarFrame (aPresShell);
return new (aPresShell) nsMenuBarFrame (aPresShell, aContext);
}
NS_IMETHODIMP_(nsrefcnt)
@@ -105,11 +105,14 @@ NS_INTERFACE_MAP_END_INHERITING(nsBoxFrame)
//
// nsMenuBarFrame cntr
//
nsMenuBarFrame::nsMenuBarFrame(nsIPresShell* aShell):nsBoxFrame(aShell),
mMenuBarListener(nsnull), mKeyboardNavigator(nsnull),
mIsActive(PR_FALSE), mTarget(nsnull), mCaretWasVisible(PR_FALSE)
nsMenuBarFrame::nsMenuBarFrame(nsIPresShell* aShell, nsStyleContext* aContext):
nsBoxFrame(aShell, aContext),
mMenuBarListener(nsnull),
mKeyboardNavigator(nsnull),
mIsActive(PR_FALSE),
mTarget(nsnull),
mCaretWasVisible(PR_FALSE)
{
} // cntr
nsMenuBarFrame::~nsMenuBarFrame()
@@ -126,10 +129,9 @@ nsMenuBarFrame::~nsMenuBarFrame()
NS_IMETHODIMP
nsMenuBarFrame::Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
nsresult rv = nsBoxFrame::Init(aContent, aParent, aContext, aPrevInFlow);
nsresult rv = nsBoxFrame::Init(aContent, aParent, aPrevInFlow);
// Create the menu bar listener.
mMenuBarListener = new nsMenuBarListener(this);