return 0;
NS_PRECONDITION(nsnull != aPresContext, "null arg"); NS_PRECONDITION(nsnull != aContent, "null arg"); NS_PRECONDITION(nsnull != aResults, "null arg");  PRInt32 matchCount = 0;  nsIHTMLContent* htmlContent; if (NS_OK == aContent->QueryInterface(kIHTMLContentIID, (void**)&htmlContent)) { nsIAtom*  tag; htmlContent->GetTag(tag);  if (tag == nsHTMLAtoms::a) { if ((nsnull != mLinkRule) || (nsnull != mVisitedRule) || (nsnull != mActiveRule)) {  nsILinkHandler* linkHandler;  if ((NS_OK == aPresContext->GetLinkHandler(&linkHandler)) && (nsnull != linkHandler)) { nsAutoString base, href; nsresult attrState = htmlContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::href, href);  if (NS_CONTENT_ATTR_HAS_VALUE == attrState) { nsIURL* docURL = nsnull; nsIDocument* doc = nsnull; aContent->GetDocument(doc); if (nsnull != doc) { docURL = doc->GetDocumentURL(); NS_RELEASE(doc); }  nsAutoString absURLSpec; nsresult rv = NS_MakeAbsoluteURL(docURL, base, href, absURLSpec); NS_IF_RELEASE(docURL);  nsLinkState  state; if (NS_OK == linkHandler->GetLinkState(absURLSpec, state)) { switch (state) { case eLinkState_Unvisited: if (nsnull != mLinkRule) { aResults->AppendElement(mLinkRule); matchCount++; } break; case eLinkState_Visited: if (nsnull != mVisitedRule) { aResults->AppendElement(mVisitedRule); matchCount++; } break; case eLinkState_Active: if (nsnull != mActiveRule) { aResults->AppendElement(mActiveRule); matchCount++; } break; } } } NS_RELEASE(linkHandler); } } }   nsIStyleRule* rule; htmlContent->GetContentStyleRule(rule); if (nsnull != rule) { aResults->AppendElement(rule); NS_RELEASE(rule); matchCount++; }  NS_IF_RELEASE(tag); NS_RELEASE(htmlContent); }  return matchCount;
PRInt32 HTMLStyleSheetImpl::RulesMatching(nsIPresContext* aPresContext,                                          nsIContent* aParentContent,                                          nsIAtom* aPseudoTag,                                          nsIStyleContext* aParentContext,                                          nsISupportsArray* aResults){  // no pseudo frame style  return 0;}