The string returned from CSSStyleDeclaration::removeProperty() should only contain the old value, not the property name.

This commit is contained in:
jst%netscape.com 2000-05-02 00:24:45 +00:00
Родитель 5171cbcd2e
Коммит ecb8ae96cd
5 изменённых файлов: 49 добавлений и 19 удалений

Просмотреть файл

@ -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;