Bug 677495 - Image documents shouldn't have things other than the <img> in the <body> r=roc
This commit is contained in:
@@ -649,9 +649,9 @@ ImageDocument::CreateSyntheticDocument()
|
||||
// This is bad during printing, it means tall image frames won't know
|
||||
// the size of the paper and cannot break into continuations along
|
||||
// multiple pages.
|
||||
Element* body = GetBodyElement();
|
||||
if (!body) {
|
||||
NS_WARNING("no body on image document!");
|
||||
Element* head = GetHeadElement();
|
||||
if (!head) {
|
||||
NS_WARNING("no head on image document!");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
@@ -666,9 +666,15 @@ ImageDocument::CreateSyntheticDocument()
|
||||
}
|
||||
|
||||
styleContent->SetTextContent(NS_LITERAL_STRING("img { display: block; }"));
|
||||
body->AppendChildTo(styleContent, PR_FALSE);
|
||||
head->AppendChildTo(styleContent, PR_FALSE);
|
||||
|
||||
// Add the image element
|
||||
Element* body = GetBodyElement();
|
||||
if (!body) {
|
||||
NS_WARNING("no body on image document!");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nodeInfo = mNodeInfoManager->GetNodeInfo(nsGkAtoms::img, nsnull,
|
||||
kNameSpaceID_XHTML,
|
||||
nsIDOMNode::ELEMENT_NODE);
|
||||
|
||||
Reference in New Issue
Block a user