Bug 785630 - nsIDocument's mAttrStyleSheet can be nsRefPtr r=khuey

This commit is contained in:
David Zbarsky 2012-08-26 12:51:58 -04:00
parent 2385322e53
commit 3aba5f61d2
2 changed files with 1 additions and 3 deletions

View File

@ -1772,7 +1772,7 @@ protected:
nsNodeInfoManager* mNodeInfoManager; // [STRONG]
nsRefPtr<mozilla::css::Loader> mCSSLoader;
nsRefPtr<mozilla::css::ImageLoader> mStyleImageLoader;
nsHTMLStyleSheet* mAttrStyleSheet;
nsRefPtr<nsHTMLStyleSheet> mAttrStyleSheet;
// The set of all object, embed, applet, video and audio elements for
// which this is the owner document. (They might not be in the document.)

View File

@ -1622,7 +1622,6 @@ nsDocument::~nsDocument()
}
if (mAttrStyleSheet) {
mAttrStyleSheet->SetOwningDocument(nullptr);
NS_RELEASE(mAttrStyleSheet);
}
if (mStyleAttrStyleSheet)
mStyleAttrStyleSheet->SetOwningDocument(nullptr);
@ -2276,7 +2275,6 @@ nsDocument::ResetStylesheetsToURI(nsIURI* aURI)
mAttrStyleSheet->Reset(aURI);
} else {
mAttrStyleSheet = new nsHTMLStyleSheet(aURI, this);
NS_ADDREF(mAttrStyleSheet);
}
// Don't use AddStyleSheet, since it'll put the sheet into style