if (tag == nsHTMLAtoms::object) rv = aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::data, data); else rv = aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::src, data);  PRBool havedata = (rv == NS_CONTENT_ATTR_HAS_VALUE) && (!data.IsEmpty()); if (!havedata) return PR_FALSE;
nsAutoString data; rv = aContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::data, data); if((rv == NS_CONTENT_ATTR_HAS_VALUE) && (data.Length() > 0)) {  nsAutoString ext;
PRBool nsObjectFrame::IsSupportedImage(nsIContent* aContent){  if (!aContent)    return PR_FALSE;  nsAutoString uType;  nsresult rv = aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::type, uType);  NS_ConvertUCS2toUTF8 type(uType);  PRBool haveType = (rv == NS_CONTENT_ATTR_HAS_VALUE) && (!type.IsEmpty());  if (!haveType)   {    nsCOMPtr<nsIAtom> tag;    aContent->GetTag(getter_AddRefs(tag));    nsAutoString data;    // If this is an OBJECT tag, we should look for a DATA attribute.    // If not, it's an EMBED tag, and so we should look for a SRC attribute.    if (tag == nsHTMLAtoms::object)      rv = aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::data, data);    else      rv = aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::src, data);    PRBool havedata = (rv == NS_CONTENT_ATTR_HAS_VALUE) && (!data.IsEmpty());    if (!havedata)      return PR_FALSE;     // Find the extension in the string     PRInt32 iLastCharOffset = data.Length() - 1;    PRInt32 iPointOffset = data.RFindChar('.');    if (iPointOffset == -1)      return PR_FALSE;      const nsAString & ext = Substring(data, iPointOffset + 1, iLastCharOffset - iPointOffset);    nsCOMPtr<nsIMIMEService> mimeService(do_GetService("@mozilla.org/mime;1", &rv));    if (NS_FAILED(rv))      return PR_FALSE;    nsXPIDLCString cType;    rv = mimeService->GetTypeFromExtension(NS_ConvertUCS2toUTF8(ext).get(), getter_Copies(cType));    if (NS_FAILED(rv))      return PR_FALSE;    type.Assign(cType);  }    nsCOMPtr<imgILoader> loader(do_GetService("@mozilla.org/image/loader;1"));  PRBool supported;  rv = loader->SupportImageWithMimeType(type.get(), &supported);  return NS_SUCCEEDED(rv) && supported;}