Bug 1032116 - Outparamdel nsIStyleSheetLinkingElement::GetStyleSheet; r=dbaron

This commit is contained in:
Ms2ger 2014-07-02 12:53:40 +02:00
parent ae0fcf2811
commit ce5ab085ef
4 changed files with 7 additions and 15 deletions

View File

@ -15,8 +15,6 @@ class nsIURI;
{ 0xd753c84a, 0x17fd, 0x4d5f, \
{ 0xb2, 0xe9, 0x63, 0x52, 0x8c, 0x87, 0x99, 0x7a } }
class nsIStyleSheet;
namespace mozilla {
class CSSStyleSheet;
} // namespace mozilla
@ -37,10 +35,9 @@ public:
/**
* Used to obtain the style sheet linked in by this element.
*
* @param aStyleSheet out parameter that returns the style
* sheet associated with this element.
* @return the style sheet associated with this element.
*/
NS_IMETHOD GetStyleSheet(nsIStyleSheet*& aStyleSheet) = 0;
NS_IMETHOD_(mozilla::CSSStyleSheet*) GetStyleSheet() = 0;
/**
* Initialize the stylesheet linking element. If aDontLoadStyle is

View File

@ -77,13 +77,10 @@ nsStyleLinkElement::SetStyleSheet(CSSStyleSheet* aStyleSheet)
return NS_OK;
}
NS_IMETHODIMP
nsStyleLinkElement::GetStyleSheet(nsIStyleSheet*& aStyleSheet)
NS_IMETHODIMP_(CSSStyleSheet*)
nsStyleLinkElement::GetStyleSheet()
{
aStyleSheet = mStyleSheet;
NS_IF_ADDREF(aStyleSheet);
return NS_OK;
return mStyleSheet;
}
NS_IMETHODIMP

View File

@ -41,7 +41,7 @@ public:
// nsIStyleSheetLinkingElement
NS_IMETHOD SetStyleSheet(mozilla::CSSStyleSheet* aStyleSheet) MOZ_OVERRIDE;
NS_IMETHOD GetStyleSheet(nsIStyleSheet*& aStyleSheet) MOZ_OVERRIDE;
NS_IMETHOD_(mozilla::CSSStyleSheet*) GetStyleSheet() MOZ_OVERRIDE;
NS_IMETHOD InitStyleLinkElement(bool aDontLoadStyle) MOZ_OVERRIDE;
NS_IMETHOD UpdateStyleSheet(nsICSSLoaderObserver* aObserver,
bool* aWillNotify,

View File

@ -560,9 +560,7 @@ RuleHash::~RuleHash()
RuleValue* value = &(mUniversalRules[i]);
nsAutoString selectorText;
uint32_t lineNumber = value->mRule->GetLineNumber();
nsCOMPtr<nsIStyleSheet> sheet;
value->mRule->GetStyleSheet(*getter_AddRefs(sheet));
nsRefPtr<CSSStyleSheet> cssSheet = do_QueryObject(sheet);
nsRefPtr<CSSStyleSheet> cssSheet = value->mRule->GetStyleSheet();
value->mSelector->ToString(selectorText, cssSheet);
printf(" line %d, %s\n",