Make FindBackground not QI to nsIHTMLBodyElement -- this makes it much

faster.  Bug 129079, r=rjesup@wgate.com, sr=jst, a=asa


git-svn-id: svn://10.0.0.236/trunk@115871 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzbarsky%mit.edu
2002-03-05 23:17:32 +00:00
parent 374a98ef8e
commit 970eee3834
2 changed files with 20 additions and 6 deletions

View File

@@ -2509,9 +2509,16 @@ FindElementBackground(nsIPresContext* aPresContext,
nsCOMPtr<nsIContent> content;
aForFrame->GetContent(getter_AddRefs(content));
nsCOMPtr<nsIDOMHTMLBodyElement> body = do_QueryInterface(content);
if (!body || !parentFrame)
return PR_TRUE; // not frame for BODY element
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));

View File

@@ -2509,9 +2509,16 @@ FindElementBackground(nsIPresContext* aPresContext,
nsCOMPtr<nsIContent> content;
aForFrame->GetContent(getter_AddRefs(content));
nsCOMPtr<nsIDOMHTMLBodyElement> body = do_QueryInterface(content);
if (!body || !parentFrame)
return PR_TRUE; // not frame for BODY element
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));