Create HTML-html-element not a root part
git-svn-id: svn://10.0.0.236/trunk@9564 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -1315,10 +1315,12 @@ HTMLContentSink::Init(nsIDocument* aDoc,
|
||||
NS_ADDREF(aContainer);
|
||||
|
||||
// Make root part
|
||||
nsresult rv = NS_NewRootPart(&mRoot, mDocument);
|
||||
nsresult rv = NS_NewHTMLHtmlElement(&mRoot, nsHTMLAtoms::html);
|
||||
if (NS_OK != rv) {
|
||||
return rv;
|
||||
}
|
||||
mRoot->SetDocument(mDocument);
|
||||
mDocument->SetRootContent(mRoot);
|
||||
|
||||
// Make head part
|
||||
nsIAtom* atom = NS_NewAtom("HEAD");
|
||||
|
||||
@@ -197,10 +197,12 @@ nsImageDocument::CreateSyntheticDocument()
|
||||
// Synthesize an html document that refers to the image
|
||||
nsresult rv;
|
||||
nsIHTMLContent* root;
|
||||
rv = NS_NewRootPart(&root, this);
|
||||
rv = NS_NewHTMLHtmlElement(&root, nsHTMLAtoms::html);
|
||||
if (NS_OK != rv) {
|
||||
return rv;
|
||||
}
|
||||
root->SetDocument(this);
|
||||
SetRootContent(root);
|
||||
|
||||
nsIHTMLContent* body;
|
||||
rv = NS_NewHTMLBodyElement(&body, nsHTMLAtoms::body);
|
||||
|
||||
@@ -1315,10 +1315,12 @@ HTMLContentSink::Init(nsIDocument* aDoc,
|
||||
NS_ADDREF(aContainer);
|
||||
|
||||
// Make root part
|
||||
nsresult rv = NS_NewRootPart(&mRoot, mDocument);
|
||||
nsresult rv = NS_NewHTMLHtmlElement(&mRoot, nsHTMLAtoms::html);
|
||||
if (NS_OK != rv) {
|
||||
return rv;
|
||||
}
|
||||
mRoot->SetDocument(mDocument);
|
||||
mDocument->SetRootContent(mRoot);
|
||||
|
||||
// Make head part
|
||||
nsIAtom* atom = NS_NewAtom("HEAD");
|
||||
|
||||
@@ -197,10 +197,12 @@ nsImageDocument::CreateSyntheticDocument()
|
||||
// Synthesize an html document that refers to the image
|
||||
nsresult rv;
|
||||
nsIHTMLContent* root;
|
||||
rv = NS_NewRootPart(&root, this);
|
||||
rv = NS_NewHTMLHtmlElement(&root, nsHTMLAtoms::html);
|
||||
if (NS_OK != rv) {
|
||||
return rv;
|
||||
}
|
||||
root->SetDocument(this);
|
||||
SetRootContent(root);
|
||||
|
||||
nsIHTMLContent* body;
|
||||
rv = NS_NewHTMLBodyElement(&body, nsHTMLAtoms::body);
|
||||
|
||||
Reference in New Issue
Block a user