nsIContent* aContent,
nsIAtom* aPseudoTag,
PRInt32 HTMLCSSStyleSheetImpl::RulesMatching(nsIPresContext* aPresContext,                                             nsIContent* aContent,                                             nsIFrame* aParentFrame,                                             nsISupportsArray* aResults){  NS_PRECONDITION(nsnull != aPresContext, "null arg");  NS_PRECONDITION(nsnull != aContent, "null arg");//  NS_PRECONDITION(nsnull != aParentFrame, "null arg");  NS_PRECONDITION(nsnull != aResults, "null arg");  PRInt32 matchCount = 0;  nsIContent* parentContent = nsnull;  if (nsnull != aParentFrame) {    aParentFrame->GetContent(parentContent);  }  if (aContent != parentContent) {  // if not a pseudo frame...    nsIHTMLContent* htmlContent;    // just get the one and only style rule from the content's STYLE attribute    if (NS_OK == aContent->QueryInterface(kIHTMLContentIID, (void**)&htmlContent)) {      nsHTMLValue value;      if (NS_CONTENT_ATTR_HAS_VALUE == htmlContent->GetAttribute(nsHTMLAtoms::style, value)) {        if (eHTMLUnit_ISupports == value.GetUnit()) {          nsISupports*  rule = value.GetISupportsValue();          if (nsnull != rule) {            aResults->AppendElement(rule);            matchCount++;            nsICSSStyleRule*  cssRule;            if (NS_OK == rule->QueryInterface(kICSSStyleRuleIID, (void**)&cssRule)) {              nsIStyleRule* important = cssRule->GetImportantRule();              if (nsnull != important) {                aResults->AppendElement(important);                matchCount++;                NS_RELEASE(important);              }              NS_RELEASE(cssRule);            }            NS_RELEASE(rule);          }        }      }      NS_RELEASE(htmlContent);    }  }  NS_IF_RELEASE(parentContent);  return matchCount;}