hint = decl->GetStyleImpact();
nsDOMCSSAttributeDeclaration::ParseDeclaration(const nsAString& aDecl,                                               PRBool aParseOnlyOneDecl,                                               PRBool aClearOldDecl){  nsCSSDeclaration* decl;  nsresult result = GetCSSDeclaration(&decl, PR_TRUE);  if (decl) {    nsCOMPtr<nsICSSLoader> cssLoader;    nsCOMPtr<nsICSSParser> cssParser;    nsCOMPtr<nsIURI> baseURI;    nsCOMPtr<nsIDocument> doc;    result = mContent->GetDocument(*getter_AddRefs(doc));    if (NS_FAILED(result)) {      return result;    }    result = GetCSSParsingEnvironment(mContent,                                      getter_AddRefs(baseURI),                                      getter_AddRefs(cssLoader),                                      getter_AddRefs(cssParser));    if (NS_SUCCEEDED(result)) {      PRInt32 hint = NS_STYLE_HINT_NONE;      if (doc) {        doc->BeginUpdate();        doc->AttributeWillChange(mContent, kNameSpaceID_None,                                 nsHTMLAtoms::style);      }      nsCSSDeclaration* declClone = decl->Clone();      if (aClearOldDecl) {        hint = decl->GetStyleImpact();        // This should be done with decl->Clear() once such a method exists.        nsAutoString propName;        PRUint32 count, i;        count = decl->Count();        for (i = 0; i < count; i++) {          decl->GetNthProperty(0, propName);          nsCSSProperty prop = nsCSSProps::LookupProperty(propName);          nsCSSValue val;          decl->RemoveProperty(prop, val);        }      }        PRInt32 newHint = NS_STYLE_HINT_NONE;      result = cssParser->ParseAndAppendDeclaration(aDecl, baseURI, decl,                                                    aParseOnlyOneDecl, &newHint);      hint = PR_MAX(hint, newHint);            if (result == NS_CSS_PARSER_DROP_DECLARATION) {        SetCSSDeclaration(declClone);        result = NS_OK;      }      if (doc) {        if (NS_SUCCEEDED(result) && result != NS_CSS_PARSER_DROP_DECLARATION) {          doc->AttributeChanged(mContent, kNameSpaceID_None,                                nsHTMLAtoms::style,                                nsIDOMMutationEvent::MODIFICATION, hint);        }        doc->EndUpdate();      }      if (cssLoader) {        cssLoader->RecycleParser(cssParser);      }    }  }  return result;}