Bug 358415, Crash [@ nsHTMLCSSUtils::GetCSSInlinePropertyBase] when inputing title of new blog entry on blogger.com before page is entirely loaded up, r+sr=jst

This commit is contained in:
Olli.Pettay@helsinki.fi
2007-01-16 17:04:16 +00:00
parent 6b5398d1cf
commit 83483b75d0

View File

@@ -571,7 +571,7 @@ nsHTMLCSSUtils::GetCSSInlinePropertyBase(nsIDOMNode *aNode, nsIAtom *aProperty,
aProperty->ToString(propString);
// Get the all the computed css styles attached to the element node
res = aViewCSS->GetComputedStyle(element, EmptyString(), getter_AddRefs(cssDecl));
if (NS_FAILED(res)) return res;
if (NS_FAILED(res) || !cssDecl) return res;
// from these declarations, get the one we want and that one only
res = cssDecl->GetPropertyValue(propString, value);
if (NS_FAILED(res)) return res;
@@ -583,7 +583,7 @@ nsHTMLCSSUtils::GetCSSInlinePropertyBase(nsIDOMNode *aNode, nsIAtom *aProperty,
nsCOMPtr<nsIDOMCSSStyleDeclaration> cssDecl;
PRUint32 length;
res = GetInlineStyles(element, getter_AddRefs(cssDecl), &length);
if (NS_FAILED(res)) return res;
if (NS_FAILED(res) || !cssDecl) return res;
nsAutoString value, propString;
aProperty->ToString(propString);
res = cssDecl->GetPropertyValue(propString, value);
@@ -1435,7 +1435,7 @@ nsHTMLCSSUtils::SetCSSProperty(nsIDOMElement * aElement,
nsCOMPtr<nsIDOMCSSStyleDeclaration> cssDecl;
PRUint32 length;
nsresult res = GetInlineStyles(aElement, getter_AddRefs(cssDecl), &length);
if (NS_FAILED(res)) return res;
if (NS_FAILED(res) || !cssDecl) return res;
return cssDecl->SetProperty(aProperty,
aValue,
@@ -1459,7 +1459,7 @@ nsHTMLCSSUtils::RemoveCSSProperty(nsIDOMElement * aElement,
nsCOMPtr<nsIDOMCSSStyleDeclaration> cssDecl;
PRUint32 length;
nsresult res = GetInlineStyles(aElement, getter_AddRefs(cssDecl), &length);
if (NS_FAILED(res)) return res;
if (NS_FAILED(res) || !cssDecl) return res;
nsAutoString returnString;
return cssDecl->RemoveProperty(aProperty, returnString);