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
git-svn-id: svn://10.0.0.236/trunk@193022 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -85,14 +85,14 @@ class CanvasFrame : public nsHTMLContainerFrame,
|
||||
public nsIScrollPositionListener,
|
||||
public nsICanvasFrame {
|
||||
public:
|
||||
CanvasFrame() : mDoPaintFocus(PR_FALSE) {}
|
||||
CanvasFrame(nsStyleContext* aContext)
|
||||
: nsHTMLContainerFrame(aContext), mDoPaintFocus(PR_FALSE) {}
|
||||
|
||||
// nsISupports
|
||||
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
||||
|
||||
NS_IMETHOD Init(nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsStyleContext* aContext,
|
||||
nsIFrame* aPrevInFlow);
|
||||
NS_IMETHOD Destroy(nsPresContext* aPresContext);
|
||||
|
||||
@@ -155,9 +155,9 @@ private:
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
nsIFrame*
|
||||
NS_NewCanvasFrame(nsIPresShell* aPresShell)
|
||||
NS_NewCanvasFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
|
||||
{
|
||||
return new (aPresShell)CanvasFrame;
|
||||
return new (aPresShell)CanvasFrame(aContext);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
@@ -187,10 +187,9 @@ CanvasFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
NS_IMETHODIMP
|
||||
CanvasFrame::Init(nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsStyleContext* aContext,
|
||||
nsIFrame* aPrevInFlow)
|
||||
{
|
||||
nsresult rv = nsHTMLContainerFrame::Init(aContent, aParent, aContext, aPrevInFlow);
|
||||
nsresult rv = nsHTMLContainerFrame::Init(aContent, aParent, aPrevInFlow);
|
||||
|
||||
mViewManager = GetPresContext()->GetViewManager();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user