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:
roc+%cs.cmu.edu
2006-03-26 21:30:36 +00:00
parent cbf12a16e3
commit 140fbb3377
228 changed files with 1576 additions and 1768 deletions

View File

@@ -466,14 +466,13 @@ static NS_DEFINE_CID(kCPluginManagerCID, NS_PLUGINMANAGER_CID);
NS_IMETHODIMP
nsObjectFrame::Init(nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
#ifdef DEBUG
mInstantiating = PR_FALSE;
#endif
nsresult rv = nsObjectFrameSuper::Init(aContent, aParent, aContext, aPrevInFlow);
nsresult rv = nsObjectFrameSuper::Init(aContent, aParent, aPrevInFlow);
nsCOMPtr<nsIObjectLoadingContent> objContent(do_QueryInterface(mContent));
NS_ASSERTION(objContent, "Why not an object loading content?");
objContent->HasNewFrame(this);
@@ -1482,9 +1481,9 @@ nsObjectFrame::GetNextObjectFrame(nsPresContext* aPresContext, nsIFrame* aRoot)
}
nsIFrame*
NS_NewObjectFrame(nsIPresShell* aPresShell)
NS_NewObjectFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsObjectFrame;
return new (aPresShell) nsObjectFrame(aContext);
}