Make createDocument-created documents UTF-8. Bug 464958, r+sr=sicking, a=dveditz
git-svn-id: svn://10.0.0.236/trunk@255083 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -71,7 +71,7 @@ var tests = [
|
||||
[ frameDoc("five"), "UTF-8", "UTF-8", null ],
|
||||
[ frameDoc("six"), "UTF-8", "UTF-8", "UTF-8"],
|
||||
[ frameDoc("seven"), "ISO-8859-1", "ISO-8859-1", "ISO-8859-1" ],
|
||||
[ createDoc, "ISO-8859-1", null, null ],
|
||||
[ createDoc, "UTF-8", null, null ],
|
||||
[ xhrDoc(4), "UTF-8", "UTF-8", null ],
|
||||
[ xhrDoc(5), "UTF-8", "UTF-8", "UTF-8" ],
|
||||
[ xhrDoc(6), "ISO-8859-1", "ISO-8859-1", "ISO-8859-1" ],
|
||||
|
||||
@@ -133,6 +133,10 @@ NS_NewDOMDocument(nsIDOMDocument** aInstancePtrResult,
|
||||
doc->SetPrincipal(aPrincipal);
|
||||
doc->SetBaseURI(aBaseURI);
|
||||
|
||||
// XMLDocuments and documents "created in memory" get to be UTF-8 by default,
|
||||
// unlike the legacy HTML mess
|
||||
doc->SetDocumentCharacterSet(NS_LITERAL_CSTRING("UTF-8"));
|
||||
|
||||
if (aDoctype) {
|
||||
nsCOMPtr<nsIDOMNode> tmpNode;
|
||||
rv = doc->AppendChild(aDoctype, getter_AddRefs(tmpNode));
|
||||
|
||||
Reference in New Issue
Block a user