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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user