if (NS_SUCCEEDED(rule->QueryInterface(kICSSStyleRuleIID, (void**)&cssRule))) {
if (NS_SUCCEEDED(rule->QueryInterface(NS_GET_IID(nsICSSStyleRule), (void**)&cssRule))) {
HTMLCSSStyleSheetImpl::RulesMatching(nsIPresContext* aPresContext,                                     nsIAtom* aMedium,                                     nsIContent* aContent,                                     nsIStyleContext* aParentContext,                                     nsISupportsArray* aResults){  NS_PRECONDITION(nsnull != aPresContext, "null arg");  NS_PRECONDITION(nsnull != aContent, "null arg");  NS_PRECONDITION(nsnull != aResults, "null arg");  nsIStyledContent* styledContent;  // just get the one and only style rule from the content's STYLE attribute  if (NS_SUCCEEDED(aContent->QueryInterface(NS_GET_IID(nsIStyledContent), (void**)&styledContent))) {    PRUint32 index = 0;    aResults->Count(&index);    if (NS_SUCCEEDED(styledContent->GetInlineStyleRules(aResults))) {      PRUint32 postCount = 0;      aResults->Count(&postCount);      while (index < postCount) {        nsIStyleRule* rule = (nsIStyleRule*)aResults->ElementAt(index++);        nsICSSStyleRule*  cssRule;        if (NS_SUCCEEDED(rule->QueryInterface(kICSSStyleRuleIID, (void**)&cssRule))) {          nsIStyleRule* important = cssRule->GetImportantRule();          if (nsnull != important) {            aResults->AppendElement(important);            NS_RELEASE(important);          }          NS_RELEASE(cssRule);        }        NS_RELEASE(rule);      }    }    NS_RELEASE(styledContent);  }  return NS_OK;}