rv = content->GetHTMLAttribute(sBAD, ret); if (rv != NS_CONTENT_ATTR_NOT_THERE) {
attr = content->GetParsedAttr(sBAD); if (attr) {
void testAttributes(nsGenericHTMLElement* content) {  nsIAtom* sBORDER = NS_NewAtom("border");  nsIAtom* sHEIGHT = NS_NewAtom("height");  nsIAtom* sSRC = NS_NewAtom("src");  nsIAtom* sBAD = NS_NewAtom("badattribute");  nsString sempty;  nsString sfoo_gif(NS_LITERAL_STRING("foo.gif"));  content->SetAttr(kNameSpaceID_None, sBORDER, EmptyString(), PR_FALSE);  content->SetAttribute(kNameSpaceID_None, sHEIGHT, sempty, PR_FALSE);  content->SetAttribute(kNameSpaceID_None, sSRC, sfoo_gif, PR_FALSE);  nsHTMLValue ret;  nsresult rv;  rv = content->GetHTMLAttribute(sBORDER, ret);  if (rv == NS_CONTENT_ATTR_NOT_THERE || ret.GetUnit() != eHTMLUnit_String) {    printf("test 0 failed\n");  }  rv = content->GetHTMLAttribute(sBAD, ret);  if (rv != NS_CONTENT_ATTR_NOT_THERE) {    printf("test 2 failed\n");  }  content->UnsetAttribute(kNameSpaceID_None, sWIDTH, PR_FALSE);  nsISupportsArray* allNames;  NS_NewISupportsArray(&allNames);  if (nsnull == allNames) return;  PRInt32 na;  content->GetAttributeCount(na);  if (na != 3) {    printf("test 5 (unset attriubte) failed\n");  }  PRInt32 index;  for (index = 0; index < na; index++) {    nsIAtom* name, *prefix = nsnull;    PRInt32 nameSpaceID;    content->GetAttributeNameAt(index, nameSpaceID, name, prefix);    allNames->AppendElement(name);    NS_RELEASE(name);    NS_IF_RELEASE(prefix);  }  PRBool borderFound = PR_FALSE,heightFound = PR_FALSE,srcFound = PR_FALSE;  for (int n = 0; n < 3; n++) {    const nsIAtom* ident = (const nsIAtom*)allNames->ElementAt(n);    if (sBORDER == ident) {      borderFound = PR_TRUE;    }    if (sHEIGHT == ident) {      heightFound = PR_TRUE;    }    if (sSRC == ident) {      srcFound = PR_TRUE;    }  }  if (!(borderFound && heightFound && srcFound)) {    printf("test 6 failed\n");  }  NS_RELEASE(allNames);  NS_RELEASE(sBORDER);  NS_RELEASE(sWIDTH);  NS_RELEASE(sHEIGHT);  NS_RELEASE(sSRC);}