Revert "Update the tests (ISO-8859-1 => windows-1252)"

This reverts commit 9c188b20fbb4d4c2006ab1a611ed8a9b971e7cee.

Broke several browser_tests which depended on the previous behavior:
BrowserEncodingTest.TestOverrideEncoding
EncodingAliases/BrowserEncodingTest.TestEncodingAliasMapping/16
BrowserEncodingTest.TestEncodingAutoDetect
EncodingAliases/BrowserEncodingTest.TestEncodingAliasMapping/3

E.g.
http://test-results.appspot.com/dashboards/flakiness_dashboard.html#tests=BrowserEncodingTest.TestOverrideEncoding&testType=browser_tests

TBR=jshin@chromium.org
BUG=412053
NOTRY=true

Review URL: https://codereview.chromium.org/658193002

git-svn-id: svn://svn.chromium.org/blink/trunk@183822 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 7eed7d05
PASS: windows-1252 PASS: ISO-8859-1
This test baselines charset sniffer behavior where the opening bracket inside a tag is consumed as part of the tag data, causing the meta tag to be missed. This test baselines charset sniffer behavior where the opening bracket inside a tag is consumed as part of the tag data, causing the meta tag to be missed.
Should be your browser default encoding: windows-1252 Should be your browser default encoding: ISO-8859-1
If it's latin-1 (ISO-8859-1, windows-1252), this should be accented e: é If it's latin-1 (ISO-8859-1), this should be accented e: é
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
if (window.testRunner) if (window.testRunner)
testRunner.dumpAsText(); testRunner.dumpAsText();
document.write("<p>Should be your browser default encoding: " + document.characterSet + "</p>"); document.write("<p>Should be your browser default encoding: " + document.characterSet + "</p>");
document.write("<p>If it's latin-1 (ISO-8859-1, windows-1252), this should be accented e: </p>"); document.write("<p>If it's latin-1 (ISO-8859-1), this should be accented e: </p>");
</script> </script>
</body> </body>
......
Should be your browser default encoding: windows-1252 Should be your browser default encoding: ISO-8859-1
If it's latin-1 (ISO-8859-1, windows-1252), this should be accented e: é If it's latin-1 (ISO-8859-1), this should be accented e: é
If you got a render tree with U+FFFD instead, this failed If you got a render tree with U+FFFD instead, this failed
...@@ -5,6 +5,6 @@ ...@@ -5,6 +5,6 @@
if (window.testRunner) if (window.testRunner)
testRunner.dumpAsText(); testRunner.dumpAsText();
document.write("<p>Should be your browser default encoding: " + document.characterSet + "</p>"); document.write("<p>Should be your browser default encoding: " + document.characterSet + "</p>");
document.write("<p>If it's latin-1 (ISO-8859-1, windows-1252), this should be accented e: </p>"); document.write("<p>If it's latin-1 (ISO-8859-1), this should be accented e: é</p>");
document.write("<p>If you got a render tree with U+FFFD instead, this failed</p>"); document.write("<p>If you got a render tree with U+FFFD instead, this failed</p>");
</script> </script>
Should be your browser default encoding: windows-1252 Should be your browser default encoding: ISO-8859-1
Test for bug 9783: An XML declaration without an explicit encoding incorrectly triggers UTF-8 encoding in an HTML document Test for bug 9783: An XML declaration without an explicit encoding incorrectly triggers UTF-8 encoding in an HTML document
Charset: windows-1252 (should be your browser default one) Charset: ISO-8859-1 (should be your browser default one)
ALERT: windows-1252 ALERT: ISO-8859-1
ALERT: windows-1255 ALERT: windows-1255
This test demonstrates that we don't buffer HTML documents looking for a meta charset directive. Instead, we follow the HTML5 specification and switch encoding mid-parse. The iframe below should alert two different encodings. This test demonstrates that we don't buffer HTML documents looking for a meta charset directive. Instead, we follow the HTML5 specification and switch encoding mid-parse. The iframe below should alert two different encodings.
This is a test for https://bugs.webkit.org/show_bug.cgi?id=19079, it send the submissions character encoding in hidden _charset_ field. This is a test for https://bugs.webkit.org/show_bug.cgi?id=19079, it send the submissions character encoding in hidden _charset_ field.
PASSED: _charset_=windows-1252 PASSED: _charset_=ISO-8859-1
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
character encoding in hidden _charset_ field. character encoding in hidden _charset_ field.
</p> </p>
<p> <p>
This should submit _charset_=windows-1252. Note that this _charset_ input has a value before it submits, which is overwritten. </p> This should submit _charset_=iso8559-1. Note that this _charset_ input has a value before it submits, which is overwritten. IE6 submits windows1252, because all pages are evidently Unicode in IE6. The point is that it submits the charset we're using, not what exactly it submits.</p>
<form name="testForm" action="resources/char-encoding-in-hidden-charset-field.php" method="post"> <form name="testForm" action="resources/char-encoding-in-hidden-charset-field.php" method="post">
<input type=hidden name="_charset_" value="This value should change"> <input type=hidden name="_charset_" value="This value should change">
......
...@@ -173,16 +173,13 @@ void TextCodecICU::registerEncodingNames(EncodingNameRegistrar registrar) ...@@ -173,16 +173,13 @@ void TextCodecICU::registerEncodingNames(EncodingNameRegistrar registrar)
// listed in WHATWG Encoding Living Standard (http://encoding.spec.whatwg.org/ ). // listed in WHATWG Encoding Living Standard (http://encoding.spec.whatwg.org/ ).
// Additional aliases present in the WHATWG Encoding Standard // Additional aliases present in the WHATWG Encoding Standard
// and Firefox (as of Oct 2014), but not in the upstream ICU. // and Firefox (24), but not in ICU 4.6.
// Three entries for windows-1252 need not be listed here because
// TextCodecLatin1 registers them.
// FIXME: We may introduce SYSTEM_ICU and enclose this block
// with |#if SYSTEM_ICU| because Chromium's ICU has them all.
registrar("csiso58gb231280", "GBK"); registrar("csiso58gb231280", "GBK");
registrar("csiso88596e", "ISO-8859-6"); registrar("csiso88596e", "ISO-8859-6");
registrar("csiso88596i", "ISO-8859-6"); registrar("csiso88596i", "ISO-8859-6");
registrar("csiso88598e", "ISO-8859-8"); registrar("csiso88598e", "ISO-8859-8");
registrar("gb_2312", "GBK"); registrar("gb_2312", "GBK");
registrar("iso88591", "windows-1252");
registrar("iso88592", "ISO-8859-2"); registrar("iso88592", "ISO-8859-2");
registrar("iso88593", "ISO-8859-3"); registrar("iso88593", "ISO-8859-3");
registrar("iso88594", "ISO-8859-4"); registrar("iso88594", "ISO-8859-4");
...@@ -196,6 +193,7 @@ void TextCodecICU::registerEncodingNames(EncodingNameRegistrar registrar) ...@@ -196,6 +193,7 @@ void TextCodecICU::registerEncodingNames(EncodingNameRegistrar registrar)
registrar("iso885913", "ISO-8859-13"); registrar("iso885913", "ISO-8859-13");
registrar("iso885914", "ISO-8859-14"); registrar("iso885914", "ISO-8859-14");
registrar("iso885915", "ISO-8859-15"); registrar("iso885915", "ISO-8859-15");
registrar("iso_8859-1", "windows-1252");
registrar("iso_8859-2", "ISO-8859-2"); registrar("iso_8859-2", "ISO-8859-2");
registrar("iso_8859-3", "ISO-8859-3"); registrar("iso_8859-3", "ISO-8859-3");
registrar("iso_8859-4", "ISO-8859-4"); registrar("iso_8859-4", "ISO-8859-4");
...@@ -206,6 +204,7 @@ void TextCodecICU::registerEncodingNames(EncodingNameRegistrar registrar) ...@@ -206,6 +204,7 @@ void TextCodecICU::registerEncodingNames(EncodingNameRegistrar registrar)
registrar("iso_8859-9", "windows-1254"); registrar("iso_8859-9", "windows-1254");
registrar("iso_8859-15", "ISO-8859-15"); registrar("iso_8859-15", "ISO-8859-15");
registrar("koi8_r", "KOI8-R"); registrar("koi8_r", "KOI8-R");
registrar("x-cp1252", "windows-1252");
registrar("x-cp1253", "windows-1253"); registrar("x-cp1253", "windows-1253");
registrar("x-cp1254", "windows-1254"); registrar("x-cp1254", "windows-1254");
registrar("x-cp1255", "windows-1255"); registrar("x-cp1255", "windows-1255");
......
...@@ -73,24 +73,35 @@ static const UChar table[256] = { ...@@ -73,24 +73,35 @@ static const UChar table[256] = {
void TextCodecLatin1::registerEncodingNames(EncodingNameRegistrar registrar) void TextCodecLatin1::registerEncodingNames(EncodingNameRegistrar registrar)
{ {
// Taken from the alias table at https://encoding.spec.whatwg.org/
registrar("windows-1252", "windows-1252"); registrar("windows-1252", "windows-1252");
registrar("ANSI_X3.4-1968", "windows-1252"); registrar("ISO-8859-1", "ISO-8859-1");
registrar("ASCII", "windows-1252"); registrar("US-ASCII", "US-ASCII");
registrar("cp1252", "windows-1252");
registrar("cp819", "windows-1252"); registrar("WinLatin1", "windows-1252");
registrar("csISOLatin1", "windows-1252"); registrar("ibm-1252", "windows-1252");
registrar("IBM819", "windows-1252"); registrar("ibm-1252_P100-2000", "windows-1252");
registrar("ISO-8859-1", "windows-1252");
registrar("iso-ir-100", "windows-1252"); registrar("CP819", "ISO-8859-1");
registrar("iso8859-1", "windows-1252"); registrar("IBM819", "ISO-8859-1");
registrar("iso88591", "windows-1252"); registrar("csISOLatin1", "ISO-8859-1");
registrar("iso_8859-1", "windows-1252"); registrar("iso-ir-100", "ISO-8859-1");
registrar("iso_8859-1:1987", "windows-1252"); registrar("iso_8859-1:1987", "ISO-8859-1");
registrar("l1", "windows-1252"); registrar("l1", "ISO-8859-1");
registrar("latin1", "windows-1252"); registrar("latin1", "ISO-8859-1");
registrar("US-ASCII", "windows-1252");
registrar("x-cp1252", "windows-1252"); registrar("ANSI_X3.4-1968", "US-ASCII");
registrar("ANSI_X3.4-1986", "US-ASCII");
registrar("ASCII", "US-ASCII");
registrar("IBM367", "US-ASCII");
registrar("ISO646-US", "US-ASCII");
registrar("ISO_646.irv:1991", "US-ASCII");
registrar("cp367", "US-ASCII");
registrar("csASCII", "US-ASCII");
registrar("ibm-367_P100-1995", "US-ASCII");
registrar("iso-ir-6", "US-ASCII");
registrar("iso-ir-6-us", "US-ASCII");
registrar("us", "US-ASCII");
registrar("x-ansi", "US-ASCII");
} }
static PassOwnPtr<TextCodec> newStreamingTextDecoderWindowsLatin1(const TextEncoding&, const void*) static PassOwnPtr<TextCodec> newStreamingTextDecoderWindowsLatin1(const TextEncoding&, const void*)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment