Bug 1292432 part 10 - Make style/link elements return StyleSheet. r=heycam

MozReview-Commit-ID: EIcfdYGZ8UH

--HG--
extra : source : 3fd1c648a97cef67b9ae080f26e22dba4f7be62f
This commit is contained in:
Xidorn Quan 2016-10-14 22:25:38 +11:00
parent ea2d289c2c
commit 80c70397ac
3 changed files with 5 additions and 15 deletions

View File

@ -39,15 +39,7 @@ public:
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr) override = 0;
mozilla::CSSStyleSheet* GetSheet() const
{
// XXXheycam Return nullptr for ServoStyleSheets until we have a way of
// exposing them to script.
NS_ASSERTION(!mStyleSheet || mStyleSheet->IsGecko(),
"stylo: ServoStyleSheets can't be exposed to script yet");
return mStyleSheet && mStyleSheet->IsGecko() ? mStyleSheet->AsGecko() :
nullptr;
}
mozilla::StyleSheet* GetSheet() const { return mStyleSheet; }
// nsIStyleSheetLinkingElement
NS_IMETHOD SetStyleSheet(mozilla::StyleSheet* aStyleSheet) override;

View File

@ -95,7 +95,7 @@ NS_IMPL_ELEMENT_CLONE(HTMLLinkElement)
bool
HTMLLinkElement::Disabled()
{
CSSStyleSheet* ss = GetSheet();
StyleSheet* ss = GetSheet();
return ss && ss->Disabled();
}
@ -109,8 +109,7 @@ HTMLLinkElement::GetMozDisabled(bool* aDisabled)
void
HTMLLinkElement::SetDisabled(bool aDisabled)
{
CSSStyleSheet* ss = GetSheet();
if (ss) {
if (StyleSheet* ss = GetSheet()) {
ss->SetDisabled(aDisabled);
}
}

View File

@ -68,7 +68,7 @@ HTMLStyleElement::GetMozDisabled(bool* aDisabled)
bool
HTMLStyleElement::Disabled()
{
CSSStyleSheet* ss = GetSheet();
StyleSheet* ss = GetSheet();
return ss && ss->Disabled();
}
@ -82,8 +82,7 @@ HTMLStyleElement::SetMozDisabled(bool aDisabled)
void
HTMLStyleElement::SetDisabled(bool aDisabled)
{
CSSStyleSheet* ss = GetSheet();
if (ss) {
if (StyleSheet* ss = GetSheet()) {
ss->SetDisabled(aDisabled);
}
}