blob: 943afac0e8bd73ab08c67b94bc8e25a43cd1f4be [file] [log] [blame]
<meta charset="koi8-r">
<body>
<p>Test that iso-8859-1 aliases that aren't known to Firefox and IE aren't supported
(we should fall back to parent frame charset).</p>
<p id=result>Testing...</p>
<script>
if (window.testRunner) {
testRunner.waitUntilDone();
testRunner.dumpAsText();
}
var aliases = [
"foobar", // Definitely unknown, verify that charset inheritance works.
"8859_1", // <rdar://problem/7859068>
"ISO8859_1", // <rdar://problem/7863399>
"8859-1", // WebKit used to specifically add this alias name, but other browsers don't support it.
"ISO_2022,locale=ja,version=0", // We never want versioned alias names, other browsers don't support these.
"utf 8", // Other weird variations
"utf_8",
"8859 1",
"8859*1",
"8859:1",
"88591",
"ISO_88591",
"ISO-88591",
"ISO-88-59-1",
"latin-1" // Yes, it's "latin1" without a dash - neither IE nor Firefox support "latin-1".
];
for (i = 0; i < aliases.length; ++i) {
var ifr = document.createElement("iframe");
ifr.setAttribute("src", "resources/bad-charset-alias.py?charset=" + aliases[i]);
document.body.appendChild(ifr);
}
var framesLeft = aliases.length;
function frameLoaded()
{
if (!--framesLeft) {
var failures = "";
for (i = 0; i < aliases.length; ++i) {
var ifr = frames[i];
if (ifr.document.getElementById("test").innerHTML != "SUóóåSS")
failures += ifr.document.getElementById("charset").innerHTML + " ";
}
document.getElementById("result").innerHTML = !failures.length ? "SUCCESS" :
("FAIL: " + failures);
if (window.testRunner)
testRunner.notifyDone();
}
}
</script>
</body>