nsAutoString type; nsresult rv = aContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::type, type); if((rv == NS_CONTENT_ATTR_HAS_VALUE) && (type.Length() > 0)) {  if(type.EqualsIgnoreCase(IMAGE_GIF) || type.EqualsIgnoreCase(IMAGE_JPG) || type.EqualsIgnoreCase(IMAGE_PJPG)|| type.EqualsIgnoreCase(IMAGE_PNG) || type.EqualsIgnoreCase(IMAGE_PPM) || type.EqualsIgnoreCase(IMAGE_XBM) || type.EqualsIgnoreCase(IMAGE_XBM2)|| type.EqualsIgnoreCase(IMAGE_XBM3)) { *aImage = PR_TRUE; } return; }
if (tag == nsHTMLAtoms::object) rv = aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::data, data); else rv = aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::src, data);
void nsObjectFrame::IsSupportedImage(nsIContent* aContent, PRBool* aImage){  *aImage = PR_FALSE;  if(aContent == NULL)    return;  nsAutoString type;  nsresult rv = aContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::type, type);  if((rv == NS_CONTENT_ATTR_HAS_VALUE) && (type.Length() > 0))   {    // should be really call to imlib    if(type.EqualsIgnoreCase(IMAGE_GIF) ||       type.EqualsIgnoreCase(IMAGE_JPG) ||       type.EqualsIgnoreCase(IMAGE_PJPG)||       type.EqualsIgnoreCase(IMAGE_PNG) ||       type.EqualsIgnoreCase(IMAGE_PPM) ||       type.EqualsIgnoreCase(IMAGE_XBM) ||       type.EqualsIgnoreCase(IMAGE_XBM2)||       type.EqualsIgnoreCase(IMAGE_XBM3))    {      *aImage = PR_TRUE;    }    return;  }  nsAutoString data;  rv = aContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::data, data);  if((rv == NS_CONTENT_ATTR_HAS_VALUE) && (data.Length() > 0))   {    // should be really call to imlib    nsAutoString ext;        PRInt32 iLastCharOffset = data.Length() - 1;    PRInt32 iPointOffset = data.RFindChar('.');    if(iPointOffset != -1)    {      data.Mid(ext, iPointOffset + 1, iLastCharOffset - iPointOffset);      if(ext.EqualsIgnoreCase(IMAGE_EXT_GIF) ||         ext.EqualsIgnoreCase(IMAGE_EXT_JPG) ||         ext.EqualsIgnoreCase(IMAGE_EXT_PNG) ||         ext.EqualsIgnoreCase(IMAGE_EXT_XBM))      {        *aImage = PR_TRUE;      }    }    return;  }}