nsCOMPtr<nsIAtom> tag; content->GetTag(getter_AddRefs(tag)); if (tag != nsHTMLAtoms::body)
if (content->Tag() != nsHTMLAtoms::body)
FindElementBackground(nsIPresContext* aPresContext,                      nsIFrame* aForFrame,                      const nsStyleBackground** aBackground){  nsIFrame *parentFrame = aForFrame->GetParent();  // XXXldb We shouldn't have to null-check |parentFrame| here.  if (parentFrame && IsCanvasFrame(aPresContext, parentFrame) == parentFrame) {    // Check that we're really the root (rather than in another child list).    nsIFrame *childFrame;    parentFrame->FirstChild(aPresContext, nsnull, &childFrame);    if (childFrame == aForFrame)      return PR_FALSE; // Background was already drawn for the canvas.  }  *aBackground = aForFrame->GetStyleBackground();  nsIContent* content = aForFrame->GetContent();  if (!content || !content->IsContentOfType(nsIContent::eHTML))    return PR_TRUE;  // not frame for an HTML element  if (!parentFrame)    return PR_TRUE; // no parent to look at    nsCOMPtr<nsIAtom> tag;  content->GetTag(getter_AddRefs(tag));  if (tag != nsHTMLAtoms::body)    return PR_TRUE; // not frame for <BODY> element  // We should only look at the <html> background if we're in an HTML document  nsCOMPtr<nsIDOMNode> node(do_QueryInterface(content));  nsCOMPtr<nsIDOMDocument> doc;  node->GetOwnerDocument(getter_AddRefs(doc));  nsCOMPtr<nsIDOMHTMLDocument> htmlDoc(do_QueryInterface(doc));  if (!htmlDoc)    return PR_TRUE;  nsCOMPtr<nsIDocument> document(do_QueryInterface(doc));  if (document->IsCaseSensitive()) // XHTML, not HTML    return PR_TRUE;    const nsStyleBackground* htmlBG = parentFrame->GetStyleBackground();  return !htmlBG->IsTransparent();}