Fix parent style context warnings by being consistent about parent contexts.

Bug 380116, r+sr=dbaron
This commit is contained in:
2007-06-15 22:11:20 -07:00
parent e670005a61
commit 82a9cab943
2 changed files with 3 additions and 4 deletions

View File

@@ -138,14 +138,13 @@ nsGfxButtonControlFrame::CreateFrameFor(nsIContent* aContent)
if (aContent == mTextContent) {
nsIFrame * parentFrame = mFrames.FirstChild();
nsStyleContext* styleContext = parentFrame->GetStyleContext();
nsPresContext* presContext = PresContext();
nsRefPtr<nsStyleContext> textStyleContext;
textStyleContext = presContext->StyleSet()->
ResolveStyleForNonElement(styleContext);
ResolveStyleForNonElement(mStyleContext);
if (textStyleContext && styleContext) {
if (textStyleContext) {
newFrame = NS_NewTextFrame(presContext->PresShell(), textStyleContext);
if (newFrame) {
// initialize the text frame