diff --git a/dom/base/Element.cpp b/dom/base/Element.cpp index c24a88d958b0..cd4bd09e0875 100644 --- a/dom/base/Element.cpp +++ b/dom/base/Element.cpp @@ -1835,11 +1835,8 @@ DeclarationBlock* Element::GetSMILOverrideStyleDeclaration() { return slots ? slots->mSMILOverrideStyleDeclaration.get() : nullptr; } -nsresult Element::SetSMILOverrideStyleDeclaration( - DeclarationBlock* aDeclaration) { - Element::nsExtendedDOMSlots* slots = ExtendedDOMSlots(); - - slots->mSMILOverrideStyleDeclaration = aDeclaration; +void Element::SetSMILOverrideStyleDeclaration(DeclarationBlock& aDeclaration) { + ExtendedDOMSlots()->mSMILOverrideStyleDeclaration = &aDeclaration; // Only need to request a restyle if we're in a document. (We might not // be in a document, if we're clearing animation effects on a target node @@ -1849,8 +1846,6 @@ nsresult Element::SetSMILOverrideStyleDeclaration( presShell->RestyleForAnimation(this, StyleRestyleHint_RESTYLE_SMIL); } } - - return NS_OK; } bool Element::IsLabelable() const { return false; } diff --git a/dom/base/Element.h b/dom/base/Element.h index 598f8a718953..e07e06a5b9e5 100644 --- a/dom/base/Element.h +++ b/dom/base/Element.h @@ -336,7 +336,7 @@ class Element : public FragmentOrElement { * notify the document's pres context, so that the style changes will be * noticed. */ - nsresult SetSMILOverrideStyleDeclaration(DeclarationBlock* aDeclaration); + void SetSMILOverrideStyleDeclaration(DeclarationBlock&); /** * Returns a new SMILAttr that allows the caller to animate the given diff --git a/layout/style/nsDOMCSSAttrDeclaration.cpp b/layout/style/nsDOMCSSAttrDeclaration.cpp index b131e9d87aa4..9b5d52728d3b 100644 --- a/layout/style/nsDOMCSSAttrDeclaration.cpp +++ b/layout/style/nsDOMCSSAttrDeclaration.cpp @@ -79,9 +79,11 @@ nsresult nsDOMCSSAttributeDeclaration::SetCSSDeclaration( MOZ_ASSERT_IF(aClosureData, !aClosureData->mClosure); aDecl->SetDirty(); - return mIsSMILOverride - ? mElement->SetSMILOverrideStyleDeclaration(aDecl) - : mElement->SetInlineStyleDeclaration(*aDecl, *aClosureData); + if (mIsSMILOverride) { + mElement->SetSMILOverrideStyleDeclaration(*aDecl); + return NS_OK; + } + return mElement->SetInlineStyleDeclaration(*aDecl, *aClosureData); } Document* nsDOMCSSAttributeDeclaration::DocToUpdate() {