nsCOMPtr<nsIAtom> tag; aContent->GetTag(getter_AddRefs(tag));
nsIAtom *tag = aContent->Tag();
FindNamedItems(const nsAString& aName, nsIContent *aContent,               IdAndNameMapEntry& aEntry, PRBool aIsXHTML){  NS_ASSERTION(aEntry.mContentList,               "Entry w/o content list passed to FindNamedItems()!");  nsCOMPtr<nsIAtom> tag;  aContent->GetTag(getter_AddRefs(tag));  if (tag == nsLayoutAtoms::textTagName) {    // Text nodes are not named items nor can they have children.    return;  }  nsAutoString value;  if (!aIsXHTML && IsNamedItem(aContent, tag, value) && value.Equals(aName)) {    aEntry.mContentList->AppendElement(aContent);  }  if (!aEntry.mIdContent) {    nsIAtom* idAttr = aContent->GetIDAttributeName();    if (idAttr) {      aContent->GetAttr(kNameSpaceID_None, idAttr, value);      if (value.Equals(aName)) {        aEntry.mIdContent = aContent;      }    }  }  PRUint32 i, count = aContent->GetChildCount();  for (i = 0; i < count; ++i) {    FindNamedItems(aName, aContent->GetChildAt(i), aEntry, aIsXHTML);  }}