CSSParserImpl::ParseDeclarations(const nsString& aDeclaration, nsIURI*         aBaseURL, nsIStyleRule*&  aResult)
CSSParserImpl::ParseDeclarations(const nsAReadableString& aDeclaration, nsIURI*                  aBaseURL, nsIStyleRule*&           aResult)
CSSParserImpl::ParseDeclarations(const nsString& aDeclaration,                                 nsIURI*         aBaseURL,                                 nsIStyleRule*&  aResult){  NS_ASSERTION(nsnull != aBaseURL, "need base URL");  nsString* str = new nsString(aDeclaration);  if (nsnull == str) {    return NS_ERROR_OUT_OF_MEMORY;  }  nsIUnicharInputStream* input = nsnull;  nsresult rv = NS_NewStringUnicharInputStream(&input, str);  if (NS_OK != rv) {    delete str;    return rv;  }  rv = InitScanner(input, aBaseURL);  NS_RELEASE(input);  if (! NS_SUCCEEDED(rv)) {    return rv;  }  mSection = eCSSSection_General;  PRInt32 errorCode = NS_OK;  nsICSSDeclaration* declaration = ParseDeclarationBlock(errorCode, PR_FALSE);  if (nsnull != declaration) {    // Create a style rule for the delcaration    nsICSSStyleRule* rule = nsnull;    NS_NewCSSStyleRule(&rule, nsCSSSelector());    rule->SetDeclaration(declaration);    aResult = rule;    NS_RELEASE(declaration);  }  else {    aResult = nsnull;  }  ReleaseScanner();  return NS_OK;}