--- a/content/base/src/nsDocument.cpp
+++ b/content/base/src/nsDocument.cpp
@@ -4745,17 +4745,16 @@ nsDocument::EnableStyleSheetsForSetInter
}
EndUpdate(UPDATE_STYLE);
}
NS_IMETHODIMP
nsDocument::GetCharacterSet(nsAString& aCharacterSet)
{
CopyASCIItoUTF16(GetDocumentCharacterSet(), aCharacterSet);
- ToLowerCase(aCharacterSet);
return NS_OK;
}
NS_IMETHODIMP
nsDocument::ImportNode(nsIDOMNode* aImportedNode,
bool aDeep,
uint8_t aArgc,
nsIDOMNode** aResult)
--- a/content/base/test/test_XHRSendData.html
+++ b/content/base/test/test_XHRSendData.html
@@ -25,17 +25,17 @@ var gen = runTests();
function continueTest() { gen.next(); }
function runTests() {
xhr = new XMLHttpRequest();
xhr.open("GET", "file_XHRSendData_doc.xml", false);
xhr.send();
testDoc1 = xhr.responseXML;
-is(testDoc1.inputEncoding, "iso-8859-1", "wrong encoding");
+is(testDoc1.inputEncoding, "ISO-8859-1", "wrong encoding");
testDoc2 = document.implementation.createDocument("", "", null);
testDoc2.appendChild(testDoc2.createComment(" doc 2 "));
testDoc2.appendChild(testDoc2.createElement("res"));
testDoc2.documentElement.appendChild(testDoc2.createTextNode("text"));
is(testDoc2.inputEncoding, null, "wrong encoding");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
@@ -116,27 +116,27 @@ tests = [{ body: null,
},
{ body: "hi",
contentType: "foo/bar; charset=uTf-8",
resBody: "hi",
resContentType: "foo/bar; charset=uTf-8",
},
{ body: testDoc1,
resBody: "<!-- comment -->\n<out>hi</out>",
- resContentType: "application/xml; charset=iso-8859-1",
+ resContentType: "application/xml; charset=ISO-8859-1",
},
{ body: testDoc1,
contentType: "foo/bar",
resBody: "<!-- comment -->\n<out>hi</out>",
- resContentType: "foo/bar; charset=iso-8859-1",
+ resContentType: "foo/bar; charset=ISO-8859-1",
},
{ body: testDoc1,
contentType: "foo/bar; charset=ascii; baz=bin",
resBody: "<!-- comment -->\n<out>hi</out>",
- resContentType: "foo/bar; charset=iso-8859-1; baz=bin",
+ resContentType: "foo/bar; charset=ISO-8859-1; baz=bin",
},
{ body: testDoc1,
contentType: "foo/bar; charset=IsO-8859-1",
resBody: "<!-- comment -->\n<out>hi</out>",
resContentType: "foo/bar; charset=IsO-8859-1",
},
{ body: testDoc2,
resBody: "<!-- doc 2 -->\n<res>text</res>",
--- a/content/base/test/test_bug431701.html
+++ b/content/base/test/test_bug431701.html
@@ -57,27 +57,27 @@ function xhrDoc(idx) {
return xhr.responseXML;
};
}
// Each row has the document getter function, then the characterSet,
// inputEncoding expected for that document.
var tests = [
- [ frameDoc("one"), "iso-8859-1", "iso-8859-1" ],
- [ frameDoc("two"), "utf-8", "utf-8" ],
- [ frameDoc("three"), "iso-8859-1", "iso-8859-1" ],
- [ frameDoc("four"), "utf-8", "utf-8" ],
- [ frameDoc("five"), "utf-8", "utf-8" ],
- [ frameDoc("six"), "utf-8", "utf-8" ],
- [ frameDoc("seven"), "iso-8859-1", "iso-8859-1" ],
- [ createDoc, "utf-8", null ],
- [ xhrDoc(4), "utf-8", "utf-8" ],
- [ xhrDoc(5), "utf-8", "utf-8" ],
- [ xhrDoc(6), "iso-8859-1", "iso-8859-1" ],
+ [ frameDoc("one"), "ISO-8859-1", "ISO-8859-1" ],
+ [ frameDoc("two"), "UTF-8", "UTF-8" ],
+ [ frameDoc("three"), "ISO-8859-1", "ISO-8859-1" ],
+ [ frameDoc("four"), "UTF-8", "UTF-8" ],
+ [ frameDoc("five"), "UTF-8", "UTF-8" ],
+ [ frameDoc("six"), "UTF-8", "UTF-8" ],
+ [ frameDoc("seven"), "ISO-8859-1", "ISO-8859-1" ],
+ [ createDoc, "UTF-8", null ],
+ [ xhrDoc(4), "UTF-8", "UTF-8" ],
+ [ xhrDoc(5), "UTF-8", "UTF-8" ],
+ [ xhrDoc(6), "ISO-8859-1", "ISO-8859-1" ],
];
function doTest(idx) {
var [docGetter, expectedCharacterSet,
expectedInputEncoding] = tests[idx];
var doc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
z|9On}OPobY4?1rAu=T~;=-?V48duT<&=dJ;Xwi<6%+Dn+v1r;wR`QKWX!-l9?6<-p
zom-TNsF{_O$X%P&b8T)r9=Gm$G3ro0ufCQW(CBYu^;d$+IdC$$2WI^>etVt&9!!;*
Odo`>5&5iv3l)nJYyQQW8
--- a/content/html/document/test/test_bug255820.html
+++ b/content/html/document/test/test_bug255820.html
@@ -20,17 +20,17 @@ https://bugzilla.mozilla.org/show_bug.cg
</div>
<pre id="test">
<script class="testbody" type="text/javascript">
/** Test for Bug 255820 **/
SimpleTest.waitForExplicitFinish();
-is(document.characterSet, "utf-8",
+is(document.characterSet, "UTF-8",
"Unexpected character set for our document");
var testsLeft = 4;
function testFinished() {
--testsLeft;
if (testsLeft == 0) {
SimpleTest.finish();
@@ -58,64 +58,64 @@ function f3Continue() {
is(doc.defaultView.getComputedStyle(doc.body, "").color, "rgb(0, 180, 0)",
"Wrong color before reload");
$("f3").
setAttribute("onload",
'var doc = this.contentDocument; ' +
'is(doc.defaultView.getComputedStyle(doc.body, "").color, ' +
' "rgb(0, 180, 0)",' +
' "Wrong color after reload");' +
- "charsetTestFinished('f1', this.contentDocument, 'utf-8')");
+ "charsetTestFinished('f1', this.contentDocument, 'UTF-8')");
$("f3").contentWindow.location.reload();
}
function runTest() {
var doc = $("f1").contentDocument;
- is(doc.characterSet, "utf-8",
+ is(doc.characterSet, "UTF-8",
"Unexpected initial character set for first frame");
doc.open();
doc.write('<html></html>');
doc.close();
- is(doc.characterSet, "utf-8",
+ is(doc.characterSet, "UTF-8",
"Unexpected character set for first frame after write");
$("f1").
setAttribute("onload",
- "charsetTestFinished('f1', this.contentDocument, 'utf-8')");
+ "charsetTestFinished('f1', this.contentDocument, 'UTF-8')");
$("f1").contentWindow.location.reload();
doc = $("f2").contentDocument;
- is(doc.characterSet, "utf-8",
+ is(doc.characterSet, "UTF-8",
"Unexpected initial character set for second frame");
doc.open();
var str = '<html><head>';
str += '<script src="data:application/javascript,"><'+'/script>';
str += '<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">';
str += '</head><body>';
str += '</body></html>';
doc.write(str);
doc.close();
- is(doc.characterSet, "utf-8",
+ is(doc.characterSet, "UTF-8",
"Unexpected character set for second frame after write");
$("f2").
setAttribute("onload",
- "charsetTestFinished('f2', this.contentDocument, 'utf-8');" +
+ "charsetTestFinished('f2', this.contentDocument, 'UTF-8');" +
"f2Continue()");
doc = $("f3").contentDocument;
- is(doc.characterSet, "utf-8",
+ is(doc.characterSet, "UTF-8",
"Unexpected initial character set for first frame");
doc.open();
var str = '<html><head>';
str += '<style>body { color: rgb(255, 0, 0) }</style>';
str += '<link type="text/css" rel="stylesheet" href="data:text/css, body { color: rgb(0, 180, 0) }">';
str += '</head><body>';
str += '</body></html>';
doc.write(str);
doc.close();
- is(doc.characterSet, "utf-8",
+ is(doc.characterSet, "UTF-8",
"Unexpected character set for first frame after write");
$("f3").setAttribute("onload", "f3Continue()");
}
addLoadEvent(runTest);
</script>
</pre>
</body>
--- a/content/html/document/test/test_bug380383.html
+++ b/content/html/document/test/test_bug380383.html
@@ -16,21 +16,21 @@ https://bugzilla.mozilla.org/show_bug.cg
<iframe id="f2" name="f2"></iframe>
</p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script class="testbody" type="text/javascript">
/** Test for Bug 380383 **/
- is($("f1").contentDocument.characterSet, "utf-8",
+ is($("f1").contentDocument.characterSet, "UTF-8",
"Unexpected charset for f1");
function runTest() {
- is($("f2").contentDocument.characterSet, "utf-8",
+ is($("f2").contentDocument.characterSet, "UTF-8",
"Unexpected charset for f2");
}
addLoadEvent(runTest);
addLoadEvent(SimpleTest.finish);
SimpleTest.waitForExplicitFinish();
</script>
</pre>
--- a/extensions/universalchardet/tests/CharsetDetectionTests.js
+++ b/extensions/universalchardet/tests/CharsetDetectionTests.js
@@ -44,19 +44,19 @@ function InitDetectorTests()
gTestIndex = 0;
$("testframe").onload = DoDetectionTest;
if (gExpectedCharset == "default") {
try {
gExpectedCharset = prefService
.getComplexValue("intl.charset.default",
Ci.nsIPrefLocalizedString)
- .data.toLowerCase();
+ .data;
} catch (e) {
- gExpectedCharset = "iso-8859-8";
+ gExpectedCharset = "ISO-8859-8";
}
}
// Get the local directory. This needs to be a file: URI because chrome:
// URIs are always UTF-8 (bug 617339) and we are testing decoding from other
// charsets.
var jar = getJar(getRootDirectory(window.location.href));
var dir = jar ?
--- a/extensions/universalchardet/tests/test_bug306272.html
+++ b/extensions/universalchardet/tests/test_bug306272.html
@@ -17,17 +17,17 @@ https://bugzilla.mozilla.org/show_bug.cg
<p id="display"></p>
<div id="content" style="display: none">
</div>
<iframe id="testframe"></iframe>
<pre id="test">
<script class="testbody" type="text/javascript">
/** Test for Bug 306272 **/
CharsetDetectionTests("bug306272_text.html",
- "utf-8",
+ "UTF-8",
new Array("ja_parallel_state_machine",
"zh_parallel_state_machine",
"zhtw_parallel_state_machine",
"zhcn_parallel_state_machine",
"cjk_parallel_state_machine",
"universal_charset_detector"));
</script>
</pre>
--- a/extensions/universalchardet/tests/test_bug426271-euc-jp.html
+++ b/extensions/universalchardet/tests/test_bug426271-euc-jp.html
@@ -17,17 +17,17 @@ https://bugzilla.mozilla.org/show_bug.cg
<p id="display"></p>
<div id="content" style="display: none">
</div>
<iframe id="testframe"></iframe>
<pre id="test">
<script class="testbody" type="text/javascript">
/** Test for Bug 426271 **/
CharsetDetectionTests("bug426271_text-euc-jp.html",
- "euc-jp",
+ "EUC-JP",
new Array("ja_parallel_state_machine",
"cjk_parallel_state_machine",
"universal_charset_detector"));
</script>
</pre>
</body>
</html>
--- a/extensions/universalchardet/tests/test_bug426271-utf-8.html
+++ b/extensions/universalchardet/tests/test_bug426271-utf-8.html
@@ -17,17 +17,17 @@ https://bugzilla.mozilla.org/show_bug.cg
<p id="display"></p>
<div id="content" style="display: none">
</div>
<iframe id="testframe"></iframe>
<pre id="test">
<script class="testbody" type="text/javascript">
/** Test for Bug 426271 **/
CharsetDetectionTests("bug426271_text-utf-8.html",
- "utf-8",
+ "UTF-8",
new Array("ja_parallel_state_machine",
"zhtw_parallel_state_machine",
"zhcn_parallel_state_machine",
"zh_parallel_state_machine",
"cjk_parallel_state_machine",
"universal_charset_detector"));
</script>
</pre>
--- a/extensions/universalchardet/tests/test_bug431054-japanese.html
+++ b/extensions/universalchardet/tests/test_bug431054-japanese.html
@@ -17,14 +17,14 @@ https://bugzilla.mozilla.org/show_bug.cg
<p id="display"></p>
<div id="content" style="display: none">
</div>
<iframe id="testframe"></iframe>
<pre id="test">
<script class="testbody" type="text/javascript">
/** Test for Bug 431054 **/
CharsetDetectionTests("bug431054_text.html",
- "euc-jp",
+ "EUC-JP",
new Array("ja_parallel_state_machine"));
</script>
</pre>
</body>
</html>
--- a/extensions/universalchardet/tests/test_bug488426.html
+++ b/extensions/universalchardet/tests/test_bug488426.html
@@ -17,14 +17,14 @@ https://bugzilla.mozilla.org/show_bug.cg
<p id="display"></p>
<div id="content" style="display: none">
</div>
<iframe id="testframe"></iframe>
<pre id="test">
<script class="testbody" type="text/javascript">
/** Test for Bug 488426 **/
CharsetDetectionTests("bug488426_text.html",
- "tis-620",
+ "TIS-620",
new Array("universal_charset_detector"));
</script>
</pre>
</body>
</html>
--- a/extensions/universalchardet/tests/test_bug620106.html
+++ b/extensions/universalchardet/tests/test_bug620106.html
@@ -17,14 +17,14 @@ https://bugzilla.mozilla.org/show_bug.cg
<p id="display"></p>
<div id="content" style="display: none">
</div>
<iframe id="testframe"></iframe>
<pre id="test">
<script class="testbody" type="text/javascript">
/** Test for Bug 620106 **/
CharsetDetectionTests("bug620106_text.html",
- "euc-jp",
+ "EUC-JP",
new Array("universal_charset_detector"));
</script>
</pre>
</body>
</html>
--- a/extensions/universalchardet/tests/test_bug631751be.html
+++ b/extensions/universalchardet/tests/test_bug631751be.html
@@ -18,14 +18,14 @@ https://bugzilla.mozilla.org/show_bug.cg
<div id="content" style="display: none">
</div>
<iframe id="testframe"></iframe>
<pre id="test">
<script class="testbody" type="text/javascript">
/** Test for Bug 631751 **/
/* Note! This test uses the chardet test harness but doesn't test chardet! */
CharsetDetectionTests("bug631751be_text.html",
- "utf-16be",
+ "UTF-16BE",
new Array(""));
</script>
</pre>
</body>
</html>
--- a/extensions/universalchardet/tests/test_bug631751le.html
+++ b/extensions/universalchardet/tests/test_bug631751le.html
@@ -18,14 +18,14 @@ https://bugzilla.mozilla.org/show_bug.cg
<div id="content" style="display: none">
</div>
<iframe id="testframe"></iframe>
<pre id="test">
<script class="testbody" type="text/javascript">
/** Test for Bug 631751 **/
/* Note! This test uses the chardet test harness but doesn't test chardet! */
CharsetDetectionTests("bug631751le_text.html",
- "utf-16le",
+ "UTF-16LE",
new Array(""));
</script>
</pre>
</body>
</html>
--- a/extensions/universalchardet/tests/test_bug638318.html
+++ b/extensions/universalchardet/tests/test_bug638318.html
@@ -18,14 +18,14 @@ https://bugzilla.mozilla.org/show_bug.cg
<div id="content" style="display: none">
</div>
<iframe id="testframe"></iframe>
<pre id="test">
<script class="testbody" type="text/javascript">
/** Test for Bug 638318 **/
/* Note! This test uses the chardet test harness but doesn't test chardet! */
CharsetDetectionTests("bug638318_text.html",
- "iso-8859-1",
+ "ISO-8859-1",
new Array(""));
</script>
</pre>
</body>
</html>
--- a/extensions/universalchardet/tests/test_bug9357.html
+++ b/extensions/universalchardet/tests/test_bug9357.html
@@ -17,17 +17,17 @@ https://bugzilla.mozilla.org/show_bug.cg
<p id="display"></p>
<div id="content" style="display: none">
</div>
<iframe id="testframe"></iframe>
<pre id="test">
<script class="testbody" type="text/javascript">
/** Test for Bug 9357 **/
CharsetDetectionTests("bug9357_text.html",
- "euc-kr",
+ "EUC-KR",
new Array("ko_parallel_state_machine",
"cjk_parallel_state_machine",
"universal_charset_detector"));
</script>
</pre>
</body>
</html>
--- a/js/xpconnect/tests/mochitest/test_bug393269.html
+++ b/js/xpconnect/tests/mochitest/test_bug393269.html
@@ -11,31 +11,31 @@ https://bugzilla.mozilla.org/show_bug.cg
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=393269">Mozilla Bug 393269</a>
<iframe id="ifr"></iframe>
<pre id="test">
<script class="testbody" type="text/javascript">
(function () {
/** Test for Bug 393269 **/
var doc = $("ifr").contentDocument;
- is("utf-8", doc.characterSet, "control, getting a property");
+ is("UTF-8", doc.characterSet, "control, getting a property");
doc.open();
try {
- is("utf-8", doc.characterSet,
+ is("UTF-8", doc.characterSet,
"can get a property after 1 document.open")
} catch (e) {
fail("Shouldn't have thrown: " + e);
return;
} finally {
doc.close();
}
doc.open();
try {
- is("utf-8", doc.characterSet,
+ is("UTF-8", doc.characterSet,
"can get a property after 2 document.opens")
} catch (e) {
fail("Shouldn't have thrown: " + e);
} finally {
doc.close();
}
})();
</script>
--- a/parser/htmlparser/tests/mochitest/test_bug102699.html
+++ b/parser/htmlparser/tests/mochitest/test_bug102699.html
@@ -41,17 +41,17 @@ var d = p.parseFromString(
'<noscript><div></div></noscript>"', "text/html");
is(d.createElement("div").tagName, "DIV", "The created document should have HTML nature.");
is(d.getElementsByTagName("div").length, 1, "There should be one div.");
is(d.contentType, "text/html", "contentType should be text/html");
-is(d.characterSet, "utf-8", "Expected the <meta> to be ignored.");
+is(d.characterSet, "UTF-8", "Expected the <meta> to be ignored.");
is(d.compatMode, "BackCompat", "Should be in the quirks mode.");
var scripts = d.getElementsByTagName("script");
is(scripts.length, 4, "Unexpected number of scripts.");
while (scripts.length) {
// These should not run when moved to another doc
document.body.appendChild(scripts[0]);