result = rule->QueryInterface(NS_GET_IID(nsICSSStyleRule), (void**)&cssRule);
result = rule->QueryInterface(kICSSStyleRuleIID, (void**)&cssRule);
nsDOMCSSAttributeDeclaration::GetCSSDeclaration(nsICSSDeclaration **aDecl,                                                  PRBool aAllocate){  nsHTMLValue val;  nsIStyleRule* rule;  nsICSSStyleRule*  cssRule;  nsresult result = NS_OK;  *aDecl = nsnull;  if (nsnull != mContent) {    mContent->GetHTMLAttribute(nsHTMLAtoms::style, val);    if (eHTMLUnit_ISupports == val.GetUnit()) {      rule = (nsIStyleRule*) val.GetISupportsValue();      result = rule->QueryInterface(NS_GET_IID(nsICSSStyleRule), (void**)&cssRule);      if (NS_OK == result) {        *aDecl = cssRule->GetDeclaration();        NS_RELEASE(cssRule);      }            NS_RELEASE(rule);    }    else if (PR_TRUE == aAllocate) {      result = NS_NewCSSDeclaration(aDecl);      if (NS_OK == result) {        result = NS_NewCSSStyleRule(&cssRule, nsCSSSelector());        if (NS_OK == result) {          cssRule->SetDeclaration(*aDecl);          cssRule->SetWeight(0x7fffffff);          rule = (nsIStyleRule *)cssRule;          result = mContent->SetHTMLAttribute(nsHTMLAtoms::style,                                               nsHTMLValue(cssRule),                                               PR_FALSE);          NS_RELEASE(cssRule);        }        else {          NS_RELEASE(*aDecl);        }      }    }  }  return result;}