зеркало из https://github.com/mozilla/pjs.git
The string returned from CSSStyleDeclaration::removeProperty() should only contain the old value, not the property name.
This commit is contained in:
Родитель
5171cbcd2e
Коммит
ecb8ae96cd
|
@ -156,14 +156,20 @@ nsDOMCSSAttributeDeclaration::RemoveProperty(const nsString& aPropertyName,
|
|||
|
||||
nsCSSProperty prop = nsCSSProps::LookupProperty(aPropertyName);
|
||||
nsCSSValue val;
|
||||
rv = decl->RemoveProperty(prop, val);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
val.ToString(aReturn, prop);
|
||||
rv = decl->RemoveProperty(prop, val);
|
||||
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
// We pass in eCSSProperty_UNKNOWN here so that we don't get the
|
||||
// property name in the return string.
|
||||
val.ToString(aReturn, eCSSProperty_UNKNOWN);
|
||||
} else {
|
||||
// If we tried to remove an invalid property or a property that wasn't
|
||||
// set we simply return success and an empty string
|
||||
rv = NS_OK;
|
||||
}
|
||||
|
||||
if (doc) {
|
||||
|
||||
doc->AttributeChanged(mContent, kNameSpaceID_None, nsHTMLAtoms::style,
|
||||
hint);
|
||||
doc->EndUpdate();
|
||||
|
|
|
@ -830,10 +830,16 @@ DOMCSSDeclarationImpl::RemoveProperty(const nsString& aPropertyName,
|
|||
nsCSSValue val;
|
||||
|
||||
rv = decl->RemoveProperty(prop, val);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
val.ToString(aReturn, prop);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
// We pass in eCSSProperty_UNKNOWN here so that we don't get the
|
||||
// property name in the return string.
|
||||
val.ToString(aReturn, eCSSProperty_UNKNOWN);
|
||||
} else {
|
||||
// If we tried to remove an invalid property or a property that wasn't
|
||||
// set we simply return success and an empty string
|
||||
rv = NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
return rv;
|
||||
|
|
|
@ -156,14 +156,20 @@ nsDOMCSSAttributeDeclaration::RemoveProperty(const nsString& aPropertyName,
|
|||
|
||||
nsCSSProperty prop = nsCSSProps::LookupProperty(aPropertyName);
|
||||
nsCSSValue val;
|
||||
rv = decl->RemoveProperty(prop, val);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
val.ToString(aReturn, prop);
|
||||
rv = decl->RemoveProperty(prop, val);
|
||||
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
// We pass in eCSSProperty_UNKNOWN here so that we don't get the
|
||||
// property name in the return string.
|
||||
val.ToString(aReturn, eCSSProperty_UNKNOWN);
|
||||
} else {
|
||||
// If we tried to remove an invalid property or a property that wasn't
|
||||
// set we simply return success and an empty string
|
||||
rv = NS_OK;
|
||||
}
|
||||
|
||||
if (doc) {
|
||||
|
||||
doc->AttributeChanged(mContent, kNameSpaceID_None, nsHTMLAtoms::style,
|
||||
hint);
|
||||
doc->EndUpdate();
|
||||
|
|
|
@ -830,10 +830,16 @@ DOMCSSDeclarationImpl::RemoveProperty(const nsString& aPropertyName,
|
|||
nsCSSValue val;
|
||||
|
||||
rv = decl->RemoveProperty(prop, val);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
val.ToString(aReturn, prop);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
// We pass in eCSSProperty_UNKNOWN here so that we don't get the
|
||||
// property name in the return string.
|
||||
val.ToString(aReturn, eCSSProperty_UNKNOWN);
|
||||
} else {
|
||||
// If we tried to remove an invalid property or a property that wasn't
|
||||
// set we simply return success and an empty string
|
||||
rv = NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
return rv;
|
||||
|
|
|
@ -830,10 +830,16 @@ DOMCSSDeclarationImpl::RemoveProperty(const nsString& aPropertyName,
|
|||
nsCSSValue val;
|
||||
|
||||
rv = decl->RemoveProperty(prop, val);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
val.ToString(aReturn, prop);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
// We pass in eCSSProperty_UNKNOWN here so that we don't get the
|
||||
// property name in the return string.
|
||||
val.ToString(aReturn, eCSSProperty_UNKNOWN);
|
||||
} else {
|
||||
// If we tried to remove an invalid property or a property that wasn't
|
||||
// set we simply return success and an empty string
|
||||
rv = NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
return rv;
|
||||
|
|
Загрузка…
Ссылка в новой задаче