зеркало из https://github.com/mozilla/pjs.git
Bug 604596. Stop using an out param for the return value of GetSMILOverrideStyle. r=bzbarsky
This commit is contained in:
Родитель
82bdeb451b
Коммит
7e664f367c
|
@ -76,8 +76,8 @@ enum nsLinkState {
|
|||
|
||||
// IID for the nsIContent interface
|
||||
#define NS_ICONTENT_IID \
|
||||
{ 0x8331ca9f, 0x8717, 0x4ab4, \
|
||||
{ 0xad, 0x17, 0xb4, 0x9d, 0xdc, 0xe8, 0xb6, 0x77 } }
|
||||
{ 0x5788c9eb, 0x646a, 0x4285, \
|
||||
{ 0xa2, 0x8c, 0xde, 0x0d, 0x43, 0x6b, 0x47, 0x72 } }
|
||||
|
||||
/**
|
||||
* A node of content in a document's content model. This interface
|
||||
|
@ -906,15 +906,15 @@ public:
|
|||
*/
|
||||
virtual nsISMILAttr* GetAnimatedAttr(PRInt32 aNamespaceID, nsIAtom* aName) = 0;
|
||||
|
||||
/**
|
||||
* Get the SMIL override style for this content node. This is a style
|
||||
* declaration that is applied *after* the inline style, and it can be used
|
||||
* e.g. to store animated style values.
|
||||
*
|
||||
* Note: This method is analogous to the 'GetStyle' method in
|
||||
* nsGenericHTMLElement and nsStyledElement.
|
||||
*/
|
||||
virtual nsresult GetSMILOverrideStyle(nsIDOMCSSStyleDeclaration** aStyle) = 0;
|
||||
/**
|
||||
* Get the SMIL override style for this content node. This is a style
|
||||
* declaration that is applied *after* the inline style, and it can be used
|
||||
* e.g. to store animated style values.
|
||||
*
|
||||
* Note: This method is analogous to the 'GetStyle' method in
|
||||
* nsGenericHTMLElement and nsStyledElement.
|
||||
*/
|
||||
virtual nsIDOMCSSStyleDeclaration* GetSMILOverrideStyle() = 0;
|
||||
|
||||
/**
|
||||
* Get the SMIL override style rule for this content node. If the rule
|
||||
|
|
|
@ -1115,11 +1115,10 @@ nsGenericDOMDataNode::WalkContentStyleRules(nsRuleWalker* aRuleWalker)
|
|||
}
|
||||
|
||||
#ifdef MOZ_SMIL
|
||||
nsresult
|
||||
nsGenericDOMDataNode::GetSMILOverrideStyle(nsIDOMCSSStyleDeclaration** aStyle)
|
||||
nsIDOMCSSStyleDeclaration*
|
||||
nsGenericDOMDataNode::GetSMILOverrideStyle()
|
||||
{
|
||||
*aStyle = nsnull;
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
css::StyleRule*
|
||||
|
|
|
@ -234,7 +234,7 @@ public:
|
|||
{
|
||||
return nsnull;
|
||||
}
|
||||
virtual nsresult GetSMILOverrideStyle(nsIDOMCSSStyleDeclaration** aStyle);
|
||||
virtual nsIDOMCSSStyleDeclaration* GetSMILOverrideStyle();
|
||||
virtual mozilla::css::StyleRule* GetSMILOverrideStyleRule();
|
||||
virtual nsresult SetSMILOverrideStyleRule(mozilla::css::StyleRule* aStyleRule,
|
||||
PRBool aNotify);
|
||||
|
|
|
@ -3349,19 +3349,16 @@ nsGenericElement::WalkContentStyleRules(nsRuleWalker* aRuleWalker)
|
|||
}
|
||||
|
||||
#ifdef MOZ_SMIL
|
||||
nsresult
|
||||
nsGenericElement::GetSMILOverrideStyle(nsIDOMCSSStyleDeclaration** aStyle)
|
||||
nsIDOMCSSStyleDeclaration*
|
||||
nsGenericElement::GetSMILOverrideStyle()
|
||||
{
|
||||
nsGenericElement::nsDOMSlots *slots = DOMSlots();
|
||||
|
||||
if (!slots->mSMILOverrideStyle) {
|
||||
slots->mSMILOverrideStyle = new nsDOMCSSAttributeDeclaration(this, PR_TRUE);
|
||||
NS_ENSURE_TRUE(slots->mSMILOverrideStyle, NS_ERROR_OUT_OF_MEMORY);
|
||||
}
|
||||
|
||||
// Why bother with QI?
|
||||
NS_ADDREF(*aStyle = slots->mSMILOverrideStyle);
|
||||
return NS_OK;
|
||||
return slots->mSMILOverrideStyle;
|
||||
}
|
||||
|
||||
css::StyleRule*
|
||||
|
|
|
@ -455,7 +455,7 @@ public:
|
|||
{
|
||||
return nsnull;
|
||||
}
|
||||
virtual nsresult GetSMILOverrideStyle(nsIDOMCSSStyleDeclaration** aStyle);
|
||||
virtual nsIDOMCSSStyleDeclaration* GetSMILOverrideStyle();
|
||||
virtual mozilla::css::StyleRule* GetSMILOverrideStyleRule();
|
||||
virtual nsresult SetSMILOverrideStyleRule(mozilla::css::StyleRule* aStyleRule,
|
||||
PRBool aNotify);
|
||||
|
|
|
@ -123,9 +123,8 @@ nsSMILCSSProperty::GetBaseValue() const
|
|||
// GENERAL CASE: Non-Shorthands
|
||||
// (1) Put empty string in override style for property mPropID
|
||||
// (saving old override style value, so we can set it again when we're done)
|
||||
nsCOMPtr<nsIDOMCSSStyleDeclaration> overrideStyle;
|
||||
mElement->GetSMILOverrideStyle(getter_AddRefs(overrideStyle));
|
||||
nsCOMPtr<nsICSSDeclaration> overrideDecl = do_QueryInterface(overrideStyle);
|
||||
nsCOMPtr<nsICSSDeclaration> overrideDecl =
|
||||
do_QueryInterface(mElement->GetSMILOverrideStyle());
|
||||
nsAutoString cachedOverrideStyleVal;
|
||||
if (overrideDecl) {
|
||||
overrideDecl->GetPropertyValue(mPropID, cachedOverrideStyleVal);
|
||||
|
@ -192,11 +191,8 @@ nsSMILCSSProperty::SetAnimValue(const nsSMILValue& aValue)
|
|||
}
|
||||
|
||||
// Use string value to style the target element
|
||||
nsCOMPtr<nsIDOMCSSStyleDeclaration> overrideStyle;
|
||||
mElement->GetSMILOverrideStyle(getter_AddRefs(overrideStyle));
|
||||
NS_ABORT_IF_FALSE(overrideStyle, "Need a non-null overrideStyle");
|
||||
|
||||
nsCOMPtr<nsICSSDeclaration> overrideDecl = do_QueryInterface(overrideStyle);
|
||||
nsCOMPtr<nsICSSDeclaration> overrideDecl =
|
||||
do_QueryInterface(mElement->GetSMILOverrideStyle());
|
||||
if (overrideDecl) {
|
||||
overrideDecl->SetPropertyValue(mPropID, valStr);
|
||||
}
|
||||
|
@ -207,9 +203,8 @@ void
|
|||
nsSMILCSSProperty::ClearAnimValue()
|
||||
{
|
||||
// Put empty string in override style for our property
|
||||
nsCOMPtr<nsIDOMCSSStyleDeclaration> overrideStyle;
|
||||
mElement->GetSMILOverrideStyle(getter_AddRefs(overrideStyle));
|
||||
nsCOMPtr<nsICSSDeclaration> overrideDecl = do_QueryInterface(overrideStyle);
|
||||
nsCOMPtr<nsICSSDeclaration> overrideDecl =
|
||||
do_QueryInterface(mElement->GetSMILOverrideStyle());
|
||||
if (overrideDecl) {
|
||||
overrideDecl->SetPropertyValue(mPropID, EmptyString());
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче